Class 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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.handly.ui.outline.CommonOutlinePage
CommonOutlinePage.OutlineTreeViewer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds collapse-all support.protected abstract void
Registers the given element change listener with the underlying model.protected void
Adds link-with-editor support.protected void
Hook to add contributions to this outline page.protected void
Adds sorting support.protected Object
Computes the input element for the outline page's tree viewer.protected void
Notifies that this outline page is affected in some way by the given element change event.Returns the content adapter that defines a mapping between elements of a Handly-based model and the outline's content.protected abstract IInputElementProvider
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
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.IPage
setActionBars
Methods inherited from interface org.eclipse.ui.part.IPageBookViewPage
getSite
-
Constructor Details
-
HandlyOutlinePage
public HandlyOutlinePage()
-
-
Method Details
-
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 interfaceICommonOutlinePage
- Overrides:
init
in classCommonOutlinePage
- Parameters:
editor
- the editor which created this outline page (notnull
)
-
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 interfaceIContentAdapterProvider
- Returns:
- an
IContentAdapter
(nevernull
)
-
computeInput
Computes the input element for the outline page's tree viewer.This implementation uses the
input element provider
to obtain anIElement
corresponding to the editor input and returns an outline element corresponding to theIElement
, as determined by thecontent adapter
.- Specified by:
computeInput
in classCommonOutlinePage
- Returns:
- the input element (may be
null
)
-
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
, andsorting
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 aLinkWithEditorContribution
with aSourceElementLinkingHelper
. 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 aLexicalSortContribution
. Subclasses may override this method. In particular, if sorting support is not needed, this method may be overridden to do nothing. -
addElementChangeListener
Registers the given element change listener with the underlying model.- Parameters:
listener
- nevernull
-
removeElementChangeListener
Removes the given element change listener from the underlying model.- Parameters:
listener
- nevernull
-
elementChanged
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
- nevernull
-