com.sas.swing.visuals.dualselector
Class DualListSelector

com.sas.swing.visuals.dualselector.DualListSelector
All Implemented Interfaces:
ViewDefaultModel, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListSelectionListener

public class DualListSelector
implements javax.swing.event.ListSelectionListener, ViewDefaultModel

DualListSelector implements a dual selector with two lists.

Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.

Examples for this class may be found on the Examples Site.


Since:
3.1
See Also:
Serialized Form

Field Summary
protected  javax.swing.JList sourceJList
          the source JList component
protected  javax.swing.JList targetJList
          the target JList component
 
Fields inherited from class com.sas.swing.visuals.dualselector.BaseDualSelector
allLeftButton, allRightButton, ALTERNATING_MULTIPLE_BUTTON, ALTERNATING_SINGLE_BUTTON, alternatingMultipleButton, alternatingMultipleButtonStyle, alternatingSingleButton, alternatingSingleButtonStyle, buttonContainer, copyModeDuplicatesAllowed, copyModeEnabled, designTime, direction, doubleLeftArrow, doubleRightArrow, dragAndDropEnabled, dragGestureInitiator, initialized, LEFT, leftArrow, leftButton, mainPanel, MIDDLE_BOTTOM, middleContainer, partitioner, RIGHT, rightArrow, rightButton, selectedItems, sourceAdapter, sourceBottomButtonContainer, sourceContainer, sourceFocusListener, sourceLabel, sourceMouseListener, sourceTopButtonContainer, targetAdapter, targetContainer, targetControlsVisible, targetDownButton, targetFocusListener, targetLabel, targetMaximumCount, targetMouseListener, targetUpButton, TOP_RIGHT, transferAllControlsVisible
 
Constructor Summary
DualListSelector()
          Constructs a DualListSelector object.
 
Method Summary
protected  void addListeners()
          Adds a list selection listener to both lists.
 javax.swing.ListModel getModel()
          Returns the ListModel for the source component.
 javax.swing.ListCellRenderer getSourceCellRenderer()
          Returns the cell renderer for the source component.
 javax.swing.ListCellRenderer getTargetCellRenderer()
          Returns the cell renderer for the target component.
 javax.swing.ListModel getTargetModel()
          Returns the ListModel for the target component.
 boolean isDefaultModelAttached()
          Returns true if the default model is being used, false otherwise.
 void setDefaultTargetModel(javax.swing.DefaultListModel listModel)
          Sets the default model for the target list.
 void setModel(javax.swing.ListModel listModel)
          Sets the ListModel for the source component.
 void setSourceCellRenderer(javax.swing.ListCellRenderer newValue)
          Sets the cell renderer for the source component.
 void setTargetCellRenderer(javax.swing.ListCellRenderer newValue)
          Sets the cell renderer for the target component.
 void setTargetModel(javax.swing.ListModel listModel)
          Sets the ListModel for the target component.
 void valueChanged(javax.swing.event.ListSelectionEvent ie)
          Event handler for the ListSelectionEvent's received.
 
Methods inherited from class com.sas.swing.visuals.dualselector.BaseDualSelector
actionPerformed, areValuesEqual, canTransferAllSourceItems, canTransferAllTargetItems, canTransferSelectedSourceItems, canTransferSelectedTargetItems, canTransferSourceItems, canTransferTargetItems, createSourceLabel, createTargetLabel, ensureButtonsEnabled, getAlternatingButtonIcon, getAlternatingMultipleButtonStyle, getAlternatingSingleButtonStyle, getCopyModeDuplicatesAllowed, getExtendedBeanInfo, getSourceBottomActionButtonContainer, getSourceComponent, getSourceLabel, getSourceLabelComponent, getSourceMouseListener, getSourceTopActionButtonContainer, getTargetComponent, getTargetLabel, getTargetLabelComponent, getTargetMaximumCount, getTargetMouseListener, initializeBaseDualSelector, initializeSize, isCopyModeEnabled, isDesignTime, isDragAndDropEnabled, isGroupDirectionalButtonsTogether, isInSourceModel, isInTargetModel, isTargetControlsVisible, isTransferAllControlsVisible, moveTargetItem, paintComponent, setAlternatingMultipleButtonIcons, setAlternatingMultipleButtonStyle, setAlternatingSingleButtonIcons, setAlternatingSingleButtonStyle, setBackground, setCopyModeDuplicatesAllowed, setCopyModeEnabled, setDesignTime, setDragAndDropEnabled, setEnabled, setFont, setForeground, setGroupDirectionalButtonsTogether, setSourceLabel, setSourceMouseListener, setTargetButtonsLocation, setTargetControlsVisible, setTargetLabel, setTargetMaximumCount, setTargetMouseListener, setToolTipText, setTransferAllControlsVisible, transferAllItems, transferAllSourceItems, transferAllTargetItems, transferItems, transferItems, transferSourceItems, transferTargetItems, transferToSourceModel, transferToTargetModel
 

Field Detail

sourceJList

protected javax.swing.JList sourceJList
the source JList component


targetJList

protected javax.swing.JList targetJList
the target JList component

Constructor Detail

DualListSelector

public DualListSelector()
Constructs a DualListSelector object.

Method Detail

addListeners

protected void addListeners()
Adds a list selection listener to both lists.

Overrides:
addListeners in class BaseDualSelector

getSourceCellRenderer

public javax.swing.ListCellRenderer getSourceCellRenderer()
Returns the cell renderer for the source component. The cell renderer controls how the items in the source component are displayed.

Returns:
cell renderer for the source component
See Also:
setSourceCellRenderer(javax.swing.ListCellRenderer)

setSourceCellRenderer

public void setSourceCellRenderer(javax.swing.ListCellRenderer newValue)
Sets the cell renderer for the source component. The cell renderer controls how the items in the source component are displayed.

Parameters:
newValue - the new value for the the source component cell renderer
See Also:
getSourceCellRenderer()

getTargetCellRenderer

public javax.swing.ListCellRenderer getTargetCellRenderer()
Returns the cell renderer for the target component. The cell renderer controls how the items in the target component are displayed.

Returns:
the cell renderer for the target component
See Also:
setTargetCellRenderer(javax.swing.ListCellRenderer)

setTargetCellRenderer

public void setTargetCellRenderer(javax.swing.ListCellRenderer newValue)
Sets the cell renderer for the target component. The cell renderer controls how the items in the target component are displayed.

Parameters:
newValue - the new value for the target component cell renderer
See Also:
getTargetCellRenderer()

getModel

public javax.swing.ListModel getModel()
Returns the ListModel for the source component. The ListModel for the target component can be obtained by calling getTargetModel.

Returns:
the ListModel for the source component
See Also:
setTargetModel(javax.swing.ListModel)

setModel

public void setModel(javax.swing.ListModel listModel)
Sets the ListModel for the source component. The ListModel for the target component can be set by calling setTargetModel.

Parameters:
listModel - the ListModel to set for the source component
See Also:
setTargetModel(javax.swing.ListModel)

getTargetModel

public javax.swing.ListModel getTargetModel()
Returns the ListModel for the target component. The ListModel for the source component can be obtained by calling getModel.

Returns:
the ListModel for the target component
See Also:
setTargetModel(javax.swing.ListModel)

setDefaultTargetModel

public void setDefaultTargetModel(javax.swing.DefaultListModel listModel)
Sets the default model for the target list.

Parameters:
listModel - the target list model

setTargetModel

public void setTargetModel(javax.swing.ListModel listModel)
                    throws java.lang.IllegalArgumentException
Sets the ListModel for the target component. The ListModel for the target component can be set by calling setModel.

Parameters:
listModel - the ListModel to set for the target component
Throws:
java.lang.IllegalArgumentException
See Also:
setModel(javax.swing.ListModel)

isDefaultModelAttached

public boolean isDefaultModelAttached()
Returns true if the default model is being used, false otherwise.

Specified by:
isDefaultModelAttached in interface ViewDefaultModel
Returns:
true if the default model is being used, false otherwise.
See Also:
ViewDefaultModel

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent ie)
Event handler for the ListSelectionEvent's received.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Parameters:
ie - the event to handle



Copyright © 2009 SAS Institute Inc. All Rights Reserved.