public class EditorUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static EditorUtility |
DEFAULT
A default instance of the editor utility.
|
Constructor and Description |
---|
EditorUtility() |
Modifier and Type | Method and Description |
---|---|
org.eclipse.ui.IEditorReference |
findEditor(org.eclipse.ui.IWorkbenchPage page,
java.lang.Object element)
Returns the editor reference that matches the given element,
or
null if there is no opened editor with that element. |
protected IBuffer |
getBuffer(ISourceElement element)
Returns the buffer for the given source element, or
null
if its buffer cannot be accessed. |
org.eclipse.ui.IEditorInput |
getEditorInput(java.lang.Object element)
Returns the editor input for the given element,
or
null if none. |
void |
revealElement(org.eclipse.ui.IEditorPart editor,
java.lang.Object element)
Reveals an element in an editor on a best effort basis.
|
public static final EditorUtility DEFAULT
public org.eclipse.ui.IEditorInput getEditorInput(java.lang.Object element)
null
if none.element
- the element (may be null
)null
if nonepublic org.eclipse.ui.IEditorReference findEditor(org.eclipse.ui.IWorkbenchPage page, java.lang.Object element)
null
if there is no opened editor with that element.
If several matching editors are found, returns the reference for
the 'most specific' editor, which would typically be the most recently
used editor with that element.page
- the workbench page containing the editor
(not null
)element
- the element (not null
)null
if there is no opened editor with the given elementpublic void revealElement(org.eclipse.ui.IEditorPart editor, java.lang.Object element)
editor
- the editor (not null
)element
- the element (not null
)protected IBuffer getBuffer(ISourceElement element)
null
if its buffer cannot be accessed.element
- the source element (not null
)null
if none