Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMélanie Bats2017-07-06 14:31:14 +0000
committerPierre-Charles David2017-08-07 08:33:40 +0000
commitc25ad5c4af16642a2307194af312a035ab6932fa (patch)
tree210a31d2745e29713e8f9975e1c6787ac8c71311
parent06e7dfbec0e9504787d96754edd71b5a67d5e99a (diff)
downloadorg.eclipse.sirius-c25ad5c4af16642a2307194af312a035ab6932fa.tar.gz
org.eclipse.sirius-c25ad5c4af16642a2307194af312a035ab6932fa.tar.xz
org.eclipse.sirius-c25ad5c4af16642a2307194af312a035ab6932fa.zip
[519322] Rename the filtering expression variables
All the filtering expression variables were renamed to match the following pattern: featureName+'Description' Now, when the specifier extends a page he is able to filter the groups with the filtering expression thanks to the groupDescription variable Bug:519322 Change-Id: I918b355b06d81a731fb960473c3b34aeb5a860bb Signed-off-by: Mélanie Bats <melanie.bats@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html1
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile1
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.html22
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/specifier/properties/Properties_View_Description.textile8
-rw-r--r--plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionPreprocessor.java2
5 files changed, 18 insertions, 16 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index 70e4b9041f..0054a2e43c 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -139,6 +139,7 @@
<em>Automatic Refresh</em> Sirius preference disabled), when the
<em>Force Refresh</em> option of a tool is enabled in your VSM, only the current representation is refreshed when the tool is applied. Before this version, all open representations were refreshed.
</li>
+ <li><span class="label label-info">Modified</span> The filtering expression variables available in the properties view definition in the &#8249;Extends&#8250; tab were renamed to match the following pattern: featureName+&#8249;Description&#8250;.</li>
</ul>
<h3 id="DeveloperVisibleChanges">Developer-Visible Changes</h3>
<h4 id="Migrations">Migrations</h4>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 2f537e8e84..eec3fc3913 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -19,6 +19,7 @@ h3. Specifier-Visible Changes
** If the label is more than 1000 pixels away from the reference point on its corresponding edge, the label is considered as distant.
** Between these 2 limits, the label is considered as distant if the distance between the center of the label and the edge is higher than "four times the size of the nearest segment".
* <span class="label label-info">Modified</span> In manual refresh mode (_Automatic Refresh_ Sirius preference disabled), when the _Force Refresh_ option of a tool is enabled in your VSM, only the current representation is refreshed when the tool is applied. Before this version, all open representations were refreshed.
+* <span class="label label-info">Modified</span> The filtering expression variables available in the properties view definition in the 'Extends' tab were renamed to match the following pattern: featureName+'Description'.
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 673de23d7f..a5ad36be85 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
@@ -209,7 +209,7 @@
<li>
<a href="#pages">
<em>Pages</em>
- </a>, which correspond to &#8220;tabs&#8221;;
+ </a>, which correspond to &#171;tabs&#187;;
</li>
<li>
<a href="#groups">
@@ -304,7 +304,7 @@
</p>
<ul>
<li>Extend the default rules model inside your VSM: from the top-level element of the VSM model, select
- <em>New Properties&gt; Extend Default Properties View</em>. This will allow you to redefine the behavior of the default rules thanks to the &#8220;extension mechanism&#8221;#extensibility_features.
+ <em>New Properties&gt; Extend Default Properties View</em>. This will allow you to redefine the behavior of the default rules thanks to the &#171;extension mechanism&#187;#extensibility_features.
</li>
<li>Import a copy of the default rules model inside your VSM: from the top-level element of the VSM model, select
<em>New Properties &gt; Import Default Properties View</em>.
@@ -368,7 +368,7 @@
<strong>Styles.</strong> Each kind of properties view element supports a rich set of possible
<a href="#styling">styles</a>.
</p>
- <p>To find some documentation for each properties, you can also refer to the tool-tips available directly in the editor on the &#8220;question mark&#8221; icon of each property.</p>
+ <p>To find some documentation for each properties, you can also refer to the tool-tips available directly in the editor on the &#171;question mark&#187; icon of each property.</p>
<p>Here is an example of a widget configuration (a single-line
<a href="#text">text</a> in this case) which illustrates some of the common attributes:
</p>
@@ -413,7 +413,7 @@
<code>self</code> variable inside a
<em>Page</em>, but inside a group
<code>self</code> may have a different value is
- <em>Semantic Candidate Expressions</em> were used, so this service can be used to obtain the &#8220;original self&#8221; from anywhere.
+ <em>Semantic Candidate Expressions</em> were used, so this service can be used to obtain the &#171;original self&#187; from anywhere.
</li>
<li>
<code>input.getAllSemanticElements()</code>: returns
@@ -421,7 +421,7 @@
<code>DRepresentationElement#semanticElements</code> if there are any.
</li>
<li>
- <code>input.emfEditServices(EObject)</code>: provides a handle to invoke &#8220;EMF Edit&#8221;-related services on the model element specified in argument. See below for the list of services that can be called on the result.
+ <code>input.emfEditServices(EObject)</code>: provides a handle to invoke &#171;EMF Edit&#187;-related services on the model element specified in argument. See below for the list of services that can be called on the result.
</li>
<li>
<code>input.context()</code>: provides a handle to invoke additional services to obtain more information about the overall context of the selection. See below fot the list of services that can be called on the result.
@@ -461,7 +461,7 @@
<code>IItemLabelProvider</code>.
</li>
<li>
- <code>getText(EStructuralFeature)</code>: returns the &#8220;display name&#8221; of the specified feature of
+ <code>getText(EStructuralFeature)</code>: returns the &#171;display name&#187; of the specified feature of
<code>obj</code>, as defined by its
<code>IItemPropertyDescriptor</code>, or the textual representation of the feature itself (as defined by its own
<code>IItemLabelProvider</code>) if no display name is defined.
@@ -1202,7 +1202,7 @@
<p>To define the behavior, you simply specify the behavior associated to the edition inside the
<em>Begin</em> element using all the standard
<a href="../general/Model_Operations.html">model operations</a>. A variable named
- <code>onClickEventKind</code> is available to determine if the operation has been triggered by a single click or double click. In case of a single click, the variable has the value &#8220;SINGLE_CLICK&#8221; and &#8220;DOUBLE_CLICK&#8221; in case of a double click.
+ <code>onClickEventKind</code> is available to determine if the operation has been triggered by a single click or double click. In case of a single click, the variable has the value &#171;SINGLE_CLICK&#187; and &#171;DOUBLE_CLICK&#187; in case of a double click.
</p>
<p>The expressions defined under the
<em>Begin</em> can use the
@@ -1480,12 +1480,12 @@
<li>The
<code>Filter Groups Expression</code> is used to
<strong>filter</strong> which inherited groups are visible under the page. The
- <code>group</code> variable can be used to check if a group must be filtered or not.
+ <code>groupDescription</code> variable can be used to check if a group must be filtered or not.
</li>
<li>The
<code>Filter Validation Rules Expression</code> is used to
<strong>filter</strong> which inherited validation rules are used under the page. The
- <code>validationRule</code> variable can be used to check if a rule must be filtered or not.
+ <code>validationRuleDescription</code> variable can be used to check if a rule must be filtered or not.
</li>
</ul>
<p>Following some examples of the extension mechanism usage are detailed:</p>
@@ -1659,12 +1659,12 @@
<li>The
<code>Filter Groups Expression</code> is used to
<strong>filter</strong> which inherited groups are visible under the page. The
- <code>group</code> variable can be used to check if a group must be filtered or not.
+ <code>groupDescription</code> variable can be used to check if a group must be filtered or not.
</li>
<li>The
<code>Filter Validation Rules Expression</code> is used to
<strong>filter</strong> which inherited validation rules are used under the page. The
- <code>validationRule</code> variable can be used to check if a rule must be filtered or not.
+ <code>validationRuleDescription</code> variable can be used to check if a rule must be filtered or not.
</li>
</ul>
<p>If an element is overridden by many override definitions, the first encountered in the specification is applied.</p>
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 7490a76322..3fe7acf334 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
@@ -575,8 +575,8 @@ p(#filters). *Filter Expressions.* Different filters exist depending on the elem
If the expression is not specified, all the inherited elements will be visible.
For each _Filter expression_, a variable is available which represents the element which could be filtered. It is possible to filter all the inherited elements by just returning @false@ all the time. In this case, the elements defined under the current description *overrides* the elements defined in the extended description.
For example if a _Page A_ extends another _Page B_, the @Extends@ tab allows to define:
-* The @Filter Groups Expression@ is used to *filter* which inherited groups are visible under the page. The @group@ variable can be used to check if a group must be filtered or not.
-* The @Filter Validation Rules Expression@ is used to *filter* which inherited validation rules are used under the page. The @validationRule@ variable can be used to check if a rule must be filtered or not.
+* The @Filter Groups Expression@ is used to *filter* which inherited groups are visible under the page. The @groupDescription@ variable can be used to check if a group must be filtered or not.
+* The @Filter Validation Rules Expression@ is used to *filter* which inherited validation rules are used under the page. The @validationRuleDescription@ variable can be used to check if a rule must be filtered or not.
Following some examples of the extension mechanism usage are detailed:
* *Reuse widgets*: In this example we want to specify the properties view of a Class and an interface both are defining a name attribute. A _Class Name_ text widget is defined to represent the _Name_ attribute of a _Class_ in the properties view. This widget defines in the _General_ tab:
@@ -632,8 +632,8 @@ p(#filters). *Filter Expressions.* Different filters exist depending on the elem
If the expression is not specified, all the inherited elements will be visible.
For each _Filter expression_, a variable is available which represents the element which could be filtered. It is possible to filter all the inherited elements by just returning @false@ all the time. In this case, the elements defined under the current description *overrides* the elements defined in the extended description.
For example if a _Page A_ extends another _Page B_, the @Extends@ tab allows to define:
-* The @Filter Groups Expression@ is used to *filter* which inherited groups are visible under the page. The @group@ variable can be used to check if a group must be filtered or not.
-* The @Filter Validation Rules Expression@ is used to *filter* which inherited validation rules are used under the page. The @validationRule@ variable can be used to check if a rule must be filtered or not.
+* The @Filter Groups Expression@ is used to *filter* which inherited groups are visible under the page. The @groupDescription@ variable can be used to check if a group must be filtered or not.
+* The @Filter Validation Rules Expression@ is used to *filter* which inherited validation rules are used under the page. The @validationRuleDescription@ variable can be used to check if a rule must be filtered or not.
If an element is overridden by many override definitions, the first encountered in the specification is applied.
diff --git a/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionPreprocessor.java b/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionPreprocessor.java
index 0c5e75f3d6..1d7aa86b67 100644
--- a/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionPreprocessor.java
+++ b/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionPreprocessor.java
@@ -490,7 +490,7 @@ public class DefaultDescriptionPreprocessor<SIRIUS extends EObject> implements I
private Map<String, Object> computeFilterVariables(IVariableManager variableManager, EObject currentDescription, String eStructuralFeatureName) {
Map<String, Object> variables = new HashMap<>();
variables.putAll(variableManager.getVariables());
- String variableName = this.getVariableName(eStructuralFeatureName);
+ String variableName = this.getVariableName(eStructuralFeatureName) + "Description"; //$NON-NLS-1$
variables.put(variableName, currentDescription);
return variables;
}

Back to the top