Package com._1c.g5.v8.dt.ui.util
Class OpenHelper
- java.lang.Object
-
- com._1c.g5.v8.dt.ui.util.OpenHelper
-
public class OpenHelper extends Object
Provides helpers for opening and activating editors.
-
-
Constructor Summary
Constructors Constructor Description OpenHelper()
CreatesOpenHelper
using the active page in the active workbench.OpenHelper(org.eclipse.ui.IWorkbenchPage workbenchPage)
CreatesOpenHelper
for providedIWorkbenchPage
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
activateEditor(org.eclipse.core.resources.IFile file)
Activates the editor for a givenIFile
, if any.boolean
activateEditor(org.eclipse.emf.common.util.URI uri, ISelection selection)
Activates the editor for a given uri.boolean
activateEditor(org.eclipse.emf.ecore.EObject model)
Activates the editor for a given model, if any.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.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.boolean
activateEditor(org.eclipse.ui.model.IWorkbenchAdapter workbenchAdapter)
Activates the editor for a givenIWorkbenchAdapter
, if any.static org.eclipse.ui.IEditorInput
createEObjectEditorInput(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.String
getEditorId(org.eclipse.ui.IEditorInput input)
Returns editor id byIEditorInput
given input.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.org.eclipse.ui.IEditorPart
openEditor(org.eclipse.core.resources.IFile file, ISelection selection)
Opens an editor for a givenIFile
.org.eclipse.ui.IEditorPart
openEditor(org.eclipse.emf.common.util.URI uri, ISelection selection)
Opens an editor for a given uri.org.eclipse.ui.IEditorPart
openEditor(org.eclipse.emf.ecore.EObject model)
Opens an editor for a given model.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.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.org.eclipse.ui.IEditorPart
openEditor(org.eclipse.ui.model.IWorkbenchAdapter workbenchAdapter)
Opens an editor for a givenIWorkbenchAdapter
.
-
-
-
Constructor Detail
-
OpenHelper
public OpenHelper()
CreatesOpenHelper
using the active page in the active workbench.
-
OpenHelper
public OpenHelper(org.eclipse.ui.IWorkbenchPage workbenchPage)
CreatesOpenHelper
for providedIWorkbenchPage
.- Parameters:
workbenchPage
- page to create helper for ornull
to use active page in the active workbench
-
-
Method Detail
-
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
null
if 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:
true
if activated,false
otherwise.
-
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:
true
if activated,false
otherwise.
-
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:
true
if activated,false
otherwise.
-
activateEditor
public boolean activateEditor(org.eclipse.emf.common.util.URI uri, ISelection selection)
Activates the editor for a given uri.- Parameters:
uri
- uri for open editor, can't benull
selection
- selection to set, can benull
- Returns:
true
if activated,false
otherwise.
-
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:
true
if activated,false
otherwise.
-
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:
true
if activated,false
otherwise.
-
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
null
if 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
null
if 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
null
if 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 benull
selection
- selection to set, can benull
- Returns:
- an open editor or
null
if 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
null
if 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
null
if 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 benull
feature
- 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
public String getEditorId(org.eclipse.ui.IEditorInput input)
Returns editor id byIEditorInput
given input.Can return
null
.- Parameters:
input
- actualIEditorInput
, cannot benull
- Returns:
- found editor id or
null
if editor wasn't found byIEditorInput
-
-