Extension SDK 10.1.2

oracle.ide.explorer
Interface TreeExplorer

All Superinterfaces:
ControllerProvider, Helpable, IconOverlayConsumer, View

public interface TreeExplorer
extends View, IconOverlayConsumer

The TreeExplorer interface defines the API for managing the nodes in the navigator and explorer trees.


Field Summary
static java.lang.String DELETE_TNODE_CMD
           
 
Fields inherited from interface oracle.ide.addin.View
PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Method Summary
 TNode addChild(Element element, TNode parent, javax.swing.tree.DefaultTreeModel model)
          Add the specified element to the model as a child of parent.
 void addChildren(TNode root)
          Add the children to the specified root TNode.
 void cacheFilter(TNode node, ChildFilter filter)
          Associate the specified node and filter.
 boolean canRefresh(TNode tnode, java.lang.Class cls)
          Check if the ancestor of the specified tnode whose data object class is an instance of the specified cls can be refreshed.
 TNode childrenAdded(java.util.List children, TNode parent, javax.swing.tree.DefaultTreeModel model, ChildFilter filter, boolean select)
          Add the nodes in the children list to the parent node.
 TNode childrenRemoved(java.util.List removed, TNode node, javax.swing.tree.DefaultTreeModel model, ChildFilter filter)
          Remove the nodes in the removed list from the parent node.
 void collapse(TNode tnode, boolean drop)
          Collapse the specified tnode.
 void expand(TNode tnode, boolean all)
          Expand the specified tnode.
 ChildFilter findCacheFilter(TNode node)
          Find the ChildFilter associated with the specified node.
 TNode findTNode(Element element, TNode root)
          Find the TNode encapsulating the specified element.
 TNode findTNodeBreadthFirst(Element element, TNode root)
          Find the TNode encapsulating the specified element.
 Attributes getCellRendererAttributes()
          Renderer attribute control how nodes should be rendered.
 java.util.Comparator getComparator()
          Get the Comparator that is used to sort the children of this node.
 Context getContext(java.util.EventObject event)
          Get the current tree context.
 java.awt.Component getGUI()
          Returns the component managing the tree.
 javax.swing.JTree getJTree()
          Returns the JTree.
 TNode getRoot()
          Returns the root TNode in the tree.
 Element getRootElement()
          Returns the root Element.
 javax.swing.tree.DefaultTreeModel getTreeModel()
          Returns the tree model associated with this TreeExplorer.
 void nodeChanged(TNode tnode)
          Call this method when you want to repaint the cell associated with the specified tnode.
 void nodeCollapsed(TNode node, boolean closing)
          Method called when the specified node is collapsed.
 void nodeExpanded(TNode node, boolean opening)
          Method called when the specified node is expanded.
 boolean open(TNode node)
          Add the children of the specified node.
 void openFilters(PropertyAccess layout)
          Lod the filters for the view identified by the viewId from the specified layout.
 void refresh(TNode tnode)
          Drops all children of the specified tnode and immediately collects them again.
 void refresh(TNode tnode, java.lang.Class cls)
          Refresh the ancestor of the specified tnode whose data object class is an instance of the specified cls.
 TNode removeChild(TNode child, javax.swing.tree.DefaultTreeModel model)
          Remove the specified child from the model.
 void saveFilters(PropertyAccess layout)
          Save the filters for the view identified by the viewId in the specified layout.
 TNode searchTNode(Element element, TNode root)
          Search for the TNode encapsulating the specified element.
 TNode searchTNodeBreadthFirst(Element element, TNode root)
          Search for the TNode encapsulating the specified element.
 void setComparator(java.util.Comparator comparator)
          Set the Comparator that is used to sort the children of this node.
 void setRootElement(Element element)
          Sets the root Element.
 void setSelected(TNode tnode)
          Select the given tnode in the tree.
 void setSelected(TNode[] tnodes)
          Select the given tnodes in the tree.
 boolean updateActiveNode(TNode newActiveNode)
          Activates the specified TNode.
 void updateCachedFilter(ChildFilter filter)
          Update the filter cache with the specified filter.
 
Methods inherited from interface oracle.ide.addin.View
activate, addViewListener, addViewSelectionListener, close, deactivate, getContext, getContextMenu, getId, getSelection, getToolbar, isVisible, owner, removeViewListener, removeViewSelectionListener, setToolbarVisible, show, updateTitle, updateVisibleActions
 
Methods inherited from interface oracle.ide.addin.ControllerProvider
getController
 
Methods inherited from interface oracle.ide.help.Helpable
getHelpInfo
 
Methods inherited from interface oracle.ide.explorer.IconOverlayConsumer
getElement, getOverlayCache, setOverlayCache
 

Field Detail

DELETE_TNODE_CMD

public static final java.lang.String DELETE_TNODE_CMD
See Also:
Constant Field Values
Method Detail

findTNode

public TNode findTNode(Element element,
                       TNode root)
Find the TNode encapsulating the specified element. Start looking recursively depth first from the given root node. Unlike searchTNode(Element, TNode), this routine will open unopened child container nodes during the search in order to find the specified element. Since this type of search is potentially costly, searchTNode(Element, TNode) is preferred in most cases.


findTNodeBreadthFirst

public TNode findTNodeBreadthFirst(Element element,
                                   TNode root)
Find the TNode encapsulating the specified element. Start looking recursively breadth first from the given root node. The search does not descend into unopened child container nodes. Unlike searchTNode(Element, TNode), this routine will open unopened child container nodes during the search in order to find the specified element. Since this type of search is potentially costly, searchTNode(Element, TNode) is preferred in most cases.


searchTNode

public TNode searchTNode(Element element,
                         TNode root)
Search for the TNode encapsulating the specified element. Start looking recursively depth first from the given root node.

The search does not descend into unopened child container nodes.


searchTNodeBreadthFirst

public TNode searchTNodeBreadthFirst(Element element,
                                     TNode root)
Search for the TNode encapsulating the specified element. Start looking recursively breadth first from the given root node.

The search does not descend into unopened child container nodes.


findCacheFilter

public ChildFilter findCacheFilter(TNode node)
Find the ChildFilter associated with the specified node. Returns null if no filter is found.


cacheFilter

public void cacheFilter(TNode node,
                        ChildFilter filter)
Associate the specified node and filter.


updateCachedFilter

public void updateCachedFilter(ChildFilter filter)
Update the filter cache with the specified filter.


saveFilters

public void saveFilters(PropertyAccess layout)
Save the filters for the view identified by the viewId in the specified layout.


openFilters

public void openFilters(PropertyAccess layout)
Lod the filters for the view identified by the viewId from the specified layout.


addChildren

public void addChildren(TNode root)
Add the children to the specified root TNode. If a ChildFilter is found for root, this method gets the children from the filter.


addChild

public TNode addChild(Element element,
                      TNode parent,
                      javax.swing.tree.DefaultTreeModel model)
Add the specified element to the model as a child of parent. Returns the TNode encapsulating the Element.


removeChild

public TNode removeChild(TNode child,
                         javax.swing.tree.DefaultTreeModel model)
Remove the specified child from the model. Returns the TNode closest to the removed child.


childrenRemoved

public TNode childrenRemoved(java.util.List removed,
                             TNode node,
                             javax.swing.tree.DefaultTreeModel model,
                             ChildFilter filter)
Remove the nodes in the removed list from the parent node. If a filter is specified the method delegates the children removal to the ChildFilter. The model parameter is passed to the filter so that it can remove the children from the tree model.


childrenAdded

public TNode childrenAdded(java.util.List children,
                           TNode parent,
                           javax.swing.tree.DefaultTreeModel model,
                           ChildFilter filter,
                           boolean select)
Add the nodes in the children list to the parent node. If a filter is specified the method delegates the children addition to the ChildFilter. The model parameter is passed to the filter so that it can add the children to the tree model. When the select parameter is true, the last child added is selected in the tree.


open

public boolean open(TNode node)
Add the children of the specified node. If the node is already opened this method returns immediately. Reloads the tree model once the children are added to the node.


nodeChanged

public void nodeChanged(TNode tnode)
Call this method when you want to repaint the cell associated with the specified tnode. The TNode should not be null.


refresh

public void refresh(TNode tnode)
Drops all children of the specified tnode and immediately collects them again.


refresh

public void refresh(TNode tnode,
                    java.lang.Class cls)
Refresh the ancestor of the specified tnode whose data object class is an instance of the specified cls.

Parameters:
cls - The class of the data object contained by the ancestor of tnode that should be refreshed.

canRefresh

public boolean canRefresh(TNode tnode,
                          java.lang.Class cls)
Check if the ancestor of the specified tnode whose data object class is an instance of the specified cls can be refreshed.

Parameters:
cls - The class of the data object contained by the ancestor of tnode that should be refreshed.

expand

public void expand(TNode tnode,
                   boolean all)
Expand the specified tnode. If all is set to true, it recursively expands container children.


collapse

public void collapse(TNode tnode,
                     boolean drop)
Collapse the specified tnode. If drop is set to true, it drops all children.


setSelected

public void setSelected(TNode tnode)
Select the given tnode in the tree.


setSelected

public void setSelected(TNode[] tnodes)
Select the given tnodes in the tree.


getTreeModel

public javax.swing.tree.DefaultTreeModel getTreeModel()
Returns the tree model associated with this TreeExplorer.


getComparator

public java.util.Comparator getComparator()
Get the Comparator that is used to sort the children of this node.


setComparator

public void setComparator(java.util.Comparator comparator)
Set the Comparator that is used to sort the children of this node. Calling this method has no effect if the node is not a container node. If the comparator has changed, then the child nodes are re-ordered.

Parameters:
comparator - The Comparator used for sorting the children of this node; if null, the children are not sorted.

updateActiveNode

public boolean updateActiveNode(TNode newActiveNode)
Activates the specified TNode. It makes sure that the affected nodes are repainted.


nodeExpanded

public void nodeExpanded(TNode node,
                         boolean opening)
Method called when the specified node is expanded. When opening is true, the node is being opened for the first time.


nodeCollapsed

public void nodeCollapsed(TNode node,
                          boolean closing)
Method called when the specified node is collapsed. When closing is true, node is about to drop all of its children and will be set to an un-opened state.


getRoot

public TNode getRoot()
Returns the root TNode in the tree.


getRootElement

public Element getRootElement()
Returns the root Element.


setRootElement

public void setRootElement(Element element)
Sets the root Element.


getJTree

public javax.swing.JTree getJTree()
Returns the JTree.

Specified by:
getJTree in interface IconOverlayConsumer

getGUI

public java.awt.Component getGUI()
Returns the component managing the tree. It is this component that should be added to the user interface hosting the tree explorer.

Specified by:
getGUI in interface View

getContext

public Context getContext(java.util.EventObject event)
Get the current tree context.

Specified by:
getContext in interface View
Parameters:
event - event associated with the context;

getCellRendererAttributes

public Attributes getCellRendererAttributes()
Renderer attribute control how nodes should be rendered. For example, setting the ALWAYS_BOLD_ACTIVE_NODE attribute will cause the tree to show active nodes in bold characters even when the tree does not have the focus.


Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.