net.sourceforge.nite.nstyle.handler
Class ListHandler

java.lang.Object
  extended by net.sourceforge.nite.nstyle.handler.NDisplayObjectHandler
      extended by net.sourceforge.nite.nstyle.handler.JComponentHandler
          extended by net.sourceforge.nite.nstyle.handler.ListHandler
All Implemented Interfaces:
InputComponent, OutputComponent

public class ListHandler
extends JComponentHandler
implements InputComponent, OutputComponent

Author:
judyr

Constructor Summary
ListHandler()
           
 
Method Summary
 void addChild(NDisplayObjectHandler child)
          Only Labels can be displayed on lists.
 javax.swing.JComponent displayElement(ObjectModelElement e, boolean selected)
          Display this element on the user interface
 javax.swing.JList getList()
          Returns the list.
 java.util.Set getSelectedObjectModelElements()
          Returns a list of object model elements which corresponds to the input currently selected or entered in this JComponentHandler's component.
 void insertDisplayElement(ObjectModelElement newElement, ObjectModelElement parent, int position)
          Used to update the display after an addChild operation.
 void redisplayElement(ObjectModelElement e)
          Used to refresh the display of an element on the screen after changes to textual content or attribute values on underlying xml
 void registerAction(java.lang.String key, NiteAction a)
          Register an action with the list.
 void removeDisplayComponent(ObjectModelElement e)
          Remove the on screen representation of an element once it has been removed from the object model
 
Methods inherited from class net.sourceforge.nite.nstyle.handler.JComponentHandler
addActionReference, getImage, getJComponent, setImage, setUpBackgroundColour, setUpFont, setUpForegroundColour, setUpImage, setUpToolTip
 
Methods inherited from class net.sourceforge.nite.nstyle.handler.NDisplayObjectHandler
addActionReference, getActionReferences, getChildren, getClock, getElement, getEndTime, getID, getParent, getSourceID, getStartTime, init, setChildren, setClock, setElement, setEndTime, setID, setParent, setSourceID, setStartTime, setUpTimes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListHandler

public ListHandler()
Method Detail

addChild

public void addChild(NDisplayObjectHandler child)
Only Labels can be displayed on lists. All other component handlers will cause an exception

Overrides:
addChild in class JComponentHandler
Parameters:
child - The child to add.
See Also:
net.sourceforge.net.sourceforge.nite.nstyle.handler.NDisplayObjectHandler#addChild(net.sourceforge.net.sourceforge.nite.nstyle.handler.NDisplayObjectHandler)

registerAction

public void registerAction(java.lang.String key,
                           NiteAction a)
Register an action with the list.

Overrides:
registerAction in class JComponentHandler
Parameters:
key - specifies which key binding or mouse click will cause actions to be performed on this component
See Also:
JComponentHandler.registerAction(String, NiteAction)

getSelectedObjectModelElements

public java.util.Set getSelectedObjectModelElements()
Description copied from interface: InputComponent
Returns a list of object model elements which corresponds to the input currently selected or entered in this JComponentHandler's component.

Specified by:
getSelectedObjectModelElements in interface InputComponent
See Also:
net.sourceforge.nite.gui.actions.InputComponent#getInputData()

getList

public javax.swing.JList getList()
Returns the list.

Returns:
JList

displayElement

public javax.swing.JComponent displayElement(ObjectModelElement e,
                                             boolean selected)
Description copied from interface: OutputComponent
Display this element on the user interface

Specified by:
displayElement in interface OutputComponent

redisplayElement

public void redisplayElement(ObjectModelElement e)
Description copied from interface: OutputComponent
Used to refresh the display of an element on the screen after changes to textual content or attribute values on underlying xml

Specified by:
redisplayElement in interface OutputComponent
Parameters:
e - The element which should have its representation refreshed.

removeDisplayComponent

public void removeDisplayComponent(ObjectModelElement e)
Description copied from interface: OutputComponent
Remove the on screen representation of an element once it has been removed from the object model

Specified by:
removeDisplayComponent in interface OutputComponent

insertDisplayElement

public void insertDisplayElement(ObjectModelElement newElement,
                                 ObjectModelElement parent,
                                 int position)
Description copied from interface: OutputComponent
Used to update the display after an addChild operation. Place the new element "after" the positionth child of the parent element. After is easily defined a tree component, but it is far less obvious how this shoud be implemented for text areas.

Specified by:
insertDisplayElement in interface OutputComponent
Parameters:
newElement - The element which is to be inserted
parent - The parent of the element to be added
position - The index into the list of children belonging to the parent