This asset contains extensions to the odesign editor providing Xtext-enabled text entry fields.
Xtext-enabled editors provide the usual Xtext features: syntax highlighting, auto completion, validation, etc.
The Xtext language does not need to be modified to be used in the editor (except for [advancedCapabilities]).
The text entry fields can be placed
-
either inside a Sirius diagram (direct editors; directEdit)
-
or in the Sirius properties view (widgets; property).
The contents of the editors can be retrieved from two sources:
-
A semantic element of a model that’s used as input to the diagram (model). In this case, we may set additional options:
-
limit the set of editableFeatures,
-
ignore some nested features (ignoredNestedFeatures).
-
specify which features should be pre-selected when showing the Xtext editor (selectedFeatures).
-
specify which terminals should be included before and after the edited text (prefixTerminals / suffixTerminals).
-
-
A String feature of a semantic element (value). In this case, we may supply additional information if we wanted to edit an incomplete model:
-
text (hidden from the end-user) to be pre-pended (prefixText),
-
text (hidden from the end-user) to be appended (suffixText).
-
For model-based directEdit editors, if the model element is an edge, the affected label must be set (edgeLabelPosition).
An editor can display
-
either single-line contents (singleLine),
-
or multi-line contents (multiLine).
For all editors, we can set:
-
whether validation errors should be allowed (cancelOnValidationError)
-
whether an formatter should be applied (enableFormatter)
For all editors, we need to provide
-
An injector to access the Xtext language to use (injector).
All of this can be summarized in one table:
| property | directEdit | add. info [info] | ||
|---|---|---|---|---|
add. info [info] |
||||
As advanced capabilities,
-
the editor might use a different grammar (a.k.a. Xtext language) for editing model contents than the one used for serialization;
-
we can force the serialization of whitespaces if our formatter does not work as expected;
-
the serializer can force ignored nested features to be transient;
-
we can constrain the editor’s global Scope to all Ecore resources from the Sirius session.
we provide two different Eclipse features:
-
com.altran.general.integration.xtextsirius.design.featurecontains all Eclipse plug-ins required to edit the Xtext-enabled entry fields in the odesign editor. It also contains the runtime feature below. -
com.altran.general.integration.xtextsirius.runtime.featurecontains all Eclipse plug-ins required at runtime to use the Xtext-enabled entry fields in a diagram (or associated property view).





