Class CommonOutlinePage

  • All Implemented Interfaces:
    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:
    HandlyOutlinePage

    public abstract class CommonOutlinePage
    extends org.eclipse.ui.part.Page
    implements ICommonOutlinePage
    An abstract base implementation of ICommonOutlinePage.
    • Constructor Detail

      • CommonOutlinePage

        public CommonOutlinePage()
    • Method Detail

      • getTreeViewer

        public final org.eclipse.jface.viewers.TreeViewer getTreeViewer()
        Description copied from interface: ICommonOutlinePage
        Returns the tree viewer of this outline page.
        Specified by:
        getTreeViewer in interface ICommonOutlinePage
        Returns:
        the tree viewer of this outline page, or null if it has not been created yet
      • 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
        Parameters:
        editor - the editor which created this outline page (not null)
      • getEditor

        public final org.eclipse.ui.IEditorPart getEditor()
        Description copied from interface: ICommonOutlinePage
        Returns the editor which created this outline page.
        Specified by:
        getEditor in interface ICommonOutlinePage
        Returns:
        the editor which created this outline page, or null if it has not been set yet
      • init

        public void init​(org.eclipse.ui.part.IPageSite pageSite)
        Specified by:
        init in interface org.eclipse.ui.part.IPageBookViewPage
        Overrides:
        init in class org.eclipse.ui.part.Page
      • getControl

        public final org.eclipse.swt.widgets.Control getControl()
        Specified by:
        getControl in interface org.eclipse.ui.part.IPage
        Specified by:
        getControl in class org.eclipse.ui.part.Page
      • createControl

        public void createControl​(org.eclipse.swt.widgets.Composite parent)
        Specified by:
        createControl in interface org.eclipse.ui.part.IPage
        Specified by:
        createControl in class org.eclipse.ui.part.Page
      • setFocus

        public void setFocus()
        Specified by:
        setFocus in interface org.eclipse.ui.part.IPage
        Specified by:
        setFocus in class org.eclipse.ui.part.Page
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.eclipse.ui.part.IPage
        Overrides:
        dispose in class org.eclipse.ui.part.Page
      • getSelection

        public org.eclipse.jface.viewers.ISelection getSelection()
        Specified by:
        getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
      • setSelection

        public void setSelection​(org.eclipse.jface.viewers.ISelection selection)
        Specified by:
        setSelection in interface org.eclipse.jface.viewers.ISelectionProvider
      • addSelectionChangedListener

        public void addSelectionChangedListener​(org.eclipse.jface.viewers.ISelectionChangedListener listener)
        Specified by:
        addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
      • removeSelectionChangedListener

        public void removeSelectionChangedListener​(org.eclipse.jface.viewers.ISelectionChangedListener listener)
        Specified by:
        removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
      • refresh

        public void refresh()
        Completely refreshes this outline page's tree viewer, preserving expanded tree paths where possible.
      • shouldUseHashlookup

        protected boolean shouldUseHashlookup()
        Returns whether the outline page's tree viewer should use hash lookup. This method is called once, when the page's control is created.

        Default implementation returns true. Subclasses may override.

        See Also:
        StructuredViewer.setUseHashlookup(boolean)
      • getContentProvider

        protected abstract org.eclipse.jface.viewers.ITreeContentProvider getContentProvider()
        Returns the content provider that is to be used by the outline page's tree viewer. This method is called once, when the page's control is created.
        Returns:
        the content provider (not null)
      • getLabelProvider

        protected abstract org.eclipse.jface.viewers.IBaseLabelProvider getLabelProvider()
        Returns the label provider that is to be used by the outline page's tree viewer. This method is called once, when the page's control is created.
        Returns:
        the label provider (not null)
      • computeInput

        protected abstract java.lang.Object computeInput()
        Computes the input element for the outline page's tree viewer.
        Returns:
        the input element (may be null)
      • createTreeViewer

        protected CommonOutlinePage.OutlineTreeViewer createTreeViewer​(org.eclipse.swt.widgets.Composite parent)
        Creates a tree viewer for this outline page. The viewer has no input, no content provider, a default label provider, no sorter, and no filters. This method is called once, when the page's control is created.
        Parameters:
        parent - the parent composite (never null)
        Returns:
        the created tree viewer (not null)
      • editorInputChanged

        protected void editorInputChanged()
        Notifies that the outline page's editor input has changed.

        Default implementation computes and sets the new input for the outline page's tree viewer. Subclasses may extend.

      • isAutoExpandable

        protected boolean isAutoExpandable​(org.eclipse.swt.widgets.TreeItem item)
        Returns whether the given tree item is auto-expandable. This method should be consulted by the tree viewer's expandXXX methods. If it returns false, the item is to be collapsed, rather than expanded.

        Default implementation returns true for the root item and false for all other items. Subclasses may override.

        Parameters:
        item - the tree item (never null)
        Returns:
        true if the given item is auto-expandable; false otherwise
      • registerGlobalActions

        protected void registerGlobalActions()
        Hook to register global action handlers. Subclasses may extend or override.

        If the editor which created this outline page is a text editor, default implementation registers global action handlers for the following text editor actions: UNDO, REDO, NEXT, PREVIOUS.

      • initDecorationContext

        protected void initDecorationContext​(org.eclipse.jface.viewers.DecorationContext context)
        Hook to initialize decoration context. Subclasses may extend.

        If this outline page implements IContentAdapterProvider, default implementation registers this outline page in the given context under the name IContentAdapterProvider.class.getName().

        Parameters:
        context - the decoration context (never null)