JIDE 3.5.15

com.jidesoft.grid
Class QuickFilterPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jidesoft.grid.QuickFilterPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class QuickFilterPane
extends JPanel

QuickFilterPane works along with any TableModel to provide filtering feature.

It is very simple to use it.

 QuickFilterPane quickFilterPane = new QuickFilterPane(new SortableTableModel(tableModel), new int[]{3, 1,
 2});
Later on, when you display the table, instead using your original table model, use getDisplayTableModel().
 SortableTable table = new SortableTable(quickFilterPane.getDisplayTableModel());
 
As you can see, the usage is the same as QuickTableFilterField. In fact, you can pass quickTableFilterField.getDisplayTableModel() to QuickFilterPane as input. Or you can take quickFilterPane.getDisplayTableModel() and pass it as input to QuickTableFilterField. You can imagine as two pipes that connect. The input end is the raw table model. The output end is getDisplayTableModel() which you should use it to display in a JTable or SortableTable.

QuickFilterPane has several JLists. The number of JList is determined by the length of columnIndices array. If you select an item from the list, a filter will be applied the underlying table model on corresponding column, so you will see less rows in the table as well as the following JLists. You can multiple select which will add more filters in OR relation. So just a few clicks, you can quick narrow down the table to have only the rows you are interested in.

See Also:
Serialized Form

Nested Class Summary
 class QuickFilterPane.QuickFilterCheckBoxList
           
 class QuickFilterPane.QuickFilterList
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  MessageFormat _allItemFormat
           
protected  JList[] _lists
           
protected  IFilterableTableModel[] _models
           
protected  JTable _table
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
QuickFilterPane()
          Creates an empty QuickFilterPane.
QuickFilterPane(TableModel tableModel)
          Creates a QuickFilterPane using the specified table model.
QuickFilterPane(TableModel tableModel, int[] columnIndices)
          Creates a QuickFilterPane using the specified table model and indices to the columns to be filtered.
QuickFilterPane(TableModel tableModel, int[] columnIndices, String[] displayNames)
          Creates a QuickFilterPane using the specified table model and indices to the columns to be filtered.
 
Method Summary
protected  void applyFilter(JList list, IFilterableTableModel filterableTableModel, int column)
          Apply filters to FilterableTableModel.
protected  TableModel createFilterableTableModel(TableModel tableModel, int index)
          Creates the FilterableTableModel for the JList at the specified index.
protected  Component createListComponent(JList list, String name)
          Creates a panel for the list which is used as filter for a column.
protected  ListModel createListModel(IFilterableTableModel filterableTableModel, int column)
          Creates the ListModel for the JList.
protected  Component createListsComponent(Component[] components)
          Creates a component that contains all the lists.
protected  JList createQuickFilterList(IFilterableTableModel model, int index)
          Creates the list component that will be used for the quick filter.
protected  Object customizeDisplayedTextForAll(Object text)
          Get displayed text in the list to represent "all" items.
 int[] getColumnIndices()
          Gets the column indices.
 String[] getDisplayNames()
          Gets the label name for each list in an array.
 TableModel getDisplayTableModel()
          Gets the display table model.
 JList getList(int index)
          Gets the JList at the specified index in QuickFilterPane.
protected  String getPluralForm(String word)
          Gets the plural form.
protected  Object[] getPossibleValues(TableModel tableModel, int column)
          Gets all possible values at the specified column in the table model.
protected  String getResourceString(String key)
          Gets the localized string from resource bundle.
 JTable getTable()
          Gets the table where the display table model will be set.
 TableModel getTableModel()
          Gets the table model used by QuickFilterPane.
 TableScrollPane getTablePane()
          Gets the TableScrollPane where the display table model will be set.
 int getVisibleRowCount()
          Returns the preferred number of visible rows.
protected  void initComponent()
          Initialize this component.
 boolean isAutoUpdate()
          Sets the auto-updated flag.
 boolean isUseCheckBoxList()
          Checks if the CheckBoxList is used as the filter JList.
 boolean isUseTableCellRenderer()
          Gets the flag indicating if table cell renderer will be used for the list.
 void removeAll()
           
 void reset()
          Resets the QuickFilterPane and selects the first row in all the lists.
 void setAutoUpdate(boolean autoUpdate)
          Sets the autoUpdate flag.
 void setColumnIndices(int[] columnIndices)
          Sets the filter column indices.
 void setDisplayNames(String[] displayNames)
          Sets the label name for each list.
 void setEnabled(boolean enabled)
           
 void setTable(JTable table)
          Sets the table where the display table model will be set.
 void setTableModel(TableModel tableModel)
          Sets the table model.
 void setTablePane(TableScrollPane tablePane)
          Sets the TableScrollPane where the display table model will be set.
 void setUseCheckBoxList(boolean useCheckBoxList)
          Uses the CheckBoxList as the filter JList.
 void setUseTableCellRenderer(boolean useTableCellRenderer)
          Sets the flag indicating if table cell renderer will be used for the list.
 void setVisibleRowCount(int visibleRowCount)
          Sets the preferred number of rows in the lists.
protected  boolean shouldPossibleValueBeIncluded(FilterableTableModel filterableTableModel, Object value, int column)
          Check if the possible value should be included in the value select list.
 void update()
          Updates the QuickFilterPane to refresh the data from the table model.
 void updateListsFromFilters()
          Updates the selection of the lists from the filters in the FilterTableModel's created by QuickFilterPane.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_models

protected IFilterableTableModel[] _models

_lists

protected JList[] _lists

_allItemFormat

protected final MessageFormat _allItemFormat

_table

protected JTable _table
Constructor Detail

QuickFilterPane

public QuickFilterPane()
Creates an empty QuickFilterPane. This method is useless since QuickFilterPane has to have a table model in order to work correctly. So we have this method in place mainly to make it JavaBean compatible. You must call setTableModel(javax.swing.table.TableModel) after you create QuickFilterPane using this constructor.


QuickFilterPane

public QuickFilterPane(TableModel tableModel)
Creates a QuickFilterPane using the specified table model. Since it doesn't specify the columns to be filtered, it will use all columns as filter columns.

Parameters:
tableModel - the table model. It could be any table model. We will automatically wrap it in FilterableTableModel.

QuickFilterPane

public QuickFilterPane(TableModel tableModel,
                       int[] columnIndices)
Creates a QuickFilterPane using the specified table model and indices to the columns to be filtered.

Parameters:
tableModel - the table model. It could be any table model. We will automatically wrap it in FilterableTableModel.
columnIndices - the indices to the columns to be filtered. You need to make sure all values in the index array are within the range. Otherwise, it will throw ArrayIndexOutOfBoundsException. The order also matters as it will determine the filter order. In the other words, it will apply filter to the first column index, then the second and so on.
Throws:
ArrayIndexOutOfBoundsException - if the value in columnIndices array are out of the range of tableModel's column count.

QuickFilterPane

public QuickFilterPane(TableModel tableModel,
                       int[] columnIndices,
                       String[] displayNames)
Creates a QuickFilterPane using the specified table model and indices to the columns to be filtered.

Parameters:
tableModel - the table model. It could be any table model. We will automatically wrap it in FilterableTableModel.
columnIndices - the indices to the columns to be filtered. You need to make sure all values in the index array are within the range. Otherwise, it will throw ArrayIndexOutOfBoundsException. The order also matters as it will determine the filter order. In the other words, it will apply filter to the first column index, then the second and so on.
displayNames - the names used to label each list. If you don't specify this parameter, it will use column names in tableModel instead. In most cases, it should be fine.
Throws:
ArrayIndexOutOfBoundsException - if the value in columnIndices array are out of the range of tableModel's column count.
IllegalArgumentException - if the length of columnIndices array is different from that of displayNames array.
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class JComponent

updateListsFromFilters

public void updateListsFromFilters()
Updates the selection of the lists from the filters in the FilterTableModel's created by QuickFilterPane.

Only if the FilterableTableModel's filters are applied and contains one MultipleValuesFilter in its filter item, the list would be updated accordingly.

Since:
3.3.0

createListModel

protected ListModel createListModel(IFilterableTableModel filterableTableModel,
                                    int column)
Creates the ListModel for the JList. Subclass can override this method to create their own ListModel.

Parameters:
filterableTableModel - the FilterableTableModel controlled by the JList.
column - the column index.
Returns:
a ListModel. It contains all values from getPossibleValues(filterableTableModel, column) as well as (All) as the first item.

customizeDisplayedTextForAll

protected Object customizeDisplayedTextForAll(Object text)
Get displayed text in the list to represent "all" items.

JIDE has predefined the input parameter text. If the input is invalid, an "(All)" will be returned. In this case, clicking that item or not doesn't really change the filter. If i is zero and there are more than 1 possible value for the column inside the filterableTableModel. "All (x columnNames)" will be returned.

By default, we simply returns text directly. You could override this method to change the text if you want.

Parameters:
text - the default text generated by JIDE
Returns:
A string to represent all items.

applyFilter

protected void applyFilter(JList list,
                           IFilterableTableModel filterableTableModel,
                           int column)
Apply filters to FilterableTableModel. This is called when the selection in the JList changes. Subclass can override this method if they want to apply the selected values from JList to some other places. This is the only method that a filter is added to the FilterableTableModel.

Parameters:
list - the list.
filterableTableModel - the FilterableTableModel where filter will be added.
column - the column index.

getPossibleValues

protected Object[] getPossibleValues(TableModel tableModel,
                                     int column)
Gets all possible values at the specified column in the table model. By default, it will go through all rows, find all the values in the specified column, sort them and return them as a List. Subclass can override it to return a different list. For example, you can return the list without sorting them. Or if the list is predefined, you can return it directly without looping through the table model. Or you can even find all possible values from a database table.

Parameters:
tableModel - the table model
column - the column
Returns:
a List of all possible values. Null value or empty string is not included.

initComponent

protected void initComponent()
Initialize this component.


createQuickFilterList

protected JList createQuickFilterList(IFilterableTableModel model,
                                      int index)
Creates the list component that will be used for the quick filter.

Parameters:
model - FilterableTableModel
index - the index of the list
Returns:
A JList. It is a QuickFilterList by default or QuickFilterCheckBoxList is setUseCheckBoxList(boolean) is set to true.

createFilterableTableModel

protected TableModel createFilterableTableModel(TableModel tableModel,
                                                int index)
Creates the FilterableTableModel for the JList at the specified index. By default, it will create a FilterableTableModel that wraps the table model passed in. You can subclass it to change the behavior. For example if you want to do thing as http://www.jidesoft.com/forum/viewtopic.php?p=10350#10350, you can override it and implement it as
 if(index == 0) {
     return new FilterableTableModel(tableModel);
 }
 else {
     return tableModel;
 }
 

Parameters:
tableModel - the table model. For the first JList, it is the the table model passed to the constructor of QuickFilterPane. For the following JLists, the table model is the FilterableTableModel returned from previous call of createFilterableTableModel.
index - the index of the JList.
Returns:
FilterableTableModel.

shouldPossibleValueBeIncluded

protected boolean shouldPossibleValueBeIncluded(FilterableTableModel filterableTableModel,
                                                Object value,
                                                int column)
Check if the possible value should be included in the value select list.

By default, we will not display the null and empty values to keep original behavior. You could override this method to return true to make everything visible.

Parameters:
filterableTableModel - the filterable table model
value - the value to be check
column - the column index where the value resides
Returns:
true if the possible values should be included. Otherwise false.

createListsComponent

protected Component createListsComponent(Component[] components)
Creates a component that contains all the lists.

Parameters:
components - the list of components. Each component contains a JList which is used as filter. The component is created by createListComponent(javax.swing.JList, String).
Returns:
a component that contains all the lists. By default, it will create a JideSplitPane and add those components into that split pane. Subclass can override to customize the layout. For example, if there are too many lists, you can add them into a multiple-row grid layout. Or you can even add then to tabbed pane.

createListComponent

protected Component createListComponent(JList list,
                                        String name)
Creates a panel for the list which is used as filter for a column.

Parameters:
list - the list which is used as filter for a column.
name - the name of the list. If you specify displayName, the name will be the display name. Otherwise, it will be the corresponding column name.
Returns:
a panel that contains the list. By default, the name is used in a JLabel and set as the column header of the JList.

reset

public void reset()
Resets the QuickFilterPane and selects the first row in all the lists.


update

public void update()
Updates the QuickFilterPane to refresh the data from the table model.


getTableModel

public TableModel getTableModel()
Gets the table model used by QuickFilterPane.

Returns:
the table model.

setTableModel

public void setTableModel(TableModel tableModel)
Sets the table model. This method will reinitialize the component.

Parameters:
tableModel - the new table model

removeAll

public void removeAll()
Overrides:
removeAll in class Container

getColumnIndices

public int[] getColumnIndices()
Gets the column indices.

Returns:
the column indices.

setColumnIndices

public void setColumnIndices(int[] columnIndices)
Sets the filter column indices. If the tableModel has been set at this point, this method will call reinitialize the component.

Please note, we will set the table's model to getDisplayTableModel() at the end of this method. However it won't work if you didn't call setTable(javax.swing.JTable) method before. If so, you just call table.setModel(quickFilterPane.getDisplayTableModel() method yourself after the setColumnIndices call.

Parameters:
columnIndices - the indices to the columns to be filtered. You need to make sure all values in the index array are within the range. Otherwise, it will throw ArrayIndexOutOfBoundsException. The order also matters as it will determine the filter order. In the other words, it will apply filter to the first column index, then the second and so on.
Throws:
ArrayIndexOutOfBoundsException - if the value in columnIndices array are out of the range of tableModel's column count.
IllegalArgumentException - if the length of columnIndices array is different from that of displayNames array.

getDisplayNames

public String[] getDisplayNames()
Gets the label name for each list in an array.

Returns:
the array of labels for lists.

setDisplayNames

public void setDisplayNames(String[] displayNames)
Sets the label name for each list. The name will appear as a label on top of each list.

Parameters:
displayNames - the names used to label each list. If you don't specify this parameter, it will use column names in tableModel instead. In most cases, it should be fine.
Throws:
IllegalArgumentException - if the length of columnIndices array is different from that of displayNames array.

getDisplayTableModel

public TableModel getDisplayTableModel()
Gets the display table model. QuickFilterPane doesn't modify the table model that you passed in but wrap it in FilterableTableModel. So if you want to display the result after being filtered, you should use this method to get the display table model and set it to your table.

Returns:
the table model to be displayed.

setVisibleRowCount

public void setVisibleRowCount(int visibleRowCount)
Sets the preferred number of rows in the lists.

Parameters:
visibleRowCount - the new visible row count

getVisibleRowCount

public int getVisibleRowCount()
Returns the preferred number of visible rows.

Returns:
an integer indicating the preferred number of rows to display without using a scroll bar

getList

public JList getList(int index)
Gets the JList at the specified index in QuickFilterPane. You should call this method after QuickFilterPane having been initialized (after tableModel has been set).

Parameters:
index - the index.
Returns:
the JList at the specified index in QuickFilterPane. It will return null if QuickFilterPane has not been initialized.
Throws:
IndexOutOfBoundsException - if the index is less than 0 or larger than the number filtered columns.

getResourceString

protected String getResourceString(String key)
Gets the localized string from resource bundle. Subclass can override it to provide its own string. Available keys are defined in grid.properties that begin with "Search.".

Parameters:
key - the key for the resource string
Returns:
the localized string.

getPluralForm

protected String getPluralForm(String word)
Gets the plural form. By default it will add "es" (if ends with "s" or "sh" or "ch") or "s" at the end of the word since it's the most common case in English. Subclass can override it to provide the exact plural form for the giving word if you know exactly what words will be used in your application.

Parameters:
word - the word
Returns:
the plural form of the giving word.

getTable

public JTable getTable()
Gets the table where the display table model will be set.

Returns:
the table

setTable

public void setTable(JTable table)
Sets the table where the display table model will be set. Usually you don't need to call this method. The only place the table could be used is at setColumnIndices(int[]) method so that you don't need to explicitly set the display table model to the table after the call.

Parameters:
table - the table where the display table model will be set.

getTablePane

public TableScrollPane getTablePane()
Gets the TableScrollPane where the display table model will be set.

Returns:
the table
See Also:
setTablePane(TableScrollPane)

setTablePane

public void setTablePane(TableScrollPane tablePane)
Sets the TableScrollPane where the display table model will be set. Usually you don't need to call this method. The only place the scroll pane could be used is at setColumnIndices(int[]) method so that you don't need to explicitly set the display table model to the table scroll pane after the call.

Parameters:
tablePane - the table scroll pane where the display table model will be set.

isUseCheckBoxList

public boolean isUseCheckBoxList()
Checks if the CheckBoxList is used as the filter JList.

Returns:
true or false.

setUseCheckBoxList

public void setUseCheckBoxList(boolean useCheckBoxList)
Uses the CheckBoxList as the filter JList.

Parameters:
useCheckBoxList - true to use CheckBoxList as the lists.

isAutoUpdate

public boolean isAutoUpdate()
Sets the auto-updated flag. If the flag is true, we will automatically update the JLists when the table model is changed.

Returns:
true or false.

setAutoUpdate

public void setAutoUpdate(boolean autoUpdate)
Sets the autoUpdate flag. By default, this flag is true, meaning we will automatically update the JLists when the table model is changed. However when your table model is updated very frequently, it will cause the JLists to flicker. To avoid this problem, you can set the flag to false before the table model is updated. After the updates are done, you set the flag back to true.

Parameters:
autoUpdate - true to update JList automatically when table model is updated.

isUseTableCellRenderer

public boolean isUseTableCellRenderer()
Gets the flag indicating if table cell renderer will be used for the list.

Returns:
true if table cell renderer will be used. Otherwise false.
See Also:
setUseTableCellRenderer(boolean)

setUseTableCellRenderer

public void setUseTableCellRenderer(boolean useTableCellRenderer)
Sets the flag indicating if table cell renderer will be used for the list.

By default, the value is false to keep current behavior. However, if you have a column with a special renderer which can be retrieved from CellRendererManager, you may need set this flag to true. In this way, the popup list will try to borrow the renderer component from the table cell renderer to paint its entries.

Parameters:
useTableCellRenderer - the flag

JIDE 3.5.15