diff options
| author | Stéphane Bégaudeau | 2016-09-01 08:23:54 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2016-09-14 14:57:25 +0000 |
| commit | 763e077d6c83471450631d0bf2fccfe0e5aa4e7d (patch) | |
| tree | 5a1f67f828e6570e78d4ec1156af91ba00964498 | |
| parent | 889a911d5aefff2042ebcd88c4955528d0b9dba8 (diff) | |
| download | org.eclipse.sirius-763e077d6c83471450631d0bf2fccfe0e5aa4e7d.tar.gz org.eclipse.sirius-763e077d6c83471450631d0bf2fccfe0e5aa4e7d.tar.xz org.eclipse.sirius-763e077d6c83471450631d0bf2fccfe0e5aa4e7d.zip | |
[500472] Add support for widget actions on label and hyperlink
Bug: 500472
Change-Id: I849f4a16eb68358591666cca2b396d4928a79d76
Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
20 files changed, 932 insertions, 35 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index e4dd070a0c..0efd8a76b0 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -142,18 +142,23 @@ </ul> <h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3> <ul> - <li>The rules concerning the layout of compartments have been changed/completed. You can have a look at the - <a href="specifier/diagrams/Diagrams.html#compartments_layout">dedicated chapter</a> in the specifier documentation for more details. + <li><span class="label label-success">Added</span> In the definition of the Properties view, hyperlink and label widgets can now have widget actions</li> + <li><span class="label label-success">Added</span> Hyperlink and label widgets now have a + <code>displayExpression</code>, if blank the result of the value expression will be used after a call to the method + <code>java.lang.Object#toString()</code>. </li> - <li>The extension point - <code>org.eclipse.sirius.diagram.ui.layoutDataManager</code> is deprecated. It is replaced by the new extension point - <code>org.eclipse.sirius.diagram.ui.formatDataManager</code>. The deprecated extension point will be removed in the next 5.0 Sirius major release. Several classes associated with this deprecated extension point are also deprecated (see Developer-Visible Changes for details). + <li><span class="label label-info">Modified</span> The rules concerning the layout of compartments have been changed/completed. You can have a look at the + <a href="specifier/diagrams/Diagrams.html#compartments_layout">dedicated chapter</a> in the specifier documentation for more details. </li> <li><span class="label label-info">Modified</span> The property <code>Domain Class Expression</code> in <code>DynamicMappingFor</code> elements (in properties views definitions) has been renamed into <code>Iterable Expression</code>. </li> + <li><span class="label label-warning">Deprecated</span> The extension point + <code>org.eclipse.sirius.diagram.ui.layoutDataManager</code> is deprecated. It is replaced by the new extension point + <code>org.eclipse.sirius.diagram.ui.formatDataManager</code>. The deprecated extension point will be removed in the next 5.0 Sirius major release. Several classes associated with this deprecated extension point are also deprecated (see Developer-Visible Changes for details). + </li> </ul> <h3 id="DeveloperVisibleChanges">Developer-Visible Changes</h3> <ul> diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index 68be592183..c9282293fb 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -21,9 +21,11 @@ If a viewpoint has been defined with a more recent version of Sirius than the o h3. Specifier-Visible Changes -* The rules concerning the layout of compartments have been changed/completed. You can have a look at the "dedicated chapter":specifier/diagrams/Diagrams.html#compartments_layout in the specifier documentation for more details. -* The extension point @org.eclipse.sirius.diagram.ui.layoutDataManager@ is deprecated. It is replaced by the new extension point @org.eclipse.sirius.diagram.ui.formatDataManager@. The deprecated extension point will be removed in the next 5.0 Sirius major release. Several classes associated with this deprecated extension point are also deprecated (see Developer-Visible Changes for details). +* <span class="label label-success">Added</span> In the definition of the Properties view, hyperlink and label widgets can now have widget actions +* <span class="label label-success">Added</span> Hyperlink and label widgets now have a @displayExpression@, if blank the result of the value expression will be used after a call to the method @java.lang.Object#toString()@. +* <span class="label label-info">Modified</span> The rules concerning the layout of compartments have been changed/completed. You can have a look at the "dedicated chapter":specifier/diagrams/Diagrams.html#compartments_layout in the specifier documentation for more details. * <span class="label label-info">Modified</span> The property @Domain Class Expression@ in @DynamicMappingFor@ elements (in properties views definitions) has been renamed into @Iterable Expression@. +* <span class="label label-warning">Deprecated</span> The extension point @org.eclipse.sirius.diagram.ui.layoutDataManager@ is deprecated. It is replaced by the new extension point @org.eclipse.sirius.diagram.ui.formatDataManager@. The deprecated extension point will be removed in the next 5.0 Sirius major release. Several classes associated with this deprecated extension point are also deprecated (see Developer-Visible Changes for details). h3. Developer-Visible Changes diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.html b/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.html index 539c4dece0..1815b7641e 100644 --- a/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.html +++ b/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.html @@ -567,7 +567,13 @@ <a href="#widgets">above</a> to determine the semantic elements for which a label should be created. It is evaluated in the context of the semantic target element. </p> <p>For labels, you must define the - <em>Value Expression</em> which is used to compute the text displayed in the description and should return a string. If the expression is not specified, the default value is the empty string. + <em>Value Expression</em> which is used to compute the text displayed in the description. The + <em>Value Expression</em> can return any kind of object but the result displayed will be the result of a call to + <em>java.lang.Object#toString()</em>. If you want to customize how the result will be displayed, you can return a String in the value expression or use the + <em>Display Expression</em>. The + <em>Display Expression</em> will have access to the result of the + <em>Value Expression</em> using the variable + <em>value</em> and it should return a String. If the expression is not specified, the default value is the empty string. </p> <h5 id="label_styles">Label styles</h5> <p>See the @@ -727,7 +733,13 @@ <a href="#widgets">above</a> to determine the semantic elements for which an hyperlink should be created. It is evaluated in the context of the semantic target element. </p> <p>For hyperlinks, you must define the - <em>Value Expression</em> which is used to compute the hyperlink displayed and should return a string. + <em>Value Expression</em> which is used to compute the hyperlink displayed. The + <em>Value Expression</em> can return any kind of object but the result displayed will be the result of a call to + <em>java.lang.Object#toString()</em>. If you want to customize how the result will be displayed, you can return a String in the value expression or use the + <em>Display Expression</em>. The + <em>Display Expression</em> will have access to the result of the + <em>Value Expression</em> using the variable named + <em>value</em> and it should return a String. </p> <h5 id="hyperlink_click_on_value">Click on value</h5> <p>To define the behavior of the hyperlinked when is clicked, you simply specify the behavior associated to the edition inside the diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.textile b/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.textile index 3aa6609939..d698f37c30 100644 --- a/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.textile +++ b/plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.textile @@ -209,7 +209,7 @@ Here is an example which shows two label widgets: The definition of a label follows the general rules described "above":#widgets to determine the semantic elements for which a label should be created. It is evaluated in the context of the semantic target element. -For labels, you must define the _Value Expression_ which is used to compute the text displayed in the description and should return a string. If the expression is not specified, the default value is the empty string. +For labels, you must define the _Value Expression_ which is used to compute the text displayed in the description. The _Value Expression_ can return any kind of object but the result displayed will be the result of a call to _java.lang.Object#toString()_. If you want to customize how the result will be displayed, you can return a String in the value expression or use the _Display Expression_. The _Display Expression_ will have access to the result of the _Value Expression_ using the variable _value_ and it should return a String. If the expression is not specified, the default value is the empty string. h5(#label_styles). Label styles @@ -298,7 +298,7 @@ A _Hyperlink Description_ is used to represent an *hyperlink* in a "group":#grou The definition of an hyperlink follows the general rules described "above":#widgets to determine the semantic elements for which an hyperlink should be created. It is evaluated in the context of the semantic target element. -For hyperlinks, you must define the _Value Expression_ which is used to compute the hyperlink displayed and should return a string. +For hyperlinks, you must define the _Value Expression_ which is used to compute the hyperlink displayed. The _Value Expression_ can return any kind of object but the result displayed will be the result of a call to _java.lang.Object#toString()_. If you want to customize how the result will be displayed, you can return a String in the value expression or use the _Display Expression_. The _Display Expression_ will have access to the result of the _Value Expression_ using the variable named _value_ and it should return a String. h5(#hyperlink_click_on_value). Click on value diff --git a/plugins/org.eclipse.sirius.editor.properties/plugin.xml b/plugins/org.eclipse.sirius.editor.properties/plugin.xml index a356233750..335c427928 100644 --- a/plugins/org.eclipse.sirius.editor.properties/plugin.xml +++ b/plugins/org.eclipse.sirius.editor.properties/plugin.xml @@ -234,6 +234,14 @@ <input type="org.eclipse.sirius.properties.WidgetStyle"/> </propertySection> <propertySection + class="org.eclipse.sirius.properties.editor.properties.sections.properties.hyperlinkdescription.HyperlinkDescriptionDisplayExpressionPropertySection" + id="properties.section.hyperlinkDescription.DisplayExpression" + filter="org.eclipse.sirius.properties.editor.properties.filters.properties.hyperlinkdescription.HyperlinkDescriptionDisplayExpressionFilter" + afterSection="properties.section.hyperlinkDescription.ValueExpression" + tab="viewpoint.tab.general"> + <input type="org.eclipse.sirius.properties.HyperlinkDescription"/> + </propertySection> + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.hyperlinkdescription.HyperlinkDescriptionValueExpressionPropertySection" id="properties.section.hyperlinkDescription.ValueExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.hyperlinkdescription.HyperlinkDescriptionValueExpressionFilter" @@ -376,6 +384,14 @@ <input type="org.eclipse.sirius.properties.CheckboxDescription"/> </propertySection> <propertySection + class="org.eclipse.sirius.properties.editor.properties.sections.properties.labeldescription.LabelDescriptionDisplayExpressionPropertySection" + id="properties.section.labelDescription.DisplayExpression" + filter="org.eclipse.sirius.properties.editor.properties.filters.properties.labeldescription.LabelDescriptionDisplayExpressionFilter" + afterSection="properties.section.labelDescription.ValueExpression" + tab="viewpoint.tab.general"> + <input type="org.eclipse.sirius.properties.LabelDescription"/> + </propertySection> + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.labeldescription.LabelDescriptionValueExpressionPropertySection" id="properties.section.labelDescription.ValueExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.labeldescription.LabelDescriptionValueExpressionFilter" @@ -448,8 +464,7 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.ControlDescription"/> </propertySection> - - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.groupdescription.GroupDescriptionIdentifierPropertySection" id="properties.section.groupDescription.Identifier" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.groupdescription.GroupDescriptionIdentifierFilter" @@ -464,7 +479,7 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.GroupDescription"/> </propertySection> - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.groupdescription.GroupDescriptionSemanticCandidateExpressionPropertySection" id="properties.section.groupDescription.SemanticCandidateExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.groupdescription.GroupDescriptionSemanticCandidateExpressionFilter" @@ -488,7 +503,6 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.GroupDescription"/> </propertySection> - <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.propertyvalidationrule.PropertyValidationRuleTargetsPropertySection" id="properties.section.propertyValidationRule.Targets" @@ -496,15 +510,14 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.PropertyValidationRule"/> </propertySection> - - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.pagedescription.PageDescriptionIdentifierPropertySection" id="properties.section.pageDescription.Identifier" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.pagedescription.PageDescriptionIdentifierFilter" tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.PageDescription"/> </propertySection> - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.pagedescription.PageDescriptionDomainClassPropertySection" id="properties.section.pageDescription.DomainClass" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.pagedescription.PageDescriptionDomainClassFilter" @@ -512,7 +525,7 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.PageDescription"/> </propertySection> - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.pagedescription.PageDescriptionSemanticCandidateExpressionPropertySection" id="properties.section.pageDescription.SemanticCandidateExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.pagedescription.PageDescriptionSemanticCandidateExpressionFilter" @@ -520,7 +533,7 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.PageDescription"/> </propertySection> - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.pagedescription.PageDescriptionPreconditionExpressionPropertySection" id="properties.section.pageDescription.PreconditionExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.pagedescription.PageDescriptionPreconditionExpressionFilter" @@ -528,7 +541,7 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.PageDescription"/> </propertySection> - <propertySection + <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.pagedescription.PageDescriptionLabelExpressionPropertySection" id="properties.section.pageDescription.LabelExpression" filter="org.eclipse.sirius.properties.editor.properties.filters.properties.pagedescription.PageDescriptionLabelExpressionFilter" @@ -544,7 +557,6 @@ tab="viewpoint.tab.general"> <input type="org.eclipse.sirius.properties.PageDescription"/> </propertySection> - <propertySection class="org.eclipse.sirius.properties.editor.properties.sections.properties.viewextensiondescription.ViewExtensionDescriptionMetamodelsPropertySection" id="properties.section.viewExtensionDescription.Metamodels" diff --git a/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/hyperlinkdescription/HyperlinkDescriptionDisplayExpressionFilter.java b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/hyperlinkdescription/HyperlinkDescriptionDisplayExpressionFilter.java new file mode 100644 index 0000000000..de0870bc76 --- /dev/null +++ b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/hyperlinkdescription/HyperlinkDescriptionDisplayExpressionFilter.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.hyperlinkdescription; + +// 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 displayExpression property section. + */ +public class HyperlinkDescriptionDisplayExpressionFilter extends ViewpointPropertyFilter { + + /** + * {@inheritDoc} + */ + @Override + protected EStructuralFeature getFeature() { + return PropertiesPackage.eINSTANCE.getHyperlinkDescription_DisplayExpression(); + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean isRightInputType(Object arg0) { + return arg0 instanceof org.eclipse.sirius.properties.HyperlinkDescription; + } + + // Start of user code user methods + + // End of user code user methods + +} diff --git a/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionDisplayExpressionFilter.java b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionDisplayExpressionFilter.java new file mode 100644 index 0000000000..6a90edef13 --- /dev/null +++ b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/filters/properties/labeldescription/LabelDescriptionDisplayExpressionFilter.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 displayExpression property section. + */ +public class LabelDescriptionDisplayExpressionFilter extends ViewpointPropertyFilter { + + /** + * {@inheritDoc} + */ + @Override + protected EStructuralFeature getFeature() { + return PropertiesPackage.eINSTANCE.getLabelDescription_DisplayExpression(); + } + + /** + * {@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/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/hyperlinkdescription/HyperlinkDescriptionDisplayExpressionPropertySection.java b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/hyperlinkdescription/HyperlinkDescriptionDisplayExpressionPropertySection.java new file mode 100644 index 0000000000..af769d0df6 --- /dev/null +++ b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/hyperlinkdescription/HyperlinkDescriptionDisplayExpressionPropertySection.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * 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.hyperlinkdescription; + +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 displayExpression property of a HyperlinkDescription + * object. + */ +public class HyperlinkDescriptionDisplayExpressionPropertySection extends AbstractTextWithButtonPropertySection implements ContentProposalClient { + + /** + * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() + */ + @Override + protected String getDefaultLabelText() { + return "DisplayExpression"; //$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.getHyperlinkDescription_DisplayExpression(); + } + + /** + * @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(), HyperlinkDescriptionDisplayExpressionPropertySection.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/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionDisplayExpressionPropertySection.java b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionDisplayExpressionPropertySection.java new file mode 100644 index 0000000000..5a36e36e3d --- /dev/null +++ b/plugins/org.eclipse.sirius.editor.properties/src-gen/org/eclipse/sirius/properties/editor/properties/sections/properties/labeldescription/LabelDescriptionDisplayExpressionPropertySection.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.labeldescription; + +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 displayExpression property of a LabelDescription object. + */ +public class LabelDescriptionDisplayExpressionPropertySection extends AbstractTextWithButtonPropertySection implements ContentProposalClient { + + /** + * @see org.eclipse.sirius.properties.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() + */ + @Override + protected String getDefaultLabelText() { + return "DisplayExpression"; //$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_DisplayExpression(); + } + + /** + * @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(), LabelDescriptionDisplayExpressionPropertySection.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/plugins/org.eclipse.sirius.properties.edit/plugin.properties b/plugins/org.eclipse.sirius.properties.edit/plugin.properties index bcffdde981..79dfdf8dc2 100644 --- a/plugins/org.eclipse.sirius.properties.edit/plugin.properties +++ b/plugins/org.eclipse.sirius.properties.edit/plugin.properties @@ -89,6 +89,8 @@ _UI_HyperlinkDescription_valueExpression_feature = Value Expression _UI_HyperlinkDescription_initialOperation_feature = Initial Operation _UI_HyperlinkDescription_style_feature = Style _UI_HyperlinkDescription_conditionalStyles_feature = Conditional Styles +_UI_HyperlinkDescription_actions_feature = Actions +_UI_HyperlinkDescription_displayExpression_feature = Display Expression _UI_OperationDescription_initialOperation_feature = Initial Operation _UI_PropertyValidationRule_type = Property Validation Rule _UI_PageDescription_validationSet_feature = Validation @@ -206,4 +208,5 @@ _UI_GroupConditionalStyle_type = Conditional Style _UI_GroupConditionalStyle_style_feature = Style _UI_GroupDescription_conditionalStyles_feature = Conditional Styles _UI_LabelDescription_valueExpression_feature = Value Expression - +_UI_LabelDescription_displayExpression_feature = Display Expression +_UI_LabelDescription_actions_feature = Actions diff --git a/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/HyperlinkDescriptionItemProvider.java b/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/HyperlinkDescriptionItemProvider.java index c06ed27423..11dbceec9c 100644 --- a/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/HyperlinkDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/HyperlinkDescriptionItemProvider.java @@ -57,6 +57,7 @@ public class HyperlinkDescriptionItemProvider extends WidgetDescriptionItemProvi super.getPropertyDescriptors(object); addValueExpressionPropertyDescriptor(object); + addDisplayExpressionPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -75,6 +76,19 @@ public class HyperlinkDescriptionItemProvider extends WidgetDescriptionItemProvi } /** + * This adds a property descriptor for the Display Expression feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected void addDisplayExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_HyperlinkDescription_displayExpression_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_HyperlinkDescription_displayExpression_feature", "_UI_HyperlinkDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** * This specifies how to implement {@link #getChildren} and is used to * deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, @@ -91,6 +105,7 @@ public class HyperlinkDescriptionItemProvider extends WidgetDescriptionItemProvi childrenFeatures.add(PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__INITIAL_OPERATION); childrenFeatures.add(PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__STYLE); childrenFeatures.add(PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES); + childrenFeatures.add(PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__ACTIONS); } return childrenFeatures; } @@ -147,11 +162,13 @@ public class HyperlinkDescriptionItemProvider extends WidgetDescriptionItemProvi switch (notification.getFeatureID(HyperlinkDescription.class)) { case PropertiesPackage.HYPERLINK_DESCRIPTION__VALUE_EXPRESSION: + case PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION: case PropertiesPackage.HYPERLINK_DESCRIPTION__STYLE: case PropertiesPackage.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES: + case PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -176,6 +193,8 @@ public class HyperlinkDescriptionItemProvider extends WidgetDescriptionItemProvi HyperlinkWidgetConditionalStyle conditionalStyle = PropertiesFactory.eINSTANCE.createHyperlinkWidgetConditionalStyle(); conditionalStyle.setStyle(PropertiesFactory.eINSTANCE.createHyperlinkWidgetStyle()); newChildDescriptors.add(createChildParameter(PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES, conditionalStyle)); + + newChildDescriptors.add(createChildParameter(PropertiesPackage.Literals.HYPERLINK_DESCRIPTION__ACTIONS, PropertiesFactory.eINSTANCE.createWidgetAction())); } } diff --git a/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java b/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java index a7c486e118..2a58653e5d 100644 --- a/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.properties.edit/src-gen/org/eclipse/sirius/properties/provider/LabelDescriptionItemProvider.java @@ -56,6 +56,7 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider super.getPropertyDescriptors(object); addValueExpressionPropertyDescriptor(object); + addDisplayExpressionPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -74,6 +75,19 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider } /** + * This adds a property descriptor for the Display Expression feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected void addDisplayExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_LabelDescription_displayExpression_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_LabelDescription_displayExpression_feature", "_UI_LabelDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + PropertiesPackage.Literals.LABEL_DESCRIPTION__DISPLAY_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** * This specifies how to implement {@link #getChildren} and is used to * deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, @@ -89,6 +103,7 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider super.getChildrenFeatures(object); childrenFeatures.add(PropertiesPackage.Literals.LABEL_DESCRIPTION__STYLE); childrenFeatures.add(PropertiesPackage.Literals.LABEL_DESCRIPTION__CONDITIONAL_STYLES); + childrenFeatures.add(PropertiesPackage.Literals.LABEL_DESCRIPTION__ACTIONS); } return childrenFeatures; } @@ -145,10 +160,12 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider switch (notification.getFeatureID(LabelDescription.class)) { case PropertiesPackage.LABEL_DESCRIPTION__VALUE_EXPRESSION: + case PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case PropertiesPackage.LABEL_DESCRIPTION__STYLE: case PropertiesPackage.LABEL_DESCRIPTION__CONDITIONAL_STYLES: + case PropertiesPackage.LABEL_DESCRIPTION__ACTIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } @@ -171,6 +188,8 @@ public class LabelDescriptionItemProvider extends WidgetDescriptionItemProvider LabelWidgetConditionalStyle conditionalStyle = PropertiesFactory.eINSTANCE.createLabelWidgetConditionalStyle(); conditionalStyle.setStyle(PropertiesFactory.eINSTANCE.createLabelWidgetStyle()); newChildDescriptors.add(createChildParameter(PropertiesPackage.Literals.LABEL_DESCRIPTION__CONDITIONAL_STYLES, conditionalStyle)); + + newChildDescriptors.add(createChildParameter(PropertiesPackage.Literals.LABEL_DESCRIPTION__ACTIONS, PropertiesFactory.eINSTANCE.createWidgetAction())); } } diff --git a/plugins/org.eclipse.sirius.properties/model/properties.ecore b/plugins/org.eclipse.sirius.properties/model/properties.ecore index a6b245d7d1..d8a5d63028 100644 --- a/plugins/org.eclipse.sirius.properties/model/properties.ecore +++ b/plugins/org.eclipse.sirius.properties/model/properties.ecore @@ -108,10 +108,13 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="LabelDescription" eSuperTypes="#//WidgetDescription"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="displayExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> <eStructuralFeatures xsi:type="ecore:EReference" name="style" eType="#//LabelWidgetStyle" containment="true"/> <eStructuralFeatures xsi:type="ecore:EReference" name="conditionalStyles" upperBound="-1" eType="#//LabelWidgetConditionalStyle" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="actions" upperBound="-1" + eType="#//WidgetAction" containment="true"/> </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"/> @@ -271,6 +274,7 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="HyperlinkDescription" eSuperTypes="#//WidgetDescription"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="displayExpression" eType="ecore:EDataType ../../org.eclipse.sirius/model/viewpoint.ecore#//description/InterpretedExpression"/> <eStructuralFeatures xsi:type="ecore:EReference" name="initialOperation" lowerBound="1" eType="ecore:EClass ../../org.eclipse.sirius/model/viewpoint.ecore#//description/tool/InitialOperation" containment="true"/> @@ -278,6 +282,8 @@ containment="true"/> <eStructuralFeatures xsi:type="ecore:EReference" name="conditionalStyles" upperBound="-1" eType="#//HyperlinkWidgetConditionalStyle" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="actions" upperBound="-1" + eType="#//WidgetAction" containment="true"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="WidgetStyle"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="labelFontNameExpression" diff --git a/plugins/org.eclipse.sirius.properties/model/properties.genmodel b/plugins/org.eclipse.sirius.properties/model/properties.genmodel index d4d7626267..4fcbfaa222 100644 --- a/plugins/org.eclipse.sirius.properties/model/properties.genmodel +++ b/plugins/org.eclipse.sirius.properties/model/properties.genmodel @@ -97,8 +97,10 @@ </genClasses> <genClasses ecoreClass="properties.ecore#//LabelDescription"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//LabelDescription/valueExpression"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//LabelDescription/displayExpression"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//LabelDescription/style"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//LabelDescription/conditionalStyles"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//LabelDescription/actions"/> </genClasses> <genClasses ecoreClass="properties.ecore#//CheckboxDescription"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//CheckboxDescription/valueExpression"/> @@ -163,9 +165,11 @@ </genClasses> <genClasses ecoreClass="properties.ecore#//HyperlinkDescription"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//HyperlinkDescription/valueExpression"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//HyperlinkDescription/displayExpression"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//HyperlinkDescription/initialOperation"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//HyperlinkDescription/style"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//HyperlinkDescription/conditionalStyles"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//HyperlinkDescription/actions"/> </genClasses> <genClasses ecoreClass="properties.ecore#//WidgetStyle"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//WidgetStyle/labelFontNameExpression"/> diff --git a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/HyperlinkDescription.java b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/HyperlinkDescription.java index 7f69056108..d0f12f6ea8 100644 --- a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/HyperlinkDescription.java +++ b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/HyperlinkDescription.java @@ -26,6 +26,9 @@ import org.eclipse.sirius.viewpoint.description.tool.InitialOperation; * {@link org.eclipse.sirius.properties.HyperlinkDescription#getValueExpression * <em>Value Expression</em>}</li> * <li> + * {@link org.eclipse.sirius.properties.HyperlinkDescription#getDisplayExpression + * <em>Display Expression</em>}</li> + * <li> * {@link org.eclipse.sirius.properties.HyperlinkDescription#getInitialOperation * <em>Initial Operation</em>}</li> * <li>{@link org.eclipse.sirius.properties.HyperlinkDescription#getStyle @@ -33,6 +36,8 @@ import org.eclipse.sirius.viewpoint.description.tool.InitialOperation; * <li> * {@link org.eclipse.sirius.properties.HyperlinkDescription#getConditionalStyles * <em>Conditional Styles</em>}</li> + * <li>{@link org.eclipse.sirius.properties.HyperlinkDescription#getActions + * <em>Actions</em>}</li> * </ul> * * @see org.eclipse.sirius.properties.PropertiesPackage#getHyperlinkDescription() @@ -72,6 +77,37 @@ public interface HyperlinkDescription extends WidgetDescription { void setValueExpression(String value); /** + * Returns the value of the '<em><b>Display Expression</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Display 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>Display Expression</em>' attribute. + * @see #setDisplayExpression(String) + * @see org.eclipse.sirius.properties.PropertiesPackage#getHyperlinkDescription_DisplayExpression() + * @model dataType= + * "org.eclipse.sirius.viewpoint.description.InterpretedExpression" + * @generated + */ + String getDisplayExpression(); + + /** + * Sets the value of the ' + * {@link org.eclipse.sirius.properties.HyperlinkDescription#getDisplayExpression + * <em>Display Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @param value + * the new value of the '<em>Display Expression</em>' attribute. + * @see #getDisplayExpression() + * @generated + */ + void setDisplayExpression(String value); + + /** * Returns the value of the '<em><b>Initial Operation</b></em>' containment * reference. <!-- begin-user-doc --> * <p> @@ -152,4 +188,22 @@ public interface HyperlinkDescription extends WidgetDescription { */ EList<HyperlinkWidgetConditionalStyle> getConditionalStyles(); + /** + * Returns the value of the '<em><b>Actions</b></em>' containment reference + * list. The list contents are of type + * {@link org.eclipse.sirius.properties.WidgetAction}. <!-- begin-user-doc + * --> + * <p> + * If the meaning of the '<em>Actions</em>' containment reference list isn't + * clear, there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Actions</em>' containment reference list. + * @see org.eclipse.sirius.properties.PropertiesPackage#getHyperlinkDescription_Actions() + * @model containment="true" + * @generated + */ + EList<WidgetAction> getActions(); + } // HyperlinkDescription diff --git a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java index 6cc638425f..7e21f8590c 100644 --- a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java +++ b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/LabelDescription.java @@ -23,11 +23,16 @@ import org.eclipse.emf.common.util.EList; * <ul> * <li>{@link org.eclipse.sirius.properties.LabelDescription#getValueExpression * <em>Value Expression</em>}</li> + * <li> + * {@link org.eclipse.sirius.properties.LabelDescription#getDisplayExpression + * <em>Display Expression</em>}</li> * <li>{@link org.eclipse.sirius.properties.LabelDescription#getStyle * <em>Style</em>}</li> * <li> * {@link org.eclipse.sirius.properties.LabelDescription#getConditionalStyles * <em>Conditional Styles</em>}</li> + * <li>{@link org.eclipse.sirius.properties.LabelDescription#getActions + * <em>Actions</em>}</li> * </ul> * * @see org.eclipse.sirius.properties.PropertiesPackage#getLabelDescription() @@ -67,6 +72,37 @@ public interface LabelDescription extends WidgetDescription { void setValueExpression(String value); /** + * Returns the value of the '<em><b>Display Expression</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Display 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>Display Expression</em>' attribute. + * @see #setDisplayExpression(String) + * @see org.eclipse.sirius.properties.PropertiesPackage#getLabelDescription_DisplayExpression() + * @model dataType= + * "org.eclipse.sirius.viewpoint.description.InterpretedExpression" + * @generated + */ + String getDisplayExpression(); + + /** + * Sets the value of the ' + * {@link org.eclipse.sirius.properties.LabelDescription#getDisplayExpression + * <em>Display Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @param value + * the new value of the '<em>Display Expression</em>' attribute. + * @see #getDisplayExpression() + * @generated + */ + void setDisplayExpression(String value); + + /** * Returns the value of the '<em><b>Style</b></em>' containment reference. * <!-- begin-user-doc --> * <p> @@ -115,4 +151,22 @@ public interface LabelDescription extends WidgetDescription { */ EList<LabelWidgetConditionalStyle> getConditionalStyles(); + /** + * Returns the value of the '<em><b>Actions</b></em>' containment reference + * list. The list contents are of type + * {@link org.eclipse.sirius.properties.WidgetAction}. <!-- begin-user-doc + * --> + * <p> + * If the meaning of the '<em>Actions</em>' containment reference list isn't + * clear, there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Actions</em>' containment reference list. + * @see org.eclipse.sirius.properties.PropertiesPackage#getLabelDescription_Actions() + * @model containment="true" + * @generated + */ + EList<WidgetAction> getActions(); + } // LabelDescription diff --git a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java index 7d81a3166f..793673f8f8 100644 --- a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java +++ b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/PropertiesPackage.java @@ -935,13 +935,22 @@ public interface PropertiesPackage extends EPackage { int LABEL_DESCRIPTION__VALUE_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 0; /** + * The feature id for the '<em><b>Display Expression</b></em>' attribute. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int LABEL_DESCRIPTION__DISPLAY_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 1; + + /** * The feature id for the '<em><b>Style</b></em>' containment reference. * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated * @ordered */ - int LABEL_DESCRIPTION__STYLE = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 1; + int LABEL_DESCRIPTION__STYLE = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Conditional Styles</b></em>' containment @@ -950,7 +959,16 @@ public interface PropertiesPackage extends EPackage { * @generated * @ordered */ - int LABEL_DESCRIPTION__CONDITIONAL_STYLES = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 2; + int LABEL_DESCRIPTION__CONDITIONAL_STYLES = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 3; + + /** + * The feature id for the '<em><b>Actions</b></em>' containment reference + * list. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int LABEL_DESCRIPTION__ACTIONS = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 4; /** * The number of structural features of the '<em>Label Description</em>' @@ -959,7 +977,7 @@ public interface PropertiesPackage extends EPackage { * @generated * @ordered */ - int LABEL_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 3; + int LABEL_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 5; /** * The meta object id for the ' @@ -1862,13 +1880,22 @@ public interface PropertiesPackage extends EPackage { int HYPERLINK_DESCRIPTION__VALUE_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 0; /** + * The feature id for the '<em><b>Display Expression</b></em>' attribute. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 1; + + /** * The feature id for the '<em><b>Initial Operation</b></em>' containment * reference. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated * @ordered */ - int HYPERLINK_DESCRIPTION__INITIAL_OPERATION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 1; + int HYPERLINK_DESCRIPTION__INITIAL_OPERATION = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Style</b></em>' containment reference. @@ -1877,7 +1904,7 @@ public interface PropertiesPackage extends EPackage { * @generated * @ordered */ - int HYPERLINK_DESCRIPTION__STYLE = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 2; + int HYPERLINK_DESCRIPTION__STYLE = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Conditional Styles</b></em>' containment @@ -1886,7 +1913,16 @@ public interface PropertiesPackage extends EPackage { * @generated * @ordered */ - int HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 3; + int HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 4; + + /** + * The feature id for the '<em><b>Actions</b></em>' containment reference + * list. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int HYPERLINK_DESCRIPTION__ACTIONS = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 5; /** * The number of structural features of the '<em>Hyperlink Description</em>' @@ -1895,7 +1931,7 @@ public interface PropertiesPackage extends EPackage { * @generated * @ordered */ - int HYPERLINK_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 4; + int HYPERLINK_DESCRIPTION_FEATURE_COUNT = PropertiesPackage.WIDGET_DESCRIPTION_FEATURE_COUNT + 6; /** * The meta object id for the ' @@ -4001,6 +4037,19 @@ public interface PropertiesPackage extends EPackage { EAttribute getLabelDescription_ValueExpression(); /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.sirius.properties.LabelDescription#getDisplayExpression + * <em>Display Expression</em>}'. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * + * @return the meta object for the attribute '<em>Display Expression</em>'. + * @see org.eclipse.sirius.properties.LabelDescription#getDisplayExpression() + * @see #getLabelDescription() + * @generated + */ + EAttribute getLabelDescription_DisplayExpression(); + + /** * Returns the meta object for the containment reference ' * {@link org.eclipse.sirius.properties.LabelDescription#getStyle * <em>Style</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> @@ -4027,6 +4076,19 @@ public interface PropertiesPackage extends EPackage { EReference getLabelDescription_ConditionalStyles(); /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.sirius.properties.LabelDescription#getActions + * <em>Actions</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the containment reference list ' + * <em>Actions</em>'. + * @see org.eclipse.sirius.properties.LabelDescription#getActions() + * @see #getLabelDescription() + * @generated + */ + EReference getLabelDescription_Actions(); + + /** * Returns the meta object for class ' * {@link org.eclipse.sirius.properties.CheckboxDescription * <em>Checkbox Description</em>}'. <!-- begin-user-doc --> <!-- @@ -4698,6 +4760,19 @@ public interface PropertiesPackage extends EPackage { EAttribute getHyperlinkDescription_ValueExpression(); /** + * Returns the meta object for the attribute ' + * {@link org.eclipse.sirius.properties.HyperlinkDescription#getDisplayExpression + * <em>Display Expression</em>}'. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * + * @return the meta object for the attribute '<em>Display Expression</em>'. + * @see org.eclipse.sirius.properties.HyperlinkDescription#getDisplayExpression() + * @see #getHyperlinkDescription() + * @generated + */ + EAttribute getHyperlinkDescription_DisplayExpression(); + + /** * Returns the meta object for the containment reference ' * {@link org.eclipse.sirius.properties.HyperlinkDescription#getInitialOperation * <em>Initial Operation</em>}'. <!-- begin-user-doc --> <!-- end-user-doc @@ -4738,6 +4813,19 @@ public interface PropertiesPackage extends EPackage { EReference getHyperlinkDescription_ConditionalStyles(); /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.sirius.properties.HyperlinkDescription#getActions + * <em>Actions</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the containment reference list ' + * <em>Actions</em>'. + * @see org.eclipse.sirius.properties.HyperlinkDescription#getActions() + * @see #getHyperlinkDescription() + * @generated + */ + EReference getHyperlinkDescription_Actions(); + + /** * Returns the meta object for class ' * {@link org.eclipse.sirius.properties.WidgetStyle <em>Widget Style</em>}'. * <!-- begin-user-doc --> <!-- end-user-doc --> @@ -6109,6 +6197,14 @@ public interface PropertiesPackage extends EPackage { EAttribute LABEL_DESCRIPTION__VALUE_EXPRESSION = PropertiesPackage.eINSTANCE.getLabelDescription_ValueExpression(); /** + * The meta object literal for the '<em><b>Display Expression</b></em>' + * attribute feature. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EAttribute LABEL_DESCRIPTION__DISPLAY_EXPRESSION = PropertiesPackage.eINSTANCE.getLabelDescription_DisplayExpression(); + + /** * The meta object literal for the '<em><b>Style</b></em>' containment * reference feature. <!-- begin-user-doc --> <!-- end-user-doc --> * @@ -6126,6 +6222,14 @@ public interface PropertiesPackage extends EPackage { EReference LABEL_DESCRIPTION__CONDITIONAL_STYLES = PropertiesPackage.eINSTANCE.getLabelDescription_ConditionalStyles(); /** + * The meta object literal for the '<em><b>Actions</b></em>' containment + * reference list feature. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EReference LABEL_DESCRIPTION__ACTIONS = PropertiesPackage.eINSTANCE.getLabelDescription_Actions(); + + /** * The meta object literal for the ' * {@link org.eclipse.sirius.properties.impl.CheckboxDescriptionImpl * <em>Checkbox Description</em>}' class. <!-- begin-user-doc --> <!-- @@ -6607,6 +6711,14 @@ public interface PropertiesPackage extends EPackage { EAttribute HYPERLINK_DESCRIPTION__VALUE_EXPRESSION = PropertiesPackage.eINSTANCE.getHyperlinkDescription_ValueExpression(); /** + * The meta object literal for the '<em><b>Display Expression</b></em>' + * attribute feature. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EAttribute HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION = PropertiesPackage.eINSTANCE.getHyperlinkDescription_DisplayExpression(); + + /** * The meta object literal for the '<em><b>Initial Operation</b></em>' * containment reference feature. <!-- begin-user-doc --> <!-- * end-user-doc --> @@ -6633,6 +6745,14 @@ public interface PropertiesPackage extends EPackage { EReference HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES = PropertiesPackage.eINSTANCE.getHyperlinkDescription_ConditionalStyles(); /** + * The meta object literal for the '<em><b>Actions</b></em>' containment + * reference list feature. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EReference HYPERLINK_DESCRIPTION__ACTIONS = PropertiesPackage.eINSTANCE.getHyperlinkDescription_Actions(); + + /** * The meta object literal for the ' * {@link org.eclipse.sirius.properties.impl.WidgetStyleImpl * <em>Widget Style</em>}' class. <!-- begin-user-doc --> <!-- diff --git a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/HyperlinkDescriptionImpl.java b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/HyperlinkDescriptionImpl.java index bd45fe1d9a..33c1e5a94f 100644 --- a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/HyperlinkDescriptionImpl.java +++ b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/HyperlinkDescriptionImpl.java @@ -25,6 +25,7 @@ import org.eclipse.sirius.properties.HyperlinkDescription; import org.eclipse.sirius.properties.HyperlinkWidgetConditionalStyle; import org.eclipse.sirius.properties.HyperlinkWidgetStyle; import org.eclipse.sirius.properties.PropertiesPackage; +import org.eclipse.sirius.properties.WidgetAction; import org.eclipse.sirius.viewpoint.description.tool.InitialOperation; /** @@ -38,6 +39,9 @@ import org.eclipse.sirius.viewpoint.description.tool.InitialOperation; * {@link org.eclipse.sirius.properties.impl.HyperlinkDescriptionImpl#getValueExpression * <em>Value Expression</em>}</li> * <li> + * {@link org.eclipse.sirius.properties.impl.HyperlinkDescriptionImpl#getDisplayExpression + * <em>Display Expression</em>}</li> + * <li> * {@link org.eclipse.sirius.properties.impl.HyperlinkDescriptionImpl#getInitialOperation * <em>Initial Operation</em>}</li> * <li> @@ -46,6 +50,9 @@ import org.eclipse.sirius.viewpoint.description.tool.InitialOperation; * <li> * {@link org.eclipse.sirius.properties.impl.HyperlinkDescriptionImpl#getConditionalStyles * <em>Conditional Styles</em>}</li> + * <li> + * {@link org.eclipse.sirius.properties.impl.HyperlinkDescriptionImpl#getActions + * <em>Actions</em>}</li> * </ul> * * @generated @@ -74,6 +81,28 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H protected String valueExpression = HyperlinkDescriptionImpl.VALUE_EXPRESSION_EDEFAULT; /** + * The default value of the '{@link #getDisplayExpression() + * <em>Display Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @see #getDisplayExpression() + * @generated + * @ordered + */ + protected static final String DISPLAY_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDisplayExpression() + * <em>Display Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @see #getDisplayExpression() + * @generated + * @ordered + */ + protected String displayExpression = HyperlinkDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT; + + /** * The cached value of the '{@link #getInitialOperation() * <em>Initial Operation</em>}' containment reference. <!-- begin-user-doc * --> <!-- end-user-doc --> @@ -106,6 +135,16 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H protected EList<HyperlinkWidgetConditionalStyle> conditionalStyles; /** + * The cached value of the '{@link #getActions() <em>Actions</em>}' + * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see #getActions() + * @generated + * @ordered + */ + protected EList<WidgetAction> actions; + + /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated @@ -154,6 +193,30 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H * @generated */ @Override + public String getDisplayExpression() { + return displayExpression; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public void setDisplayExpression(String newDisplayExpression) { + String oldDisplayExpression = displayExpression; + displayExpression = newDisplayExpression; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION, oldDisplayExpression, displayExpression)); + } + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public InitialOperation getInitialOperation() { return initialOperation; } @@ -273,6 +336,19 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H * @generated */ @Override + public EList<WidgetAction> getActions() { + if (actions == null) { + actions = new EObjectContainmentEList<WidgetAction>(WidgetAction.class, this, PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS); + } + return actions; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION: @@ -281,6 +357,8 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H return basicSetStyle(null, msgs); case PropertiesPackage.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES: return ((InternalEList<?>) getConditionalStyles()).basicRemove(otherEnd, msgs); + case PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS: + return ((InternalEList<?>) getActions()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -295,12 +373,16 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H switch (featureID) { case PropertiesPackage.HYPERLINK_DESCRIPTION__VALUE_EXPRESSION: return getValueExpression(); + case PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION: + return getDisplayExpression(); case PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION: return getInitialOperation(); case PropertiesPackage.HYPERLINK_DESCRIPTION__STYLE: return getStyle(); case PropertiesPackage.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES: return getConditionalStyles(); + case PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS: + return getActions(); } return super.eGet(featureID, resolve, coreType); } @@ -317,6 +399,9 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H case PropertiesPackage.HYPERLINK_DESCRIPTION__VALUE_EXPRESSION: setValueExpression((String) newValue); return; + case PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION: + setDisplayExpression((String) newValue); + return; case PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION: setInitialOperation((InitialOperation) newValue); return; @@ -327,6 +412,10 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H getConditionalStyles().clear(); getConditionalStyles().addAll((Collection<? extends HyperlinkWidgetConditionalStyle>) newValue); return; + case PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS: + getActions().clear(); + getActions().addAll((Collection<? extends WidgetAction>) newValue); + return; } super.eSet(featureID, newValue); } @@ -342,6 +431,9 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H case PropertiesPackage.HYPERLINK_DESCRIPTION__VALUE_EXPRESSION: setValueExpression(HyperlinkDescriptionImpl.VALUE_EXPRESSION_EDEFAULT); return; + case PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION: + setDisplayExpression(HyperlinkDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT); + return; case PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION: setInitialOperation((InitialOperation) null); return; @@ -351,6 +443,9 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H case PropertiesPackage.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES: getConditionalStyles().clear(); return; + case PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS: + getActions().clear(); + return; } super.eUnset(featureID); } @@ -365,12 +460,16 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H switch (featureID) { case PropertiesPackage.HYPERLINK_DESCRIPTION__VALUE_EXPRESSION: return HyperlinkDescriptionImpl.VALUE_EXPRESSION_EDEFAULT == null ? valueExpression != null : !HyperlinkDescriptionImpl.VALUE_EXPRESSION_EDEFAULT.equals(valueExpression); + case PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION: + return HyperlinkDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT == null ? displayExpression != null : !HyperlinkDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT.equals(displayExpression); case PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION: return initialOperation != null; case PropertiesPackage.HYPERLINK_DESCRIPTION__STYLE: return style != null; case PropertiesPackage.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES: return conditionalStyles != null && !conditionalStyles.isEmpty(); + case PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS: + return actions != null && !actions.isEmpty(); } return super.eIsSet(featureID); } @@ -389,6 +488,8 @@ public class HyperlinkDescriptionImpl extends WidgetDescriptionImpl implements H StringBuffer result = new StringBuffer(super.toString()); result.append(" (valueExpression: "); //$NON-NLS-1$ result.append(valueExpression); + result.append(", displayExpression: "); //$NON-NLS-1$ + result.append(displayExpression); result.append(')'); return result.toString(); } diff --git a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java index 854edfd8f1..3c197b450c 100644 --- a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java +++ b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/LabelDescriptionImpl.java @@ -25,6 +25,7 @@ import org.eclipse.sirius.properties.LabelDescription; import org.eclipse.sirius.properties.LabelWidgetConditionalStyle; import org.eclipse.sirius.properties.LabelWidgetStyle; import org.eclipse.sirius.properties.PropertiesPackage; +import org.eclipse.sirius.properties.WidgetAction; /** * <!-- begin-user-doc --> An implementation of the model object ' @@ -36,11 +37,16 @@ import org.eclipse.sirius.properties.PropertiesPackage; * <li> * {@link org.eclipse.sirius.properties.impl.LabelDescriptionImpl#getValueExpression * <em>Value Expression</em>}</li> + * <li> + * {@link org.eclipse.sirius.properties.impl.LabelDescriptionImpl#getDisplayExpression + * <em>Display Expression</em>}</li> * <li>{@link org.eclipse.sirius.properties.impl.LabelDescriptionImpl#getStyle * <em>Style</em>}</li> * <li> * {@link org.eclipse.sirius.properties.impl.LabelDescriptionImpl#getConditionalStyles * <em>Conditional Styles</em>}</li> + * <li>{@link org.eclipse.sirius.properties.impl.LabelDescriptionImpl#getActions + * <em>Actions</em>}</li> * </ul> * * @generated @@ -69,6 +75,28 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label protected String valueExpression = LabelDescriptionImpl.VALUE_EXPRESSION_EDEFAULT; /** + * The default value of the '{@link #getDisplayExpression() + * <em>Display Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @see #getDisplayExpression() + * @generated + * @ordered + */ + protected static final String DISPLAY_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDisplayExpression() + * <em>Display Expression</em>}' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @see #getDisplayExpression() + * @generated + * @ordered + */ + protected String displayExpression = LabelDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT; + + /** * The cached value of the '{@link #getStyle() <em>Style</em>}' containment * reference. <!-- begin-user-doc --> <!-- end-user-doc --> * @@ -90,6 +118,16 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label protected EList<LabelWidgetConditionalStyle> conditionalStyles; /** + * The cached value of the '{@link #getActions() <em>Actions</em>}' + * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see #getActions() + * @generated + * @ordered + */ + protected EList<WidgetAction> actions; + + /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated @@ -138,6 +176,30 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label * @generated */ @Override + public String getDisplayExpression() { + return displayExpression; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public void setDisplayExpression(String newDisplayExpression) { + String oldDisplayExpression = displayExpression; + displayExpression = newDisplayExpression; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION, oldDisplayExpression, displayExpression)); + } + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public LabelWidgetStyle getStyle() { return style; } @@ -204,12 +266,27 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label * @generated */ @Override + public EList<WidgetAction> getActions() { + if (actions == null) { + actions = new EObjectContainmentEList<WidgetAction>(WidgetAction.class, this, PropertiesPackage.LABEL_DESCRIPTION__ACTIONS); + } + return actions; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case PropertiesPackage.LABEL_DESCRIPTION__STYLE: return basicSetStyle(null, msgs); case PropertiesPackage.LABEL_DESCRIPTION__CONDITIONAL_STYLES: return ((InternalEList<?>) getConditionalStyles()).basicRemove(otherEnd, msgs); + case PropertiesPackage.LABEL_DESCRIPTION__ACTIONS: + return ((InternalEList<?>) getActions()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -224,10 +301,14 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label switch (featureID) { case PropertiesPackage.LABEL_DESCRIPTION__VALUE_EXPRESSION: return getValueExpression(); + case PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION: + return getDisplayExpression(); case PropertiesPackage.LABEL_DESCRIPTION__STYLE: return getStyle(); case PropertiesPackage.LABEL_DESCRIPTION__CONDITIONAL_STYLES: return getConditionalStyles(); + case PropertiesPackage.LABEL_DESCRIPTION__ACTIONS: + return getActions(); } return super.eGet(featureID, resolve, coreType); } @@ -244,6 +325,9 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label case PropertiesPackage.LABEL_DESCRIPTION__VALUE_EXPRESSION: setValueExpression((String) newValue); return; + case PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION: + setDisplayExpression((String) newValue); + return; case PropertiesPackage.LABEL_DESCRIPTION__STYLE: setStyle((LabelWidgetStyle) newValue); return; @@ -251,6 +335,10 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label getConditionalStyles().clear(); getConditionalStyles().addAll((Collection<? extends LabelWidgetConditionalStyle>) newValue); return; + case PropertiesPackage.LABEL_DESCRIPTION__ACTIONS: + getActions().clear(); + getActions().addAll((Collection<? extends WidgetAction>) newValue); + return; } super.eSet(featureID, newValue); } @@ -266,12 +354,18 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label case PropertiesPackage.LABEL_DESCRIPTION__VALUE_EXPRESSION: setValueExpression(LabelDescriptionImpl.VALUE_EXPRESSION_EDEFAULT); return; + case PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION: + setDisplayExpression(LabelDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT); + return; case PropertiesPackage.LABEL_DESCRIPTION__STYLE: setStyle((LabelWidgetStyle) null); return; case PropertiesPackage.LABEL_DESCRIPTION__CONDITIONAL_STYLES: getConditionalStyles().clear(); return; + case PropertiesPackage.LABEL_DESCRIPTION__ACTIONS: + getActions().clear(); + return; } super.eUnset(featureID); } @@ -286,10 +380,14 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label switch (featureID) { case PropertiesPackage.LABEL_DESCRIPTION__VALUE_EXPRESSION: return LabelDescriptionImpl.VALUE_EXPRESSION_EDEFAULT == null ? valueExpression != null : !LabelDescriptionImpl.VALUE_EXPRESSION_EDEFAULT.equals(valueExpression); + case PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION: + return LabelDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT == null ? displayExpression != null : !LabelDescriptionImpl.DISPLAY_EXPRESSION_EDEFAULT.equals(displayExpression); case PropertiesPackage.LABEL_DESCRIPTION__STYLE: return style != null; case PropertiesPackage.LABEL_DESCRIPTION__CONDITIONAL_STYLES: return conditionalStyles != null && !conditionalStyles.isEmpty(); + case PropertiesPackage.LABEL_DESCRIPTION__ACTIONS: + return actions != null && !actions.isEmpty(); } return super.eIsSet(featureID); } @@ -308,6 +406,8 @@ public class LabelDescriptionImpl extends WidgetDescriptionImpl implements Label StringBuffer result = new StringBuffer(super.toString()); result.append(" (valueExpression: "); //$NON-NLS-1$ result.append(valueExpression); + result.append(", displayExpression: "); //$NON-NLS-1$ + result.append(displayExpression); result.append(')'); return result.toString(); } diff --git a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java index 5f5b33df53..5d68a2415d 100644 --- a/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java +++ b/plugins/org.eclipse.sirius.properties/src-gen/org/eclipse/sirius/properties/impl/PropertiesPackageImpl.java @@ -1100,8 +1100,18 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac * @generated */ @Override + public EAttribute getLabelDescription_DisplayExpression() { + return (EAttribute) labelDescriptionEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public EReference getLabelDescription_Style() { - return (EReference) labelDescriptionEClass.getEStructuralFeatures().get(1); + return (EReference) labelDescriptionEClass.getEStructuralFeatures().get(2); } /** @@ -1111,7 +1121,17 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac */ @Override public EReference getLabelDescription_ConditionalStyles() { - return (EReference) labelDescriptionEClass.getEStructuralFeatures().get(2); + return (EReference) labelDescriptionEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public EReference getLabelDescription_Actions() { + return (EReference) labelDescriptionEClass.getEStructuralFeatures().get(4); } /** @@ -1640,8 +1660,18 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac * @generated */ @Override + public EAttribute getHyperlinkDescription_DisplayExpression() { + return (EAttribute) hyperlinkDescriptionEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public EReference getHyperlinkDescription_InitialOperation() { - return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(1); + return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(2); } /** @@ -1651,7 +1681,7 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac */ @Override public EReference getHyperlinkDescription_Style() { - return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(2); + return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(3); } /** @@ -1661,7 +1691,17 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac */ @Override public EReference getHyperlinkDescription_ConditionalStyles() { - return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(3); + return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public EReference getHyperlinkDescription_Actions() { + return (EReference) hyperlinkDescriptionEClass.getEStructuralFeatures().get(5); } /** @@ -2416,8 +2456,10 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac labelDescriptionEClass = createEClass(PropertiesPackage.LABEL_DESCRIPTION); createEAttribute(labelDescriptionEClass, PropertiesPackage.LABEL_DESCRIPTION__VALUE_EXPRESSION); + createEAttribute(labelDescriptionEClass, PropertiesPackage.LABEL_DESCRIPTION__DISPLAY_EXPRESSION); createEReference(labelDescriptionEClass, PropertiesPackage.LABEL_DESCRIPTION__STYLE); createEReference(labelDescriptionEClass, PropertiesPackage.LABEL_DESCRIPTION__CONDITIONAL_STYLES); + createEReference(labelDescriptionEClass, PropertiesPackage.LABEL_DESCRIPTION__ACTIONS); checkboxDescriptionEClass = createEClass(PropertiesPackage.CHECKBOX_DESCRIPTION); createEAttribute(checkboxDescriptionEClass, PropertiesPackage.CHECKBOX_DESCRIPTION__VALUE_EXPRESSION); @@ -2482,9 +2524,11 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac hyperlinkDescriptionEClass = createEClass(PropertiesPackage.HYPERLINK_DESCRIPTION); createEAttribute(hyperlinkDescriptionEClass, PropertiesPackage.HYPERLINK_DESCRIPTION__VALUE_EXPRESSION); + createEAttribute(hyperlinkDescriptionEClass, PropertiesPackage.HYPERLINK_DESCRIPTION__DISPLAY_EXPRESSION); createEReference(hyperlinkDescriptionEClass, PropertiesPackage.HYPERLINK_DESCRIPTION__INITIAL_OPERATION); createEReference(hyperlinkDescriptionEClass, PropertiesPackage.HYPERLINK_DESCRIPTION__STYLE); createEReference(hyperlinkDescriptionEClass, PropertiesPackage.HYPERLINK_DESCRIPTION__CONDITIONAL_STYLES); + createEReference(hyperlinkDescriptionEClass, PropertiesPackage.HYPERLINK_DESCRIPTION__ACTIONS); widgetStyleEClass = createEClass(PropertiesPackage.WIDGET_STYLE); createEAttribute(widgetStyleEClass, PropertiesPackage.WIDGET_STYLE__LABEL_FONT_NAME_EXPRESSION); @@ -2797,12 +2841,17 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac initEClass(labelDescriptionEClass, LabelDescription.class, "LabelDescription", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getLabelDescription_ValueExpression(), theDescriptionPackage.getInterpretedExpression(), "valueExpression", null, 0, 1, LabelDescription.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); + initEAttribute(getLabelDescription_DisplayExpression(), theDescriptionPackage.getInterpretedExpression(), "displayExpression", null, 0, 1, LabelDescription.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ + !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); initEReference(getLabelDescription_Style(), this.getLabelWidgetStyle(), null, "style", null, 0, 1, LabelDescription.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, !EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); initEReference(getLabelDescription_ConditionalStyles(), this.getLabelWidgetConditionalStyle(), null, "conditionalStyles", null, 0, -1, LabelDescription.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, !EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); + initEReference(getLabelDescription_Actions(), this.getWidgetAction(), null, "actions", null, 0, -1, LabelDescription.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ + EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, !EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, 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); //$NON-NLS-1$ initEAttribute(getCheckboxDescription_ValueExpression(), theDescriptionPackage.getInterpretedExpression(), "valueExpression", null, 0, 1, CheckboxDescription.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ @@ -2937,6 +2986,9 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac initEAttribute(getHyperlinkDescription_ValueExpression(), theDescriptionPackage.getInterpretedExpression(), "valueExpression", null, 0, 1, HyperlinkDescription.class, //$NON-NLS-1$ !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(getHyperlinkDescription_DisplayExpression(), theDescriptionPackage.getInterpretedExpression(), "displayExpression", null, 0, 1, HyperlinkDescription.class, //$NON-NLS-1$ + !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_UNSETTABLE, !EPackageImpl.IS_ID, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, + EPackageImpl.IS_ORDERED); initEReference(getHyperlinkDescription_InitialOperation(), theToolPackage.getInitialOperation(), null, "initialOperation", null, 1, 1, HyperlinkDescription.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, !EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); @@ -2946,6 +2998,9 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac initEReference(getHyperlinkDescription_ConditionalStyles(), this.getHyperlinkWidgetConditionalStyle(), null, "conditionalStyles", null, 0, -1, HyperlinkDescription.class, //$NON-NLS-1$ !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, !EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); + initEReference(getHyperlinkDescription_Actions(), this.getWidgetAction(), null, "actions", null, 0, -1, HyperlinkDescription.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ + EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, !EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, + EPackageImpl.IS_ORDERED); initEClass(widgetStyleEClass, WidgetStyle.class, "WidgetStyle", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getWidgetStyle_LabelFontNameExpression(), theDescriptionPackage.getInterpretedExpression(), "labelFontNameExpression", null, 0, 1, WidgetStyle.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ |
