org.eclipse.actf.model.javapp.traverse
Class SwtTreeNodeWalker
java.lang.Object
org.eclipse.actf.model.traverse.AbstractNodeWalker
org.eclipse.actf.model.traverse.AbstractTreeNodeWalker
org.eclipse.actf.model.javapp.traverse.SwtTreeNodeWalker
- All Implemented Interfaces:
- INodeWalker, ITreeNodeWalker
public class SwtTreeNodeWalker
- extends AbstractTreeNodeWalker
used to walk a tree of org.eclipse.swt.widgets.Composite
nodes. If a node is an instance of org.eclipse.swt.widgets.Shell
,
the child shells of this node will not be included in the children returned. Thus, a call to hasChildren()
that returns false
does not mean that
the particular element has no children at all.
Note: Composite objects that have org.eclipse.swt.widgets.Item
children
will have two children for each such Item
object - one for the Item
object itself and one for the Control
object returned by getControl
,
should that item support this method.
- Author:
- Mike Squillace
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SwtTreeNodeWalker
public SwtTreeNodeWalker()
getChildren
public Object[] getChildren(Object element)
throws InvalidComponentException
- returns the children of the given node.
For convenience, the menu of any control object is also counted as a child of that control. Subsequent menu items
that have menus as children will also be traversed by this method.
- Parameters:
element
- - node of tree
- Returns:
- children of given node or empty array if no children are found
- Throws:
InvalidComponentException
- if component is disposed or otherwise invalid
getParent
public Object getParent(Object element)
throws InvalidComponentException
- return the parent of the given node.
- Parameters:
element
- - node of tree
- Returns:
- parent of given node or
null
if node has no parent
- Throws:
InvalidComponentException
- if component is disposed or otherwise invalid
getStartNodes
public Object[] getStartNodes()
- get the starting nodes of the graph. These are the nodes of the graph that have
no predecessors.
- Returns:
- starting nodes of graph
getAllChildren
protected Object[] getAllChildren(Object element)
throws InvalidComponentException
- Throws:
InvalidComponentException
addAssociatedControls
protected Object[] addAssociatedControls(Object[] children)
throws Exception
- Throws:
Exception
getShellChildren
protected Object[] getShellChildren(Object element)
getItemChildren
protected Object[] getItemChildren(Object element)