org.openbp.jaspira.propertybrowser.nodes
Class ObjectNode

java.lang.Object
  extended by org.openbp.jaspira.propertybrowser.nodes.AbstractNode
      extended by org.openbp.jaspira.propertybrowser.nodes.ObjectNode
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.TreeNode, Copyable, TreeTableNode

public class ObjectNode
extends AbstractNode

An object descriptor node is either the root node of an property browser tree, represents an object contained in a collection (see CollectionNode) or the value of a complex type property.

Author:
Erich Lauterbach

Field Summary
 
Fields inherited from class org.openbp.jaspira.propertybrowser.nodes.AbstractNode
children, object, parentNode, propertyBrowser
 
Fields inherited from interface org.openbp.common.generic.Copyable
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW
 
Constructor Summary
ObjectNode(ObjectDescriptor objectDescriptor)
          Constructor for regular object nodes.
ObjectNode(PropertyDescriptor propertyDescriptor)
          Constructor for object nodes describing a complex property.
 
Method Summary
protected  void addProperty(PropertyDescriptor pd)
          Adds a property descriptor as a PropertyNode to a specified GroupNode according to the group name.
 void copyFrom(java.lang.Object source, int copyMode)
          Copies the values of the source object to this object.
 java.lang.Object getColumnValue(int columnIndex)
          Returns the column value for specified column index.
 java.lang.String getNodeText()
           
 ObjectDescriptor getObjectDescriptor()
          Returns the objectDescriptor.
 PropertyDescriptor getPropertyDescriptor()
          Gets the property descritpor in case this object descriptor specifies a complex type property.
 ObjectValidator getValidator()
          Gets the object validator that is associated with the object descriptor of this node.
 void initialize()
          Initializes the node.
 boolean isLeaf()
          Returns true if the receiver is a leaf.
 void reload()
          Reloads the content of this node.
 boolean representsProperty(java.lang.String propertyName)
          Checks if this node represents the given property.
 void setObject(java.lang.Object object)
          Sets the object containing the values for the porperty.
 void setObjectDescriptor(ObjectDescriptor objectDescriptor)
          Sets the objectDescriptor.
 void setValidator(ObjectValidator validator)
          Sets the object validator that is associated with the object descriptor of this node.
 boolean shouldExpand()
          Checks if the node node should be expanded on initial display.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class org.openbp.jaspira.propertybrowser.nodes.AbstractNode
add, add, children, clone, filterPropertyNodes, findNodeForProperty, getAllowsChildren, getAssociatedCollectionNode, getChildAt, getChildCount, getIndex, getLastHeight, getObject, getObjectNode, getParent, getPreferredSize, getPropertyBrowser, getPropertyNodes, reloadProperty, remove, setLastHeight, setParent, setPropertyBrowser
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectNode

public ObjectNode(ObjectDescriptor objectDescriptor)
Constructor for regular object nodes.

Parameters:
objectDescriptor - Object descriptor represented by this node

ObjectNode

public ObjectNode(PropertyDescriptor propertyDescriptor)
Constructor for object nodes describing a complex property.

Parameters:
propertyDescriptor - Property descriptor in case this object node specifies a complex type property
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object

reload

public void reload()
Reloads the content of this node.

Overrides:
reload in class AbstractNode

representsProperty

public boolean representsProperty(java.lang.String propertyName)
Checks if this node represents the given property.

Overrides:
representsProperty in class AbstractNode
Parameters:
propertyName - Name of the property to check

initialize

public void initialize()
Initializes the node.


getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor()
Gets the property descritpor in case this object descriptor specifies a complex type property.


copyFrom

public void copyFrom(java.lang.Object source,
                     int copyMode)
              throws java.lang.CloneNotSupportedException
Copies the values of the source object to this object.

Specified by:
copyFrom in interface Copyable
Overrides:
copyFrom in class AbstractNode
Parameters:
source - The source object. Must be of the same type as this object.
copyMode - Determines if a deep copy, a first level copy or a shallow copy is to be performed. See the constants of the org.openbp.common.generic.description.Copyable class.
Throws:
java.lang.CloneNotSupportedException - If the cloning of one of the contained objects failed

getNodeText

public java.lang.String getNodeText()

getColumnValue

public java.lang.Object getColumnValue(int columnIndex)
Returns the column value for specified column index.

Parameters:
columnIndex - The of the column object to be returned
Returns:
The column value as an object

isLeaf

public boolean isLeaf()
Description copied from class: AbstractNode
Returns true if the receiver is a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class AbstractNode

shouldExpand

public boolean shouldExpand()
Checks if the node node should be expanded on initial display.

Overrides:
shouldExpand in class AbstractNode
Returns:
true If the node should be expanded
false If the node should be collapsed

setObject

public void setObject(java.lang.Object object)
Sets the object containing the values for the porperty.

Overrides:
setObject in class AbstractNode
Parameters:
object - The object to be set

getObjectDescriptor

public ObjectDescriptor getObjectDescriptor()
Returns the objectDescriptor.

Returns:
ObjectDescriptor

setObjectDescriptor

public void setObjectDescriptor(ObjectDescriptor objectDescriptor)
Sets the objectDescriptor.

Parameters:
objectDescriptor - The objectDescriptor to set

getValidator

public ObjectValidator getValidator()
Gets the object validator that is associated with the object descriptor of this node.


setValidator

public void setValidator(ObjectValidator validator)
Sets the object validator that is associated with the object descriptor of this node.


addProperty

protected void addProperty(PropertyDescriptor pd)
Adds a property descriptor as a PropertyNode to a specified GroupNode according to the group name. If the GroupNode should not exist, then a new GroupNode will be created.

Parameters:
pd - to be added


Copyright © 2011. All Rights Reserved.