Package org.apache.myfaces.tobago.model
Class ExpandedState
java.lang.Object
org.apache.myfaces.tobago.model.ExpandedState
- All Implemented Interfaces:
- Serializable
Manages the expanded state of an tree.
- Since:
- 2.0.0
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionExpandedState(int defaultExpandedLevels) Creates a new state object to store which nodes of a tree are expanded and collapsed in a view.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcollapse(int level) Collapses all nodes that level are higher or equals the parameter level.voidCollapses a single node.voidCollapses a single node.voidCollapses a nodes of the tree.voidCollapses a nodes of the tree.voidexpand(int level) Expands all nodes that level are lower or equals the parameter level.voidExpands a single node.voidExpands a single node.voidExpands a single node.voidExpands a single node.voidExpands a nodes of the tree.booleanisExpanded(TreeNode node) Checks if a node is expanded.booleanisExpanded(TreePath path) Checks if a node is expanded.voidreset()Resets the state to the defaults.
- 
Constructor Details- 
ExpandedStatepublic ExpandedState(int defaultExpandedLevels) Creates a new state object to store which nodes of a tree are expanded and collapsed in a view.- Parameters:
- defaultExpandedLevels- All nodes up to this level are expanded by default.
 
 
- 
- 
Method Details- 
isExpandedChecks if a node is expanded.- Parameters:
- node- The node to check.
- Returns:
- Is the node expanded?
 
- 
isExpandedChecks if a node is expanded.- Parameters:
- path- The path of the node to check.
- Returns:
- Is the node behind this path is expanded?
 
- 
expandExpands a single node.- Parameters:
- node- The node to expand. Also the parents will be expanded since Tobago 3.0.0.
 
- 
expandExpands a single node.- Parameters:
- node- The node to expand.
- parents- Should the parents also be expanded?
 
- 
expandExpands a single node.- Parameters:
- path- The path of the node to expand. Also the parents will be expanded since Tobago 3.0.0.
 
- 
expandExpands a single node.- Parameters:
- path- The path of the node to expand.
- parents- Should the parents also be expanded?
 
- 
expandpublic void expand(int level) Expands all nodes that level are lower or equals the parameter level.- Parameters:
- level- The level to expand.
 
- 
expandAllpublic void expandAll()Expands a nodes of the tree.
- 
collapseCollapses a single node.- Parameters:
- node- The node to collapse.
 
- 
collapseCollapses a single node.- Parameters:
- path- The path of the node to collapse.
 
- 
collapsepublic void collapse(int level) Collapses all nodes that level are higher or equals the parameter level.- Parameters:
- level- The level to expand.
 
- 
collapseAllpublic void collapseAll()Collapses a nodes of the tree.
- 
collapseAllButRootpublic void collapseAllButRoot()Collapses a nodes of the tree. The root node will be expanded.
- 
resetpublic void reset()Resets the state to the defaults. After this call, the nodes with level smaller than defaultExpandedLevels are expanded, the other ones are collapsed.
- 
getExpandedSet- Returns:
- A unmodifiable set of paths of the expanded nodes.
 
- 
getCollapsedSet- Returns:
- A unmodifiable set of paths of the collapsed nodes.
 
 
-