com.sas.swing.models
Class ListModelPropertyChangeAdapter

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

public class ListModelPropertyChangeAdapter
implements java.beans.PropertyChangeListener, javax.swing.ComboBoxModel, com.sas.beans.PropertyChangeSource

Implements the javax.swing.ListModel and gets the list contents using the specified source and property. The property can be an array, a java.util.List implementation, or an implementation of com.sas.util.Enumerable. If the source property is not any of these, the list will have a size of 0 and return no elements. If the source property fires a PropertyChangeEvent, the contents of the ListModel will be updated to reflect the current contents of the source property.

See Also:
Serialized Form

Field Summary
protected static java.util.List emptyList
           
protected  java.lang.String property
           
protected  java.beans.PropertyChangeSupport propertyChangeSupport
           
protected  java.lang.Object selectedObject
           
protected  java.lang.Object source
           
protected  java.util.List sourceList
           
 
Constructor Summary
ListModelPropertyChangeAdapter()
           
ListModelPropertyChangeAdapter(java.lang.Object sourceObject, java.lang.String propertyName)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
protected  void firePropertyChange(java.beans.PropertyChangeEvent evt)
           
protected  void firePropertyChange(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue)
           
 java.lang.Object getElementAt(int i)
           
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 java.lang.String getPropertyName()
           
 java.lang.Object getSelectedItem()
           
 int getSize()
           
 java.lang.Object getSource()
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void setPropertyName(java.lang.String propertyName)
           
 void setPropertySource(java.lang.Object sourceObject, java.lang.String propertyName)
           
 void setSelectedItem(java.lang.Object item)
           
 void setSource(java.lang.Object sourceObject)
           
protected  void updateSourceList()
           
 

Field Detail

selectedObject

protected java.lang.Object selectedObject

source

protected java.lang.Object source

property

protected java.lang.String property

sourceList

protected java.util.List sourceList

propertyChangeSupport

protected java.beans.PropertyChangeSupport propertyChangeSupport

emptyList

protected static java.util.List emptyList
Constructor Detail

ListModelPropertyChangeAdapter

public ListModelPropertyChangeAdapter()

ListModelPropertyChangeAdapter

public ListModelPropertyChangeAdapter(java.lang.Object sourceObject,
                                      java.lang.String propertyName)
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface com.sas.beans.PropertyChangeSource

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface com.sas.beans.PropertyChangeSource

firePropertyChange

protected void firePropertyChange(java.beans.PropertyChangeEvent evt)

firePropertyChange

protected void firePropertyChange(java.lang.String propName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)

getSource

public java.lang.Object getSource()

setSource

public void setSource(java.lang.Object sourceObject)

getPropertyName

public java.lang.String getPropertyName()

setPropertyName

public void setPropertyName(java.lang.String propertyName)

setPropertySource

public void setPropertySource(java.lang.Object sourceObject,
                              java.lang.String propertyName)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

updateSourceList

protected void updateSourceList()

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

getElementAt

public java.lang.Object getElementAt(int i)
Specified by:
getElementAt in interface javax.swing.ListModel

getSelectedItem

public java.lang.Object getSelectedItem()
Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

setSelectedItem

public void setSelectedItem(java.lang.Object item)
Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.