org.openbp.jaspira.propertybrowser.nodes
Class PropertyNode

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

public class PropertyNode
extends AbstractNode
implements PropertyEditorOwner

A property descriptor node represents a single non-collection property of an object.

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
PropertyNode(PropertyDescriptor propertyDescriptor)
          Default Contructor
 
Method Summary
 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()
           
 java.awt.Dimension getPreferredSize()
          Gets the preferred height of the node in the tree.
 PropertyDescriptor getPropertyDescriptor()
          Gets the propertyDescriptor for this node..
 PropertyEditor getPropertyEditor()
          Gets the the propertyEditor associated with the property descriptor.
 PropertyValidator getValidator()
          Gets the the property validator used by this property editor..
 void handleKeyEvent(java.awt.event.KeyEvent e)
          Handles a key event that is not consumed by the property editor.
 boolean isReadOnly()
          Returns true if the propertyEditor is read only.
 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 setPropertyDescriptor(PropertyDescriptor propertyDescriptor)
          Sets the propertyDescriptor for this node..
 void setPropertyEditor(PropertyEditor propertyEditor)
          Sets the the propertyEditor associated with the property descriptor.
 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, getPropertyBrowser, getPropertyNodes, isLeaf, reloadProperty, remove, setLastHeight, setParent, setPropertyBrowser
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openbp.jaspira.propertybrowser.editor.PropertyEditorOwner
reloadProperty
 

Constructor Detail

PropertyNode

public PropertyNode(PropertyDescriptor propertyDescriptor)
Default Contructor

Parameters:
propertyDescriptor - Property descriptor represented by this node
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

getPropertyEditor

public PropertyEditor getPropertyEditor()
Gets the the propertyEditor associated with the property descriptor.


setPropertyEditor

public void setPropertyEditor(PropertyEditor propertyEditor)
Sets the the propertyEditor associated with the property descriptor.


getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor()
Gets the propertyDescriptor for this node..


setPropertyDescriptor

public void setPropertyDescriptor(PropertyDescriptor propertyDescriptor)
Sets the propertyDescriptor for this node..


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

getValidator

public PropertyValidator getValidator()
Gets the the property validator used by this property editor..

Specified by:
getValidator in interface PropertyEditorOwner

handleKeyEvent

public void handleKeyEvent(java.awt.event.KeyEvent e)
Handles a key event that is not consumed by the property editor.

Specified by:
handleKeyEvent in interface PropertyEditorOwner
Parameters:
e - The key event

getNodeText

public java.lang.String getNodeText()
Specified by:
getNodeText in interface TreeTableNode

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred height of the node in the tree.

Specified by:
getPreferredSize in interface TreeTableNode
Overrides:
getPreferredSize in class AbstractNode
Returns:
The height as an int in pixels

getColumnValue

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

Specified by:
getColumnValue in interface TreeTableNode
Parameters:
columnIndex - The of the column object to be returned
Returns:
The column value as an object

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

isReadOnly

public boolean isReadOnly()
Returns true if the propertyEditor is read only.


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


Copyright © 2011. All Rights Reserved.