com.sas.swing.models
Class CollectionToComboBoxModelAdapter

com.sas.swing.models.CollectionToComboBoxModelAdapter
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, java.io.Serializable, javax.swing.ComboBoxModel, javax.swing.ListModel, javax.swing.MutableComboBoxModel

public class CollectionToComboBoxModelAdapter
implements javax.swing.MutableComboBoxModel

The CollectionToListModelAdapter allows collections that extend from java.util.Collection, such as instances of java.util.List and java.util.Set, to be used as the model for a javax.swing.JComboBox. The collection must be set as the model for the adapter, which can then used as the model for the viewer.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object selectedItem
          Currently selected item
 
Fields inherited from class com.sas.swing.models.CollectionToListModelAdapter
delegate, model, spcs
 
Constructor Summary
CollectionToComboBoxModelAdapter()
          Default constructor
CollectionToComboBoxModelAdapter(java.util.Collection c)
          Overloaded constructor that intializes the adapter with the data given by the Collection
CollectionToComboBoxModelAdapter(int size)
          Overloaded constructor that initializes the delegate to be of given size
 
Method Summary
 java.lang.Object getSelectedItem()
          Returns the selected item
 void setSelectedItem(java.lang.Object item)
          Sets the selected item
 
Methods inherited from class com.sas.swing.models.CollectionToListModelAdapter
addPropertyChangeListener, createDelegate, getElementAt, getExtendedBeanInfo, getModel, getSize, refresh, removePropertyChangeListener, setModel
 

Field Detail

selectedItem

protected java.lang.Object selectedItem
Currently selected item

Constructor Detail

CollectionToComboBoxModelAdapter

public CollectionToComboBoxModelAdapter()
Default constructor


CollectionToComboBoxModelAdapter

public CollectionToComboBoxModelAdapter(int size)
Overloaded constructor that initializes the delegate to be of given size

Parameters:
size - Initial size of the delegate representing the Collection

CollectionToComboBoxModelAdapter

public CollectionToComboBoxModelAdapter(java.util.Collection c)
Overloaded constructor that intializes the adapter with the data given by the Collection

Parameters:
c - Collection whose data will be used within the adapter
Method Detail

getSelectedItem

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

Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Sets the selected item

Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.