net.sf.jame.core.tree
Class NodeEditor

java.lang.Object
  extended by net.sf.jame.core.tree.NodeEditor
Direct Known Subclasses:
AbstractConfigElementListNode.ListNodeEditor, AbstractConfigElementSingleNode.ListNodeEditor, BooleanElementNode.BooleanNodeEditor, ColorElementNode.ColorNodeEditor, ComplexElementNode.ComplexNodeEditor, ConfigurableExtensionReferenceElementNode.ConfigElementNodeEditor, CriteriaElementNode.CriteriaNodeEditor, DefaultNodeEditor, DoubleElementNode.DoubleNodeEditor, ExtensionReferenceElementNode.ConfigElementNodeEditor, FloatElementNode.FloatNodeEditor, FontElementNode.FontNodeEditor, IntegerElementNode.IntegerNodeEditor, LongElementNode.LongNodeEditor, NumberNodeEditor, PaletteElementNode.PaletteNodeEditor, RectangleElementNode.RectangleNodeEditor, RenderedPaletteElementNode.PaletteNodeEditor, ShortElementNode.ShortNodeEditor, SpeedElementNode.SpeedNodeEditor, StringElementNode.StringNodeEditor, ViewElementNode.ViewNodeEditor

public abstract class NodeEditor
extends java.lang.Object

Author:
Andrea Medeghini

Field Summary
protected  Node node
           
 
Constructor Summary
NodeEditor(Node node)
          Constructs a new editor.
 
Method Summary
 void appendChildNode(NodeValue<?> value)
           
protected abstract  Node createChildNode(NodeValue<?> value)
           
abstract  NodeValue<?> createNodeValue(java.lang.Object value)
           
protected  void doAppendNode(Node node)
           
protected  void doChangeNode(int nodeIndex, Node node)
           
protected  void doInsertNodeAfter(int index, Node node)
           
protected  void doInsertNodeBefore(int index, Node node)
           
protected  void doMoveDownNode(int nodeIndex)
           
protected  void doMoveUpNode(int nodeIndex)
           
protected  void doRemoveNode(int nodeIndex)
           
protected  void doSetValue(NodeValue<?> value)
           
 Node getChildNode(int index)
           
 int getChildNodeCount()
          Returns the number of childs.
 ConfigContext getContext()
           
 int getIndex()
           
 java.lang.String getNodeClass()
           
 java.lang.String getNodeId()
           
 java.lang.String getNodeLabel()
           
 NodeValue<?> getNodeValue()
          Returns the node value.
 java.lang.String getNodeValueAsString()
          Returns the node value as string.
 TransferableNodeValue getNodeValueAsTransferable()
          Returns the node value as transferable value.
abstract  java.lang.Class<?> getNodeValueType()
          Returns the node type.
 NodeEditor getParentNodeEditor()
           
 NodeValue<?> getPreviousNodeValue()
          Returns the previous node value.
 boolean hasValue()
          Returns true if value is set.
 void insertChildNodeAfter(int index, NodeValue<?> value)
           
 void insertChildNodeAt(java.lang.Integer index, NodeValue<?> value)
           
 void insertChildNodeBefore(int index, NodeValue<?> value)
           
 boolean isNodeAttribute()
           
 boolean isNodeEditable()
           
 boolean isNodeMutable()
           
 boolean isParentMutable()
           
 boolean isRefreshRequired()
           
 void moveDownChildNode(int index)
           
 void moveUpChildNode(int index)
           
 void removeAllChildNodes()
           
 void removeChildNode(int index)
           
 void setNodeValue(NodeValue<?> value)
          Sets the node value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected Node node
Constructor Detail

NodeEditor

public NodeEditor(Node node)
Constructs a new editor.

Parameters:
node - the node.
Method Detail

getContext

public ConfigContext getContext()
Returns:

getNodeId

public java.lang.String getNodeId()
Returns:
the nodeId.

getNodeLabel

public java.lang.String getNodeLabel()
Returns:

getNodeClass

public java.lang.String getNodeClass()
Returns:

isNodeEditable

public boolean isNodeEditable()
Returns:
true if the node is editable.

isNodeMutable

public boolean isNodeMutable()
Returns:
true if the node is mutable.

isNodeAttribute

public boolean isNodeAttribute()
Returns:
true if the node is an attribute.

isRefreshRequired

public boolean isRefreshRequired()
Returns:
true if refresh is required.

getNodeValueType

public abstract java.lang.Class<?> getNodeValueType()
Returns the node type.

Returns:
the node type.

createNodeValue

public abstract NodeValue<?> createNodeValue(java.lang.Object value)
Parameters:
value -
Returns:

getPreviousNodeValue

public final NodeValue<?> getPreviousNodeValue()
Returns the previous node value.

Returns:
the previous node value.

getNodeValue

public final NodeValue<?> getNodeValue()
Returns the node value.

Returns:
the node value.

hasValue

public final boolean hasValue()
Returns true if value is set.

Returns:
true if value is set.

setNodeValue

public final void setNodeValue(NodeValue<?> value)
Sets the node value.

Parameters:
value - the node value to set.

getNodeValueAsString

public java.lang.String getNodeValueAsString()
Returns the node value as string.

Returns:
the string.

getNodeValueAsTransferable

public TransferableNodeValue getNodeValueAsTransferable()
Returns the node value as transferable value.

Returns:
the transferable value.

getIndex

public int getIndex()
Returns:
the node index.

getChildNodeCount

public int getChildNodeCount()
Returns the number of childs.

Returns:
the number of childs.

getChildNode

public Node getChildNode(int index)
Parameters:
index -
Returns:
the child.

appendChildNode

public final void appendChildNode(NodeValue<?> value)
Parameters:
value -

insertChildNodeBefore

public final void insertChildNodeBefore(int index,
                                        NodeValue<?> value)
Parameters:
index -
value -

insertChildNodeAfter

public final void insertChildNodeAfter(int index,
                                       NodeValue<?> value)
Parameters:
index -
value -

insertChildNodeAt

public void insertChildNodeAt(java.lang.Integer index,
                              NodeValue<?> value)
Parameters:
index -
value -

removeChildNode

public final void removeChildNode(int index)
Parameters:
index -

moveUpChildNode

public final void moveUpChildNode(int index)
Parameters:
index -

moveDownChildNode

public final void moveDownChildNode(int index)
Parameters:
index -

removeAllChildNodes

public void removeAllChildNodes()

getParentNodeEditor

public NodeEditor getParentNodeEditor()
Returns:
the parent node editor.

isParentMutable

public boolean isParentMutable()
Returns:
true if node is removable.

createChildNode

protected abstract Node createChildNode(NodeValue<?> value)
Parameters:
value -

doSetValue

protected void doSetValue(NodeValue<?> value)
Parameters:
value -

doAppendNode

protected void doAppendNode(Node node)
Parameters:
node -

doInsertNodeAfter

protected void doInsertNodeAfter(int index,
                                 Node node)
Parameters:
index -
node -

doInsertNodeBefore

protected void doInsertNodeBefore(int index,
                                  Node node)
Parameters:
index -
node -

doRemoveNode

protected void doRemoveNode(int nodeIndex)
Parameters:
nodeIndex -

doMoveUpNode

protected void doMoveUpNode(int nodeIndex)
Parameters:
nodeIndex -

doMoveDownNode

protected void doMoveDownNode(int nodeIndex)
Parameters:
nodeIndex -

doChangeNode

protected void doChangeNode(int nodeIndex,
                            Node node)
Parameters:
nodeIndex -