|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractListModel | +--org.joda.swing.binder.PropertyListModel
JList model that binds to a data list property. JList models cannot be updated programmatically or by the GUI, so this implementation is fairly simple. Use of this model is best achieved by using SwingBinder.
This class can be used for both mutable and immutable properties. Immutable properties cannot be updated by the swing GUI, however they will update correctly if their value changes.
Field Summary |
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
PropertyListModel()
Constructor |
|
PropertyListModel(javax.swing.JList comp,
DataListProperty property)
Constructor that binds to a particular property. |
Method Summary | |
protected void |
activate()
Activate the connection between the GUI and the model |
void |
bind(javax.swing.JComponent component,
Property property)
Bind a Property object to the component. |
protected void |
deactivate()
Deactivate the connection between the GUI and the model |
java.lang.Object |
getElementAt(int index)
|
int |
getSize()
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handle programmatic changes made to the property by updating the swing model. |
void |
setActive(boolean active)
Set the model to GUI binding as active or inactive |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyListModel()
public PropertyListModel(javax.swing.JList comp, DataListProperty property)
Method Detail |
public java.lang.Object getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
ListModel.getElementAt(int)
public int getSize()
getSize
in interface javax.swing.ListModel
ListModel.getSize()
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- the property change eventpublic void setActive(boolean active)
setActive
in interface JComponentBinder
protected void activate()
protected void deactivate()
public void bind(javax.swing.JComponent component, Property property)
JComponentBinder
bind
in interface JComponentBinder
component
- the component to bindproperty
- the property to bind toJComponentBinder.bind(JComponent,Property)
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |