public abstract class HandlyOutlinePage extends CommonOutlinePage implements IContentAdapterProvider
CommonOutlinePage.OutlineTreeViewer
Constructor and Description |
---|
HandlyOutlinePage() |
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.
|
addInputChangeListener, addOutlineContribution, addSelectionChangedListener, createControl, createTreeViewer, dispose, editorInputChanged, getContentProvider, getControl, getEditor, getLabelProvider, getSelection, getTreeViewer, init, initDecorationContext, isAutoExpandable, refresh, registerGlobalActions, removeInputChangeListener, removeOutlineContribution, removeSelectionChangedListener, setFocus, setSelection, shouldUseHashlookup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLexicalSortPreference, getLinkWithEditorPreference
public void init(org.eclipse.ui.IEditorPart editor)
ICommonOutlinePage
init
in interface ICommonOutlinePage
init
in class CommonOutlinePage
editor
- the editor which created this outline page
(not null
)public IContentAdapter getContentAdapter()
Default implementation returns a NullContentAdapter
.
Subclasses may override.
getContentAdapter
in interface IContentAdapterProvider
IContentAdapter
(never null
)protected java.lang.Object computeInput()
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
.
computeInput
in class CommonOutlinePage
null
)protected abstract IInputElementProvider getInputElementProvider()
protected void addOutlineContributions()
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.
protected void addCollapseAllSupport()
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.
protected void addLinkWithEditorSupport()
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.
protected void addSortingSupport()
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.
protected abstract void addElementChangeListener(IElementChangeListener listener)
listener
- never null
protected abstract void removeElementChangeListener(IElementChangeListener listener)
listener
- never null
protected void elementChanged(IElementChangeEvent 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.
event
- never null
Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0