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

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.OjbMetaRootNode
All Implemented Interfaces:
ActionTarget, java.lang.Comparable, PropertyEditorTarget, java.io.Serializable, javax.swing.tree.TreeNode

public class OjbMetaRootNode
extends OjbMetaTreeNode

This represents the root of the repository.xml tree model. It contains the ClassDescriptor objects for this repository and the default JDBC connection.

Version:
$Id: OjbMetaRootNode.java,v 1.4 2002/12/24 13:49:22 arminw Exp $
Author:
Florian Bruckner
See Also:
Serialized Form

Field Summary
(package private)  java.util.HashMap cldToNodes
           
 
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
OjbMetaRootNode(DescriptorRepository pRepository, OjbMetaDataTreeModel model)
          Creates a new instance of OjbMetaRootNode
 
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.
 void addClassDescriptor(ClassDescriptor cld)
           
 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 strKey)
          Get an attribute of this node as Object.
 OjbMetaClassDescriptorNode getClassDescriptorNodeForClassDescriptor(ClassDescriptor cld)
           
 java.lang.Class getPropertyEditorClass()
          Return the property editor class for this PropertyEditorTarget.
 boolean isLeaf()
           
 void setAttribute(java.lang.String strKey, java.lang.Object value)
          Set an attribute of this node as Object.
 
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, toString, wait, wait, wait
 

Field Detail

cldToNodes

java.util.HashMap cldToNodes
Constructor Detail

OjbMetaRootNode

public OjbMetaRootNode(DescriptorRepository pRepository,
                       OjbMetaDataTreeModel model)
Creates a new instance of OjbMetaRootNode

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()

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.


isLeaf

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

getAttribute

public java.lang.Object getAttribute(java.lang.String strKey)
Get an attribute of this node as Object.

Specified by:
getAttribute in interface PropertyEditorTarget
Overrides:
getAttribute in class EditableTreeNodeWithProperties

setAttribute

public void setAttribute(java.lang.String strKey,
                         java.lang.Object value)
Set an attribute of this node as Object.

Specified by:
setAttribute in interface PropertyEditorTarget
Overrides:
setAttribute in class EditableTreeNodeWithProperties

getClassDescriptorNodeForClassDescriptor

public OjbMetaClassDescriptorNode getClassDescriptorNodeForClassDescriptor(ClassDescriptor cld)

_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

addClassDescriptor

public void addClassDescriptor(ClassDescriptor cld)

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.

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)

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.

See Also:
ActionTarget

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. Null in this case because the root doesn't have any associated objects.

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