Package com.ribs

Class RBListBinder

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.ListSelectionListener

    public class RBListBinder
    extends java.lang.Object
    implements javax.swing.event.ListSelectionListener
    This 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 class  RBListBinder.BinderListModel
      List 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
      void fireContentsChanged()
      Called when binder's source list has changed.
      java.lang.Object fromXML​(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      static RBListBinder getBinder​(javax.swing.JComponent aComponent)
      Returns the binder for a given component.
      java.lang.String getBindKey()
      Returns the bind key for this binder.
      java.util.List getList()
      Return the list that this binder is brokering.
      java.lang.String getListKey()
      Returns the list key for this binder.
      java.lang.String getListKeyDeep()
      Returns the list key from master datasource to this binder.
      javax.swing.ListModel getListModel​(javax.swing.JList aList)
      Returns a list model for given list.
      javax.swing.ListSelectionModel getListSelectionModel()
      Returns the list selection model for this binder.
      RJPanel getMaster()
      Returns the panel that loaded this binder.
      java.lang.String getName()
      Returns the name of this binder.
      RBListBinder getParentBinder()
      Returns the parent binder for this binder.
      java.lang.String getParentBinderName()
      Returns the binder name for this binder.
      java.lang.Object getSelectedObject()
      Return the selected object in the list that this binder is brokering.
      void setBindKey​(java.lang.String aBindKey)
      Sets the bind key for this binder.
      void setMaster​(RJPanel aPanel)
      Sets the panel that loaded this binder.
      void setName​(java.lang.String aName)
      Sets the name of this binder.
      RXElement toXML​(RXArchiver anArchiver)
      XML archival.
      void valueChanged​(javax.swing.event.ListSelectionEvent anEvent)
      Called when list selection changes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RBListBinder

        public RBListBinder()
        Create new binder.
    • 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:
        valueChanged in interface javax.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.
      • fromXML

        public java.lang.Object fromXML​(RXArchiver anArchiver,
                                        RXElement anElement)
        XML unarchival.