Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Plouhinec2022-09-06 15:41:45 +0000
committerJessy Mallet2023-03-08 10:28:18 +0000
commit07dd333ca9d365a8dc719162a0b77a85bedf5237 (patch)
tree1d4521f2b8a075b1ab8e3531df9907150a50cefa
parentf1a706a5e917d9cb24157a9af91d198acca555b0 (diff)
downloadorg.eclipse.papyrus-sirius-07dd333ca9d365a8dc719162a0b77a85bedf5237.tar.gz
org.eclipse.papyrus-sirius-07dd333ca9d365a8dc719162a0b77a85bedf5237.tar.xz
org.eclipse.papyrus-sirius-07dd333ca9d365a8dc719162a0b77a85bedf5237.zip
Bug 22: [PropertiesView] Add Language Expression Widget
A specific advanced widget has been created to manage UML "BodyOwner" elements in properties view. This widget displays a table associating languages to a "body" text editor. Ticket: https://github.com/PapyrusSirius/papyrus-desktop/issues/22 Change-Id: Iaf78563623e4e1991ad3e6b78e19fa9c04949b90 Signed-off-by: Glenn Plouhinec <glenn.plouhinec@obeo.fr>
-rw-r--r--plugins/doc/org.eclipse.papyrus.sirius.doc/image/dev/languageExpression_popupWidget_VSM.pngbin0 -> 23698 bytes
-rw-r--r--plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_OCL_example.pngbin0 -> 7766 bytes
-rw-r--r--plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_browseDialog.pngbin0 -> 18512 bytes
-rw-r--r--plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_editDialog.pngbin0 -> 18925 bytes
-rwxr-xr-xplugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-devDoc.mediawiki23
-rwxr-xr-xplugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-userDoc.mediawiki23
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/icons/full/obj16/LanguageExpressionDescription.gifbin0 -> 202 bytes
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/plugin.properties1
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/ContainerBorderDescriptionItemProvider.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/LanguageExpressionDescriptionItemProvider.java185
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/PropertiesAdvancedControlsItemProviderAdapterFactory.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.ecore1
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.genmodel10
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/LanguageExpressionDescription.java30
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsFactory.java9
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsPackage.java93
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/LanguageExpressionDescriptionImpl.java346
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsFactoryImpl.java14
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsPackageImpl.java27
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsAdapterFactory.java21
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsSwitch.java36
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.ecore1
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.genmodel1
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EEFLanguageExpressionDescription.java29
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsFactory.java9
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsPackage.java84
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EEFLanguageExpressionDescriptionImpl.java49
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsFactoryImpl.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsPackageImpl.java22
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsAdapterFactory.java18
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsSwitch.java23
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/META-INF/MANIFEST.MF7
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/plugin.xml9
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionController.java56
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManager.java848
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManagerProvider.java57
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.properties5
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.xml18
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionConverter.java45
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionPreprocessor.java43
-rw-r--r--plugins/uml/org.eclipse.papyrus.sirius.properties.uml/description/umlProperties.odesign9
41 files changed, 2203 insertions, 6 deletions
diff --git a/plugins/doc/org.eclipse.papyrus.sirius.doc/image/dev/languageExpression_popupWidget_VSM.png b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/dev/languageExpression_popupWidget_VSM.png
new file mode 100644
index 000000000..e65e90250
--- /dev/null
+++ b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/dev/languageExpression_popupWidget_VSM.png
Binary files differ
diff --git a/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_OCL_example.png b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_OCL_example.png
new file mode 100644
index 000000000..6795a6c91
--- /dev/null
+++ b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_OCL_example.png
Binary files differ
diff --git a/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_browseDialog.png b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_browseDialog.png
new file mode 100644
index 000000000..728d0f1b3
--- /dev/null
+++ b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_browseDialog.png
Binary files differ
diff --git a/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_editDialog.png b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_editDialog.png
new file mode 100644
index 000000000..209038a3e
--- /dev/null
+++ b/plugins/doc/org.eclipse.papyrus.sirius.doc/image/user/expressionLanguageWidget_editDialog.png
Binary files differ
diff --git a/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-devDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-devDoc.mediawiki
index 715db2c25..59a4982e1 100755
--- a/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-devDoc.mediawiki
+++ b/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-devDoc.mediawiki
@@ -408,3 +408,26 @@ The definition of "container Border" control follows the rules described for the
Note that the ''Label Expression'' may be an empty String if it is not set or if specified by the expression, in which case the border will not be labeled.
[[File:../../../image/dev/containerBorderControl_emptyStringResult.png]]
+
+== Language Expression Widget ==
+
+The "Language Expression" Widget has been specifically created to manage "language" and "body" features of "BodyOwner" UML elements such as OpaqueExpression, OpaqueAction, OpaqueBehavior and FunctionBehavior.
+
+[[File:../../../image/dev/languageExpression_popupWidget_VSM.png]]
+
+This Widget displays, on the left part, the list of languages associated to their "body", on the right part, which is a text editor.
+
+[[File:../../../image/user/expressionLanguageWidget_OCL_example.png]]
+
+Inspired by the reference widget, the left part of the Language Expression Widget provides the same buttons as the Papyrus Reference one: '''Up''', '''Down''', '''Browse''', '''Add''', '''Remove''' and '''Edit''' buttons. See the related user documentation for more information about the behavior of these buttons.
+
+According to the selected language, the body editor is updated. For example, for the OCL language, a Xtext editor is displayed and for the JAVA language, a kind of multi-string editor is displayed.
+
+A language expression can be added in a group or a container.
+The definition of the language expression widget follows different rules to configure it:
+
+* '''Id''' used to distinguish elements of the same type in the VSM editor,
+* '''Label Expression''' used to compute the text of the label describing the element,
+* '''Help Expression''' used to display help as tooltip on the question-mark icon,
+* '''Is Enabled Expression''' used to enabled or disabled the widget.
+These general rules are more described in documentation ''Sirius > Sirius Specifier Manual > Properties View > Properties View Description''.
diff --git a/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-userDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-userDoc.mediawiki
index 9f83abb18..93ef0a92d 100755
--- a/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-userDoc.mediawiki
+++ b/plugins/doc/org.eclipse.papyrus.sirius.doc/src/site/mediawiki/papyrus-sirius-userDoc.mediawiki
@@ -208,3 +208,26 @@ Mono-valued references without containment are represented by the same widget as
[[File:../../../image/user/mono-valuedReferenceWithoutContainment_example.png]]
* '''Browse''' button : it invokes the same Dialog as the ''Browse'' button for Multi-valued references without containment.
+===Language Expression widget===
+
+The Language Expression Widget has been specifically created to handle UML "BodyOwner" elements such as OpaqueExpressions, OpaqueActions, OpaqueBehaviors and FunctionBehaviors. This Widget allows to create a list of expressions that are described by a language and a text field.
+
+[[File:../../../image/user/expressionLanguageWidget_OCL_example.png]]
+
+According to the language selected on the left part of the widget, a specific editor is displayed on the right part.
+
+For the OCL language, an Xtext editor is displayed with several functionalities to assist user. For example, syntax highlighting and auto-completion are provided for the OCL language using the Xtext technology.
+
+For other languages, NaturalLanguageEditor is used. This Papyrus editor is a multi-String editor.ing editor.
+
+Several buttons are displayed horizontally on the right side of the languages list:
+* '''Up''' and '''Down''' buttons allow to change the order of the list by moving the selected elements. If no element is selected in the list, these buttons are grayed.
+* '''Browse''' button allows to browse existing languages from the "Language Registry" and add one or many languages to the languages list of the Language Expression widget.
+
+[[File:../../../image/user/expressionLanguageWidget_browseDialog.png]]
+
+* '''Add''' button allows to add a new custom language to the languages list of the Language Expression widget.
+* '''Remove''' button removes the selected language and its body. This button is grayed if no element is selected.
+* '''Edit''' button allows to edit the name of the selected language. This button is grayed if no element is selected. The user can also double-click on the language to edit its name.
+
+[[File:../../../image/user/expressionLanguageWidget_editDialog.png]]
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/icons/full/obj16/LanguageExpressionDescription.gif b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/icons/full/obj16/LanguageExpressionDescription.gif
new file mode 100644
index 000000000..7f9fb5093
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/icons/full/obj16/LanguageExpressionDescription.gif
Binary files differ
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/plugin.properties b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/plugin.properties
index 31bc87419..2a46a8834 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/plugin.properties
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/plugin.properties
@@ -31,3 +31,4 @@ _UI_Unknown_datatype= Value
_UI_Unknown_feature = Unspecified
_UI_ContainerBorderDescription_type = Container Border
_UI_ContainerBorderDescription_labelExpression_feature = Label Expression
+_UI_LanguageExpressionDescription_type = Language Expression
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/ContainerBorderDescriptionItemProvider.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/ContainerBorderDescriptionItemProvider.java
index d2dbdf9ec..ba581e74b 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/ContainerBorderDescriptionItemProvider.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/ContainerBorderDescriptionItemProvider.java
@@ -23,9 +23,11 @@ import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.ContainerBorderDescription;
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsFactory;
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage;
+
import org.eclipse.sirius.properties.PropertiesPackage;
import org.eclipse.sirius.properties.ext.widgets.reference.propertiesextwidgetsreference.PropertiesExtWidgetsReferenceFactory;
@@ -156,6 +158,10 @@ public class ContainerBorderDescriptionItemProvider extends ContainerDescription
newChildDescriptors
.add(createChildParameter(PropertiesPackage.Literals.ABSTRACT_CONTAINER_DESCRIPTION__CONTROLS,
+ PropertiesAdvancedControlsFactory.eINSTANCE.createLanguageExpressionDescription()));
+
+ newChildDescriptors
+ .add(createChildParameter(PropertiesPackage.Literals.ABSTRACT_CONTAINER_DESCRIPTION__CONTROLS,
PropertiesExtWidgetsReferenceFactory.eINSTANCE.createExtReferenceDescription()));
}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/LanguageExpressionDescriptionItemProvider.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/LanguageExpressionDescriptionItemProvider.java
new file mode 100644
index 000000000..f2862bbc0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/LanguageExpressionDescriptionItemProvider.java
@@ -0,0 +1,185 @@
+/**
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription;
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage;
+
+import org.eclipse.sirius.properties.PropertiesPackage;
+
+import org.eclipse.sirius.properties.provider.WidgetDescriptionItemProvider;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class LanguageExpressionDescriptionItemProvider extends WidgetDescriptionItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public LanguageExpressionDescriptionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addLabelExpressionPropertyDescriptor(object);
+ addHelpExpressionPropertyDescriptor(object);
+ addIsEnabledExpressionPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Label Expression feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addLabelExpressionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_AbstractWidgetDescription_labelExpression_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AbstractWidgetDescription_labelExpression_feature", //$NON-NLS-1$//$NON-NLS-2$
+ "_UI_AbstractWidgetDescription_type"), //$NON-NLS-1$
+ PropertiesPackage.Literals.ABSTRACT_WIDGET_DESCRIPTION__LABEL_EXPRESSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Help Expression feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addHelpExpressionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_AbstractWidgetDescription_helpExpression_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AbstractWidgetDescription_helpExpression_feature", //$NON-NLS-1$//$NON-NLS-2$
+ "_UI_AbstractWidgetDescription_type"), //$NON-NLS-1$
+ PropertiesPackage.Literals.ABSTRACT_WIDGET_DESCRIPTION__HELP_EXPRESSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Is Enabled Expression feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIsEnabledExpressionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(), getString("_UI_AbstractWidgetDescription_isEnabledExpression_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", //$NON-NLS-1$
+ "_UI_AbstractWidgetDescription_isEnabledExpression_feature", //$NON-NLS-1$
+ "_UI_AbstractWidgetDescription_type"), //$NON-NLS-1$
+ PropertiesPackage.Literals.ABSTRACT_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns LanguageExpressionDescription.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/LanguageExpressionDescription")); //$NON-NLS-1$
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean shouldComposeCreationImage() {
+ return true;
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((LanguageExpressionDescription) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_LanguageExpressionDescription_type") : //$NON-NLS-1$
+ getString("_UI_LanguageExpressionDescription_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(LanguageExpressionDescription.class)) {
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION:
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION:
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/PropertiesAdvancedControlsItemProviderAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/PropertiesAdvancedControlsItemProviderAdapterFactory.java
index 2e4190ef6..7f903d331 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/PropertiesAdvancedControlsItemProviderAdapterFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/provider/PropertiesAdvancedControlsItemProviderAdapterFactory.java
@@ -42,9 +42,12 @@ import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.INotifyChangedListener;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsFactory;
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.util.PropertiesAdvancedControlsAdapterFactory;
+
import org.eclipse.sirius.properties.AbstractContainerDescription;
import org.eclipse.sirius.properties.AbstractDynamicMappingIfDescription;
import org.eclipse.sirius.properties.AbstractGroupDescription;
@@ -157,6 +160,29 @@ public class PropertiesAdvancedControlsItemProviderAdapterFactory extends Proper
}
/**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LanguageExpressionDescriptionItemProvider languageExpressionDescriptionItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createLanguageExpressionDescriptionAdapter() {
+ if (languageExpressionDescriptionItemProvider == null) {
+ languageExpressionDescriptionItemProvider = new LanguageExpressionDescriptionItemProvider(this);
+ }
+
+ return languageExpressionDescriptionItemProvider;
+ }
+
+ /**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -292,6 +318,8 @@ public class PropertiesAdvancedControlsItemProviderAdapterFactory extends Proper
extEditableReferenceDescriptionItemProvider.dispose();
if (containerBorderDescriptionItemProvider != null)
containerBorderDescriptionItemProvider.dispose();
+ if (languageExpressionDescriptionItemProvider != null)
+ languageExpressionDescriptionItemProvider.dispose();
}
/**
@@ -350,6 +378,10 @@ public class PropertiesAdvancedControlsItemProviderAdapterFactory extends Proper
.add(createChildParameter(PropertiesPackage.Literals.ABSTRACT_GROUP_DESCRIPTION__CONTROLS,
PropertiesAdvancedControlsFactory.eINSTANCE.createContainerBorderDescription()));
+ newChildDescriptors
+ .add(createChildParameter(PropertiesPackage.Literals.ABSTRACT_GROUP_DESCRIPTION__CONTROLS,
+ PropertiesAdvancedControlsFactory.eINSTANCE.createLanguageExpressionDescription()));
+
return null;
}
@@ -368,6 +400,10 @@ public class PropertiesAdvancedControlsItemProviderAdapterFactory extends Proper
.add(createChildParameter(PropertiesPackage.Literals.ABSTRACT_CONTAINER_DESCRIPTION__CONTROLS,
PropertiesAdvancedControlsFactory.eINSTANCE.createContainerBorderDescription()));
+ newChildDescriptors
+ .add(createChildParameter(PropertiesPackage.Literals.ABSTRACT_CONTAINER_DESCRIPTION__CONTROLS,
+ PropertiesAdvancedControlsFactory.eINSTANCE.createLanguageExpressionDescription()));
+
return null;
}
@@ -382,6 +418,10 @@ public class PropertiesAdvancedControlsItemProviderAdapterFactory extends Proper
createChildParameter(PropertiesPackage.Literals.ABSTRACT_DYNAMIC_MAPPING_IF_DESCRIPTION__WIDGET,
PropertiesAdvancedControlsFactory.eINSTANCE.createExtEditableReferenceDescription()));
+ newChildDescriptors.add(
+ createChildParameter(PropertiesPackage.Literals.ABSTRACT_DYNAMIC_MAPPING_IF_DESCRIPTION__WIDGET,
+ PropertiesAdvancedControlsFactory.eINSTANCE.createLanguageExpressionDescription()));
+
return null;
}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.ecore b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.ecore
index 0fd6dd051..e473883c4 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.ecore
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.ecore
@@ -6,4 +6,5 @@
<eClassifiers xsi:type="ecore:EClass" name="ContainerBorderDescription" eSuperTypes="platform:/plugin/org.eclipse.sirius.properties/model/properties.ecore#//ContainerDescription">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="labelExpression" eType="ecore:EDataType platform:/plugin/org.eclipse.sirius.model/model/viewpoint.ecore#//description/InterpretedExpression"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="LanguageExpressionDescription" eSuperTypes="platform:/plugin/org.eclipse.sirius.properties/model/properties.ecore#//WidgetDescription platform:/plugin/org.eclipse.sirius.properties/model/properties.ecore#//AbstractWidgetDescription"/>
</ecore:EPackage>
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.genmodel b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.genmodel
index 556832dcf..a52d0a532 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.genmodel
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/model/properties-advanced-controls.genmodel
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2022 CEA, Obeo&#xA;&#xA;This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License 2.0&#xA;which accompanies this distribution, and is available at&#xA;https://www.eclipse.org/legal/epl-2.0/&#xA;&#xA;SPDX-License-Identifier: EPL-2.0&#xA;&#xA;Contributors:&#xA; Obeo - initial API and implementation"
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
+ copyrightText="Copyright (c) 2022 CEA, Obeo&#xA;&#xA;This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License 2.0&#xA;which accompanies this distribution, and is available at&#xA;https://www.eclipse.org/legal/epl-2.0/&#xA;&#xA;SPDX-License-Identifier: EPL-2.0&#xA;&#xA;Contributors:&#xA; Obeo - initial API and implementation"
modelDirectory="/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen"
creationIcons="false" editDirectory="/org.eclipse.papyrus.sirius.properties.advanced.controls.edit/src-gen"
editorDirectory="/org.eclipse.papyrus.sirius.properties.advanced.controls.editor/src-gen"
- modelPluginID="org.eclipse.papyrus.sirius.properties.advanced.controls"
- modelName="Properties-advanced-controls" nonNLSMarkers="true" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+ modelPluginID="org.eclipse.papyrus.sirius.properties.advanced.controls" modelName="Properties-advanced-controls"
+ nonNLSMarkers="true" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
codeFormatting="true" importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0"
copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.sirius.properties/model/properties.genmodel#//properties platform:/plugin/org.eclipse.sirius.properties.ext.widgets.reference/model/properties-ext-widgets-reference.genmodel#//propertiesextwidgetsreference platform:/plugin/org.eclipse.sirius.model/model/viewpoint.genmodel#//viewpoint"
operationReflection="true" importOrganizing="true">
@@ -18,5 +19,6 @@
<genClasses ecoreClass="properties-advanced-controls.ecore#//ContainerBorderDescription">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties-advanced-controls.ecore#//ContainerBorderDescription/labelExpression"/>
</genClasses>
+ <genClasses ecoreClass="properties-advanced-controls.ecore#//LanguageExpressionDescription"/>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/LanguageExpressionDescription.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/LanguageExpressionDescription.java
new file mode 100644
index 000000000..41809a498
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/LanguageExpressionDescription.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols;
+
+import org.eclipse.sirius.properties.AbstractWidgetDescription;
+import org.eclipse.sirius.properties.WidgetDescription;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Language Expression Description</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage#getLanguageExpressionDescription()
+ * @model
+ * @generated
+ */
+public interface LanguageExpressionDescription extends WidgetDescription, AbstractWidgetDescription {
+} // LanguageExpressionDescription
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsFactory.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsFactory.java
index c1654f355..3db50ae2e 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsFactory.java
@@ -52,6 +52,15 @@ public interface PropertiesAdvancedControlsFactory extends EFactory {
ContainerBorderDescription createContainerBorderDescription();
/**
+ * Returns a new object of class '<em>Language Expression Description</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Language Expression Description</em>'.
+ * @generated
+ */
+ LanguageExpressionDescription createLanguageExpressionDescription();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsPackage.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsPackage.java
index 23595f045..621ae15d7 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsPackage.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/PropertiesAdvancedControlsPackage.java
@@ -291,6 +291,79 @@ public interface PropertiesAdvancedControlsPackage extends EPackage {
int CONTAINER_BORDER_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.CONTAINER_DESCRIPTION_FEATURE_COUNT + 1;
/**
+ * The meta object id for the '{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl <em>Language Expression Description</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.PropertiesAdvancedControlsPackageImpl#getLanguageExpressionDescription()
+ * @generated
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION__NAME = PropertiesPackage.WIDGET_DESCRIPTION__NAME;
+
+ /**
+ * The feature id for the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION__LABEL = PropertiesPackage.WIDGET_DESCRIPTION__LABEL;
+
+ /**
+ * The feature id for the '<em><b>Documentation</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION__DOCUMENTATION = PropertiesPackage.WIDGET_DESCRIPTION__DOCUMENTATION;
+
+ /**
+ * The feature id for the '<em><b>Label Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Is Enabled Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Language Expression Description</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_EXPRESSION_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 3;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.ExtEditableReferenceDescription <em>Ext Editable Reference Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -322,6 +395,16 @@ public interface PropertiesAdvancedControlsPackage extends EPackage {
EAttribute getContainerBorderDescription_LabelExpression();
/**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription <em>Language Expression Description</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Language Expression Description</em>'.
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription
+ * @generated
+ */
+ EClass getLanguageExpressionDescription();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -373,6 +456,16 @@ public interface PropertiesAdvancedControlsPackage extends EPackage {
EAttribute CONTAINER_BORDER_DESCRIPTION__LABEL_EXPRESSION = eINSTANCE
.getContainerBorderDescription_LabelExpression();
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl <em>Language Expression Description</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.PropertiesAdvancedControlsPackageImpl#getLanguageExpressionDescription()
+ * @generated
+ */
+ EClass LANGUAGE_EXPRESSION_DESCRIPTION = eINSTANCE.getLanguageExpressionDescription();
+
}
} //PropertiesAdvancedControlsPackage
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/LanguageExpressionDescriptionImpl.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/LanguageExpressionDescriptionImpl.java
new file mode 100644
index 000000000..737556f1f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/LanguageExpressionDescriptionImpl.java
@@ -0,0 +1,346 @@
+/**
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription;
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage;
+
+import org.eclipse.sirius.properties.AbstractWidgetDescription;
+import org.eclipse.sirius.properties.PropertiesPackage;
+
+import org.eclipse.sirius.properties.impl.WidgetDescriptionImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Language Expression Description</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl#getLabelExpression <em>Label Expression</em>}</li>
+ * <li>{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl#getHelpExpression <em>Help Expression</em>}</li>
+ * <li>{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.impl.LanguageExpressionDescriptionImpl#getIsEnabledExpression <em>Is Enabled Expression</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class LanguageExpressionDescriptionImpl extends WidgetDescriptionImpl implements LanguageExpressionDescription {
+ /**
+ * The default value of the '{@link #getLabelExpression() <em>Label Expression</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabelExpression()
+ * @generated
+ * @ordered
+ */
+ protected static final String LABEL_EXPRESSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLabelExpression() <em>Label Expression</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabelExpression()
+ * @generated
+ * @ordered
+ */
+ protected String labelExpression = LABEL_EXPRESSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getHelpExpression() <em>Help Expression</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHelpExpression()
+ * @generated
+ * @ordered
+ */
+ protected static final String HELP_EXPRESSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getHelpExpression() <em>Help Expression</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHelpExpression()
+ * @generated
+ * @ordered
+ */
+ protected String helpExpression = HELP_EXPRESSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getIsEnabledExpression() <em>Is Enabled Expression</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIsEnabledExpression()
+ * @generated
+ * @ordered
+ */
+ protected static final String IS_ENABLED_EXPRESSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getIsEnabledExpression() <em>Is Enabled Expression</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIsEnabledExpression()
+ * @generated
+ * @ordered
+ */
+ protected String isEnabledExpression = IS_ENABLED_EXPRESSION_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LanguageExpressionDescriptionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PropertiesAdvancedControlsPackage.Literals.LANGUAGE_EXPRESSION_DESCRIPTION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getLabelExpression() {
+ return labelExpression;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setLabelExpression(String newLabelExpression) {
+ String oldLabelExpression = labelExpression;
+ labelExpression = newLabelExpression;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION,
+ oldLabelExpression, labelExpression));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getHelpExpression() {
+ return helpExpression;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setHelpExpression(String newHelpExpression) {
+ String oldHelpExpression = helpExpression;
+ helpExpression = newHelpExpression;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION,
+ oldHelpExpression, helpExpression));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getIsEnabledExpression() {
+ return isEnabledExpression;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setIsEnabledExpression(String newIsEnabledExpression) {
+ String oldIsEnabledExpression = isEnabledExpression;
+ isEnabledExpression = newIsEnabledExpression;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION,
+ oldIsEnabledExpression, isEnabledExpression));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION:
+ return getLabelExpression();
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION:
+ return getHelpExpression();
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ return getIsEnabledExpression();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION:
+ setLabelExpression((String) newValue);
+ return;
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION:
+ setHelpExpression((String) newValue);
+ return;
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ setIsEnabledExpression((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION:
+ setLabelExpression(LABEL_EXPRESSION_EDEFAULT);
+ return;
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION:
+ setHelpExpression(HELP_EXPRESSION_EDEFAULT);
+ return;
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ setIsEnabledExpression(IS_ENABLED_EXPRESSION_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION:
+ return LABEL_EXPRESSION_EDEFAULT == null ? labelExpression != null
+ : !LABEL_EXPRESSION_EDEFAULT.equals(labelExpression);
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION:
+ return HELP_EXPRESSION_EDEFAULT == null ? helpExpression != null
+ : !HELP_EXPRESSION_EDEFAULT.equals(helpExpression);
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ return IS_ENABLED_EXPRESSION_EDEFAULT == null ? isEnabledExpression != null
+ : !IS_ENABLED_EXPRESSION_EDEFAULT.equals(isEnabledExpression);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == AbstractWidgetDescription.class) {
+ switch (derivedFeatureID) {
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION:
+ return PropertiesPackage.ABSTRACT_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION:
+ return PropertiesPackage.ABSTRACT_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ return PropertiesPackage.ABSTRACT_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION;
+ default:
+ return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+ if (baseClass == AbstractWidgetDescription.class) {
+ switch (baseFeatureID) {
+ case PropertiesPackage.ABSTRACT_WIDGET_DESCRIPTION__LABEL_EXPRESSION:
+ return PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION;
+ case PropertiesPackage.ABSTRACT_WIDGET_DESCRIPTION__HELP_EXPRESSION:
+ return PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION;
+ case PropertiesPackage.ABSTRACT_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION:
+ return PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION;
+ default:
+ return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuilder result = new StringBuilder(super.toString());
+ result.append(" (labelExpression: "); //$NON-NLS-1$
+ result.append(labelExpression);
+ result.append(", helpExpression: "); //$NON-NLS-1$
+ result.append(helpExpression);
+ result.append(", isEnabledExpression: "); //$NON-NLS-1$
+ result.append(isEnabledExpression);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LanguageExpressionDescriptionImpl
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsFactoryImpl.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsFactoryImpl.java
index 1dbac8162..fa28c0d8c 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsFactoryImpl.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsFactoryImpl.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.*;
/**
@@ -70,6 +71,8 @@ public class PropertiesAdvancedControlsFactoryImpl extends EFactoryImpl implemen
return createExtEditableReferenceDescription();
case PropertiesAdvancedControlsPackage.CONTAINER_BORDER_DESCRIPTION:
return createContainerBorderDescription();
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION:
+ return createLanguageExpressionDescription();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -103,6 +106,17 @@ public class PropertiesAdvancedControlsFactoryImpl extends EFactoryImpl implemen
* @generated
*/
@Override
+ public LanguageExpressionDescription createLanguageExpressionDescription() {
+ LanguageExpressionDescriptionImpl languageExpressionDescription = new LanguageExpressionDescriptionImpl();
+ return languageExpressionDescription;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
public PropertiesAdvancedControlsPackage getPropertiesAdvancedControlsPackage() {
return (PropertiesAdvancedControlsPackage) getEPackage();
}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsPackageImpl.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsPackageImpl.java
index 7e851dd7d..3494ba805 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsPackageImpl.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/impl/PropertiesAdvancedControlsPackageImpl.java
@@ -19,10 +19,13 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.ContainerBorderDescription;
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.ExtEditableReferenceDescription;
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription;
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsFactory;
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage;
+
import org.eclipse.sirius.properties.PropertiesPackage;
import org.eclipse.sirius.properties.ext.widgets.reference.propertiesextwidgetsreference.PropertiesExtWidgetsReferencePackage;
@@ -53,6 +56,13 @@ public class PropertiesAdvancedControlsPackageImpl extends EPackageImpl implemen
private EClass containerBorderDescriptionEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass languageExpressionDescriptionEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -159,6 +169,16 @@ public class PropertiesAdvancedControlsPackageImpl extends EPackageImpl implemen
* @generated
*/
@Override
+ public EClass getLanguageExpressionDescription() {
+ return languageExpressionDescriptionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
public PropertiesAdvancedControlsFactory getPropertiesAdvancedControlsFactory() {
return (PropertiesAdvancedControlsFactory) getEFactoryInstance();
}
@@ -187,6 +207,8 @@ public class PropertiesAdvancedControlsPackageImpl extends EPackageImpl implemen
containerBorderDescriptionEClass = createEClass(CONTAINER_BORDER_DESCRIPTION);
createEAttribute(containerBorderDescriptionEClass, CONTAINER_BORDER_DESCRIPTION__LABEL_EXPRESSION);
+
+ languageExpressionDescriptionEClass = createEClass(LANGUAGE_EXPRESSION_DESCRIPTION);
}
/**
@@ -229,6 +251,8 @@ public class PropertiesAdvancedControlsPackageImpl extends EPackageImpl implemen
extEditableReferenceDescriptionEClass.getESuperTypes()
.add(thePropertiesExtWidgetsReferencePackage.getExtReferenceDescription());
containerBorderDescriptionEClass.getESuperTypes().add(thePropertiesPackage.getContainerDescription());
+ languageExpressionDescriptionEClass.getESuperTypes().add(thePropertiesPackage.getWidgetDescription());
+ languageExpressionDescriptionEClass.getESuperTypes().add(thePropertiesPackage.getAbstractWidgetDescription());
// Initialize classes, features, and operations; add parameters
initEClass(extEditableReferenceDescriptionEClass, ExtEditableReferenceDescription.class,
@@ -241,6 +265,9 @@ public class PropertiesAdvancedControlsPackageImpl extends EPackageImpl implemen
ContainerBorderDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(languageExpressionDescriptionEClass, LanguageExpressionDescription.class,
+ "LanguageExpressionDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsAdapterFactory.java
index 076db00cc..418859fd0 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsAdapterFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsAdapterFactory.java
@@ -19,7 +19,9 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.*;
+
import org.eclipse.sirius.properties.AbstractContainerDescription;
import org.eclipse.sirius.properties.AbstractControlDescription;
import org.eclipse.sirius.properties.AbstractWidgetDescription;
@@ -99,6 +101,11 @@ public class PropertiesAdvancedControlsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseLanguageExpressionDescription(LanguageExpressionDescription object) {
+ return createLanguageExpressionDescriptionAdapter();
+ }
+
+ @Override
public Adapter caseIdentifiedElement(IdentifiedElement object) {
return createIdentifiedElementAdapter();
}
@@ -196,6 +203,20 @@ public class PropertiesAdvancedControlsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription <em>Language Expression Description</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription
+ * @generated
+ */
+ public Adapter createLanguageExpressionDescriptionAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.sirius.viewpoint.description.IdentifiedElement <em>Identified Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsSwitch.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsSwitch.java
index 5dee9cf05..e87af9499 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsSwitch.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.advanced.controls/src-gen/org/eclipse/papyrus/sirius/properties/advanced/controls/propertiesadvancedcontrols/util/PropertiesAdvancedControlsSwitch.java
@@ -17,7 +17,9 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
+
import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.*;
+
import org.eclipse.sirius.properties.AbstractContainerDescription;
import org.eclipse.sirius.properties.AbstractControlDescription;
import org.eclipse.sirius.properties.AbstractWidgetDescription;
@@ -130,6 +132,25 @@ public class PropertiesAdvancedControlsSwitch<T> extends Switch<T> {
result = defaultCase(theEObject);
return result;
}
+ case PropertiesAdvancedControlsPackage.LANGUAGE_EXPRESSION_DESCRIPTION: {
+ LanguageExpressionDescription languageExpressionDescription = (LanguageExpressionDescription) theEObject;
+ T result = caseLanguageExpressionDescription(languageExpressionDescription);
+ if (result == null)
+ result = caseWidgetDescription(languageExpressionDescription);
+ if (result == null)
+ result = caseAbstractWidgetDescription(languageExpressionDescription);
+ if (result == null)
+ result = caseControlDescription(languageExpressionDescription);
+ if (result == null)
+ result = caseAbstractControlDescription(languageExpressionDescription);
+ if (result == null)
+ result = caseIdentifiedElement(languageExpressionDescription);
+ if (result == null)
+ result = caseDocumentedElement(languageExpressionDescription);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -166,6 +187,21 @@ public class PropertiesAdvancedControlsSwitch<T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Language Expression Description</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Language Expression Description</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLanguageExpressionDescription(LanguageExpressionDescription object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Identified Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.ecore b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.ecore
index de210df0c..75cc31938 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.ecore
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.ecore
@@ -7,4 +7,5 @@
<eClassifiers xsi:type="ecore:EClass" name="EEFContainerBorderDescription" eSuperTypes="../../org.eclipse.eef/model/eef.ecore#//EEFContainerDescription ../../org.eclipse.eef/model/eef.ecore#//EEFControlDescription">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="labelExpression" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="EEFLanguageExpressionDescription" eSuperTypes="../../org.eclipse.eef/model/eef.ecore#//EEFWidgetDescription"/>
</ecore:EPackage>
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.genmodel b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.genmodel
index 299138f04..ac7c8262e 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.genmodel
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/model/eef-advanced-controls.genmodel
@@ -13,5 +13,6 @@
<genClasses ecoreClass="eef-advanced-controls.ecore#//EEFContainerBorderDescription">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute eef-advanced-controls.ecore#//EEFContainerBorderDescription/labelExpression"/>
</genClasses>
+ <genClasses ecoreClass="eef-advanced-controls.ecore#//EEFLanguageExpressionDescription"/>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EEFLanguageExpressionDescription.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EEFLanguageExpressionDescription.java
new file mode 100644
index 000000000..028796b41
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EEFLanguageExpressionDescription.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.papyrus.sirius.properties.eef.advanced.controls;
+
+import org.eclipse.eef.EEFWidgetDescription;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>EEF Language Expression Description</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EefAdvancedControlsPackage#getEEFLanguageExpressionDescription()
+ * @model
+ * @generated
+ */
+public interface EEFLanguageExpressionDescription extends EEFWidgetDescription {
+} // EEFLanguageExpressionDescription
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsFactory.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsFactory.java
index 07987feab..91d4d8650 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsFactory.java
@@ -51,6 +51,15 @@ public interface EefAdvancedControlsFactory extends EFactory {
EEFContainerBorderDescription createEEFContainerBorderDescription();
/**
+ * Returns a new object of class '<em>EEF Language Expression Description</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>EEF Language Expression Description</em>'.
+ * @generated
+ */
+ EEFLanguageExpressionDescription createEEFLanguageExpressionDescription();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsPackage.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsPackage.java
index 6f30eaf8b..55fe14496 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsPackage.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/EefAdvancedControlsPackage.java
@@ -235,6 +235,70 @@ public interface EefAdvancedControlsPackage extends EPackage {
int EEF_CONTAINER_BORDER_DESCRIPTION_FEATURE_COUNT = EefPackage.EEF_CONTAINER_DESCRIPTION_FEATURE_COUNT + 1;
/**
+ * The meta object id for the '{@link org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl.EEFLanguageExpressionDescriptionImpl <em>EEF Language Expression Description</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl.EEFLanguageExpressionDescriptionImpl
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl.EefAdvancedControlsPackageImpl#getEEFLanguageExpressionDescription()
+ * @generated
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION = 2;
+
+ /**
+ * The feature id for the '<em><b>Identifier</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION__IDENTIFIER = EefPackage.EEF_WIDGET_DESCRIPTION__IDENTIFIER;
+
+ /**
+ * The feature id for the '<em><b>Label Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION__LABEL_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__LABEL_EXPRESSION;
+
+ /**
+ * The feature id for the '<em><b>Help Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION__HELP_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__HELP_EXPRESSION;
+
+ /**
+ * The feature id for the '<em><b>Is Enabled Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION__IS_ENABLED_EXPRESSION = EefPackage.EEF_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION;
+
+ /**
+ * The feature id for the '<em><b>Property Validation Rules</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION__PROPERTY_VALIDATION_RULES = EefPackage.EEF_WIDGET_DESCRIPTION__PROPERTY_VALIDATION_RULES;
+
+ /**
+ * The number of structural features of the '<em>EEF Language Expression Description</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EEF_LANGUAGE_EXPRESSION_DESCRIPTION_FEATURE_COUNT = EefPackage.EEF_WIDGET_DESCRIPTION_FEATURE_COUNT + 0;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFExtEditableReferenceDescription <em>EEF Ext Editable Reference Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -266,6 +330,16 @@ public interface EefAdvancedControlsPackage extends EPackage {
EAttribute getEEFContainerBorderDescription_LabelExpression();
/**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription <em>EEF Language Expression Description</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>EEF Language Expression Description</em>'.
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription
+ * @generated
+ */
+ EClass getEEFLanguageExpressionDescription();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -316,6 +390,16 @@ public interface EefAdvancedControlsPackage extends EPackage {
*/
EAttribute EEF_CONTAINER_BORDER_DESCRIPTION__LABEL_EXPRESSION = eINSTANCE.getEEFContainerBorderDescription_LabelExpression();
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl.EEFLanguageExpressionDescriptionImpl <em>EEF Language Expression Description</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl.EEFLanguageExpressionDescriptionImpl
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl.EefAdvancedControlsPackageImpl#getEEFLanguageExpressionDescription()
+ * @generated
+ */
+ EClass EEF_LANGUAGE_EXPRESSION_DESCRIPTION = eINSTANCE.getEEFLanguageExpressionDescription();
+
}
} //EefAdvancedControlsPackage
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EEFLanguageExpressionDescriptionImpl.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EEFLanguageExpressionDescriptionImpl.java
new file mode 100644
index 000000000..32d1aa15b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EEFLanguageExpressionDescriptionImpl.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.papyrus.sirius.properties.eef.advanced.controls.impl;
+
+import org.eclipse.eef.impl.EEFWidgetDescriptionImpl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EefAdvancedControlsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EEF Language Expression Description</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class EEFLanguageExpressionDescriptionImpl extends EEFWidgetDescriptionImpl implements EEFLanguageExpressionDescription {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EEFLanguageExpressionDescriptionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EefAdvancedControlsPackage.Literals.EEF_LANGUAGE_EXPRESSION_DESCRIPTION;
+ }
+
+} //EEFLanguageExpressionDescriptionImpl
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsFactoryImpl.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsFactoryImpl.java
index 4757c4f3c..21a66e3a3 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsFactoryImpl.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsFactoryImpl.java
@@ -68,6 +68,7 @@ public class EefAdvancedControlsFactoryImpl extends EFactoryImpl implements EefA
switch (eClass.getClassifierID()) {
case EefAdvancedControlsPackage.EEF_EXT_EDITABLE_REFERENCE_DESCRIPTION: return createEEFExtEditableReferenceDescription();
case EefAdvancedControlsPackage.EEF_CONTAINER_BORDER_DESCRIPTION: return createEEFContainerBorderDescription();
+ case EefAdvancedControlsPackage.EEF_LANGUAGE_EXPRESSION_DESCRIPTION: return createEEFLanguageExpressionDescription();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -98,6 +99,16 @@ public class EefAdvancedControlsFactoryImpl extends EFactoryImpl implements EefA
* <!-- end-user-doc -->
* @generated
*/
+ public EEFLanguageExpressionDescription createEEFLanguageExpressionDescription() {
+ EEFLanguageExpressionDescriptionImpl eefLanguageExpressionDescription = new EEFLanguageExpressionDescriptionImpl();
+ return eefLanguageExpressionDescription;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EefAdvancedControlsPackage getEefAdvancedControlsPackage() {
return (EefAdvancedControlsPackage)getEPackage();
}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsPackageImpl.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsPackageImpl.java
index ece24e689..967911444 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsPackageImpl.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/impl/EefAdvancedControlsPackageImpl.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFContainerBorderDescription;
import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFExtEditableReferenceDescription;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription;
import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EefAdvancedControlsFactory;
import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EefAdvancedControlsPackage;
@@ -50,6 +51,13 @@ public class EefAdvancedControlsPackageImpl extends EPackageImpl implements EefA
private EClass eefContainerBorderDescriptionEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass eefLanguageExpressionDescriptionEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -147,6 +155,15 @@ public class EefAdvancedControlsPackageImpl extends EPackageImpl implements EefA
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getEEFLanguageExpressionDescription() {
+ return eefLanguageExpressionDescriptionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EefAdvancedControlsFactory getEefAdvancedControlsFactory() {
return (EefAdvancedControlsFactory)getEFactoryInstance();
}
@@ -174,6 +191,8 @@ public class EefAdvancedControlsPackageImpl extends EPackageImpl implements EefA
eefContainerBorderDescriptionEClass = createEClass(EEF_CONTAINER_BORDER_DESCRIPTION);
createEAttribute(eefContainerBorderDescriptionEClass, EEF_CONTAINER_BORDER_DESCRIPTION__LABEL_EXPRESSION);
+
+ eefLanguageExpressionDescriptionEClass = createEClass(EEF_LANGUAGE_EXPRESSION_DESCRIPTION);
}
/**
@@ -212,6 +231,7 @@ public class EefAdvancedControlsPackageImpl extends EPackageImpl implements EefA
eefExtEditableReferenceDescriptionEClass.getESuperTypes().add(theEefExtWidgetsReferencePackage.getEEFExtReferenceDescription());
eefContainerBorderDescriptionEClass.getESuperTypes().add(theEefPackage.getEEFContainerDescription());
eefContainerBorderDescriptionEClass.getESuperTypes().add(theEefPackage.getEEFControlDescription());
+ eefLanguageExpressionDescriptionEClass.getESuperTypes().add(theEefPackage.getEEFWidgetDescription());
// Initialize classes, features, and operations; add parameters
initEClass(eefExtEditableReferenceDescriptionEClass, EEFExtEditableReferenceDescription.class, "EEFExtEditableReferenceDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -219,6 +239,8 @@ public class EefAdvancedControlsPackageImpl extends EPackageImpl implements EefA
initEClass(eefContainerBorderDescriptionEClass, EEFContainerBorderDescription.class, "EEFContainerBorderDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getEEFContainerBorderDescription_LabelExpression(), theEcorePackage.getEString(), "labelExpression", null, 0, 1, EEFContainerBorderDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(eefLanguageExpressionDescriptionEClass, EEFLanguageExpressionDescription.class, "EEFLanguageExpressionDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsAdapterFactory.java
index 90e30f1a1..34cc5fa91 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsAdapterFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsAdapterFactory.java
@@ -92,6 +92,10 @@ public class EefAdvancedControlsAdapterFactory extends AdapterFactoryImpl {
return createEEFContainerBorderDescriptionAdapter();
}
@Override
+ public Adapter caseEEFLanguageExpressionDescription(EEFLanguageExpressionDescription object) {
+ return createEEFLanguageExpressionDescriptionAdapter();
+ }
+ @Override
public Adapter caseEEFControlDescription(EEFControlDescription object) {
return createEEFControlDescriptionAdapter();
}
@@ -156,6 +160,20 @@ public class EefAdvancedControlsAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription <em>EEF Language Expression Description</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription
+ * @generated
+ */
+ public Adapter createEEFLanguageExpressionDescriptionAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.eef.EEFControlDescription <em>EEF Control Description</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsSwitch.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsSwitch.java
index 0306a12ee..e34decf05 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsSwitch.java
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/advanced/controls/util/EefAdvancedControlsSwitch.java
@@ -99,6 +99,14 @@ public class EefAdvancedControlsSwitch<T> extends Switch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case EefAdvancedControlsPackage.EEF_LANGUAGE_EXPRESSION_DESCRIPTION: {
+ EEFLanguageExpressionDescription eefLanguageExpressionDescription = (EEFLanguageExpressionDescription)theEObject;
+ T result = caseEEFLanguageExpressionDescription(eefLanguageExpressionDescription);
+ if (result == null) result = caseEEFWidgetDescription(eefLanguageExpressionDescription);
+ if (result == null) result = caseEEFControlDescription(eefLanguageExpressionDescription);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -134,6 +142,21 @@ public class EefAdvancedControlsSwitch<T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>EEF Language Expression Description</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EEF Language Expression Description</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEEFLanguageExpressionDescription(EEFLanguageExpressionDescription object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EEF Control Description</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/META-INF/MANIFEST.MF
index 36342c664..f29f9adc1 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/META-INF/MANIFEST.MF
@@ -15,7 +15,12 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.eef.common.ui;bundle-version="[2.0.0,3.0.0)",
org.eclipse.eef.core.ext.widgets.reference;bundle-version="[2.0.0,3.0.0)",
org.eclipse.emf.edit.ui;bundle-version="2.20.0",
- org.eclipse.ui.forms
+ org.eclipse.ui.forms,
+ org.eclipse.papyrus.uml.properties,
+ org.eclipse.papyrus.infra.widgets;bundle-version="4.1.0",
+ org.eclipse.papyrus.infra.properties.ui;bundle-version="4.1.0",
+ org.eclipse.core.databinding;bundle-version="1.10.100",
+ org.eclipse.uml2.uml
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls
Bundle-ActivationPolicy: lazy
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/plugin.xml b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/plugin.xml
index 533d31b46..28293a43b 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/plugin.xml
@@ -35,5 +35,14 @@
label="%containerBorderLifecycleManagerProvider.Name">
</descriptor>
</extension>
+ <extension
+ point="org.eclipse.eef.ide.ui.eefLifecycleManagerProvider">
+ <descriptor
+ class="org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls.languageexpression.internal.LanguageExpressionLifecycleManagerProvider"
+ description="description"
+ id="org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls.languageexpression.LanguageExpressionLifecycleManagerProvider"
+ label="label">
+ </descriptor>
+ </extension>
</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionController.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionController.java
new file mode 100644
index 000000000..816f615fb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionController.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls.languageexpression.internal;
+
+import org.eclipse.eef.core.api.EditingContextAdapter;
+import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription;
+import org.eclipse.sirius.common.interpreter.api.IInterpreter;
+import org.eclipse.sirius.common.interpreter.api.IVariableManager;
+
+/**
+ * The controller of the Language Expression widget is used to manage the
+ * behavior of the Language Expression Widget.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ *
+ */
+public class LanguageExpressionController extends AbstractEEFWidgetController {
+
+ /**
+ * The description of the language expression.
+ */
+ private EEFLanguageExpressionDescription description;
+
+ /**
+ * Constructor.
+ *
+ * @param description the description of the language expression.
+ * @param variableManager the variable manager which contain variables used by
+ * Interpreter to evaluate AQL expression
+ * @param interpreter the interpreter to evaluate AQL expressions
+ * @param contextAdapter the adapter used to modify model elements
+ */
+ public LanguageExpressionController(EEFLanguageExpressionDescription description, IVariableManager variableManager,
+ IInterpreter interpreter, EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
+ this.description = description;
+ }
+
+ @Override
+ protected EEFLanguageExpressionDescription getDescription() {
+ return this.description;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManager.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManager.java
new file mode 100644
index 000000000..fd89c6452
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManager.java
@@ -0,0 +1,848 @@
+/*******************************************************************************
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls.languageexpression.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
+import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
+import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
+import org.eclipse.eef.ide.ui.ext.widgets.reference.internal.EEFExtReferenceUIPlugin;
+import org.eclipse.eef.ide.ui.ext.widgets.reference.internal.Messages;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription;
+import org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls.Activator;
+import org.eclipse.papyrus.uml.properties.expression.ExpressionList.Expression;
+import org.eclipse.papyrus.uml.properties.modelelement.UMLModelElement;
+import org.eclipse.papyrus.uml.properties.preferences.LanguageRegistry;
+import org.eclipse.papyrus.uml.properties.widgets.DynamicBodyEditor;
+import org.eclipse.sirius.common.interpreter.api.IInterpreter;
+import org.eclipse.sirius.common.interpreter.api.IVariableManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.dialogs.ListDialog;
+import org.eclipse.uml2.uml.BodyOwner;
+
+/**
+ * This lifecycle manager is used to handle the Language Expression Widget for
+ * {@link org.eclipse.uml2.uml.BodyOwner} types.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ *
+ */
+@SuppressWarnings("restriction")
+public class LanguageExpressionLifecycleManager extends AbstractEEFWidgetLifecycleManager {
+
+ /**
+ * Index of an invalid selection in the table. This index is used to avoid
+ * selecting an item at the refresh of the table.
+ */
+ private static final int INVALID_SELECTION_INDEX = -1;
+
+ /**
+ * The tooltip text for the Edit button.
+ */
+ private static final String EDIT_BUTTON_TOOLTIP = "Edit the selected value"; //$NON-NLS-1$
+
+ /**
+ * The string used to initialize Bodies text.
+ */
+ private static final String DEFAULT_BODY_STRING = ""; //$NON-NLS-1$
+
+ /**
+ * The dialog message of the "Add Language Dialog" invoked when clicking the Add
+ * button.
+ */
+ private static final String ADD_LANGUAGE_DIALOG_MESSAGE = "Create a new Language"; //$NON-NLS-1$
+
+ /**
+ * The dialog title of the "Add Language Dialog" invoked when clicking the Add
+ * button.
+ */
+ private static final String ADD_LANGUAGE_DIALOG_TITLE = "New Language"; //$NON-NLS-1$
+
+ /**
+ * The dialog title of the "Browse Language Dialog" invoked when clicking the
+ * Browse button.
+ */
+ private static final String BROWSE_LANGUAGES_DIALOG_TITLE = "Language"; //$NON-NLS-1$
+
+ /**
+ * The dialog message of the "Edit Language Dialog" invoked when clicking the
+ * Edit button.
+ */
+ private static final String EDIT_LANGUAGE_DIALOG_MESSAGE = "Edit the value of the Language"; //$NON-NLS-1$
+
+ /**
+ * The dialog title of the "Edit Language Dialog" invoked when clicking the Edit
+ * button.
+ */
+ private static final String EDIT_LANGUAGE_DIALOG_TITLE = "Edit Language"; //$NON-NLS-1$
+
+ /**
+ * This enumeration is used for the direction of the up and down buttons.
+ */
+ private enum Direction {
+ /**
+ * Up.
+ */
+ UP,
+
+ /**
+ * Down.
+ */
+ DOWN
+ }
+
+ /**
+ * The composed adapter factory.
+ */
+ private ComposedAdapterFactory composedAdapterFactory;
+
+ /**
+ * The description of the language expression.
+ */
+ private EEFLanguageExpressionDescription description;
+ /**
+ * The widget controller.
+ */
+ private LanguageExpressionController controller;
+
+ /**
+ * The main composite which contains the table, buttons and text editor.
+ */
+ private Composite mainComposite;
+
+ /**
+ * The table displayed in the left part of the widget. It contains all the
+ * existing languages for the language feature.
+ */
+ private TableViewer tableViewer;
+
+ /**
+ * The dynamic text editor displayed in the right part of the widget. It
+ * displays property of the body feature according to the language selected in
+ * the table.
+ */
+ private DynamicBodyEditor bodyEditor;
+
+ /**
+ * The up button used to move the selected element up.
+ */
+ private Button upButton;
+
+ /**
+ * The down button used to move the selected element down.
+ */
+ private Button downButton;
+
+ /**
+ * The browse button used to add a new element to the list by browsing
+ * compatible values.
+ */
+ private Button browseButton;
+
+ /**
+ * The add button used to add a new element to the list.
+ */
+ private Button addButton;
+
+ /**
+ * The remove button used to delete the selected element in the list.
+ */
+ private Button removeButton;
+
+ /**
+ * The edit button used to edit the selected element in the list.
+ */
+ private Button editButton;
+
+ /**
+ * The listener for the up button.
+ */
+ private ButtonSelectionListener upButtonListener;
+
+ /**
+ * The listener for the down button.
+ */
+ private ButtonSelectionListener downButtonListener;
+
+ /**
+ * The listener for the browse button.
+ */
+ private ButtonSelectionListener browseButtonListener;
+
+ /**
+ * The listener for the add button.
+ */
+ private ButtonSelectionListener addButtonListener;
+
+ /**
+ * The listener for the remove button.
+ */
+ private ButtonSelectionListener removeButtonListener;
+
+ /**
+ * The listener for the edit button.
+ */
+ private ButtonSelectionListener editButtonListener;
+
+ /**
+ * The double click listener for the table viewer.
+ */
+ private IDoubleClickListener tableDoubleClickListener;
+
+ /**
+ * The selection listener for the table viewer.
+ */
+ private ISelectionChangedListener tableSelectionChangedListener;
+
+ /**
+ * The main object managed by the Widget.
+ */
+ private BodyOwner target;
+
+ /**
+ * The current Expression selected in the widget.
+ */
+ private Expression currentExpression;
+
+ /**
+ * The constructor.
+ *
+ * @param controlDescription the description of the language expression
+ * @param target the objet managed by the widget
+ * @param variableManager the variable manager which contain variables
+ * used by Interpreter to evaluate AQL expression
+ * @param interpreter the interpreter to evaluate AQL expressions
+ * @param editingContextAdapter the adapter used to modify model elements
+ */
+ public LanguageExpressionLifecycleManager(EEFLanguageExpressionDescription controlDescription, BodyOwner target,
+ IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter editingContextAdapter) {
+ super(variableManager, interpreter, editingContextAdapter);
+ this.description = controlDescription;
+ this.target = target;
+ }
+
+ @Override
+ protected void createMainControl(Composite parent, IEEFFormContainer formContainer) {
+ this.mainComposite = new Composite(parent, SWT.NONE);
+ GridLayout mainLayout = new GridLayout(2, false);
+ this.mainComposite.setLayout(mainLayout);
+ GridData mainLayoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ this.mainComposite.setLayoutData(mainLayoutData);
+
+ createLanguageEditor(mainComposite);
+ createBodyEditor(mainComposite);
+
+ this.controller = new LanguageExpressionController(description, variableManager, interpreter,
+ editingContextAdapter);
+ }
+
+ /**
+ * Creates the language editor, the left part of the widget which contains the
+ * table and the buttons.
+ *
+ * @param parent the parent composite
+ */
+ protected void createLanguageEditor(Composite parent) {
+ Composite languageEditorComposite = new Composite(parent, SWT.NONE);
+ GridLayout languageEditorLayout = new GridLayout(2, false);
+ languageEditorComposite.setLayout(languageEditorLayout);
+ GridData languageEditorlayoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ languageEditorComposite.setLayoutData(languageEditorlayoutData);
+
+ // Create the table
+ int style = SWT.READ_ONLY | SWT.VIRTUAL;
+ int selectionStyle = SWT.FULL_SELECTION | SWT.SINGLE;
+ int tableStyle = SWT.V_SCROLL | SWT.BORDER;
+ style = style | selectionStyle | tableStyle;
+ Table table = new Table(languageEditorComposite, style);
+ GridData tableGridData = new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1);
+ tableGridData.widthHint = 150;
+ table.setLayoutData(tableGridData);
+ this.tableViewer = new TableViewer(table);
+
+ this.composedAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ this.tableViewer.setContentProvider(ArrayContentProvider.getInstance());
+ this.tableViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(
+ new AdapterFactoryLabelProvider.StyledLabelProvider(this.composedAdapterFactory, this.tableViewer)));
+
+ this.tableViewer.setInput(getExpressionsList());
+ this.tableSelectionChangedListener = new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (tableViewer.getSelection() instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) tableViewer.getSelection();
+ Expression selectedExpression = (Expression) structuredSelection.getFirstElement();
+ if (selectedExpression != currentExpression) {
+ currentExpression = selectedExpression;
+ bodyEditor.display(selectedExpression);
+ }
+ }
+ setEnabled(isEnabled());
+ }
+ };
+ this.tableDoubleClickListener = new IDoubleClickListener() {
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ if (isEnabled()) {
+ editingContextAdapter.performModelChange(() -> {
+ editButtonCallback();
+ });
+ }
+ }
+ };
+ this.tableViewer.addSelectionChangedListener(tableSelectionChangedListener);
+ this.tableViewer.addDoubleClickListener(tableDoubleClickListener);
+
+ Composite buttonsComposite = this.createButtons(languageEditorComposite);
+ Point computedSize = buttonsComposite.computeSize(-1, -1);
+ tableGridData.heightHint = computedSize.y - table.getItemHeight();
+ }
+
+ /**
+ * Creates the buttons part which allows to manage languages from the table.
+ *
+ * @param parent the parent composite
+ * @return the created composite
+ */
+ protected Composite createButtons(Composite parent) {
+ Composite buttonsComposite = new Composite(parent, SWT.NONE);
+ GridLayout buttonCompositeGridLayout = new GridLayout(1, false);
+ buttonCompositeGridLayout.marginHeight = 0;
+ buttonsComposite.setLayout(buttonCompositeGridLayout);
+ GridData buttonCompositeGridData = new GridData(SWT.CENTER, SWT.CENTER, false, false);
+ buttonsComposite.setLayoutData(buttonCompositeGridData);
+
+ Image upImage = ExtendedImageRegistry.INSTANCE.getImage(
+ EEFExtReferenceUIPlugin.getPlugin().getImage(EEFExtReferenceUIPlugin.Implementation.UP_ICON_PATH));
+ Image downImage = ExtendedImageRegistry.INSTANCE.getImage(
+ EEFExtReferenceUIPlugin.getPlugin().getImage(EEFExtReferenceUIPlugin.Implementation.DOWN_ICON_PATH));
+ Image browseImage = ExtendedImageRegistry.INSTANCE.getImage(
+ EEFExtReferenceUIPlugin.getPlugin().getImage(EEFExtReferenceUIPlugin.Implementation.BROWSE_ICON_PATH));
+ Image addImage = ExtendedImageRegistry.INSTANCE.getImage(
+ EEFExtReferenceUIPlugin.getPlugin().getImage(EEFExtReferenceUIPlugin.Implementation.ADD_ICON_PATH));
+ Image removeImage = ExtendedImageRegistry.INSTANCE.getImage(
+ EEFExtReferenceUIPlugin.getPlugin().getImage(EEFExtReferenceUIPlugin.Implementation.REMOVE_ICON_PATH));
+ Image editImage = ExtendedImageRegistry.INSTANCE.getImage(Activator.getDefault().getImage(Activator.EDIT_ICON));
+
+ this.upButton = this.createButton(buttonsComposite, upImage);
+ this.downButton = this.createButton(buttonsComposite, downImage);
+ this.browseButton = this.createButton(buttonsComposite, browseImage);
+ this.addButton = this.createButton(buttonsComposite, addImage);
+ this.removeButton = this.createButton(buttonsComposite, removeImage);
+ this.editButton = this.createButton(buttonsComposite, editImage);
+
+ return buttonsComposite;
+ }
+
+ /**
+ * Creates the body editor, the right part of the widget which contains the text
+ * editor displayed when a language is selected in the table.
+ *
+ * @param parent the parent composite
+ */
+ protected void createBodyEditor(Composite parent) {
+ this.bodyEditor = new DynamicBodyEditor(parent, SWT.NONE);
+
+ GridLayout bodyEditorLayout = new GridLayout(1, false);
+ this.bodyEditor.setLayout(bodyEditorLayout);
+ GridData bodyEditorlayoutData = new GridData(SWT.FILL, SWT.FILL, true, false);
+ this.bodyEditor.setLayoutData(bodyEditorlayoutData);
+
+ this.bodyEditor.setContext(new UMLModelElement((EObject) this.target));
+
+ this.bodyEditor.addChangeListener(new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ String newValue = bodyEditor.getValue();
+ if (currentExpression != null) {
+ if (newValue == null || currentExpression.getBody().equals(newValue)) {
+ return;
+ }
+ editingContextAdapter.performModelChange(() -> {
+ target.getBodies().set(expressionIndex(currentExpression), newValue);
+ currentExpression.setBody(newValue);
+ });
+ }
+ }
+ });
+ }
+
+ /**
+ * Creates a button used to manage the language feature.
+ *
+ * @param parent the parent composite
+ * @param image the image of the button
+ * @return the created button
+ */
+ protected Button createButton(Composite parent, Image image) {
+ Button button = new Button(parent, SWT.NONE);
+ button.setImage(image);
+
+ GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ button.setLayoutData(gridData);
+
+ return button;
+ }
+
+ @Override
+ protected IEEFWidgetController getController() {
+ return this.controller;
+ }
+
+ @Override
+ protected EEFLanguageExpressionDescription getWidgetDescription() {
+ return this.description;
+ }
+
+ @Override
+ protected Control getValidationControl() {
+ return this.mainComposite;
+ }
+
+ /**
+ * Refreshes the widget. An item can be selected in the table if it is different
+ * from {@value #INVALID_SELECTION_INDEX}.
+ *
+ * @param selectionIndice the index of the item to select in the table
+ */
+ public void refresh(int selectionIndice) {
+ super.refresh();
+ this.tableViewer.setInput(getExpressionsList());
+ this.tableViewer.refresh();
+
+ this.controller.refresh();
+ List<Expression> expressionsList = this.getExpressionsList();
+ if (selectionIndice != INVALID_SELECTION_INDEX && selectionIndice < expressionsList.size()) {
+ Expression expression = expressionsList.get(selectionIndice);
+ this.tableViewer.setSelection(new StructuredSelection(expression), true);
+ } else {
+ tableViewer.setSelection(null);
+ }
+ }
+
+ @Override
+ public void aboutToBeShown() {
+ super.aboutToBeShown();
+
+ this.initializeMoveButton();
+ this.initializeBrowseButton();
+ this.initializeAddButton();
+ this.initializeRemoveButton();
+ this.initializeEditButton();
+ }
+
+ @Override
+ public void aboutToBeHidden() {
+ super.aboutToBeHidden();
+
+ if (this.tableViewer != null) {
+ this.tableViewer.removeSelectionChangedListener(this.tableSelectionChangedListener);
+ this.tableViewer.removeDoubleClickListener(this.tableDoubleClickListener);
+ }
+ this.removeListener(upButton, upButtonListener);
+ this.removeListener(downButton, downButtonListener);
+ this.removeListener(browseButton, browseButtonListener);
+ this.removeListener(addButton, addButtonListener);
+ this.removeListener(removeButton, removeButtonListener);
+ this.removeListener(editButton, editButtonListener);
+ }
+
+ @Override
+ protected void setEnabled(boolean isEnabled) {
+ Table table = this.tableViewer.getTable();
+ boolean manyItems = table.getItemCount() > 1;
+ TableItem[] selection = table.getSelection();
+ boolean elementIsSelected = selection != null && selection.length > 0;
+ if (this.addButton != null && !this.addButton.isDisposed()) {
+ this.addButton.setEnabled(isEnabled);
+ }
+ if (this.removeButton != null && !this.removeButton.isDisposed()) {
+ if (elementIsSelected) {
+ this.removeButton.setEnabled(isEnabled);
+ } else {
+ this.removeButton.setEnabled(false);
+ }
+ }
+ if (this.browseButton != null && !this.browseButton.isDisposed()) {
+ this.browseButton.setEnabled(isEnabled);
+ }
+ if (this.editButton != null && !this.editButton.isDisposed()) {
+ if (elementIsSelected) {
+ this.editButton.setEnabled(isEnabled);
+ } else {
+ this.editButton.setEnabled(false);
+ }
+ }
+ if (this.upButton != null && !this.upButton.isDisposed()) {
+ if (elementIsSelected) {
+ boolean isFirstItem = table.indexOf(selection[0]) <= 0;
+ if (manyItems && !isFirstItem) {
+ this.upButton.setEnabled(isEnabled);
+ } else {
+ this.upButton.setEnabled(false);
+ }
+ } else {
+ this.upButton.setEnabled(false);
+ }
+ }
+ if (this.downButton != null && !this.downButton.isDisposed()) {
+ if (elementIsSelected) {
+ boolean isLastItem = table.indexOf(selection[0]) >= table.getItemCount() - 1;
+ if (manyItems && !isLastItem) {
+ this.downButton.setEnabled(isEnabled);
+ } else {
+ this.downButton.setEnabled(false);
+ }
+ } else {
+ this.downButton.setEnabled(false);
+ }
+ }
+ }
+
+ /**
+ * Initializes the up and down buttons.
+ */
+ protected void initializeMoveButton() {
+ this.upButtonListener = new ButtonSelectionListener(this.editingContextAdapter,
+ () -> this.moveButtonCallback(Direction.UP));
+ this.upButton.addSelectionListener(this.upButtonListener);
+ this.upButton.setToolTipText(Messages.ReferenceUpButton_tooltipText);
+ this.downButtonListener = new ButtonSelectionListener(this.editingContextAdapter,
+ () -> this.moveButtonCallback(Direction.DOWN));
+ this.downButton.addSelectionListener(this.downButtonListener);
+ this.downButton.setToolTipText(Messages.ReferenceDownButton_tooltipText);
+ }
+
+ /**
+ * Initializes the browse button.
+ */
+ protected void initializeBrowseButton() {
+ this.browseButtonListener = new ButtonSelectionListener(this.editingContextAdapter,
+ () -> this.browseButtonCallback());
+ this.browseButton.addSelectionListener(this.browseButtonListener);
+ this.browseButton.setToolTipText(Messages.ReferenceBrowseButton_tooltipText);
+ }
+
+ /**
+ * Initializes the add button.
+ */
+ protected void initializeAddButton() {
+ this.addButtonListener = new ButtonSelectionListener(this.editingContextAdapter,
+ () -> this.addButtonCallback());
+ this.addButton.addSelectionListener(this.addButtonListener);
+ this.addButton.setToolTipText(Messages.ReferenceAddButton_tooltipText);
+ }
+
+ /**
+ * Initializes the remove button.
+ */
+ protected void initializeRemoveButton() {
+ this.removeButtonListener = new ButtonSelectionListener(this.editingContextAdapter,
+ () -> this.removeButtonCallback());
+ this.removeButton.addSelectionListener(this.removeButtonListener);
+ this.removeButton.setToolTipText(Messages.ReferenceRemoveButton_containmentTooltipText);
+ }
+
+ /**
+ * Initializes the edit button.
+ */
+ protected void initializeEditButton() {
+ this.editButtonListener = new ButtonSelectionListener(this.editingContextAdapter,
+ () -> this.editButtonCallback());
+ this.editButton.addSelectionListener(editButtonListener);
+ this.editButton.setToolTipText(EDIT_BUTTON_TOOLTIP);
+ }
+
+ /**
+ * This method is called once a move button is clicked in order to move the
+ * selected element up or down depending of the given direction.
+ *
+ * @param direction the direction of the button clicked, UP or DOWN
+ */
+ private void moveButtonCallback(Direction direction) {
+ List<Expression> selectedExpression = this.selectionToList(this.tableViewer.getSelection());
+
+ EList<String> languageList = this.target.getLanguages();
+ EList<String> bodyList = this.target.getBodies();
+ if (selectedExpression.size() == 1) {
+ int expressionIndex = expressionIndex(this.currentExpression);
+ int newExpressionIndex;
+ if (direction == Direction.UP) {
+ newExpressionIndex = Math.max(0, expressionIndex - 1);
+ } else {
+ newExpressionIndex = Math.min(languageList.size() - 1, expressionIndex + 1);
+ }
+ languageList.move(newExpressionIndex, expressionIndex);
+ bodyList.move(newExpressionIndex, expressionIndex);
+ this.refresh(newExpressionIndex);
+ }
+ }
+
+ /**
+ * This method is called once the browse button is clicked to select an existing
+ * language.
+ */
+ private void browseButtonCallback() {
+ ListDialog dialog = new ListDialog(Display.getCurrent().getActiveShell()) {
+ @Override
+ protected int getTableStyle() {
+ int style = SWT.READ_ONLY | SWT.VIRTUAL;
+ int selectionStyle = SWT.FULL_SELECTION | SWT.MULTI;
+ int tableStyle = SWT.V_SCROLL | SWT.BORDER;
+ return style | selectionStyle | tableStyle;
+ }
+ };
+ dialog.setTitle(BROWSE_LANGUAGES_DIALOG_TITLE);
+ dialog.setInput(LanguageRegistry.instance.getLanguages());
+ dialog.setContentProvider(ArrayContentProvider.getInstance());
+ dialog.setLabelProvider(new LabelProvider());
+ int indexToSelect = INVALID_SELECTION_INDEX;
+ if (dialog.open() == Window.OK) {
+ Object[] selectedItems = dialog.getResult();
+ List<String> addedItems = new ArrayList<>();
+ for (Object item : selectedItems) {
+ boolean alreadyExists = this.getExpressionsList().stream().anyMatch(e -> e.getLanguage().equals(item));
+ if (item instanceof String && !alreadyExists) {
+ String selectedLanguage = (String) item;
+ addedItems.add(selectedLanguage);
+ this.target.getLanguages().add(selectedLanguage);
+ this.target.getBodies().add(DEFAULT_BODY_STRING);
+ }
+ }
+ if (addedItems.size() > 0) {
+ Expression firstAddedExpression = this.getExpressionsList().stream()
+ .filter(e -> e.getLanguage().equals(addedItems.get(0))).findFirst().get();
+ indexToSelect = this.expressionIndex(firstAddedExpression);
+ }
+
+ } else {
+ throw new OperationCanceledException();
+ }
+ this.refresh(indexToSelect);
+ }
+
+ /**
+ * This method is called once the add button is clicked in order to open the
+ * "add language dialog".
+ */
+ private void addButtonCallback() {
+ InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), ADD_LANGUAGE_DIALOG_TITLE,
+ ADD_LANGUAGE_DIALOG_MESSAGE, null, null);
+ if (dialog.open() == Window.OK) {
+ String newLanguage = dialog.getValue();
+ List<Expression> expressionsList = this.getExpressionsList();
+ boolean alreadyExists = expressionsList.stream().anyMatch(e -> e.getLanguage().equals(newLanguage));
+ if (!alreadyExists) {
+ int indexToAdd = expressionsList.size();
+ this.target.getLanguages().add(newLanguage);
+ this.target.getBodies().add(DEFAULT_BODY_STRING);
+ this.refresh(indexToAdd);
+ }
+ } else {
+ throw new OperationCanceledException();
+ }
+ }
+
+ /**
+ * This method is called once the remove button is clicked in order to remove
+ * the selected element.
+ */
+ private void removeButtonCallback() {
+ List<Expression> selectedExpressions = this.selectionToList(this.tableViewer.getSelection());
+ for (Expression expression : selectedExpressions) {
+ int expressionIndex = expressionIndex(expression);
+ this.target.getLanguages().remove(expressionIndex);
+ this.target.getBodies().remove(expressionIndex);
+ }
+ this.refresh(INVALID_SELECTION_INDEX);
+ }
+
+ /**
+ * This method is called once the edit button is clicked in order to open the
+ * "edit language dialog".
+ */
+ private void editButtonCallback() {
+ List<Expression> selectedExpressions = this.selectionToList(this.tableViewer.getSelection());
+ if (!selectedExpressions.isEmpty()) {
+ InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), EDIT_LANGUAGE_DIALOG_TITLE,
+ EDIT_LANGUAGE_DIALOG_MESSAGE, this.currentExpression.getLanguage(), null);
+ if (dialog.open() == Window.OK) {
+ String newLanguage = dialog.getValue();
+ int expressionIndex = expressionIndex(this.currentExpression);
+ this.target.getLanguages().set(expressionIndex, newLanguage);
+ this.refresh(expressionIndex);
+ } else {
+ throw new OperationCanceledException();
+ }
+ }
+ }
+
+ /**
+ * Creates a list of Expressions to set the input of the table.
+ *
+ * @return the expressions list
+ */
+ private List<Expression> getExpressionsList() {
+ List<Expression> expressionsList = new ArrayList<>();
+ List<String> languageList = this.target.getLanguages();
+ List<String> bodyList = this.target.getBodies();
+ for (int i = 0; i < languageList.size(); i++) {
+ Expression e = new Expression();
+ e.setLanguage(languageList.get(i));
+ if (bodyList != null && i < bodyList.size()) {
+ e.setBody(bodyList.get(i));
+ } else {
+ e.setBody(DEFAULT_BODY_STRING);
+ this.editingContextAdapter.performModelChange(() -> {
+ bodyList.add(DEFAULT_BODY_STRING);
+ });
+ }
+ expressionsList.add(e);
+ }
+ return expressionsList;
+ }
+
+ /**
+ * Returns the index of the expression relative to the languages list in the
+ * feature language. Languages and Bodies (and Expressions) use the same order
+ * as displayed in the table.
+ *
+ * @param expression the expression to find
+ * @return the index of the expression
+ */
+ private int expressionIndex(Expression expression) {
+ return this.target.getLanguages().indexOf(expression.getLanguage());
+ }
+
+ /**
+ * Returns a list containing all the objects of the given selection.
+ *
+ * @param selection The selection
+ * @return The objects of the given selection
+ */
+ private List<Expression> selectionToList(ISelection selection) {
+ List<Expression> expressions = new ArrayList<>();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ for (Object selectedObject : structuredSelection.toArray()) {
+ if (selectedObject instanceof Expression) {
+ Expression selectedExpression = (Expression) selectedObject;
+ expressions.add(selectedExpression);
+ }
+ }
+ }
+ return expressions;
+ }
+
+ /**
+ * Removes the given listener from the given button.
+ *
+ * @param button The button
+ * @param listener The listener to remove
+ */
+ protected void removeListener(Button button, ButtonSelectionListener listener) {
+ if (button != null && !button.isDisposed()) {
+ button.removeSelectionListener(listener);
+ }
+ }
+
+ /**
+ * Copied from
+ * org.eclipse.eef.ide.ui.ext.widgets.reference.internal.AbstractEEFExtReferenceLifecycleManager.ButtonSelectionListener.
+ * Utility class used to encapsulate the selection listener.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+ protected static class ButtonSelectionListener implements SelectionListener {
+
+ /**
+ * The context adapter.
+ */
+ private EditingContextAdapter editingContextAdapter;
+
+ /**
+ * The behavior to execute when the button is clicked.
+ */
+ private Runnable runnable;
+
+ /**
+ * The constructor.
+ *
+ * @param editingContextAdapter The {@link EditingContextAdapter}
+ * @param runnable The behavior to execute when the button is
+ * clicked
+ */
+ public ButtonSelectionListener(EditingContextAdapter editingContextAdapter, Runnable runnable) {
+ this.editingContextAdapter = editingContextAdapter;
+ this.runnable = runnable;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ this.editingContextAdapter.performModelChange(this.runnable);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent event) {
+ this.editingContextAdapter.performModelChange(this.runnable);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManagerProvider.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManagerProvider.java
new file mode 100644
index 000000000..bdfc84ac0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/eef/ide/ui/advanced/controls/languageexpression/internal/LanguageExpressionLifecycleManagerProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.sirius.properties.eef.ide.ui.advanced.controls.languageexpression.internal;
+
+import org.eclipse.eef.EEFControlDescription;
+import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
+import org.eclipse.eef.ide.ui.api.widgets.IEEFLifecycleManager;
+import org.eclipse.eef.ide.ui.api.widgets.IEEFLifecycleManagerProvider;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EEFLanguageExpressionDescription;
+import org.eclipse.sirius.common.interpreter.api.IInterpreter;
+import org.eclipse.sirius.common.interpreter.api.IVariableManager;
+import org.eclipse.uml2.uml.BodyOwner;
+
+/**
+ * The lifecycle manager provider is used to create a lifecycle manager for the
+ * language expression widget.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ *
+ */
+public class LanguageExpressionLifecycleManagerProvider implements IEEFLifecycleManagerProvider {
+
+ @Override
+ public boolean canHandle(EEFControlDescription controlDescription) {
+ return controlDescription instanceof EEFLanguageExpressionDescription;
+ }
+
+ @Override
+ public IEEFLifecycleManager getLifecycleManager(EEFControlDescription controlDescription,
+ IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter editingContextAdapter) {
+ IEEFLifecycleManager lifecycleManager = null;
+ if (controlDescription instanceof EEFLanguageExpressionDescription) {
+ Object selfVariable = variableManager.getVariables().get(EEFExpressionUtils.SELF);
+ BodyOwner target = null;
+ if (selfVariable instanceof BodyOwner) {
+ target = (BodyOwner) selfVariable;
+ }
+ lifecycleManager = new LanguageExpressionLifecycleManager(
+ (EEFLanguageExpressionDescription) controlDescription, target, variableManager, interpreter,
+ editingContextAdapter);
+ }
+ return lifecycleManager;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.properties b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.properties
index 1142ed6eb..5380362ea 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.properties
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.properties
@@ -26,3 +26,8 @@ containerBordereDescriptionConverter.Label=Papyrus-Sirius ContainerBorder contro
containerBorderDescriptionPreprocessor.Description=This extension is used to process the definition of the ContainerBorder Override control.
containerBorderDescriptionPreprocessor.Label=Papyrus-Sirius ContainerBorder control Override Preprocessor
+languageExpressionDescriptionConverter.Description=This extension is used to convert the definition of the LanguageExpression Widget.
+languageExpressionDescriptionConverter.Label=Papyrus-Sirius LanguageExpression Widget Converter
+
+languageExpressionDescriptionPreprocessor.Description=This extension is used to process the definition of the LanguageExpression Override Widget.
+languageExpressionDescriptionPreprocessor.Label=Papyrus-Sirius LanguageExpression Widget Override Preprocessor
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.xml b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.xml
index 995083038..749d3607b 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/plugin.xml
@@ -53,4 +53,22 @@
label="%containerBorderDescriptionPreprocessor.Label">
</descriptor>
</extension>
+ <extension
+ point="org.eclipse.sirius.properties.core.descriptionConverter">
+ <descriptor
+ class="org.eclipse.papyrus.sirius.properties.ui.advanced.controls.internal.LanguageExpressionDescriptionConverter"
+ description="%languageExpressionDescriptionConverter.Description"
+ id="org.eclipse.papyrus.sirius.properties.ui.advanced.controls.descriptionConverter.languageexpression"
+ label="%languageExpressionDescriptionConverter.Label">
+ </descriptor>
+ </extension>
+ <extension
+ point="org.eclipse.sirius.properties.core.descriptionPreprocessor">
+ <descriptor
+ class="org.eclipse.papyrus.sirius.properties.ui.advanced.controls.internal.LanguageExpressionDescriptionPreprocessor"
+ description="%languageExpressionDescriptionPreprocessor.Description"
+ id="org.eclipse.papyrus.sirius.properties.ui.advanced.controls.descriptionPreprocessor.languageexpression"
+ label="%languageExpressionDescriptionPreprocessor.Label">
+ </descriptor>
+ </extension>
</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionConverter.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionConverter.java
new file mode 100644
index 000000000..731f5b184
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionConverter.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.sirius.properties.ui.advanced.controls.internal;
+
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EefAdvancedControlsFactory;
+import org.eclipse.papyrus.sirius.properties.eef.advanced.controls.EefAdvancedControlsPackage;
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription;
+import org.eclipse.sirius.properties.core.api.DefaultDescriptionWithInitialOperationConverter;
+
+/**
+ * This class is used to convert the Sirius language expression description into
+ * the EEF one.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ *
+ */
+public class LanguageExpressionDescriptionConverter
+ extends DefaultDescriptionWithInitialOperationConverter<LanguageExpressionDescription> {
+
+ /**
+ * Constructor.
+ */
+ public LanguageExpressionDescriptionConverter() {
+ super(LanguageExpressionDescription.class,
+ EefAdvancedControlsPackage.Literals.EEF_LANGUAGE_EXPRESSION_DESCRIPTION, null);
+ }
+
+ @Override
+ protected EFactory getEFactory() {
+ return EefAdvancedControlsFactory.eINSTANCE;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionPreprocessor.java b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionPreprocessor.java
new file mode 100644
index 000000000..0842e27a1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.ui.advanced.controls/src/org/eclipse/papyrus/sirius/properties/ui/advanced/controls/internal/LanguageExpressionDescriptionPreprocessor.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2022 CEA, Obeo
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.sirius.properties.ui.advanced.controls.internal;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.LanguageExpressionDescription;
+import org.eclipse.papyrus.sirius.properties.advanced.controls.propertiesadvancedcontrols.PropertiesAdvancedControlsPackage;
+import org.eclipse.sirius.properties.core.api.PreconfiguredPreprocessor;
+
+/**
+ * The preprocessor of the language expression used by Sirius to resolve
+ * inheritance and extension relations between property view descriptions.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ *
+ */
+public class LanguageExpressionDescriptionPreprocessor
+ extends PreconfiguredPreprocessor<LanguageExpressionDescription> {
+
+ /**
+ * Constructor.
+ */
+ public LanguageExpressionDescriptionPreprocessor() {
+ super(LanguageExpressionDescription.class,
+ PropertiesAdvancedControlsPackage.Literals.LANGUAGE_EXPRESSION_DESCRIPTION);
+ }
+
+ @Override
+ public boolean canHandle(EObject description) {
+ return description instanceof LanguageExpressionDescription;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.sirius.properties.uml/description/umlProperties.odesign b/plugins/uml/org.eclipse.papyrus.sirius.properties.uml/description/umlProperties.odesign
index 05f9aad51..9cb3a7b09 100644
--- a/plugins/uml/org.eclipse.papyrus.sirius.properties.uml/description/umlProperties.odesign
+++ b/plugins/uml/org.eclipse.papyrus.sirius.properties.uml/description/umlProperties.odesign
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:properties="http://www.eclipse.org/sirius/properties/1.0.0" xmlns:properties-ext-widgets-reference="http://www.eclipse.org/sirius/properties/1.0.0/ext/widgets/reference" xmlns:tool="http://www.eclipse.org/sirius/description/tool/1.1.0" documentation="Copyright (c) 2009, 2014, 2021-2022 Obeo, CEA LIST, Artal Technologies&#xD;&#xA;&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License 2.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;https://www.eclipse.org/legal/epl-2.0/&#xD;&#xA;&#xD;&#xA;SPDX-License-Identifier: EPL-2.0&#xD;&#xA;&#xD;&#xA;Contributors:&#xD;&#xA; Obeo - initial API and implementation&#xD;&#xA; Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - adaptation to integrate in Papyrus&#xD;&#xA; Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - adaptation to integrate in Papyrus" name="papyrus" version="12.0.0.2017041100">
+<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:properties="http://www.eclipse.org/sirius/properties/1.0.0" xmlns:properties-advanced-controls="http://www.eclipse.org/papyrus/sirius/properties/advanced/controls" xmlns:properties-ext-widgets-reference="http://www.eclipse.org/sirius/properties/1.0.0/ext/widgets/reference" xmlns:tool="http://www.eclipse.org/sirius/description/tool/1.1.0" documentation="Copyright (c) 2009, 2014, 2021-2022 Obeo, CEA LIST, Artal Technologies&#xD;&#xA;&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License 2.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;https://www.eclipse.org/legal/epl-2.0/&#xD;&#xA;&#xD;&#xA;SPDX-License-Identifier: EPL-2.0&#xD;&#xA;&#xD;&#xA;Contributors:&#xD;&#xA; Obeo - initial API and implementation&#xD;&#xA; Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - adaptation to integrate in Papyrus&#xD;&#xA; Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - adaptation to integrate in Papyrus" name="papyrus" version="12.0.0.2017041100">
<ownedViewpoints name="UmlProperties" modelFileExtension="uml">
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="EmptyDiagram" domainClass="uml::Model" preconditionExpression="aql:false" enablePopupBars="true">
<defaultLayer name="Default"/>
@@ -70,6 +70,13 @@
<widget xsi:type="properties-ext-widgets-reference:ExtReferenceDescription" name="sirius_default_rules_ereference" labelExpression="aql:input.emfEditServices(self).getText(eStructuralFeature)+':'" helpExpression="aql:input.emfEditServices(self).getDescription(eStructuralFeature)" referenceNameExpression="aql:eStructuralFeature.name"/>
</ifs>
</controls>
+ <controls xsi:type="properties-advanced-controls:ContainerBorderDescription">
+ <controls xsi:type="properties:DynamicMappingForDescription" name="sirius_default_rules_structural_features_for" iterator="eStructuralFeature" iterableExpression="aql:input.emfEditServices(self).getEStructuralFeatures()">
+ <ifs name="sirius_default_rules_ereference_if" predicateExpression="aql:eStructuralFeature.oclIsKindOf(ecore::EReference)">
+ <widget xsi:type="properties-advanced-controls:ExtEditableReferenceDescription" name="sirius_default_rules_ereference2" labelExpression="aql:input.emfEditServices(self).getText(eStructuralFeature)+':'" helpExpression="aql:input.emfEditServices(self).getDescription(eStructuralFeature)" referenceNameExpression="aql:eStructuralFeature.name"/>
+ </ifs>
+ </controls>
+ </controls>
</groups>
</categories>
</extensions>

Back to the top