Class CDOTreeExpansionAgent

java.lang.Object
org.eclipse.emf.cdo.ui.CDOTreeExpansionAgent

public class CDOTreeExpansionAgent extends Object
Automatically preserves a tree viewer's item expansion states across multiple target changes of the underlying view.

When the target of the tree viewer's underlying view changes, for example during branch switches or time travels, viewer items can become unavailable and are, hence, removed from the tree viewer. These items can become available again during subsequent view target changes. This agent remembers the set of expanded tree items and reestablishes these expansion states when items become available again.

Internally this is achieved by registering a ITreeViewerListener to the tree viewer and by listening to CDOViewTargetChangedEvents of the underlying view. This agent disposes of itself when the tree viewer is disposed or when the view is closed.

Since:
4.4
Author:
Eike Stepper
  • Constructor Details

    • CDOTreeExpansionAgent

      public CDOTreeExpansionAgent(CDOView view, TreeViewer viewer)
  • Method Details

    • getView

      public final CDOView getView()
    • getViewer

      public final TreeViewer getViewer()
    • setExpandedStates

      public void setExpandedStates()
    • dispose

      public void dispose()