org.eclipse.handly.ui.outline

## Class HandlyOutlinePage

- java.lang.Object
- - org.eclipse.ui.part.Page
  - - org.eclipse.handly.ui.outline.CommonOutlinePage
    - - org.eclipse.handly.ui.outline.HandlyOutlinePage

- All Implemented Interfaces:
    IContentAdapterProvider, ICommonOutlinePage, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.ui.part.IPage, org.eclipse.ui.part.IPageBookViewPage, org.eclipse.ui.views.contentoutline.IContentOutlinePage
  Direct Known Subclasses:
    HandlyXtextOutlinePage

      public abstract class HandlyOutlinePage
      extends CommonOutlinePage
      implements IContentAdapterProvider

  A partial implementation of Handly-based outline page pre-wired with contributions that are common to a typical outline. In particular, it provides support for linking with editor and lexical sorting functionality.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.handly.ui.outline.CommonOutlinePage

      `CommonOutlinePage.OutlineTreeViewer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HandlyOutlinePage()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addCollapseAllSupport()` Adds collapse-all support.
    `protected abstract void` | `addElementChangeListener(IElementChangeListener listener)` Registers the given element change listener with the underlying model.
    `protected void` | `addLinkWithEditorSupport()` Adds link-with-editor support.
    `protected void` | `addOutlineContributions()` Hook to add contributions to this outline page.
    `protected void` | `addSortingSupport()` Adds sorting support.
    `protected java.lang.Object` | `computeInput()` Computes the input element for the outline page's tree viewer.
    `protected void` | `elementChanged(IElementChangeEvent event)` Notifies that this outline page is affected in some way by the given element change event.
    `IContentAdapter` | `getContentAdapter()` Returns the content adapter that defines a mapping between elements of a Handly-based model and the outline's content.
    `protected abstract IInputElementProvider` | `getInputElementProvider()` Returns the input element provider for this outline page.
    `void` | `init(org.eclipse.ui.IEditorPart editor)` Initializes this outline page with its corresponding editor.
    `protected abstract void` | `removeElementChangeListener(IElementChangeListener listener)` Removes the given element change listener from the underlying model.

    - ### Methods inherited from class org.eclipse.handly.ui.outline.CommonOutlinePage

      `addInputChangeListener, addOutlineContribution, addSelectionChangedListener, createControl, createTreeViewer, dispose, editorInputChanged, getContentProvider, getControl, getEditor, getLabelProvider, getSelection, getTreeViewer, init, initDecorationContext, isAutoExpandable, refresh, registerGlobalActions, removeInputChangeListener, removeOutlineContribution, removeSelectionChangedListener, setFocus, setSelection, shouldUseHashlookup`

    - ### Methods inherited from class org.eclipse.ui.part.Page

      `getSite, makeContributions, setActionBars`

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

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

    - ### Methods inherited from interface org.eclipse.handly.ui.outline.ICommonOutlinePage

      `getLexicalSortPreference, getLinkWithEditorPreference`

    - ### Methods inherited from interface org.eclipse.ui.part.IPageBookViewPage

      `getSite`

    - ### Methods inherited from interface org.eclipse.ui.part.IPage

      `setActionBars`

- - ### Constructor Detail

    - #### HandlyOutlinePage

          public HandlyOutlinePage()

  - ### Method Detail

    - #### init

          public void init(org.eclipse.ui.IEditorPart editor)

      Description copied from interface: `ICommonOutlinePage`
      Initializes this outline page with its corresponding editor. This method should be called by the editor shortly after page construction. Specifically, it must be called before the page's control is created.
      Specified by:
        `init` in interface `ICommonOutlinePage`
      Overrides:
        `init` in class `CommonOutlinePage`
      Parameters:
        `editor` - the editor which created this outline page (not `null`)

    - #### getContentAdapter

          public IContentAdapter getContentAdapter()

      Returns the content adapter that defines a mapping between elements of a Handly-based model and the outline's content.

      Default implementation returns a `NullContentAdapter`. Subclasses may override.

      Specified by:
        `getContentAdapter` in interface `IContentAdapterProvider`
      Returns:
        an `IContentAdapter` (never `null`)

    - #### computeInput

          protected java.lang.Object computeInput()

      Computes the input element for the outline page's tree viewer.

      This implementation uses the `input element provider` to obtain an `IElement` corresponding to the editor input and returns an outline element corresponding to the `IElement`, as determined by the `content adapter`.

      Specified by:
        `computeInput` in class `CommonOutlinePage`
      Returns:
        the input element (may be `null`)

    - #### getInputElementProvider

          protected abstract IInputElementProvider getInputElementProvider()

      Returns the input element provider for this outline page.
      Returns:
        the input element provider for this outline page

    - #### addOutlineContributions

          protected void addOutlineContributions()

      Hook to add contributions to this outline page.

      Default implementation adds contributions that are common to a typical outline, including `collapse-all`, `link-with-editor`, and `sorting` support. Subclasses may extend this method.

    - #### addCollapseAllSupport

          protected void addCollapseAllSupport()

      Adds collapse-all support.

      Default implementation adds a `CollapseAllActionContribution`. Subclasses may override this method. In particular, if collapse-all support is not needed, this method may be overridden to do nothing.

    - #### addLinkWithEditorSupport

          protected void addLinkWithEditorSupport()

      Adds link-with-editor support.

      Default implementation adds a `LinkWithEditorActionContribution`, and a `LinkWithEditorContribution` with a `SourceElementLinkingHelper`. Subclasses may override this method. In particular, if link-with-editor support is not needed, this method may be overridden to do nothing.

    - #### addSortingSupport

          protected void addSortingSupport()

      Adds sorting support.

      Default implementation adds a `LexicalSortActionContribution` and a `LexicalSortContribution`. Subclasses may override this method. In particular, if sorting support is not needed, this method may be overridden to do nothing.

    - #### addElementChangeListener

          protected abstract void addElementChangeListener(IElementChangeListener listener)

      Registers the given element change listener with the underlying model.
      Parameters:
        `listener` - never `null`

    - #### removeElementChangeListener

          protected abstract void removeElementChangeListener(IElementChangeListener listener)

      Removes the given element change listener from the underlying model.
      Parameters:
        `listener` - never `null`

    - #### elementChanged

          protected void elementChanged(IElementChangeEvent event)

      Notifies that this outline page is affected in some way by the given element change event.

      Note: This method may be called in any thread. The event object (and the deltas within it) is valid only for the duration of the invocation of this method.

      Default implementation schedules a full `refresh` of this outline page's tree viewer in the UI thread.

      Parameters:
        `event` - never `null`

Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0