public final class UiUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NO_DIAGRAM_FILE |
static int |
SILENT_FAILURE |
static int |
SUCCESS |
static int |
SYNTAX_ERROR |
Constructor and Description |
---|
UiUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
executeCommand(Element obj,
org.eclipse.emf.common.command.Command command)
Execute the given command using the editing domain for the given model
object.
|
static org.eclipse.emf.edit.provider.ComposedAdapterFactory |
getAdapterFactory()
Returns an adapter factory that can be used to create content providers, label
providers, editing domains, etc.
|
static org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider |
getAObjectContentProvider()
Returns a content provider similar to the one used by the aadl object editor.
|
static org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider |
getAObjectLabelProvider()
Returns a label provider similar to the one used by the aadl object editor.
|
static int |
gotoAaxldiModel(org.eclipse.ui.IWorkbenchPage page,
Element target)
goto aaxldi model in editor associated with diagram files.
|
static int |
gotoAaxldiModel(org.eclipse.ui.IWorkbenchPage page,
Element root,
int linenumber)
goto aaxldi model in editor associated with diagram files.
|
static void |
gotoAaxlModel(org.eclipse.ui.IWorkbenchPage page,
Element target)
goto aaxl model through the editor associated with aaxl files.
|
static void |
gotoAaxlModel(org.eclipse.ui.IWorkbenchPage page,
Element root,
int linenumber)
goto aaxl model through the editor associated with aaxl files.
|
static void |
gotoSourceText(org.eclipse.ui.IWorkbenchPage page,
Element obj)
go to the source text location corresponding to the location of the specified AObject
The method will ensure that the source text is up to date with the model file
|
static void |
openEditorAndExecute(Element obj,
org.eclipse.emf.common.command.Command command)
Open an object editor for the given model object and executes the
given command in the associated editing domain.
|
static org.eclipse.emf.edit.domain.EditingDomain |
openEditorFor(Element obj)
Open an object editor for the given model object.
|
public static final int SUCCESS
public static final int SILENT_FAILURE
public static final int NO_DIAGRAM_FILE
public static final int SYNTAX_ERROR
public static void gotoAaxlModel(org.eclipse.ui.IWorkbenchPage page, Element root, int linenumber)
page
- Workbench pageroot
- Root AObject of model to go tolinenumber
- line number in text whose locationin the object should be the
targetpublic static void gotoAaxlModel(org.eclipse.ui.IWorkbenchPage page, Element target)
page
- Workbench pagetarget
- AObject that is the target objectpublic static int gotoAaxldiModel(org.eclipse.ui.IWorkbenchPage page, Element root, int linenumber)
page
- Workbench pageroot
- Root AObject of model to go tolinenumber
- line number in text whose locationin the object should be the targetpublic static int gotoAaxldiModel(org.eclipse.ui.IWorkbenchPage page, Element target)
page
- Workbench pagetarget
- AObject that is the target objectpublic static void gotoSourceText(org.eclipse.ui.IWorkbenchPage page, Element obj)
public static final org.eclipse.emf.edit.domain.EditingDomain openEditorFor(Element obj)
obj
- The object to open the editor for. The editor is opened on the
resource that contains the object.null
if the editor was not able to be opened.public static final void executeCommand(Element obj, org.eclipse.emf.common.command.Command command)
editingDomain.getCommandStack().execute(command)
directly
because it makes sure that the appropriate resource is locked in the
eclipse workspace. The command is not executed if the Eclipse IResource
for the given object cannot be found, or if the editing domain is not
found. In either of these cases a error message is written to the Eclipse
log.obj
- The AADL model object from which the editing domain is
derived.command
- The editor command to execute.public static final void openEditorAndExecute(Element obj, org.eclipse.emf.common.command.Command command)
obj
- The object to open the editor for. The editor is opened on the
resource that contains the object.command
- The editor command to execute.public static final org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider getAObjectLabelProvider()
org.eclipse.jface.viewers.Viewer
to display the same text labels and icons as the object editor.public static final org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider getAObjectContentProvider()
org.eclipse.jface.viewers.TreeViewer
to display the same contents as the object editor.public static final org.eclipse.emf.edit.provider.ComposedAdapterFactory getAdapterFactory()
ResourceItemProviderAdapterFactory
, a ComponentItemProviderAdapterFactory
,
a FeatureItemProviderAdapterFactory
, a CoreItemProviderAdapterFactory
,
an InstanceItemProviderAdapterFactory
, a PropertyItemProviderAdapterFactory
,
a FlowItemProviderAdapterFactory
, a ConnectionItemProviderAdapterFactory
,
and a ReflectiveItemProviderAdapterFactory
.