net.sourceforge.nite.nstyle.handler
Class TextAreaHandler

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.TextAreaHandler
All Implemented Interfaces:
InputComponent, OutputComponent

public class TextAreaHandler
extends JComponentHandler
implements InputComponent, OutputComponent

Author:
judyr

Field Summary
 NTextArea textArea
          The text area which is displayed using this component handler
 
Constructor Summary
TextAreaHandler()
           
 
Method Summary
 void addChild(NDisplayObjectHandler child)
          Only TextElements can be displayed on text areas.
 javax.swing.JComponent displayElement(ObjectModelElement e, boolean selected)
          Display this element on the user interface
 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)
          This is used to register an action listener for the action; well, in fact it's overridden by every class that extends this, so it's not really!
 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
 

Field Detail

textArea

public NTextArea textArea
The text area which is displayed using this component handler

Constructor Detail

TextAreaHandler

public TextAreaHandler()
Method Detail

addChild

public void addChild(NDisplayObjectHandler child)
Only TextElements can be displayed on text areas. 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)
Description copied from class: JComponentHandler
This is used to register an action listener for the action; well, in fact it's overridden by every class that extends this, so it's not really!

Overrides:
registerAction in class JComponentHandler

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

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