org.apache.ojb.tools.mapping.reversedb2.propertyEditors
Class EditableTreeNodeWithProperties

java.lang.Object
  extended byorg.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
All Implemented Interfaces:
PropertyEditorTarget, java.io.Serializable, javax.swing.tree.TreeNode
Direct Known Subclasses:
OjbMetaTreeNode, ReverseDbTreeNode

public abstract class EditableTreeNodeWithProperties
extends java.lang.Object
implements javax.swing.tree.TreeNode, PropertyEditorTarget, java.io.Serializable

This class provides a basic implementation of a PropertyEditor and a TreeNode. This is the typical application of the propertyEditor framework, you will usually have a tree or a table with an overview of possibly editable objects and a panel with a detailed view on the object. The properties are maintained in a HashMap, setProperty sets these properties, getProperty retrieves them. You may want to define public final keys for your properties in order to have uniform access to them from all editors.

Version:
$Id: EditableTreeNodeWithProperties.java,v 1.2 2004/01/07 11:41:21 thma Exp $
Author:
Florian Bruckner
See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport propertyChangeDelegate
           
(package private) static long serialVersionUID
           
 
Constructor Summary
EditableTreeNodeWithProperties()
          Creates a new instance of EditableTreeNodeWithProperties
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a new PropertyChangeListener to this node.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Add a new PropertyChangeListener to this node for a specific property.
 java.lang.Object getAttribute(java.lang.String strKey)
          Get an attribute of this node as Object.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener from this node.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property from this node.
 void setAttribute(java.lang.String strKey, java.lang.Object value)
          Set an attribute of this node as Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 
Methods inherited from interface org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorTarget
getPropertyEditorClass
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

propertyChangeDelegate

protected java.beans.PropertyChangeSupport propertyChangeDelegate
Constructor Detail

EditableTreeNodeWithProperties

public EditableTreeNodeWithProperties()
Creates a new instance of EditableTreeNodeWithProperties

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a new PropertyChangeListener to this node. This functionality has been borrowed from the java.beans package, though this class has nothing to do with a bean

Specified by:
addPropertyChangeListener in interface PropertyEditorTarget

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Add a new PropertyChangeListener to this node for a specific property. This functionality has been borrowed from the java.beans package, though this class has nothing to do with a bean

Specified by:
addPropertyChangeListener in interface PropertyEditorTarget

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from this node. This functionality has been borrowed from the java.beans package, though this class has nothing to do with a bean

Specified by:
removePropertyChangeListener in interface PropertyEditorTarget

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property from this node. This functionality has. Please note that the listener this does not remove a listener that has been added without specifying the property it is interested in.

Specified by:
removePropertyChangeListener in interface PropertyEditorTarget

getAttribute

public java.lang.Object getAttribute(java.lang.String strKey)
Get an attribute of this node as Object. This method is backed by a HashMap, so all rules of HashMap apply to this method.

Specified by:
getAttribute in interface PropertyEditorTarget

setAttribute

public void setAttribute(java.lang.String strKey,
                         java.lang.Object value)
Set an attribute of this node as Object. This method is backed by a HashMap, so all rules of HashMap apply to this method. Fires a PropertyChangeEvent.

Specified by:
setAttribute in interface PropertyEditorTarget


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14