org.openbp.cockpit.plugins.finder.treemodel
Class GenericNode

java.lang.Object
  extended by org.openbp.swing.components.tree.DefaultTreeNode
      extended by org.openbp.cockpit.plugins.finder.treemodel.GenericNode
All Implemented Interfaces:
javax.swing.tree.TreeNode
Direct Known Subclasses:
LeafNode, PropertyNode

public class GenericNode
extends DefaultTreeNode

Default node in the generic model.

Author:
Baumgartner Michael

Field Summary
protected  java.lang.Object nodeData
          Data object that is represented by the node.
protected  NodeMapper nodeMapper
          Mapper of the node.
 
Fields inherited from class org.openbp.swing.components.tree.DefaultTreeNode
parent
 
Constructor Summary
GenericNode()
           
 
Method Summary
 void addChild(GenericNode child, Strategy strategy)
          Add a new child to the node.
 void addProperty(java.lang.String key, java.lang.Object value)
          Add a property to the node
 NodeMapper getNodeMapper()
          Get the node mapper.
 java.lang.Object getProperty(java.lang.String key)
          Get the property of the node
 PropertyNode getPropertyNode(java.lang.Object propertyData)
          Get the group with a special data object
 void setNodeMapper(NodeMapper nodeMapper)
          Set the node mapper.
 java.lang.String toString()
          Map the call to the node mapper.
 
Methods inherited from class org.openbp.swing.components.tree.DefaultTreeNode
addChild, children, clearChilds, getAllowsChildren, getChildAt, getChildCount, getChildList, getIndex, getParent, insertChild, isLeaf, removeChild, setChildList, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodeMapper

protected NodeMapper nodeMapper
Mapper of the node.


nodeData

protected java.lang.Object nodeData
Data object that is represented by the node.

Constructor Detail

GenericNode

public GenericNode()
Method Detail

setNodeMapper

public void setNodeMapper(NodeMapper nodeMapper)
Set the node mapper. The mapper must be set in order to display a string for the node.

Parameters:
nodeMapper - The node mapper

getNodeMapper

public NodeMapper getNodeMapper()
Get the node mapper.

Returns:
the node mapper

addProperty

public void addProperty(java.lang.String key,
                        java.lang.Object value)
Add a property to the node

Parameters:
key - The key of the property
value - The value

getProperty

public java.lang.Object getProperty(java.lang.String key)
Get the property of the node

Parameters:
key - The key of the property
Returns:
The value or null if property does not exist

getPropertyNode

public PropertyNode getPropertyNode(java.lang.Object propertyData)
Get the group with a special data object

Parameters:
propertyData - The special data object
Returns:
The found group or null

addChild

public void addChild(GenericNode child,
                     Strategy strategy)
Add a new child to the node. The children are order by the comparator of the strategy

Parameters:
child - The child to add
strategy - The strategy used by the model

toString

public java.lang.String toString()
Map the call to the node mapper.

Overrides:
toString in class java.lang.Object
Returns:
display test of the node


Copyright © 2011. All Rights Reserved.