Package docking.widgets.tree

# Class GTreeState

java.lang.Object
docking.widgets.tree.GTreeState

public class GTreeState extends Object
A class to remember the current state of the tree, for things like expanded paths, selected paths and the view location.

This class is used to restore state for uses so that updates to the tree do not cause the user to lose their spot.

Issues:

- If the number of expanded items is too large, then the tree will spend a large amount of time restoring, thus we limit the size of the expanded paths
- If we have to trim the number of items we remember, we need to do so intelligently so that the user experience seems natural (for example, when trimming what to keep, be sure to first keep what is visible to the user, versus expanded/selected items that are scrolled off the top of the view.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GTreeState(GTree tree)`
  `GTreeState(GTree tree, GTreeNode node)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<TreePath>`
  `getExpandedPaths()`
  `List<TreePath>`
  `getSelectedPaths()`
  `TreePath[]`
  `getViewPaths()`
  Returns the top few paths that are visible in the view.
  `boolean`
  `isEmpty()`
  `String`
  `toString()`
  `void`
  `updateStateForMovedNodes()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### GTreeState

    public GTreeState(GTree tree)

  - ### GTreeState

    public GTreeState(GTree tree, GTreeNode node)

- ## Method Details

  - ### getExpandedPaths

    public List<TreePath> getExpandedPaths()

  - ### getSelectedPaths

    public List<TreePath> getSelectedPaths()

  - ### getViewPaths

    public TreePath[] getViewPaths()
    Returns the top few paths that are visible in the view.
    Returns:
      the top few paths that are visible in the view.

  - ### updateStateForMovedNodes

    public void updateStateForMovedNodes()

  - ### isEmpty

    public boolean isEmpty()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`