Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Bégaudeau2016-02-18 16:17:20 +0000
committerPierre-Charles David2016-02-19 08:44:10 +0000
commit26b822a558d405e542d4b7e40eca0500daf8908a (patch)
tree8180372d7fcbe1a973f9dd6052fa91091a9c7a8f
parenta37147db68ae3003c9d379b2411dad96244d9d12 (diff)
downloadorg.eclipse.sirius-26b822a558d405e542d4b7e40eca0500daf8908a.tar.gz
org.eclipse.sirius-26b822a558d405e542d4b7e40eca0500daf8908a.tar.xz
org.eclipse.sirius-26b822a558d405e542d4b7e40eca0500daf8908a.zip
[482528] Update the API of the label to add a body expression
Bug: 482528 Change-Id: I12b2ef6716bea1810c805661db024d2d9e6197ab Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
-rw-r--r--incubation/org.eclipse.sirius.editor.properties/plugin.xml7
-rw-r--r--incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionBodyExpressionFilter.java45
-rw-r--r--incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionBodyExpressionPropertySection.java122
-rw-r--r--incubation/org.eclipse.sirius.properties.edit/plugin.properties1
-rw-r--r--incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java23
-rw-r--r--incubation/org.eclipse.sirius.properties/model/properties.ecore4
-rw-r--r--incubation/org.eclipse.sirius.properties/model/properties.genmodel4
-rw-r--r--incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java42
-rw-r--r--incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java31
-rw-r--r--incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java130
-rw-r--r--incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java13
-rw-r--r--incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/tabprovider/ViewDescriptionConverter.java1
12 files changed, 418 insertions, 5 deletions
diff --git a/incubation/org.eclipse.sirius.editor.properties/plugin.xml b/incubation/org.eclipse.sirius.editor.properties/plugin.xml
index a14e0d29a8..79537758c7 100644
--- a/incubation/org.eclipse.sirius.editor.properties/plugin.xml
+++ b/incubation/org.eclipse.sirius.editor.properties/plugin.xml
@@ -101,6 +101,13 @@
<input type="org.eclipse.sirius.properties.CheckboxDescription"/>
</propertySection>
<propertySection
+ class="org.eclipse.sirius.properties.editor.properties.sections.properties.labeldescription.LabelDescriptionBodyExpressionPropertySection"
+ id="properties.section.labelDescription.BodyExpression"
+ filter="org.eclipse.sirius.properties.editor.properties.filters.properties.labeldescription.LabelDescriptionBodyExpressionFilter"
+ tab="viewpoint.tab.general">
+ <input type="org.eclipse.sirius.properties.LabelDescription"/>
+ </propertySection>
+ <propertySection
class="org.eclipse.sirius.properties.editor.properties.sections.properties.buttondescription.ButtonDescriptionButtonLabelExpressionPropertySection"
id="properties.section.buttonDescription.ButtonLabelExpression"
filter="org.eclipse.sirius.properties.editor.properties.filters.properties.buttondescription.ButtonDescriptionButtonLabelExpressionFilter"
diff --git a/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionBodyExpressionFilter.java b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionBodyExpressionFilter.java
new file mode 100644
index 0000000000..e43d4137e1
--- /dev/null
+++ b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionBodyExpressionFilter.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.properties.editor.properties.filters.properties.labeldescription;
+
+// Start of user code specific imports
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.sirius.editor.properties.filters.common.ViewpointPropertyFilter;
+import org.eclipse.sirius.properties.PropertiesPackage;
+
+// End of user code specific imports
+
+/**
+ * A filter for the bodyExpression property section.
+ */
+public class LabelDescriptionBodyExpressionFilter extends ViewpointPropertyFilter {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected EStructuralFeature getFeature() {
+ return PropertiesPackage.eINSTANCE.getLabelDescription_BodyExpression();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isRightInputType(Object arg0) {
+ return arg0 instanceof org.eclipse.sirius.properties.LabelDescription;
+ }
+
+ // Start of user code user methods
+
+ // End of user code user methods
+
+}
diff --git a/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionBodyExpressionPropertySection.java b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionBodyExpressionPropertySection.java
new file mode 100644
index 0000000000..b3ff3c5369
--- /dev/null
+++ b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionBodyExpressionPropertySection.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.properties.editor.properties.sections.properties.labeldescription;
+
+// Start of user code imports
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.sirius.editor.editorPlugin.SiriusEditor;
+import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection;
+import org.eclipse.sirius.editor.tools.api.assist.TypeContentProposalProvider;
+import org.eclipse.sirius.editor.tools.internal.presentation.TextWithContentProposalDialog;
+import org.eclipse.sirius.properties.PropertiesPackage;
+import org.eclipse.sirius.ui.tools.api.assist.ContentProposalClient;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+// End of user code imports
+
+/**
+ * A section for the bodyExpression property of a LabelDescription object.
+ */
+public class LabelDescriptionBodyExpressionPropertySection extends AbstractTextWithButtonPropertySection implements ContentProposalClient {
+
+ /**
+ * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText()
+ */
+ @Override
+ protected String getDefaultLabelText() {
+ return "BodyExpression"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText()
+ */
+ @Override
+ protected String getLabelText() {
+ String labelText;
+ labelText = super.getLabelText() + ":"; //$NON-NLS-1$
+ // Start of user code get label text
+
+ // End of user code get label text
+ return labelText;
+ }
+
+ /**
+ * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature()
+ */
+ @Override
+ public EAttribute getFeature() {
+ return PropertiesPackage.eINSTANCE.getLabelDescription_BodyExpression();
+ }
+
+ /**
+ * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String)
+ */
+ @Override
+ protected Object getFeatureValue(String newText) {
+ return newText;
+ }
+
+ /**
+ * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String)
+ */
+ @Override
+ protected boolean isEqual(String newText) {
+ return getFeatureAsText().equals(newText);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
+ super.createControls(parent, tabbedPropertySheetPage);
+ /*
+ * We set the color as it's a InterpretedExpression
+ */
+ text.setBackground(SiriusEditor.getColorRegistry().get("yellow"));
+
+ TypeContentProposalProvider.bindPluginsCompletionProcessors(this, text);
+
+ // Start of user code create controls
+
+ // End of user code create controls
+
+ }
+
+ @Override
+ protected SelectionListener createButtonListener() {
+ return new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ TextWithContentProposalDialog dialog = new TextWithContentProposalDialog(composite.getShell(), LabelDescriptionBodyExpressionPropertySection.this, text.getText());
+ dialog.open();
+ text.setText(dialog.getResult());
+ handleTextModified();
+ }
+ };
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getPropertyDescription() {
+ return "";
+ }
+
+ // Start of user code user operations
+
+ // End of user code user operations
+}
diff --git a/incubation/org.eclipse.sirius.properties.edit/plugin.properties b/incubation/org.eclipse.sirius.properties.edit/plugin.properties
index 2f4bf8c342..a6257778d8 100644
--- a/incubation/org.eclipse.sirius.properties.edit/plugin.properties
+++ b/incubation/org.eclipse.sirius.properties.edit/plugin.properties
@@ -76,3 +76,4 @@ _UI_DynamicMappingIf_type = Dynamic Mapping If
_UI_DynamicMappingFor_ifs_feature = Ifs
_UI_DynamicMappingIf_predicateExpression_feature = Predicate Expression
_UI_DynamicMappingIf_widget_feature = Widget
+_UI_LabelDescription_bodyExpression_feature = Body Expression
diff --git a/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java b/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java
index 16fb255522..852820f07e 100644
--- a/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java
+++ b/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java
@@ -16,8 +16,12 @@ 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.sirius.properties.LabelDescription;
+import org.eclipse.sirius.properties.PropertiesPackage;
/**
* This is the item provider adapter for a
@@ -48,11 +52,24 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
+ addBodyExpressionPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
+ * This adds a property descriptor for the Body Expression feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addBodyExpressionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_LabelDescription_bodyExpression_feature"), getString("_UI_PropertyDescriptor_description", "_UI_LabelDescription_bodyExpression_feature", "_UI_LabelDescription_type"),
+ PropertiesPackage.Literals.LABEL_DESCRIPTION__BODY_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
* This returns LabelDescription.gif. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -86,6 +103,12 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
+
+ switch (notification.getFeatureID(LabelDescription.class)) {
+ case PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
super.notifyChanged(notification);
}
diff --git a/incubation/org.eclipse.sirius.properties/model/properties.ecore b/incubation/org.eclipse.sirius.properties/model/properties.ecore
index 60fce36669..e493d72567 100644
--- a/incubation/org.eclipse.sirius.properties/model/properties.ecore
+++ b/incubation/org.eclipse.sirius.properties/model/properties.ecore
@@ -60,7 +60,9 @@
eType="ecore:EClass ../../org.eclipse.sirius/model/viewpoint.ecore#//description/tool/InitialOperation"
containment="true"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="LabelDescription" eSuperTypes="#//WidgetDescription"/>
+ <eClassifiers xsi:type="ecore:EClass" name="LabelDescription" eSuperTypes="#//WidgetDescription">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="bodyExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CheckboxDescription" eSuperTypes="#//WidgetDescription">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="valueExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="initialOperation" lowerBound="1"
diff --git a/incubation/org.eclipse.sirius.properties/model/properties.genmodel b/incubation/org.eclipse.sirius.properties/model/properties.genmodel
index c6d618afa5..90e11f6246 100644
--- a/incubation/org.eclipse.sirius.properties/model/properties.genmodel
+++ b/incubation/org.eclipse.sirius.properties/model/properties.genmodel
@@ -52,7 +52,9 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//ButtonDescription/buttonLabelExpression"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//ButtonDescription/initialOperation"/>
</genClasses>
- <genClasses ecoreClass="properties.ecore#//LabelDescription"/>
+ <genClasses ecoreClass="properties.ecore#//LabelDescription">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//LabelDescription/bodyExpression"/>
+ </genClasses>
<genClasses ecoreClass="properties.ecore#//CheckboxDescription">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//CheckboxDescription/valueExpression"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//CheckboxDescription/initialOperation"/>
diff --git a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java
index c0a1f9e3c0..c960777f84 100644
--- a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java
+++ b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java
@@ -4,10 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
- *
+ *
*/
package org.eclipse.sirius.properties;
@@ -15,10 +15,48 @@ package org.eclipse.sirius.properties;
* <!-- begin-user-doc --> A representation of the model object '
* <em><b>Label Description</b></em>'. <!-- end-user-doc -->
*
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.sirius.properties.LabelDescription#getBodyExpression
+ * <em>Body Expression</em>}</li>
+ * </ul>
+ * </p>
*
* @see org.eclipse.sirius.properties.PropertiesPackage#getLabelDescription()
* @model
* @generated
*/
public interface LabelDescription extends WidgetDescription {
+
+ /**
+ * Returns the value of the '<em><b>Body Expression</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Body Expression</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Body Expression</em>' attribute.
+ * @see #setBodyExpression(String)
+ * @see org.eclipse.sirius.properties.PropertiesPackage#getLabelDescription_BodyExpression()
+ * @model dataType=
+ * "org.eclipse.sirius.viewpoint.description.InterpretedExpression"
+ * @generated
+ */
+ String getBodyExpression();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.sirius.properties.LabelDescription#getBodyExpression
+ * <em>Body Expression</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Body Expression</em>' attribute.
+ * @see #getBodyExpression()
+ * @generated
+ */
+ void setBodyExpression(String value);
} // LabelDescription
diff --git a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java
index 59e569fceb..39a4fe6f98 100644
--- a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java
+++ b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java
@@ -502,13 +502,22 @@ public interface PropertiesPackage extends EPackage {
int LABEL_DESCRIPTION__LABEL_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__LABEL_EXPRESSION;
/**
+ * The feature id for the '<em><b>Body Expression</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LABEL_DESCRIPTION__BODY_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 0;
+
+ /**
* The number of structural features of the '<em>Label Description</em>'
* class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- int LABEL_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 0;
+ int LABEL_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 1;
/**
* The meta object id for the '
@@ -1283,6 +1292,18 @@ public interface PropertiesPackage extends EPackage {
EClass getLabelDescription();
/**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.sirius.properties.LabelDescription#getBodyExpression
+ * <em>Body Expression</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Body Expression</em>'.
+ * @see org.eclipse.sirius.properties.LabelDescription#getBodyExpression()
+ * @see #getLabelDescription()
+ * @generated
+ */
+ EAttribute getLabelDescription_BodyExpression();
+
+ /**
* Returns the meta object for class '
* {@link org.eclipse.sirius.properties.CheckboxDescription
* <em>Checkbox Description</em>}'. <!-- begin-user-doc --> <!--
@@ -1892,6 +1913,14 @@ public interface PropertiesPackage extends EPackage {
EClass LABEL_DESCRIPTION = PropertiesPackage.eINSTANCE.getLabelDescription();
/**
+ * The meta object literal for the '<em><b>Body Expression</b></em>'
+ * attribute feature. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute LABEL_DESCRIPTION__BODY_EXPRESSION = PropertiesPackage.eINSTANCE.getLabelDescription_BodyExpression();
+
+ /**
* The meta object literal for the '
* {@link org.eclipse.sirius.properties.impl.CheckboxDescriptionImpl
* <em>Checkbox Description</em>}' class. <!-- begin-user-doc --> <!--
diff --git a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java
index a9a15dc360..ba6db55d82 100644
--- a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java
+++ b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java
@@ -11,7 +11,9 @@
*/
package org.eclipse.sirius.properties.impl;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.sirius.properties.LabelDescription;
import org.eclipse.sirius.properties.PropertiesPackage;
@@ -19,12 +21,40 @@ import org.eclipse.sirius.properties.PropertiesPackage;
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Label Description</b></em>'. <!-- end-user-doc -->
* <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.sirius.properties.impl.LabelDescriptionImpl#getBodyExpression
+ * <em>Body Expression</em>}</li>
+ * </ul>
* </p>
*
* @generated
*/
public class LabelDescriptionImpl extends WidgetDescriptionImpl implements LabelDescription {
/**
+ * The default value of the '{@link #getBodyExpression()
+ * <em>Body Expression</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getBodyExpression()
+ * @generated
+ * @ordered
+ */
+ protected static final String BODY_EXPRESSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getBodyExpression()
+ * <em>Body Expression</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getBodyExpression()
+ * @generated
+ * @ordered
+ */
+ protected String bodyExpression = LabelDescriptionImpl.BODY_EXPRESSION_EDEFAULT;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -43,4 +73,104 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label
return PropertiesPackage.Literals.LABEL_DESCRIPTION;
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getBodyExpression() {
+ return bodyExpression;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void setBodyExpression(String newBodyExpression) {
+ String oldBodyExpression = bodyExpression;
+ bodyExpression = newBodyExpression;
+ if (eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION, oldBodyExpression, bodyExpression));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION:
+ return getBodyExpression();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION:
+ setBodyExpression((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION:
+ setBodyExpression(LabelDescriptionImpl.BODY_EXPRESSION_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION:
+ return LabelDescriptionImpl.BODY_EXPRESSION_EDEFAULT == null ? bodyExpression != null : !LabelDescriptionImpl.BODY_EXPRESSION_EDEFAULT.equals(bodyExpression);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) {
+ return super.toString();
+ }
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (bodyExpression: ");
+ result.append(bodyExpression);
+ result.append(')');
+ return result.toString();
+ }
+
} // LabelDescriptionImpl
diff --git a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java
index 76b7ffaa2b..66033c55e7 100644
--- a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java
+++ b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java
@@ -547,6 +547,16 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac
* @generated
*/
@Override
+ public EAttribute getLabelDescription_BodyExpression() {
+ return (EAttribute) labelDescriptionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public EClass getCheckboxDescription() {
return checkboxDescriptionEClass;
}
@@ -832,6 +842,7 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac
createEReference(buttonDescriptionEClass, PropertiesPackage.BUTTON_DESCRIPTION__INITIAL_OPERATION);
labelDescriptionEClass = createEClass(PropertiesPackage.LABEL_DESCRIPTION);
+ createEAttribute(labelDescriptionEClass, PropertiesPackage.LABEL_DESCRIPTION__BODY_EXPRESSION);
checkboxDescriptionEClass = createEClass(PropertiesPackage.CHECKBOX_DESCRIPTION);
createEAttribute(checkboxDescriptionEClass, PropertiesPackage.CHECKBOX_DESCRIPTION__VALUE_EXPRESSION);
@@ -987,6 +998,8 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac
!EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED);
initEClass(labelDescriptionEClass, LabelDescription.class, "LabelDescription", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLabelDescription_BodyExpression(), theDescriptionPackage.getInterpretedExpression(), "bodyExpression", null, 0, 1, LabelDescription.class, !EPackageImpl.IS_TRANSIENT,
+ !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED);
initEClass(checkboxDescriptionEClass, CheckboxDescription.class, "CheckboxDescription", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getCheckboxDescription_ValueExpression(), theDescriptionPackage.getInterpretedExpression(), "valueExpression", null, 0, 1, CheckboxDescription.class,
diff --git a/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/tabprovider/ViewDescriptionConverter.java b/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/tabprovider/ViewDescriptionConverter.java
index 6cc1500ebc..aa4a8b3a62 100644
--- a/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/tabprovider/ViewDescriptionConverter.java
+++ b/incubation/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/tabprovider/ViewDescriptionConverter.java
@@ -192,6 +192,7 @@ public class ViewDescriptionConverter {
eefLabelDescription.setIdentifier(labelDescription.getIdentifier());
eefLabelDescription.setLabelExpression(labelDescription.getLabelExpression());
+ eefLabelDescription.setBodyExpression(labelDescription.getBodyExpression());
return eefLabelDescription;
}

Back to the top