JIDE 3.5.15

com.jidesoft.grid
Class DualTable

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.swing.JideSplitPane
                      extended by com.jidesoft.grid.DualTable
All Implemented Interfaces:
ComponentListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class DualTable
extends JideSplitPane

DualTable is a pane that contains two JTables and a bunch of buttons. The table on the left contains all the rows. The table on the right contains the rows that are selected.

DualTable uses DualListModel which is the model of this component. With the help of DualListModel, it provides three kinds of selection modes. This mode controls what to display in the right table when rows are selected. DualListModel.REMOVE_SELECTION mode means the left table will remove the rows if they are selected to the right table. This mode can prevent user from selecting the selected row again if it is not allowed in certain cases. DualListModel.DISABLE_SELECTION mode means the selected rows will be shown as disabled. User cannot select them anymore but they can still see them in the right table to show user a complete unchanged table. DualListModel.KEEP_SELECTION mode will not change the right table at all when rows are selected. This is the only mode which can result duplicated rows to be selected. If that's what you want in your situation, this mode is the one you should use. You could disable the duplicate selection option by invoking {link #setAllowDuplicates(false)}.

DualTable also uses TableModelAdapter to get some necessary information which cannot be prvided by DualListModel, such as column class, column count and column name.

DualTable extends JideSplitPane, which makes users conveniently resize the width of either table.

See Also:
DualListModel, AbstractDualListModel, DefaultDualListModel, TableModelAdapter, ListTableModelAdapter, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jidesoft.swing.JideSplitPane
JideSplitPane.AccessibleJideSplitPane
 
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  DualListModel _model
           
protected  DefaultListModelWrapper _originalListModel
           
protected  TableModel _originalTableModel
           
 JComponent _originalTablePane
           
protected  DefaultListModelWrapper _selectedListModel
           
protected  TableModel _selectedTableModel
           
 JComponent _selectedTablePane
           
protected  TableModelAdapter _tableModelAdapter
           
 String CLIENT_PROPERTY_ALWAYS_DISABLED
           
static String COMMAND_MOVE_ALL_LEFT
           
static String COMMAND_MOVE_ALL_RIGHT
           
static String COMMAND_MOVE_DOWN
           
static String COMMAND_MOVE_LEFT
           
static String COMMAND_MOVE_RIGHT
           
static String COMMAND_MOVE_TO_BOTTOM
           
static String COMMAND_MOVE_TO_TOP
           
static String COMMAND_MOVE_UP
           
 
Fields inherited from class com.jidesoft.swing.JideSplitPane
_windowDeactivatedListener, CONTINUOUS_LAYOUT_PROPERTY, DIVIDER_SIZE_PROPERTY, GRIPPER_PROPERTY, HORIZONTAL_SPLIT, NON_CONTINUOUS_DIVIDER, ONE_TOUCH_EXPANDABLE_PROPERTY, ORIENTATION_PROPERTY, PROPERTY_DIVIDER_LOCATION, PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED, PROPORTIONAL_LAYOUT_PROPERTY, PROPORTIONS_PROPERTY, VERTICAL_SPLIT
 
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
DualTable(DualListModel model, TableModelAdapter tableModelAdapter)
          Constructs a DualTable that displays the elements in the specified, non-null model.
DualTable(List<?> listData, TableModelAdapter tableModelAdapter)
          Constructs a DualTable that displays the elements in the specified List.
DualTable(Object[] listData, TableModelAdapter tableModelAdapter)
          Constructs a JList that displays the elements in the specified array.
 
Method Summary
protected  void addButtonPanel(Container container, Component buttonPanel)
          Adds ButtonPanel to DualTable.
 void addSelectionInteval(int index0, int index1)
          Change the selection to be the set union of the current selection and the indices between index0 and index1 inclusive.
 void clearSelection()
          Removes all the selections.
protected  AbstractButton createButton(Action action)
          Creates the button.
protected  Container createButtonPanel()
           
protected  JTable createTable(ListModel model, boolean originalTable)
          Creates the JList.
protected  ListTableModelAdapter createTableModel(ListModel model, TableModelAdapter adapter, boolean isOriginalTable)
          Creates the table model.
 DualListModel getModel()
          Gets the DualListModel.
 JTable getOriginalTable()
          Get the original JList.
 JComponent getOriginalTablePane()
          Gets the component containing the original JList.
 Dimension getPreferredSize()
           
protected  String getResourceString(String key)
          Gets the localized string from resource bundle.
 int[] getSelectedIndices()
          Gets the selected indices.
 JTable getSelectedTable()
          Get the selected JList.
 JComponent getSelectedTablePane()
          Gets the component containing the selected JList.
 Object[] getSelectedValues()
          Gets the selected values from the DualTable.
 int getSelectionMode()
          Gets the selection mode from DualListModel.
 int[] getUnselectedIndices()
           
 Object[] getUnselectedValues()
          Returns the values that are not selected in DaulList
protected  void installKeyboardAction()
           
 boolean isAllowDuplicates()
          Get the flag if duplicate selection is allowed in the DualTable.
 boolean isButtonEnabled(String command)
          Checks if the button is always disabled.
 boolean isButtonVisible(String command)
          Checks if the button is visible.
 boolean isDoubleClickEnabled()
          Gets the flag indicating if double click to select is enabled.
 boolean isSelectedIndex(int index)
          Checks if the index is selected.
 boolean isSelectionEmpty()
          Checks if there is any selection.
 void moveAllLeft()
          Moves all items from the right list to the left list.
 void moveAllRight()
          Moves all items from the left list to the right list.
 void moveDown()
          Moves the selected items in the right list down by one.
 void moveLeft()
          Moves the selected items in the right list to the left list.
 void moveRight()
          Moves the selected items in the left list to the right list.
 void moveToBottom()
          Moves the selected items in the right list to the bottom.
 void moveToTop()
          Moves the selected items in the right list to the top.
 void moveUp()
          Moves the selected items in the right list up by one.
protected  void performAction(String command)
          Performs the action.
 void removeSelectionInteval(int index0, int index1)
          Change the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive.
 void setAllowDuplicates(boolean allowDuplicates)
          Set the flag if duplicate selection is allowed in the DualTable.
 void setButtonEnabled(String command, boolean enabled)
          Sets the button to always disabled.
 void setButtonVisible(String command, boolean visible)
          Sets the button visible or invisible.
 void setDoubleClickEnabled(boolean doubleClickEnabled)
          Sets the flag indicating if double click to select is enabled.
 void setEnabled(boolean enabled)
           
 void setModel(DualListModel model)
          Sets the DualListModel.
 void setSelectionMode(int selectionMode)
          Sets the selection mode to DualListModel.
protected  void setupTable(JTable table, boolean originalTable)
          Customizes the JList.
 
Methods inherited from class com.jidesoft.swing.JideSplitPane
addExtraDividers, addPane, addProportion, componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, createSplitPaneDivider, doLayout, dragDividerTo, finishDraggingTo, getAccessibleContext, getDividerAt, getDividerLocation, getDividerLocations, getDividerSize, getDividerStepSize, getLeftOneTouchButtonImageIcon, getNextDividerLocation, getOrientation, getPaneAt, getPaneCount, getPreviousDividerLocation, getProportions, getRightOneTouchButtonImageIcon, indexOf, indexOfDivider, indexOfPane, insertPane, insertPane, isContinuousLayout, isDragResizable, isHeavyweightComponentEnabled, isInitiallyEven, isOneTouchExpandable, isProportionalLayout, isShowGripper, isValidateRoot, removeExtraDividers, removePane, removePane, removeProportion, resetToPreferredSizes, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerLocations, setDividerSize, setDividerStepSize, setDividersVisible, setDragResizable, setHeavyweightComponentEnabled, setInitiallyEven, setLeftOneTouchButtonImageIcon, setOneTouchExpandable, setOrientation, setPaneAt, setPaneAt, setProportionalLayout, setProportions, setRightOneTouchButtonImageIcon, setShowGripper, setVisible, startDragging, updateUI
 
Methods inherited from class javax.swing.JPanel
getUI, getUIClassID, paramString, setUI
 
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, 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, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, removeAll, 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

COMMAND_MOVE_LEFT

public static final String COMMAND_MOVE_LEFT
See Also:
Constant Field Values

COMMAND_MOVE_RIGHT

public static final String COMMAND_MOVE_RIGHT
See Also:
Constant Field Values

COMMAND_MOVE_ALL_LEFT

public static final String COMMAND_MOVE_ALL_LEFT
See Also:
Constant Field Values

COMMAND_MOVE_ALL_RIGHT

public static final String COMMAND_MOVE_ALL_RIGHT
See Also:
Constant Field Values

COMMAND_MOVE_UP

public static final String COMMAND_MOVE_UP
See Also:
Constant Field Values

COMMAND_MOVE_DOWN

public static final String COMMAND_MOVE_DOWN
See Also:
Constant Field Values

COMMAND_MOVE_TO_TOP

public static final String COMMAND_MOVE_TO_TOP
See Also:
Constant Field Values

COMMAND_MOVE_TO_BOTTOM

public static final String COMMAND_MOVE_TO_BOTTOM
See Also:
Constant Field Values

_model

protected DualListModel _model

_tableModelAdapter

protected TableModelAdapter _tableModelAdapter

_originalTablePane

public JComponent _originalTablePane

_selectedTablePane

public JComponent _selectedTablePane

CLIENT_PROPERTY_ALWAYS_DISABLED

public final String CLIENT_PROPERTY_ALWAYS_DISABLED
See Also:
Constant Field Values

_selectedListModel

protected DefaultListModelWrapper _selectedListModel

_originalListModel

protected DefaultListModelWrapper _originalListModel

_selectedTableModel

protected TableModel _selectedTableModel

_originalTableModel

protected TableModel _originalTableModel
Constructor Detail

DualTable

public DualTable(Object[] listData,
                 TableModelAdapter tableModelAdapter)
Constructs a JList that displays the elements in the specified array. This constructor just delegates to the DualListModel constructor.

Parameters:
listData - the array of Objects to be loaded into the data _model
tableModelAdapter - the table model adapter

DualTable

public DualTable(List<?> listData,
                 TableModelAdapter tableModelAdapter)
Constructs a DualTable that displays the elements in the specified List. This constructor just delegates to the DualListModel constructor.

Parameters:
listData - the List to be loaded into the data _model
tableModelAdapter - the table model adapter

DualTable

public DualTable(DualListModel model,
                 TableModelAdapter tableModelAdapter)
Constructs a DualTable that displays the elements in the specified, non-null model. All DualTable constructors delegate to this one.

Parameters:
model - the data model for this list
tableModelAdapter - the table model adapter
Throws:
NullPointerException - if model is null
Method Detail

createTable

protected JTable createTable(ListModel model,
                             boolean originalTable)
Creates the JList. By default, we will create JList and set the name to "DualTable.leftList" or "DualTable.rightList" depending on the parameter "left" value.

Parameters:
model - the list model
originalTable - true if the JList is for the original list. False if the JList is for the selected list.
Returns:
a JList.

createTableModel

protected ListTableModelAdapter createTableModel(ListModel model,
                                                 TableModelAdapter adapter,
                                                 boolean isOriginalTable)
Creates the table model.

By default, it returns new ListTableModelAdapter(model, adapter). You could override this method to customize the table model.

Parameters:
model - the list model
adapter - the adapter
isOriginalTable - the flag indicating if this is for the original table or the selected table
Returns:
the created table model.
Since:
3.5.2

setupTable

protected void setupTable(JTable table,
                          boolean originalTable)
Customizes the JList.

Parameters:
table - the JList. It could be either the original JList or the selected JList.
originalTable - true if the JList is for the original list. False if the JList is for the selected list.

getOriginalTable

public JTable getOriginalTable()
Get the original JList.

Returns:
the original JList.

getSelectedTable

public JTable getSelectedTable()
Get the selected JList.

Returns:
the selected JList.

getOriginalTablePane

public JComponent getOriginalTablePane()
Gets the component containing the original JList.

Returns:
the component containing the original JList.

getSelectedTablePane

public JComponent getSelectedTablePane()
Gets the component containing the selected JList.

Returns:
the component containing the selected JList.

addButtonPanel

protected void addButtonPanel(Container container,
                              Component buttonPanel)
Adds ButtonPanel to DualTable.

Parameters:
container - the container between the two JLists.
buttonPanel - the button panel

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

createButtonPanel

protected Container createButtonPanel()

createButton

protected AbstractButton createButton(Action action)
Creates the button. Our default code is
 protected AbstractButton createButton(Action action) {
     AbstractButton button = new JideButton(action);
     action.addPropertyChangeListener(new PropertyChangeListener() {
         public void propertyChange(PropertyChangeEvent evt) {
             if ("disabledIcon".equals(evt.getPropertyName())) {
                 button.setDisabledIcon((Icon) action.getValue("disabledIcon"));
             }
         }
     });
     button.setName("" + action.getValue(Action.ACTION_COMMAND_KEY));
     button.setDisabledIcon((Icon) action.getValue("disabledIcon"));
     button.setRequestFocusEnabled(false);
     return button;
 }
 

Parameters:
action - the action for the button.
Returns:
a button.

setEnabled

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

getSelectedIndices

public int[] getSelectedIndices()
Gets the selected indices. The index in the array is the index as in the original list.

Returns:
the selected indices.
See Also:
DualListModel.getSelectedIndices()

getUnselectedIndices

public int[] getUnselectedIndices()

installKeyboardAction

protected void installKeyboardAction()

getModel

public DualListModel getModel()
Gets the DualListModel.

Returns:
the DualListModel.

setModel

public void setModel(DualListModel model)
Sets the DualListModel.

Parameters:
model - a new DualListModel.

getSelectedValues

public Object[] getSelectedValues()
Gets the selected values from the DualTable.

Returns:
the selected values.

getUnselectedValues

public Object[] getUnselectedValues()
Returns the values that are not selected in DaulList

Returns:
the unselected values

isSelectedIndex

public boolean isSelectedIndex(int index)
Checks if the index is selected.

Parameters:
index - the index.
Returns:
true or false.

clearSelection

public void clearSelection()
Removes all the selections.


addSelectionInteval

public void addSelectionInteval(int index0,
                                int index1)
Change the selection to be the set union of the current selection and the indices between index0 and index1 inclusive. If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval

removeSelectionInteval

public void removeSelectionInteval(int index0,
                                   int index1)
Change the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive. If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval

isSelectionEmpty

public boolean isSelectionEmpty()
Checks if there is any selection.

Returns:
true means no selection. Otherwise false.

getSelectionMode

public int getSelectionMode()
Gets the selection mode from DualListModel.

Returns:
the selection mode.
See Also:
DualListModel.getSelectionMode()

setSelectionMode

public void setSelectionMode(int selectionMode)
Sets the selection mode to DualListModel.

Parameters:
selectionMode - the new selection mode.
See Also:
DualListModel.setSelectionMode(int)

setButtonVisible

public void setButtonVisible(String command,
                             boolean visible)
Sets the button visible or invisible.

Parameters:
command - the name defined in DualTable. They are constants starting with "COMMAND_" such as COMMAND_MOVE_LEFT.
visible - true to show the button and false to hide.

isButtonVisible

public boolean isButtonVisible(String command)
Checks if the button is visible.

Parameters:
command - the name defined in DualTable. They are constants starting with "COMMAND_" such as COMMAND_MOVE_LEFT.
Returns:
true or false.

setButtonEnabled

public void setButtonEnabled(String command,
                             boolean enabled)
Sets the button to always disabled.

Parameters:
command - the name defined in DualTable. They are constants starting with "COMMAND_" such as COMMAND_MOVE_LEFT.
enabled - false to always disable the button.

isButtonEnabled

public boolean isButtonEnabled(String command)
Checks if the button is always disabled.

Parameters:
command - the name defined in DualTable. They are constants starting with "COMMAND_" such as COMMAND_MOVE_LEFT.
Returns:
false if the button is always disabled. Otherwise true. Note that this method still could return true when the button isEnabled() return false.

moveLeft

public void moveLeft()
Moves the selected items in the right list to the left list.


moveRight

public void moveRight()
Moves the selected items in the left list to the right list.


moveAllLeft

public void moveAllLeft()
Moves all items from the right list to the left list.


moveAllRight

public void moveAllRight()
Moves all items from the left list to the right list.


moveUp

public void moveUp()
Moves the selected items in the right list up by one.


moveDown

public void moveDown()
Moves the selected items in the right list down by one.


moveToTop

public void moveToTop()
Moves the selected items in the right list to the top.


moveToBottom

public void moveToBottom()
Moves the selected items in the right list to the bottom.


isAllowDuplicates

public boolean isAllowDuplicates()
Get the flag if duplicate selection is allowed in the DualTable.

Returns:
true if duplicate selection is allowed. Otherwise false.
See Also:
setAllowDuplicates(boolean)

setAllowDuplicates

public void setAllowDuplicates(boolean allowDuplicates)
Set the flag if duplicate selection is allowed in the DualTable.

This flag will only take effective if getSelectionMode() returns DualListModel.KEEP_SELECTION

By default the flag is true to keep the consistent behavior with DualList.

Parameters:
allowDuplicates - the flag
See Also:
setSelectionMode(int)

isDoubleClickEnabled

public boolean isDoubleClickEnabled()
Gets the flag indicating if double click to select is enabled.

Returns:
true if double click is enabled. Otherwise false.
Since:
3.2.3
See Also:
setDoubleClickEnabled(boolean)

setDoubleClickEnabled

public void setDoubleClickEnabled(boolean doubleClickEnabled)
Sets the flag indicating if double click to select is enabled.

By default, the flag is true.

Parameters:
doubleClickEnabled - the flag
Since:
3.2.3

getResourceString

protected String getResourceString(String key)
Gets the localized string from resource bundle. Subclass can override it to provide its own string. For example, you can customize the icons by overriding this method. The key for the icons will be in the format of "DualTable.moveLeft.icon" and "DualTable.moveLeft.disabledIcon" for the move left button. There are a total of eight buttons. Once you override, you can return a full qualified path to the icon resource such as "/com/yourcompany/icons/moveLeft.png". Note that the icon must be in the class path so that we can access it as resource.

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

performAction

protected void performAction(String command)
Performs the action.

Parameters:
command - the command

JIDE 3.5.15