Class CDOTreeExpansionAgent

  • public class CDOTreeExpansionAgent
    extends java.lang.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.

    Eike Stepper
    • Constructor Detail

      • CDOTreeExpansionAgent

        public CDOTreeExpansionAgent​(CDOView view,
                                     TreeViewer viewer)
    • Method Detail

      • getView

        public final CDOView getView()
      • setExpandedStates

        public void setExpandedStates()
      • dispose

        public void dispose()