Class LinkHelper
- All Implemented Interfaces:
org.eclipse.ui.navigator.ILinkHelper
ILinkHelper for Handly-based models.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateEditor(org.eclipse.ui.IWorkbenchPage page, org.eclipse.jface.viewers.IStructuredSelection selection) org.eclipse.jface.viewers.IStructuredSelectionfindSelection(org.eclipse.ui.IEditorInput editorInput) protected EditorUtilityReturns the editor utility for this link helper.protected abstract IInputElementProviderReturns the input element provider for this link helper.protected abstract org.eclipse.ui.IViewPartReturns the navigator view this link helper is for.
-
Constructor Details
-
LinkHelper
public LinkHelper()
-
-
Method Details
-
findSelection
public org.eclipse.jface.viewers.IStructuredSelection findSelection(org.eclipse.ui.IEditorInput editorInput) This implementation uses the
input element providerto convert the given editor input to anIElement(the input element). It then attempts to obtain the current selection in thenavigator viewand returns it unchanged if the currently selected element could be adapted to anIElementand the adapter element is a descendant of the input element. Otherwise, it returns a structured selection containing a single object, the input element. If noIElementcould be provided for the editor input, this implementation attempts to adapt the editor input to anIFileand returns a structured selection consisting of that file. If all else fails,nullis returned.- Specified by:
findSelectionin interfaceorg.eclipse.ui.navigator.ILinkHelper
-
activateEditor
public void activateEditor(org.eclipse.ui.IWorkbenchPage page, org.eclipse.jface.viewers.IStructuredSelection selection) This implementation does nothing if the given selection is
nullor empty or contains two or more elements. Otherwise, it uses theeditor utilityto find the editor for the selected element and to reveal the element in the editor.- Specified by:
activateEditorin interfaceorg.eclipse.ui.navigator.ILinkHelper
-
getInputElementProvider
Returns the input element provider for this link helper.- Returns:
- the input element provider for this link helper
(never
null)
-
getEditorUtility
Returns the editor utility for this link helper.Default implementation returns
DefaultEditorUtility.INSTANCE. Subclasses may override.- Returns:
- the editor utility for this link helper (never
null)
-