public abstract class HandlyOutlinePopup extends FilteringOutlinePopup implements IContentAdapterProvider
FilteringOutlinePopup.ElementMatcher, FilteringOutlinePopup.FilteringOutlineTreeViewer, FilteringOutlinePopup.StringMatcher
OutlinePopup.OutlineTreeViewer
Constructor and Description |
---|
HandlyOutlinePopup() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
computeInput()
Computes the input element for the outline popup's tree viewer.
|
IContentAdapter |
getContentAdapter()
Returns the content adapter that defines a mapping between elements
of a Handly-based model and the outline's content.
|
protected java.lang.Object |
getCorrespondingElement(org.eclipse.jface.viewers.ISelection hostSelection)
Returns the outline element corresponding to the given host selection.
|
protected abstract IInputElementProvider |
getInputElementProvider()
Returns the input element provider for this outline popup.
|
protected boolean |
isInHost(IElement element)
Returns whether the given element is contained in the host
of this outline popup.
|
protected boolean |
revealInHost(java.lang.Object outlineElement)
Attempts to reveal the given outline element in the outline popup's host.
|
createFilterText, createPatternMatcher, createTitleControl, createTitleMenuArea, createTreeViewer, getFilterText, getFocalElement, getFocusControl, getPatternMatcher, init, patternMatcherUpdated, selectFirstMatch, setTabOrder, updatePatternMatcher
changeOutlineMode, computeInitialSelection, createDialogArea, getContentProvider, getDefaultLocation, getDialogSettings, getHost, getInitialSelection, getInvokingKeyListener, getInvokingKeyStroke, getLabelProvider, getSelectedElement, getTreeViewer, gotoSelectedElement, initDecorationContext, isAutoExpandable, shouldUseHashlookup, updateInfoText
adjustBounds, applyBackgroundColor, applyForegroundColor, close, configureShell, createContents, createInfoTextArea, fillDialogMenu, getBackground, getBackgroundColorExclusions, getDefaultSize, getForeground, getForegroundColorExclusions, getInitialLocation, getInitialSize, getPersistBounds, getPersistLocation, getPersistSize, hasInfoArea, hasTitleArea, open, saveDialogBounds, setInfoText, setTitleText, showDialogMenu
canHandleShellCloseEvent, constrainShellSize, create, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, initializeBounds, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
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 for the outline popup's host and returns an outline
element corresponding to the IElement
, as determined by
the content adapter
.
computeInput
in class OutlinePopup
null
)protected java.lang.Object getCorrespondingElement(org.eclipse.jface.viewers.ISelection hostSelection)
If the given selection is a text selection, this implementation finds
the smallest ISourceElement
that includes the offset of the
text selection and returns an outline element corresponding to the
found source element, as determined by the content adapter
.
getCorrespondingElement
in class OutlinePopup
hostSelection
- the host selection (never null
, never empty)null
if there is no such elementprotected boolean revealInHost(java.lang.Object outlineElement)
This implementation attempts to adapt the given outline element to an
IElement
through the content adapter
.
If the adapter element is an ISourceElement
and is contained in
the host as computed by isInHost(IElement)
, the identifying range
of the source element is selected in the outline popup's host.
revealInHost
in class OutlinePopup
outlineElement
- the outline element (never null
)true
if the element was successfully revealed;
false
otherwiseprotected boolean isInHost(IElement element)
This implementation uses the input element provider
to obtain an IElement
corresponding to
the editor input for the host. It then checks whether the IElement
contains
the given
element and returns the result.
element
- may be null
true
if the element is contained in the host;
false
otherwiseprotected abstract IInputElementProvider getInputElementProvider()
Copyright (c) 2014, 2018 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0