org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel
Class OjbMetaClassDescriptorNode

java.lang.Object
  extended byorg.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
      extended byorg.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaTreeNode
          extended byorg.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaClassDescriptorNode
All Implemented Interfaces:
ActionTarget, java.lang.Comparable, javax.swing.tree.MutableTreeNode, PropertyEditorTarget, java.io.Serializable, javax.swing.tree.TreeNode

public class OjbMetaClassDescriptorNode
extends OjbMetaTreeNode
implements javax.swing.tree.MutableTreeNode

Author:
Administrator
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaTreeNode
alChildren
 
Fields inherited from class org.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
propertyChangeDelegate
 
Constructor Summary
OjbMetaClassDescriptorNode(DescriptorRepository pRepository, OjbMetaDataTreeModel pTreeModel, OjbMetaRootNode pparent, ClassDescriptor pCld)
          Creates a new instance of OjbMetaClassDescriptorNode
 
Method Summary
protected  boolean _load()
          Purpose of this method is to fill the children of the node.
 boolean actionListCachable()
          Some objects may alter the list of actions they present depending on the state they are in.
 boolean actionListStatic()
          Some objects may return a list of actions depending on the state they are in or the way they have been created.
 java.util.Iterator getActions()
          Get a bunch of java.util.Action objects that this object wants to offer in a context-menu.
 boolean getAllowsChildren()
           
 java.lang.Object getAssociatedDescriptor()
          Return the descriptor object this node is associated with.
 java.lang.Object getAttribute(java.lang.String key)
          Get an attribute of this node as Object.
 java.lang.Class getPropertyEditorClass()
          Return the property editor class for this PropertyEditorTarget.
 void insert(javax.swing.tree.MutableTreeNode child, int index)
          Adds child to the receiver at index.
 boolean isLeaf()
           
 void remove(int index)
          Removes the child at index from the receiver.
 void remove(javax.swing.tree.MutableTreeNode node)
          Removes node from the receiver.
 void removeFromParent()
          Removes the receiver from its parent.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Set an attribute of this node as Object.
 void setParent(javax.swing.tree.MutableTreeNode newParent)
          Sets the parent of the receiver to newParent.
 void setUserObject(java.lang.Object object)
          Resets the user object of the receiver to object.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaTreeNode
children, compareTo, getChildAt, getChildCount, getIndex, getOjbMetaTreeModel, getParent, getRepository, load
 
Methods inherited from class org.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getChildAt, getChildCount, getIndex, getParent
 

Constructor Detail

OjbMetaClassDescriptorNode

public OjbMetaClassDescriptorNode(DescriptorRepository pRepository,
                                  OjbMetaDataTreeModel pTreeModel,
                                  OjbMetaRootNode pparent,
                                  ClassDescriptor pCld)
Creates a new instance of OjbMetaClassDescriptorNode

Method Detail

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Specified by:
getAllowsChildren in class OjbMetaTreeNode
See Also:
TreeNode.getAllowsChildren()

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Description copied from class: EditableTreeNodeWithProperties
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
Overrides:
getAttribute in class EditableTreeNodeWithProperties

getPropertyEditorClass

public java.lang.Class getPropertyEditorClass()
Description copied from interface: PropertyEditorTarget
Return the property editor class for this PropertyEditorTarget. Depending on the GUI implementation this could for example be an extension of JPanel. The Property editor is responsible for the layout, so the property editor has to know which properties this target has.

Specified by:
getPropertyEditorClass in interface PropertyEditorTarget

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Specified by:
isLeaf in class OjbMetaTreeNode
See Also:
TreeNode.isLeaf()

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Description copied from class: EditableTreeNodeWithProperties
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
Overrides:
setAttribute in class EditableTreeNodeWithProperties

_load

protected boolean _load()
Purpose of this method is to fill the children of the node. It should replace all children in alChildren (the arraylist containing the children) of this node and notify the TreeModel that a change has occurred.

Specified by:
_load in class OjbMetaTreeNode

toString

public java.lang.String toString()

getActions

public java.util.Iterator getActions()
Description copied from interface: ActionTarget
Get a bunch of java.util.Action objects that this object wants to offer in a context-menu.

Specified by:
getActions in interface ActionTarget
Returns:
an Iterator containing all the actions.
See Also:
ActionTarget#getActions()

actionListCachable

public boolean actionListCachable()
Description copied from interface: ActionTarget
Some objects may alter the list of actions they present depending on the state they are in. If this method returns true, the list of actions can be cached (i.e. the resulting GUI object can be cached and doesn't have to be regenerated all the time)

Specified by:
actionListCachable in interface ActionTarget
Returns:
true if the result of getActions() may be cached.
See Also:
ActionTarget#actionListCacheable()

actionListStatic

public boolean actionListStatic()
Description copied from interface: ActionTarget
Some objects may return a list of actions depending on the state they are in or the way they have been created. Others always return the same list of actions without any dependency on the state. If this is the case, this method should return true. Other objects may cache the list of actions and the depending GUI objects on a per-class basis instead of a per-object basis. If this method returns true, actionListCacheable has to return true as well, otherwise it would not make any sense to cache the information here.

Specified by:
actionListStatic in interface ActionTarget

insert

public void insert(javax.swing.tree.MutableTreeNode child,
                   int index)
Adds child to the receiver at index. child will be messaged with setParent.

Specified by:
insert in interface javax.swing.tree.MutableTreeNode

remove

public void remove(javax.swing.tree.MutableTreeNode node)
Removes node from the receiver. setParent will be messaged on node.

Specified by:
remove in interface javax.swing.tree.MutableTreeNode

remove

public void remove(int index)
Removes the child at index from the receiver.

Specified by:
remove in interface javax.swing.tree.MutableTreeNode

removeFromParent

public void removeFromParent()
Removes the receiver from its parent.

Specified by:
removeFromParent in interface javax.swing.tree.MutableTreeNode

setParent

public void setParent(javax.swing.tree.MutableTreeNode newParent)
Sets the parent of the receiver to newParent.

Specified by:
setParent in interface javax.swing.tree.MutableTreeNode

setUserObject

public void setUserObject(java.lang.Object object)
Resets the user object of the receiver to object.

Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode

getAssociatedDescriptor

public java.lang.Object getAssociatedDescriptor()
Return the descriptor object this node is associated with. E.g. if the node displays a class descriptor, the ClassDescriptor describing the class should be returned. Used for creating a Transferable.

Specified by:
getAssociatedDescriptor in class OjbMetaTreeNode


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