public class ExpandedState extends Object implements Serializable
Constructor and Description |
---|
ExpandedState(int defaultExpandedLevels)
Creates a new state object to store which nodes of a tree are expanded and collapsed in a view.
|
Modifier and Type | Method and Description |
---|---|
void |
collapse(int level)
Collapses all nodes that level are higher or equals the parameter level.
|
void |
collapse(TreeNode node)
Collapses a single node.
|
void |
collapse(TreePath path)
Collapses a single node.
|
void |
collapseAll()
Collapses a nodes of the tree.
|
void |
collapseAllButRoot()
Collapses a nodes of the tree.
|
void |
expand(int level)
Expands all nodes that level are lower or equals the parameter level.
|
void |
expand(TreeNode node)
Expands a single node.
|
void |
expand(TreeNode node,
boolean parents)
Expands a single node.
|
void |
expand(TreePath path)
Expands a single node.
|
void |
expand(TreePath path,
boolean parents)
Expands a single node.
|
void |
expandAll()
Expands a nodes of the tree.
|
Set<TreePath> |
getCollapsedSet() |
Set<TreePath> |
getExpandedSet() |
boolean |
isExpanded(TreeNode node)
Checks if a node is expanded.
|
boolean |
isExpanded(TreePath path)
Checks if a node is expanded.
|
void |
reset()
Resets the state to the defaults.
|
public ExpandedState(int defaultExpandedLevels)
defaultExpandedLevels
- All nodes up to this level are expanded by default.public boolean isExpanded(TreeNode node)
node
- The node to check.public boolean isExpanded(TreePath path)
path
- The path of the node to check.public void expand(TreeNode node)
node
- The node to expand.public void expand(TreeNode node, boolean parents)
node
- The node to expand.parents
- Should the parents also be expanded?public void expand(TreePath path)
path
- The path of the node to expand.public void expand(TreePath path, boolean parents)
path
- The path of the node to expand.parents
- Should the parents also be expanded?public void expand(int level)
level
- The level to expand.public void expandAll()
public void collapse(TreeNode node)
node
- The node to collapse.public void collapse(TreePath path)
path
- The path of the node to collapse.public void collapse(int level)
level
- The level to expand.public void collapseAll()
public void collapseAllButRoot()
public void reset()
public Set<TreePath> getExpandedSet()
Copyright © 2002-2018 The Apache Software Foundation. All Rights Reserved.