public interface TreeHandler extends ComponentHandler<Object>
A specialized ComponentHandler
interface for dealing with tree
components.
A tree component provides some enhanced functionality not covered by the
default methods defined in the ComponentHandler
interface.
Therefore this interface is available for accessing this special
functionality. New methods have been introduced for dealing for instance with
querying the tree's selection or registering special event handlers.
Note that this ComponentHandler
is of type Object
.
This is due to the fact that a tree supports both single and multiple
selections. In the former case the handler's data is an object of type
. In the latter case it is an array of this
type.
TreeNodePath
Modifier and Type | Method and Description |
---|---|
void |
addExpansionListener(TreeExpansionListener l)
Adds a
TreeExpansionListener to this tree component. |
void |
addPreExpansionListener(TreePreExpansionListener l)
Adds a
TreePreExpansionListener to this tree component. |
void |
addSelectedPath(TreeNodePath path)
Adds the specified path to the selection of the tree.
|
void |
clearSelection()
Removes the selection.
|
void |
collapse(TreeNodePath path)
Collapses the node specified by the given path.
|
void |
expand(TreeNodePath path)
Expands the node specified by the given path.
|
org.apache.commons.configuration.HierarchicalConfiguration |
getModel()
Returns the tree's data model.
|
TreeNodePath |
getSelectedPath()
Returns the path to the selected node.
|
TreeNodePath[] |
getSelectedPaths()
Returns an array with the paths to all selected nodes.
|
void |
removeExpansionListener(TreeExpansionListener l)
Removes the specified expansion listener from this tree component.
|
void |
removePreExpansionListener(TreePreExpansionListener l)
Removes the specified
TreePreExpansionListener from this
tree component. |
void |
setSelectedPath(TreeNodePath path)
Sets a single selected node.
|
getComponent, getData, getOuterComponent, getType, isEnabled, setData, setEnabled
TreeNodePath getSelectedPath()
TreeNodePath
object
returned points to the selected node. If nothing is selected, result will
be null.void setSelectedPath(TreeNodePath path)
path
- the path to the selected node (must not be null)TreeNodePath[] getSelectedPaths()
void addSelectedPath(TreeNodePath path)
path
- the path pointing to the node which should be added to the
selection (must not be null)void clearSelection()
void addExpansionListener(TreeExpansionListener l)
TreeExpansionListener
to this tree component. This
listener will be notified whenever a node of this tree is expanded or
collapsed.l
- the listener to add (must not be null)IllegalArgumentException
- if the listener is nullvoid removeExpansionListener(TreeExpansionListener l)
l
- the listener to removevoid addPreExpansionListener(TreePreExpansionListener l)
TreePreExpansionListener
to this tree component. This
listener will be notified whenever a tree node is about to be expanded or
collapsed and has the opportunity to forbid this operation.l
- the listener to add (must not be null)IllegalArgumentException
- if the listener is nullvoid removePreExpansionListener(TreePreExpansionListener l)
TreePreExpansionListener
from this
tree component.l
- the listener to removevoid expand(TreeNodePath path)
path
- the pathvoid collapse(TreeNodePath path)
path
- the pathorg.apache.commons.configuration.HierarchicalConfiguration getModel()
Copyright © 2016 The JGUIraffe Team. All rights reserved.