Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

org.openquark.gems.client.browser
Class BrowserTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.openquark.gems.client.browser.BrowserTreeNode
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode
Direct Known Subclasses:
BrowserTreeRootNode, GemCategoryNode, GemDrawer, GemTreeNode, SearchResultRootTreeNode, WorkspaceRootTreeNode

public abstract class BrowserTreeNode
extends DefaultMutableTreeNode

Specialized version of DefaultMutableTreeNode. Adds a getDisplayedString method that is used by the BrowserTreeCellRenderer to get the displayable string for a node. By default returns toString but can be overridden to return more complex information. This class also adds support for storing node sorting and categorization information.

Author:
Ken Wong Creation Date: Dec 19th 2002
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
BrowserTreeNode()
          Generic constructor
BrowserTreeNode(Object userObject)
          Generic constructor
BrowserTreeNode(Object userObject, boolean allowChildren)
          Generic constructor
 
Method Summary
 BrowserTreeNode addNewCategoryNode(GemCategory category)
          Adds the tree node to use for representing a sub-category of this node.
 GemCategorizer<?> getCategorizer()
          Returns the categorizer associated with this node.
 String getDisplayedString()
          Returns the string that will be used by the cell renderer to label the tree node.
 org.openquark.gems.client.browser.BrowserTreeModel.CategoryNodeProvider getNodeProvider()
          Returns the node provider associated with this node.
 String getSecondaryToolTipText()
          Returns information about the node hierarchy (ie: number of gems and categories contained), which is displayed in non-bold form in the tooltip.
 GemComparatorSorter getSorter()
          Returns the sorter associated with this node.
 String getToolTipText()
          Returns the string that will be used by the browser tree to display the tooltip for this tree node.
 void setCategorizer(GemCategorizer<?> categorizer, org.openquark.gems.client.browser.BrowserTreeModel.CategoryNodeProvider provider)
          Associates the given categorizer and node provider with this tree node.
 void setSorter(GemComparatorSorter sorter)
          Associates the given sorter with this tree node.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BrowserTreeNode

public BrowserTreeNode()
Generic constructor


BrowserTreeNode

public BrowserTreeNode(Object userObject)
Generic constructor

Parameters:
userObject -

BrowserTreeNode

public BrowserTreeNode(Object userObject,
                       boolean allowChildren)
Generic constructor

Parameters:
userObject -
allowChildren -
Method Detail

getDisplayedString

public String getDisplayedString()
Returns the string that will be used by the cell renderer to label the tree node. The default implementation simply returns toString, subclasses should override this if they wish to return more complex information.

Returns:
String

setSorter

public void setSorter(GemComparatorSorter sorter)
Associates the given sorter with this tree node.

Parameters:
sorter - the sorter to associated

setCategorizer

public void setCategorizer(GemCategorizer<?> categorizer,
                           org.openquark.gems.client.browser.BrowserTreeModel.CategoryNodeProvider provider)
Associates the given categorizer and node provider with this tree node.

Parameters:
categorizer - the categorizer to associated
provider - the node provider for the categorizer

getSorter

public GemComparatorSorter getSorter()
Returns the sorter associated with this node.

Returns:
GemComparatorSorter

getCategorizer

public GemCategorizer<?> getCategorizer()
Returns the categorizer associated with this node.

Returns:
GemCategorizer

getNodeProvider

public org.openquark.gems.client.browser.BrowserTreeModel.CategoryNodeProvider getNodeProvider()
Returns the node provider associated with this node.

Returns:
CategoryNodeProvider

addNewCategoryNode

public BrowserTreeNode addNewCategoryNode(GemCategory category)
Adds the tree node to use for representing a sub-category of this node. This method will check if the tree node has been used before and add it from the categoryToNodeMap if that is the case. Otherwise a new node will be obtained from the node provider and stored in the map for future reuse. We store the nodes in the map so that any categorization info associated with the sub-category nodes is not lost if this node is re-categorized.

Parameters:
category - the category for which to return a tree node
Returns:
the tree node to use for the given category, which has been added to this node as a child.

getToolTipText

public String getToolTipText()
Returns the string that will be used by the browser tree to display the tooltip for this tree node. Subclasses that want to return a custom tooltip need to override this. By default it returns the name of the node and information on the nodes in the hierachy below this one.

Returns:
String

getSecondaryToolTipText

public String getSecondaryToolTipText()
Returns information about the node hierarchy (ie: number of gems and categories contained), which is displayed in non-bold form in the tooltip.

Returns:
String

Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

Copyright © 2007 Business Objects. All rights reserved.