public class EditorUtils
extends java.lang.Object
| Constructor and Description |
|---|
EditorUtils()
Creates an instance (public constructor required by OSGI-DS).
|
| Modifier and Type | Method and Description |
|---|---|
static IEmbeddedEditor |
embedIvmlConstraintEditor(ModelInfo<Project> info,
org.eclipse.swt.widgets.Composite parent,
ConstraintSplitWriter.IConstraintFilter filter,
boolean trimParenthesis)
Embeds an IVML editor for the constraint indicated by
filter in given resource into the given
parent. |
static IEmbeddedEditor |
embedIvmlEditor(java.net.URI file,
org.eclipse.swt.widgets.Composite parent)
Embeds an IVML editor for the given resource into the given
parent. |
private static com.google.inject.Injector |
getInjector() |
static ConstraintSyntaxTree |
obtainExpression(IEmbeddedEditor editor,
ModelInfo<Project> info,
IModelElement context)
Obtains the edited expression from an editor created by
#embedIvmlConstraintEditor(ModelInfo, Composite, IConstraintFilter). |
static void |
setConstraint(IEmbeddedEditor editor,
ModelInfo<Project> info,
ConstraintSplitWriter.IConstraintFilter filter,
boolean trimParenthesis)
Sets new content for the given
editor. |
public EditorUtils()
public static IEmbeddedEditor embedIvmlEditor(java.net.URI file, org.eclipse.swt.widgets.Composite parent)
parent.file - the file representing the resourceparent - the parent UI componentprivate static com.google.inject.Injector getInjector()
public static IEmbeddedEditor embedIvmlConstraintEditor(ModelInfo<Project> info, org.eclipse.swt.widgets.Composite parent, ConstraintSplitWriter.IConstraintFilter filter, boolean trimParenthesis)
filter in given resource into the given
parent.info - the model information of the containing projectparent - the parent UI componentfilter - the constraint filter indicating then constraint to embed into the editortrimParenthesis - shifts the outermost parenthesis pair to the model contextpublic static void setConstraint(IEmbeddedEditor editor, ModelInfo<Project> info, ConstraintSplitWriter.IConstraintFilter filter, boolean trimParenthesis)
editor.editor - the editor to set the content oninfo - the model information of the containing projectfilter - the constraint filter indicating then constraint to embed into the editortrimParenthesis - shifts the outermost parenthesis pair to the model contextpublic static ConstraintSyntaxTree obtainExpression(IEmbeddedEditor editor, ModelInfo<Project> info, IModelElement context) throws CSTSemanticException, ConstraintSyntaxException
#embedIvmlConstraintEditor(ModelInfo, Composite, IConstraintFilter).editor - the editorinfo - the model information of the containing projectcontext - the context to resolve the expression within, see
ModelUtility.createExpression(String, IModelElement), if null, the resolved project from
info is takenCSTSemanticException - in case of semantic problems in the constraintConstraintSyntaxException - in case of syntax problems in the constraintCopyright © 2009 - 2018 SSE. All Rights Reserved.