Package com.ribs
Class RBListBinder
- java.lang.Object
-
- com.ribs.RBListBinder
-
- All Implemented Interfaces:
java.util.EventListener,javax.swing.event.ListSelectionListener
public class RBListBinder extends java.lang.Object implements javax.swing.event.ListSelectionListenerThis class manages a list of objects provided by a rib file's owner to facilitate binding to UI controls. It provides access to the list, to the currently selected object and a list selection model. Binders can also be chained, so that a binder can get a sublist from another binder's selected object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRBListBinder.BinderListModelList Model implementation for lists using bind key.
-
Constructor Summary
Constructors Constructor Description RBListBinder()Create new binder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfireContentsChanged()Called when binder's source list has changed.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.static RBListBindergetBinder(javax.swing.JComponent aComponent)Returns the binder for a given component.java.lang.StringgetBindKey()Returns the bind key for this binder.java.util.ListgetList()Return the list that this binder is brokering.java.lang.StringgetListKey()Returns the list key for this binder.java.lang.StringgetListKeyDeep()Returns the list key from master datasource to this binder.javax.swing.ListModelgetListModel(javax.swing.JList aList)Returns a list model for given list.javax.swing.ListSelectionModelgetListSelectionModel()Returns the list selection model for this binder.RJPanelgetMaster()Returns the panel that loaded this binder.java.lang.StringgetName()Returns the name of this binder.RBListBindergetParentBinder()Returns the parent binder for this binder.java.lang.StringgetParentBinderName()Returns the binder name for this binder.java.lang.ObjectgetSelectedObject()Return the selected object in the list that this binder is brokering.voidsetBindKey(java.lang.String aBindKey)Sets the bind key for this binder.voidsetMaster(RJPanel aPanel)Sets the panel that loaded this binder.voidsetName(java.lang.String aName)Sets the name of this binder.RXElementtoXML(RXArchiver anArchiver)XML archival.voidvalueChanged(javax.swing.event.ListSelectionEvent anEvent)Called when list selection changes.
-
-
-
Method Detail
-
getMaster
public RJPanel getMaster()
Returns the panel that loaded this binder.
-
setMaster
public void setMaster(RJPanel aPanel)
Sets the panel that loaded this binder.
-
getName
public java.lang.String getName()
Returns the name of this binder.
-
setName
public void setName(java.lang.String aName)
Sets the name of this binder.
-
getBindKey
public java.lang.String getBindKey()
Returns the bind key for this binder.
-
setBindKey
public void setBindKey(java.lang.String aBindKey)
Sets the bind key for this binder.
-
getParentBinder
public RBListBinder getParentBinder()
Returns the parent binder for this binder.
-
getParentBinderName
public java.lang.String getParentBinderName()
Returns the binder name for this binder.
-
getListKey
public java.lang.String getListKey()
Returns the list key for this binder.
-
getListKeyDeep
public java.lang.String getListKeyDeep()
Returns the list key from master datasource to this binder.
-
getList
public java.util.List getList()
Return the list that this binder is brokering.
-
getSelectedObject
public java.lang.Object getSelectedObject()
Return the selected object in the list that this binder is brokering.
-
getListModel
public javax.swing.ListModel getListModel(javax.swing.JList aList)
Returns a list model for given list.
-
getListSelectionModel
public javax.swing.ListSelectionModel getListSelectionModel()
Returns the list selection model for this binder.
-
getBinder
public static RBListBinder getBinder(javax.swing.JComponent aComponent)
Returns the binder for a given component.
-
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent anEvent)
Called when list selection changes.- Specified by:
valueChangedin interfacejavax.swing.event.ListSelectionListener
-
fireContentsChanged
public void fireContentsChanged()
Called when binder's source list has changed. Can be called by owner/controller or by a parent binder.
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.
-
-