Package org.pentaho.di.ui.core.widget
Class TreeMemory
- java.lang.Object
-
- 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.eclipse.swt.events.TreeListeneraddTreeListener(org.eclipse.swt.widgets.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.voidclear()static TreeMemorygetInstance()booleanisExpanded(String treeName, String[] path)static voidsetExpandedFromMemory(org.eclipse.swt.widgets.Tree tree, String treeName)Expand of collapse all TreeItems in the complete tree based on the values stored in memory.voidstoreExpanded(String treeName, String[] path, boolean expanded)voidstoreExpanded(String treeName, org.eclipse.swt.widgets.TreeItem treeItem, boolean expanded)
-
-
-
Method Detail
-
getInstance
public static final TreeMemory getInstance()
-
storeExpanded
public void storeExpanded(String treeName, org.eclipse.swt.widgets.TreeItem treeItem, boolean expanded)
-
clear
public void clear()
-
addTreeListener
public static final org.eclipse.swt.events.TreeListener addTreeListener(org.eclipse.swt.widgets.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(org.eclipse.swt.widgets.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.
-
-