Package com._1c.g5.v8.dt.ui.util
Class OpenHelper
java.lang.Object
com._1c.g5.v8.dt.ui.util.OpenHelper
Provides helpers for opening and activating editors.
-
Constructor Summary
ConstructorsConstructorDescriptionCreatesOpenHelperusing the active page in the active workbench.OpenHelper(org.eclipse.ui.IWorkbenchPage workbenchPage) CreatesOpenHelperfor providedIWorkbenchPage. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactivateEditor(org.eclipse.core.resources.IFile file) Activates the editor for a givenIFile, if any.booleanactivateEditor(org.eclipse.emf.common.util.URI uri, ISelection selection) Activates the editor for a given uri.booleanactivateEditor(org.eclipse.emf.ecore.EObject model) Activates the editor for a given model, if any.booleanactivateEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature) Activates the editor for a given model and feature, if any.booleanactivateEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection) Activates the editor for a given model, feature and selection, if any.booleanactivateEditor(org.eclipse.ui.model.IWorkbenchAdapter workbenchAdapter) Activates the editor for a givenIWorkbenchAdapter, if any.static org.eclipse.ui.IEditorInputcreateEObjectEditorInput(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature) Deprecated.getEditorId(org.eclipse.ui.IEditorInput input) Returns editor id byIEditorInputgiven input.org.eclipse.ui.IEditorInputgetEditorInput(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection) Returns appropriate (for DT editors) editor input for given model, feature and selection.org.eclipse.ui.IEditorPartopenEditor(org.eclipse.core.resources.IFile file, ISelection selection) Opens an editor for a givenIFile.org.eclipse.ui.IEditorPartopenEditor(org.eclipse.emf.common.util.URI uri, ISelection selection) Opens an editor for a given uri.org.eclipse.ui.IEditorPartopenEditor(org.eclipse.emf.ecore.EObject model) Opens an editor for a given model.org.eclipse.ui.IEditorPartopenEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature) Opens an editor for a given model and feature.org.eclipse.ui.IEditorPartopenEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection) Opens an editor for a given model, feature and selection.org.eclipse.ui.IEditorPartopenEditor(org.eclipse.ui.model.IWorkbenchAdapter workbenchAdapter) Opens an editor for a givenIWorkbenchAdapter.
-
Constructor Details
-
OpenHelper
public OpenHelper()CreatesOpenHelperusing the active page in the active workbench. -
OpenHelper
public OpenHelper(org.eclipse.ui.IWorkbenchPage workbenchPage) CreatesOpenHelperfor providedIWorkbenchPage.- Parameters:
workbenchPage- page to create helper for ornullto use active page in the active workbench
-
-
Method Details
-
createEObjectEditorInput
@Deprecated public static org.eclipse.ui.IEditorInput createEObjectEditorInput(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature) Deprecated.Creates editor input for given object and its feature.- Parameters:
object- object to create editor input for.feature- feature to create editor input for.- Returns:
- create editor input or
nullif it was not created.
-
activateEditor
public boolean activateEditor(org.eclipse.emf.ecore.EObject model) Activates the editor for a given model, if any.- Parameters:
model- model to activate editor for.- Returns:
trueif activated,falseotherwise.
-
activateEditor
public boolean activateEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature) Activates the editor for a given model and feature, if any.- Parameters:
model- model to activate editor for.feature- feature to activate page/controls for.- Returns:
trueif activated,falseotherwise.
-
activateEditor
public boolean activateEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection) Activates the editor for a given model, feature and selection, if any.- Parameters:
model- model to activate editor for.feature- feature to activate page/controls for.selection- selection to set.- Returns:
trueif activated,falseotherwise.
-
activateEditor
Activates the editor for a given uri.- Parameters:
uri- uri for open editor, can't benullselection- selection to set, can benull- Returns:
trueif activated,falseotherwise.
-
activateEditor
public boolean activateEditor(org.eclipse.ui.model.IWorkbenchAdapter workbenchAdapter) Activates the editor for a givenIWorkbenchAdapter, if any.- Parameters:
workbenchAdapter- workbench adapter to activate editor for.- Returns:
trueif activated,falseotherwise.
-
activateEditor
public boolean activateEditor(org.eclipse.core.resources.IFile file) Activates the editor for a givenIFile, if any.- Parameters:
file- file to activate editor for.- Returns:
trueif activated,falseotherwise.
-
openEditor
public org.eclipse.ui.IEditorPart openEditor(org.eclipse.emf.ecore.EObject model) Opens an editor for a given model.- Parameters:
model- model to open editor for.- Returns:
- an open editor or
nullif editor wasn't opened
-
openEditor
public org.eclipse.ui.IEditorPart openEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature) Opens an editor for a given model and feature.- Parameters:
model- model to open editor for.feature- feature to activate page/controls for.- Returns:
- an open editor or
nullif editor wasn't opened
-
openEditor
public org.eclipse.ui.IEditorPart openEditor(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection) Opens an editor for a given model, feature and selection.- Parameters:
model- model to open editor for.feature- feature to activate page/controls for.selection- selection to set.- Returns:
- an open editor or
nullif editor wasn't opened
-
openEditor
public org.eclipse.ui.IEditorPart openEditor(org.eclipse.emf.common.util.URI uri, ISelection selection) Opens an editor for a given uri.- Parameters:
uri- uri for open editor, can't benullselection- selection to set, can benull- Returns:
- an open editor or
nullif editor wasn't opened
-
openEditor
public org.eclipse.ui.IEditorPart openEditor(org.eclipse.ui.model.IWorkbenchAdapter workbenchAdapter) Opens an editor for a givenIWorkbenchAdapter.- Parameters:
workbenchAdapter- workbenchAdapter returned from the navigator content provider.- Returns:
- an open editor or
nullif editor wasn't opened
-
openEditor
public org.eclipse.ui.IEditorPart openEditor(org.eclipse.core.resources.IFile file, ISelection selection) Opens an editor for a givenIFile.- Parameters:
file- file to open and editor for.- Returns:
- an open editor or
nullif editor wasn't opened
-
getEditorInput
public org.eclipse.ui.IEditorInput getEditorInput(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection) Returns appropriate (for DT editors) editor input for given model, feature and selection.- Parameters:
model- model to activate editor for, cannot benullfeature- feature to activate page/controls for, can benull, than will not be used for input instantiationselection- selection to set, can benull, than will not be used for input instantiation- Returns:
- editor input, never
null
-
getEditorId
Returns editor id byIEditorInputgiven input.Can return
null.- Parameters:
input- actualIEditorInput, cannot benull- Returns:
- found editor id or
nullif editor wasn't found byIEditorInput
-