Class HandlyOutlinePopup
- All Implemented Interfaces:
IContentAdapterProvider,org.eclipse.jface.window.IShellProvider
- Direct Known Subclasses:
HandlyXtextOutlinePopup
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.handly.ui.quickoutline.FilteringOutlinePopup
FilteringOutlinePopup.ElementMatcher, FilteringOutlinePopup.FilteringOutlineTreeViewer, FilteringOutlinePopup.StringMatcherNested classes/interfaces inherited from class org.eclipse.handly.ui.quickoutline.OutlinePopup
OutlinePopup.OutlineTreeViewerNested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler -
Field Summary
Fields inherited from class org.eclipse.jface.dialogs.PopupDialog
HOVER_SHELLSTYLE, INFOPOPUP_SHELLSTYLE, INFOPOPUPRESIZE_SHELLSTYLE, POPUP_HORIZONTALSPACING, POPUP_IMG_MENU, POPUP_IMG_MENU_DISABLED, POPUP_MARGINHEIGHT, POPUP_MARGINWIDTH, POPUP_VERTICALSPACINGFields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectComputes the input element for the outline popup's tree viewer.Returns the content adapter that defines a mapping between elements of a Handly-based model and the outline's content.protected ObjectgetCorrespondingElement(org.eclipse.jface.viewers.ISelection hostSelection) Returns the outline element corresponding to the given host selection.protected abstract IInputElementProviderReturns the input element provider for this outline popup.protected booleanReturns whether the given element is contained in the host of this outline popup.protected booleanrevealInHost(Object outlineElement) Attempts to reveal the given outline element in the outline popup's host.Methods inherited from class org.eclipse.handly.ui.quickoutline.FilteringOutlinePopup
createFilterText, createPatternMatcher, createTitleControl, createTitleMenuArea, createTreeViewer, getFilterText, getFocalElement, getFocusControl, getPatternMatcher, init, patternMatcherUpdated, selectFirstMatch, setTabOrder, updatePatternMatcherMethods inherited from class org.eclipse.handly.ui.quickoutline.OutlinePopup
changeOutlineMode, computeInitialSelection, createDialogArea, getContentProvider, getDefaultLocation, getDialogSettings, getHost, getInitialSelection, getInvokingKeyListener, getInvokingKeyStroke, getLabelProvider, getSelectedElement, getTreeViewer, gotoSelectedElement, initDecorationContext, isAutoExpandable, shouldUseHashlookup, updateInfoTextMethods inherited from class org.eclipse.jface.dialogs.PopupDialog
adjustBounds, applyBackgroundColor, applyForegroundColor, close, configureShell, createContents, createInfoTextArea, fillDialogMenu, getBackground, getBackgroundColorExclusions, getDefaultSize, getForeground, getForegroundColorExclusions, getInitialLocation, getInitialSize, getPersistLocation, getPersistSize, hasInfoArea, hasTitleArea, open, saveDialogBounds, setInfoText, setTitleText, showDialogMenuMethods inherited from class org.eclipse.jface.window.Window
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
-
Constructor Details
-
HandlyOutlinePopup
public HandlyOutlinePopup()
-
-
Method Details
-
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:
getContentAdapterin interfaceIContentAdapterProvider- Returns:
- an
IContentAdapter(nevernull)
-
computeInput
Computes the input element for the outline popup's tree viewer. This method is called once, when the popup's control is created.This implementation uses the
input element providerto obtain anIElementcorresponding to the editor input for the outline popup's host and returns an outline element corresponding to theIElement, as determined by thecontent adapter.- Specified by:
computeInputin classOutlinePopup- Returns:
- the input element (may be
null)
-
getCorrespondingElement
Returns the outline element corresponding to the given host selection.If the given selection is a text selection, this implementation finds the smallest
ISourceElementthat includes the offset of the text selection and returns an outline element corresponding to the found source element, as determined by thecontent adapter.- Specified by:
getCorrespondingElementin classOutlinePopup- Parameters:
hostSelection- the host selection (nevernull, never empty)- Returns:
- the outline element corresponding to the host selection,
or
nullif there is no such element
-
revealInHost
Attempts to reveal the given outline element in the outline popup's host.This implementation attempts to adapt the given outline element to an
IElementthrough thecontent adapter. If the adapter element is anISourceElementand is contained in the host as computed byisInHost(IElement), the identifying range of the source element is selected in the outline popup's host.- Specified by:
revealInHostin classOutlinePopup- Parameters:
outlineElement- the outline element (nevernull)- Returns:
trueif the element was successfully revealed;falseotherwise
-
isInHost
Returns whether the given element is contained in the host of this outline popup.This implementation uses the
input element providerto obtain anIElementcorresponding to the editor input for the host. It then checks whether theIElementcontainsthe given element and returns the result.- Parameters:
element- may benull- Returns:
trueif the element is contained in the host;falseotherwise
-
getInputElementProvider
Returns the input element provider for this outline popup.- Returns:
- the input element provider for this outline popup
-