public class EditorOpener
extends java.lang.Object
Constructor and Description |
---|
EditorOpener(org.eclipse.ui.IWorkbenchPage page,
EditorUtility editorUtility)
Constructs an editor opener with the given workbench page and the given
editor utility.
|
Modifier and Type | Method and Description |
---|---|
EditorUtility |
getEditorUtility()
Returns the editor utility for this opener.
|
org.eclipse.ui.IWorkbenchPage |
getWorkbenchPage()
Returns the workbench page to open the editor in.
|
org.eclipse.ui.IEditorPart |
open(java.lang.Object element,
boolean activate,
boolean reveal)
Opens the given element in an appropriate editor.
|
protected boolean |
shouldReuseEditor()
Returns whether editors should be reused.
|
public EditorOpener(org.eclipse.ui.IWorkbenchPage page, EditorUtility editorUtility)
page
- the workbench page to open the editor in
(not null
)editorUtility
- the editor utility for this opener
(not null
)public final org.eclipse.ui.IWorkbenchPage getWorkbenchPage()
null
)public final EditorUtility getEditorUtility()
null
)public org.eclipse.ui.IEditorPart open(java.lang.Object element, boolean activate, boolean reveal) throws org.eclipse.ui.PartInitException
Default implementation attempts to find
a matching open editor or, failing that,
opens a new editor on the corresponding
editor input; it then reveals
the element in the editor, if requested.
If editors should be reused
, tries to
reuse an existing editor rather than open a new one.
element
- the element to open (not null
)activate
- whether to activate the editorreveal
- whether to reveal the element in the editornull
if an external editor
was openedorg.eclipse.ui.PartInitException
- if the editor could not be created
or initializedprotected boolean shouldReuseEditor()
Default implementation returns false
.
true
if editors should be reused,
and false
otherwiseopen(Object, boolean, boolean)
Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0