@Deprecated public abstract class AbstractOpenHandler extends Object implements IOpenHandler
Constructor and Description |
---|
AbstractOpenHandler()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static IEditorDescriptor |
findEditorDescriptor(TextGridObject object)
Deprecated.
Tries to find the default editor descriptor for the given
TextGridObject without considering the Open contribution. |
OpenHandlerContribution |
getContribution()
Deprecated.
|
abstract void |
open(TextGridObject textGridObject)
Deprecated.
|
IEditorPart |
openEditor(TextGridObject object)
Deprecated.
Try to open the object in an editor.
|
IEditorPart |
openEditor(TextGridObject object,
IWorkbenchPage activePage)
Deprecated.
Try to open the object in an editor on the given workbench page.
|
void |
setContribution(OpenHandlerContribution contribution)
Deprecated.
Inform the open handler about the contribution it is used for.
|
IWorkbenchPage |
showPerspective()
Deprecated.
If the contribution defines a perspective, show the perspective
(otherwise do nothing).
|
IWorkbenchPage |
showPerspective(IWorkbenchWindow window)
Deprecated.
If the contribution defines a perspective, show the perspective
(otherwise do nothing).
|
public void setContribution(OpenHandlerContribution contribution)
IOpenHandler
AbstractOpenHandler
does so)
and extract fields like the target perspective from it.
The framework guarantees that this method is called with a valid contribution before
any calls to the IOpenHandler.open(TextGridObject)
method.
setContribution
in interface IOpenHandler
contribution
- The contribution for which this handler has been instantiated.public OpenHandlerContribution getContribution()
public IWorkbenchPage showPerspective(IWorkbenchWindow window) throws WorkbenchException
window
- The workbench window that should show the perspective. Use
showPerspective()
for the current window.WorkbenchException
- if the perspective could not be opened.IWorkbench.showPerspective(String, IWorkbenchWindow)
public IWorkbenchPage showPerspective() throws WorkbenchException
WorkbenchException
- if the perspective could not be opened.IWorkbench.showPerspective(String, IWorkbenchWindow)
public IEditorPart openEditor(TextGridObject object, IWorkbenchPage activePage) throws CoreException
If the contribution specifies an editor, this editor is used, otherwise the implementation tries to find the default editor using Eclipse's mechanisms.
object
- The object to openactivePage
- The workbench page in which this object can be opened.NoEditorFoundException
- if no editor for this object could be determined.PartInitException
- if an editor was found, but somehow failed to open.CoreException
- if determining the content type fails (probably due to read
errors from the repository).openEditor(TextGridObject)
,
TGContentType.getEclipseContentType()
public static IEditorDescriptor findEditorDescriptor(TextGridObject object) throws CoreException
TextGridObject
without considering the Open contribution.object
- The TextGridObject for which we try to find an exception.CoreException
- if something goes wrong while trying to determine the object's content type.public IEditorPart openEditor(TextGridObject object) throws CoreException
If the contribution specifies an editor, this editor is used, otherwise the implementation tries to find the default editor using Eclipse's mechanisms.
object
- The object to openNoEditorFoundException
- if no editor for this object could be determined.PartInitException
- if an editor was found, but somehow failed to open.CoreException
- if determining the content type fails (probably due to read
errors from the repository).public abstract void open(TextGridObject textGridObject) throws CoreException
open
in interface IOpenHandler
CoreException