Package org.pentaho.di.ui.core.widget
Class TreeMemory
java.lang.Object
org.pentaho.di.ui.core.widget.TreeMemory
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
Modifier and TypeMethodDescriptionstatic 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.void
clear()
static final TreeMemory
boolean
isExpanded
(String treeName, String[] path) 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.void
storeExpanded
(String treeName, String[] path, boolean expanded) void
storeExpanded
(String treeName, org.eclipse.swt.widgets.TreeItem treeItem, boolean expanded)
-
Method Details
-
getInstance
-
storeExpanded
public void storeExpanded(String treeName, org.eclipse.swt.widgets.TreeItem treeItem, boolean expanded) -
storeExpanded
-
isExpanded
-
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
Expand of collapse all TreeItems in the complete tree based on the values stored in memory.- Parameters:
tree
- The tree to format.
-