org.apache.myfaces.tobago.model
Class TreeState

java.lang.Object
  extended by org.apache.myfaces.tobago.model.TreeState

public class TreeState
extends java.lang.Object

Manages the state on a Tree:
1. selection: selected tree-nodes
2. expandState: open/close folder state
3. marker: last used action object


Field Summary
static java.lang.String SEP
           
 
Constructor Summary
TreeState()
           
 
Method Summary
 void addExpandState(javax.swing.tree.DefaultMutableTreeNode expandStateItem)
           
 void addSelection(javax.swing.tree.DefaultMutableTreeNode selectItem)
           
 void clearExpandState()
           
 void clearSelection()
           
 void commandNew(javax.swing.tree.DefaultMutableTreeNode newNode)
          Adds a (external created) node to the actually marked node.
 void expand(javax.swing.tree.DefaultMutableTreeNode node, int level)
           
 void expandSelection()
          Expands all parents which contains selected children.
 void expandTo(javax.swing.tree.DefaultMutableTreeNode node)
           
 java.util.Set<javax.swing.tree.DefaultMutableTreeNode> getExpandState()
           
 java.lang.String getLastCommand()
           
 javax.swing.tree.DefaultMutableTreeNode getLastMarker()
           
 javax.swing.tree.DefaultMutableTreeNode getMarker()
           
 java.lang.Integer[] getScrollPosition()
           
 java.util.Set<javax.swing.tree.DefaultMutableTreeNode> getSelection()
           
 boolean isExpanded(javax.swing.tree.DefaultMutableTreeNode node)
           
 boolean isMarked(javax.swing.tree.DefaultMutableTreeNode node)
           
 boolean isSelected(javax.swing.tree.DefaultMutableTreeNode node)
           
static java.lang.Integer[] parseScrollPosition(java.lang.String value)
           
 void setExpandState(java.util.Set<javax.swing.tree.DefaultMutableTreeNode> expandState)
           
 void setLastCommand(java.lang.String lastCommand)
           
 void setLastMarker(javax.swing.tree.DefaultMutableTreeNode lastMarker)
           
 void setMarker(javax.swing.tree.DefaultMutableTreeNode marker)
           
 void setScrollPosition(java.lang.Integer[] scrollPosition)
           
 void setSelection(java.util.Set<javax.swing.tree.DefaultMutableTreeNode> selection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEP

public static final java.lang.String SEP
See Also:
Constant Field Values
Constructor Detail

TreeState

public TreeState()
Method Detail

addExpandState

public void addExpandState(javax.swing.tree.DefaultMutableTreeNode expandStateItem)

addSelection

public void addSelection(javax.swing.tree.DefaultMutableTreeNode selectItem)

clearExpandState

public void clearExpandState()

clearSelection

public void clearSelection()

commandNew

public void commandNew(javax.swing.tree.DefaultMutableTreeNode newNode)
Adds a (external created) node to the actually marked node.


expand

public void expand(javax.swing.tree.DefaultMutableTreeNode node,
                   int level)

expandSelection

public void expandSelection()
Expands all parents which contains selected children.


expandTo

public void expandTo(javax.swing.tree.DefaultMutableTreeNode node)

isExpanded

public boolean isExpanded(javax.swing.tree.DefaultMutableTreeNode node)

isMarked

public boolean isMarked(javax.swing.tree.DefaultMutableTreeNode node)

isSelected

public boolean isSelected(javax.swing.tree.DefaultMutableTreeNode node)

getExpandState

public java.util.Set<javax.swing.tree.DefaultMutableTreeNode> getExpandState()

setExpandState

public void setExpandState(java.util.Set<javax.swing.tree.DefaultMutableTreeNode> expandState)

getLastCommand

public java.lang.String getLastCommand()

setLastCommand

public void setLastCommand(java.lang.String lastCommand)

getLastMarker

public javax.swing.tree.DefaultMutableTreeNode getLastMarker()

setLastMarker

public void setLastMarker(javax.swing.tree.DefaultMutableTreeNode lastMarker)

getMarker

public javax.swing.tree.DefaultMutableTreeNode getMarker()

setMarker

public void setMarker(javax.swing.tree.DefaultMutableTreeNode marker)

getSelection

public java.util.Set<javax.swing.tree.DefaultMutableTreeNode> getSelection()

setSelection

public void setSelection(java.util.Set<javax.swing.tree.DefaultMutableTreeNode> selection)

getScrollPosition

public java.lang.Integer[] getScrollPosition()

setScrollPosition

public void setScrollPosition(java.lang.Integer[] scrollPosition)

parseScrollPosition

public static java.lang.Integer[] parseScrollPosition(java.lang.String value)


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.