diff options
| author | Mélanie Bats | 2016-04-14 07:56:52 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2016-04-27 09:15:26 +0000 |
| commit | 03a9bb95f6979e9f3227b008b695a55e7f763f46 (patch) | |
| tree | c375fa7949f7a180f203d098b3b6e07ee91f4fef | |
| parent | 91288f0904fb9b4958640e20ceebac37a7a0071c (diff) | |
| download | org.eclipse.sirius-03a9bb95f6979e9f3227b008b695a55e7f763f46.tar.gz org.eclipse.sirius-03a9bb95f6979e9f3227b008b695a55e7f763f46.tar.xz org.eclipse.sirius-03a9bb95f6979e9f3227b008b695a55e7f763f46.zip | |
[482528] Support for an enabled option on the widgets
Bug: 482528
Change-Id: If185cd5e54cac4f0c7410779d4d7cb85ea8f5bd3
Signed-off-by: Mélanie Bats <melanie.bats@obeo.fr>
12 files changed, 416 insertions, 1 deletions
diff --git a/incubation/org.eclipse.sirius.editor.properties/plugin.xml b/incubation/org.eclipse.sirius.editor.properties/plugin.xml index fb60eaa046..a62b276833 100644 --- a/incubation/org.eclipse.sirius.editor.properties/plugin.xml +++ b/incubation/org.eclipse.sirius.editor.properties/plugin.xml @@ -304,6 +304,14 @@ <input type="org.eclipse.sirius.properties.TextDescription"/> </propertySection> <propertySection + class="org.eclipse.sirius.properties.editor.properties.sections.properties.widgetdescription.WidgetDescriptionIsEnabledExpressionPropertySection" + id="properties.section.widgetDescription.IsEnabledExpression" + filter="org.eclipse.sirius.properties.editor.properties.filters.properties.widgetdescription.WidgetDescriptionIsEnabledExpressionFilter" + afterSection="properties.section.widgetDescription.HelpExpression" + tab="viewpoint.tab.general"> + <input type="org.eclipse.sirius.properties.WidgetDescription"/> + </propertySection> + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.widgetdescription.WidgetDescriptionHelpExpressionPropertySection" id="properties.section.widgetDescription.HelpExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.widgetdescription.WidgetDescriptionHelpExpressionFilter" diff --git a/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/widgetdescription/WidgetDescriptionIsEnabledExpressionFilter.java b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/widgetdescription/WidgetDescriptionIsEnabledExpressionFilter.java new file mode 100644 index 0000000000..326583f50f --- /dev/null +++ b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/widgetdescription/WidgetDescriptionIsEnabledExpressionFilter.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.widgetdescription; + +// 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 isEnabledExpression property section. + */ +public class WidgetDescriptionIsEnabledExpressionFilter extends ViewpointPropertyFilter { + + /** + * {@inheritDoc} + */ + @Override + protected EStructuralFeature getFeature() { + return PropertiesPackage.eINSTANCE.getWidgetDescription_IsEnabledExpression(); + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean isRightInputType(Object arg0) { + return arg0 instanceof org.eclipse.sirius.properties.WidgetDescription; + } + + // 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/widgetdescription/WidgetDescriptionIsEnabledExpressionPropertySection.java b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/widgetdescription/WidgetDescriptionIsEnabledExpressionPropertySection.java new file mode 100644 index 0000000000..87fddfa665 --- /dev/null +++ b/incubation/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/widgetdescription/WidgetDescriptionIsEnabledExpressionPropertySection.java @@ -0,0 +1,120 @@ +/******************************************************************************* + * 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.widgetdescription; + +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 isEnabledExpression property of a WidgetDescription object. + */ +public class WidgetDescriptionIsEnabledExpressionPropertySection extends AbstractTextWithButtonPropertySection implements ContentProposalClient { + + /** + * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() + */ + @Override + protected String getDefaultLabelText() { + return "IsEnabledExpression"; //$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.getWidgetDescription_IsEnabledExpression(); + } + + /** + * @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(), WidgetDescriptionIsEnabledExpressionPropertySection.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 5296033f97..41a0774bf6 100644 --- a/incubation/org.eclipse.sirius.properties.edit/plugin.properties +++ b/incubation/org.eclipse.sirius.properties.edit/plugin.properties @@ -185,6 +185,7 @@ _UI_CustomWidgetConditionalStyle_type = Custom Widget Conditional Style _UI_CustomDescription_style_feature = Style _UI_CustomDescription_conditionalStyles_feature = Conditional Styles _UI_CustomWidgetConditionalStyle_style_feature = Style +_UI_WidgetDescription_isEnabledExpression_feature = Is Enabled Expression _UI_ControlDescription_type = Control Description _UI_GroupDescription_controls_feature = Controls _UI_ControlDescription_identifier_feature = Identifier diff --git a/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/WidgetDescriptionItemProvider.java b/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/WidgetDescriptionItemProvider.java index 0e040fe76a..a734a1612c 100644 --- a/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/WidgetDescriptionItemProvider.java +++ b/incubation/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/WidgetDescriptionItemProvider.java @@ -54,6 +54,7 @@ public class WidgetDescriptionItemProvider extends ControlDescriptionItemProvide addLabelExpressionPropertyDescriptor(object); addHelpExpressionPropertyDescriptor(object); + addIsEnabledExpressionPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -85,6 +86,19 @@ public class WidgetDescriptionItemProvider extends ControlDescriptionItemProvide } /** + * 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_WidgetDescription_isEnabledExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_WidgetDescription_isEnabledExpression_feature", "_UI_WidgetDescription_type"), + PropertiesPackage.Literals.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** * This returns the label text for the adapted class. <!-- begin-user-doc * --> <!-- end-user-doc --> * @@ -111,6 +125,7 @@ public class WidgetDescriptionItemProvider extends ControlDescriptionItemProvide switch (notification.getFeatureID(WidgetDescription.class)) { case PropertiesPackage.WIDGET_DESCRIPTION__LABEL_EXPRESSION: case PropertiesPackage.WIDGET_DESCRIPTION__HELP_EXPRESSION: + case PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } diff --git a/incubation/org.eclipse.sirius.properties/model/properties.ecore b/incubation/org.eclipse.sirius.properties/model/properties.ecore index 6a7090ad55..e7ce8c2c49 100644 --- a/incubation/org.eclipse.sirius.properties/model/properties.ecore +++ b/incubation/org.eclipse.sirius.properties/model/properties.ecore @@ -83,6 +83,7 @@ <eClassifiers xsi:type="ecore:EClass" name="WidgetDescription" abstract="true" eSuperTypes="#//ControlDescription"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="labelExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="helpExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="isEnabledExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="TextDescription" eSuperTypes="#//WidgetDescription"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> diff --git a/incubation/org.eclipse.sirius.properties/model/properties.genmodel b/incubation/org.eclipse.sirius.properties/model/properties.genmodel index cc4bc6adaf..fe18030474 100644 --- a/incubation/org.eclipse.sirius.properties/model/properties.genmodel +++ b/incubation/org.eclipse.sirius.properties/model/properties.genmodel @@ -69,6 +69,7 @@ <genClasses image="false" ecoreClass="properties.ecore#//WidgetDescription"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//WidgetDescription/labelExpression"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//WidgetDescription/helpExpression"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//WidgetDescription/isEnabledExpression"/> </genClasses> <genClasses ecoreClass="properties.ecore#//TextDescription"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//TextDescription/valueExpression"/> 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 66de9c5d7e..5a78841cfa 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 @@ -656,13 +656,22 @@ public interface PropertiesPackage extends EPackage { int WIDGET_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.CONTROL_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 WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.CONTROL_DESCRIPTION_FEATURE_COUNT + 2; + + /** * The number of structural features of the '<em>Widget Description</em>' * class. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated * @ordered */ - int WIDGET_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.CONTROL_DESCRIPTION_FEATURE_COUNT + 2; + int WIDGET_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.CONTROL_DESCRIPTION_FEATURE_COUNT + 3; /** * The meta object id for the ' @@ -704,6 +713,15 @@ public interface PropertiesPackage extends EPackage { int TEXT_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 TEXT_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -788,6 +806,15 @@ public interface PropertiesPackage extends EPackage { int BUTTON_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 BUTTON_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Button Label Expression</b></em>' * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> * @@ -872,6 +899,15 @@ public interface PropertiesPackage extends EPackage { int LABEL_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 LABEL_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Body Expression</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -947,6 +983,15 @@ public interface PropertiesPackage extends EPackage { int CHECKBOX_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 CHECKBOX_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -1031,6 +1076,15 @@ public interface PropertiesPackage extends EPackage { int SELECT_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 SELECT_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -1229,6 +1283,15 @@ public interface PropertiesPackage extends EPackage { int TEXT_AREA_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.TEXT_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 TEXT_AREA_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.TEXT_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -1322,6 +1385,15 @@ public interface PropertiesPackage extends EPackage { int RADIO_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 RADIO_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Value Expression</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -1433,6 +1505,15 @@ public interface PropertiesPackage extends EPackage { int REFERENCE_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 REFERENCE_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Multiple</b></em>' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * @@ -1574,6 +1655,15 @@ public interface PropertiesPackage extends EPackage { int CUSTOM_DESCRIPTION__HELP_EXPRESSION = PropertiesPackage.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 CUSTOM_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION; + + /** * The feature id for the '<em><b>Custom Expressions</b></em>' containment * reference list. <!-- begin-user-doc --> <!-- end-user-doc --> * @@ -3315,6 +3405,20 @@ public interface PropertiesPackage extends EPackage { EAttribute getWidgetDescription_HelpExpression(); /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.sirius.properties.WidgetDescription#getIsEnabledExpression + * <em>Is Enabled Expression</em>}'. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @return the meta object for the attribute '<em>Is Enabled Expression</em> + * '. + * @see org.eclipse.sirius.properties.WidgetDescription#getIsEnabledExpression() + * @see #getWidgetDescription() + * @generated + */ + EAttribute getWidgetDescription_IsEnabledExpression(); + + /** * Returns the meta object for class ' * {@link org.eclipse.sirius.properties.TextDescription * <em>Text Description</em>}'. <!-- begin-user-doc --> <!-- end-user-doc @@ -5142,6 +5246,15 @@ public interface PropertiesPackage extends EPackage { /** * The meta object literal for the ' + * <em><b>Is Enabled Expression</b></em>' attribute feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EAttribute WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION = PropertiesPackage.eINSTANCE.getWidgetDescription_IsEnabledExpression(); + + /** + * The meta object literal for the ' * {@link org.eclipse.sirius.properties.impl.TextDescriptionImpl * <em>Text Description</em>}' class. <!-- begin-user-doc --> <!-- * end-user-doc --> diff --git a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/WidgetDescription.java b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/WidgetDescription.java index 760262d851..15926f99a0 100644 --- a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/WidgetDescription.java +++ b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/WidgetDescription.java @@ -23,6 +23,9 @@ package org.eclipse.sirius.properties; * <em>Label Expression</em>}</li> * <li>{@link org.eclipse.sirius.properties.WidgetDescription#getHelpExpression * <em>Help Expression</em>}</li> + * <li> + * {@link org.eclipse.sirius.properties.WidgetDescription#getIsEnabledExpression + * <em>Is Enabled Expression</em>}</li> * </ul> * * @see org.eclipse.sirius.properties.PropertiesPackage#getWidgetDescription() @@ -92,4 +95,36 @@ public interface WidgetDescription extends ControlDescription { */ void setHelpExpression(String value); + /** + * Returns the value of the '<em><b>Is Enabled Expression</b></em>' + * attribute. <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Is Enabled 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>Is Enabled Expression</em>' attribute. + * @see #setIsEnabledExpression(String) + * @see org.eclipse.sirius.properties.PropertiesPackage#getWidgetDescription_IsEnabledExpression() + * @model dataType= + * "org.eclipse.sirius.viewpoint.description.InterpretedExpression" + * @generated + */ + String getIsEnabledExpression(); + + /** + * Sets the value of the ' + * {@link org.eclipse.sirius.properties.WidgetDescription#getIsEnabledExpression + * <em>Is Enabled Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @param value + * the new value of the '<em>Is Enabled Expression</em>' + * attribute. + * @see #getIsEnabledExpression() + * @generated + */ + void setIsEnabledExpression(String value); + } // WidgetDescription 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 10ab83f4ed..b965640ce7 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 @@ -894,6 +894,16 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac * @generated */ @Override + public EAttribute getWidgetDescription_IsEnabledExpression() { + return (EAttribute) widgetDescriptionEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public EClass getTextDescription() { return textDescriptionEClass; } @@ -2072,6 +2082,7 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac widgetDescriptionEClass = createEClass(PropertiesPackage.WIDGET_DESCRIPTION); createEAttribute(widgetDescriptionEClass, PropertiesPackage.WIDGET_DESCRIPTION__LABEL_EXPRESSION); createEAttribute(widgetDescriptionEClass, PropertiesPackage.WIDGET_DESCRIPTION__HELP_EXPRESSION); + createEAttribute(widgetDescriptionEClass, PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION); textDescriptionEClass = createEClass(PropertiesPackage.TEXT_DESCRIPTION); createEAttribute(textDescriptionEClass, PropertiesPackage.TEXT_DESCRIPTION__VALUE_EXPRESSION); @@ -2395,6 +2406,9 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); initEAttribute(getWidgetDescription_HelpExpression(), theDescriptionPackage.getInterpretedExpression(), "helpExpression", null, 0, 1, WidgetDescription.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); + initEAttribute(getWidgetDescription_IsEnabledExpression(), theDescriptionPackage.getInterpretedExpression(), "isEnabledExpression", null, 0, 1, WidgetDescription.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(textDescriptionEClass, TextDescription.class, "TextDescription", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); initEAttribute(getTextDescription_ValueExpression(), theDescriptionPackage.getInterpretedExpression(), "valueExpression", null, 0, 1, TextDescription.class, !EPackageImpl.IS_TRANSIENT, diff --git a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/WidgetDescriptionImpl.java b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/WidgetDescriptionImpl.java index 78083a7729..c0daf7278f 100644 --- a/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/WidgetDescriptionImpl.java +++ b/incubation/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/WidgetDescriptionImpl.java @@ -30,6 +30,9 @@ import org.eclipse.sirius.properties.WidgetDescription; * <li> * {@link org.eclipse.sirius.properties.impl.WidgetDescriptionImpl#getHelpExpression * <em>Help Expression</em>}</li> + * <li> + * {@link org.eclipse.sirius.properties.impl.WidgetDescriptionImpl#getIsEnabledExpression + * <em>Is Enabled Expression</em>}</li> * </ul> * * @generated @@ -80,6 +83,28 @@ public abstract class WidgetDescriptionImpl extends ControlDescriptionImpl imple protected String helpExpression = WidgetDescriptionImpl.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 = WidgetDescriptionImpl.IS_ENABLED_EXPRESSION_EDEFAULT; + + /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated @@ -152,12 +177,38 @@ public abstract class WidgetDescriptionImpl extends ControlDescriptionImpl imple * @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, PropertiesPackage.WIDGET_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 PropertiesPackage.WIDGET_DESCRIPTION__LABEL_EXPRESSION: return getLabelExpression(); case PropertiesPackage.WIDGET_DESCRIPTION__HELP_EXPRESSION: return getHelpExpression(); + case PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION: + return getIsEnabledExpression(); } return super.eGet(featureID, resolve, coreType); } @@ -176,6 +227,9 @@ public abstract class WidgetDescriptionImpl extends ControlDescriptionImpl imple case PropertiesPackage.WIDGET_DESCRIPTION__HELP_EXPRESSION: setHelpExpression((String) newValue); return; + case PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION: + setIsEnabledExpression((String) newValue); + return; } super.eSet(featureID, newValue); } @@ -194,6 +248,9 @@ public abstract class WidgetDescriptionImpl extends ControlDescriptionImpl imple case PropertiesPackage.WIDGET_DESCRIPTION__HELP_EXPRESSION: setHelpExpression(WidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT); return; + case PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION: + setIsEnabledExpression(WidgetDescriptionImpl.IS_ENABLED_EXPRESSION_EDEFAULT); + return; } super.eUnset(featureID); } @@ -210,6 +267,8 @@ public abstract class WidgetDescriptionImpl extends ControlDescriptionImpl imple return WidgetDescriptionImpl.LABEL_EXPRESSION_EDEFAULT == null ? labelExpression != null : !WidgetDescriptionImpl.LABEL_EXPRESSION_EDEFAULT.equals(labelExpression); case PropertiesPackage.WIDGET_DESCRIPTION__HELP_EXPRESSION: return WidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT == null ? helpExpression != null : !WidgetDescriptionImpl.HELP_EXPRESSION_EDEFAULT.equals(helpExpression); + case PropertiesPackage.WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION: + return WidgetDescriptionImpl.IS_ENABLED_EXPRESSION_EDEFAULT == null ? isEnabledExpression != null : !WidgetDescriptionImpl.IS_ENABLED_EXPRESSION_EDEFAULT.equals(isEnabledExpression); } return super.eIsSet(featureID); } @@ -230,6 +289,8 @@ public abstract class WidgetDescriptionImpl extends ControlDescriptionImpl imple result.append(labelExpression); result.append(", helpExpression: "); result.append(helpExpression); + result.append(", isEnabledExpression: "); + result.append(isEnabledExpression); result.append(')'); return result.toString(); } 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 b820380fcb..aa34b38082 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 @@ -415,6 +415,7 @@ public class ViewDescriptionConverter { if (description != null) { description.setHelpExpression(widgetDescription.getHelpExpression()); description.setLabelExpression(widgetDescription.getLabelExpression()); + description.setIsEnabledExpression(widgetDescription.getIsEnabledExpression()); this.widget2eefWidget.put(widgetDescription, description); } |
