com.sas.swing.models
Class TransformingComboBoxModel

com.sas.swing.models.TransformingComboBoxModel
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, java.io.Serializable, java.util.EventListener, javax.swing.ComboBoxModel, javax.swing.event.ListDataListener, javax.swing.ListModel

public class TransformingComboBoxModel
implements javax.swing.ComboBoxModel

TransformingComboBoxModel is a model that is used for instances of javax.swing.JComboBox that can use transforms derived from com.sas.util.transforms.TransformInterface.

The TransformingListModel creates a new default model which is set to be a javax.swing.DefaultComboBoxModel to be used as the model for the comboBox. No default transform is set so no transformation will take place on the items in the list unless a transform is provided.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object selectedItem
          Currently selected item in the comboBox
 
Fields inherited from class com.sas.swing.models.TransformingListModel
model, propertyChangeSupport, transform
 
Constructor Summary
TransformingComboBoxModel()
          Default constructor that sets a new default model
TransformingComboBoxModel(javax.swing.ComboBoxModel model)
          Constructor that sets the model of the comboBox
 
Method Summary
 java.lang.Object getSelectedItem()
          Return the selected item
protected  javax.swing.ListModel newDefaultModel()
          Create a default model for the comboBox
 void setSelectedItem(java.lang.Object newSelectedItem)
          Set the selectedItem
 
Methods inherited from class com.sas.swing.models.TransformingListModel
addPropertyChangeListener, contentsChanged, firePropertyChange, firePropertyChange, getElementAt, getModel, getSize, getTransform, intervalAdded, intervalRemoved, removePropertyChangeListener, setModel, setTransform
 

Field Detail

selectedItem

protected java.lang.Object selectedItem
Currently selected item in the comboBox

Constructor Detail

TransformingComboBoxModel

public TransformingComboBoxModel()
Default constructor that sets a new default model


TransformingComboBoxModel

public TransformingComboBoxModel(javax.swing.ComboBoxModel model)
Constructor that sets the model of the comboBox

Parameters:
model - model to be set
Method Detail

newDefaultModel

protected javax.swing.ListModel newDefaultModel()
Create a default model for the comboBox

Overrides:
newDefaultModel in class TransformingListModel
Returns:
model to be used as default

getSelectedItem

public java.lang.Object getSelectedItem()
Return the selected item

Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

setSelectedItem

public void setSelectedItem(java.lang.Object newSelectedItem)
Set the selectedItem

Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.