org.pentaho.di.ui.core.widget
Class TreeMemory

java.lang.Object
  extended by org.pentaho.di.ui.core.widget.TreeMemory

public class TreeMemory
extends Object

This singleton class remembers whether or not a TreeItem is expanded. When the tree is refreshed, it remembers, making for a better user experience.

Author:
Matt

Method Summary
static TreeListener addTreeListener(Tree tree, String treeName)
          This method creates, adds and returns a tree listener that will keep track of the expanded/collapsed state of the TreeItems.
 void clear()
           
static TreeMemory getInstance()
           
 boolean isExpanded(String treeName, String[] path)
           
static void setExpandedFromMemory(Tree tree, String treeName)
          Expand of collapse all TreeItems in the complete tree based on the values stored in memory.
 void storeExpanded(String treeName, TreeItem treeItem, boolean expanded)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final TreeMemory getInstance()

storeExpanded

public void storeExpanded(String treeName,
                          TreeItem treeItem,
                          boolean expanded)

isExpanded

public boolean isExpanded(String treeName,
                          String[] path)

clear

public void clear()

addTreeListener

public static final TreeListener addTreeListener(Tree tree,
                                                 String treeName)
This method creates, adds and returns a tree listener that will keep track of the expanded/collapsed state of the TreeItems. This state will then be stored in the TreeMemory singleton.

Parameters:
tree - The tree to add the listener to
Returns:
The created/added TreeListener

setExpandedFromMemory

public static void setExpandedFromMemory(Tree tree,
                                         String treeName)
Expand of collapse all TreeItems in the complete tree based on the values stored in memory.

Parameters:
tree - The tree to format.