Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2015-11-12 10:03:20 +0000
committerMaxime Porhel2015-11-13 14:52:07 +0000
commit4e986b0f814f421ee6183bba32f7371e11269624 (patch)
tree2a296d64a9e5ca957019482ccd3e8a28467d167c
parent16b692e9000fd09a7c8506ca0bc21cd6553a38e3 (diff)
downloadorg.eclipse.sirius-4e986b0f814f421ee6183bba32f7371e11269624.tar.gz
org.eclipse.sirius-4e986b0f814f421ee6183bba32f7371e11269624.tar.xz
org.eclipse.sirius-4e986b0f814f421ee6183bba32f7371e11269624.zip
[481119] Complete and correct border size migration
The VSM migration was done only on the first level of container mappings. Now we also recursively handle the sub container mappings. A manual modification might be required for VSM already migrated to Sirius 3.1.0 (see release notes for more details). Bug: 481119 Change-Id: Id636c875b541503a9e5c3edcd28ef31b0a1a10ce Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/BorderSizeComputationExpressionMigrationParticipant.java73
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html25
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile6
3 files changed, 78 insertions, 26 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/BorderSizeComputationExpressionMigrationParticipant.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/BorderSizeComputationExpressionMigrationParticipant.java
index 75ede32a2e..36b7c80e08 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/BorderSizeComputationExpressionMigrationParticipant.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/migration/description/BorderSizeComputationExpressionMigrationParticipant.java
@@ -38,7 +38,9 @@ public class BorderSizeComputationExpressionMigrationParticipant extends Abstrac
/**
* The version for which this migration is added.
*/
- private static final Version MIGRATION_VERSION = new Version("10.1.0.201507101000"); //$NON-NLS-1$
+ private static final Version MIGRATION_VERSION = new Version("10.1.3.201511131800"); //$NON-NLS-1$
+
+ private static final Version INITIAL_MIGRATION_VERSION = new Version("10.1.0.201507101000"); //$NON-NLS-1$
@Override
public Version getMigrationVersion() {
@@ -50,35 +52,74 @@ public class BorderSizeComputationExpressionMigrationParticipant extends Abstrac
// Set the borderSizeComputationExpression to "1" (to replace 0 default
// value) for style of container mapping, before the bug 465211 0 is
// considered as 1.
+
+ // Replace all borderSize of Container equals to 0 by 1 and replace all
+ // borderSizeComputationExpression of Container equals to "0" by "1". If
+ // the expression is not "0" (default value), we let the borderSize
+ // unchanged.
if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) {
- for (Viewpoint viewpoint : group.getOwnedViewpoints()) {
- for (DiagramDescription diagramDescription : Iterables.filter(viewpoint.getOwnedRepresentations(), DiagramDescription.class)) {
- migrateStyleOfContainerMappingInLayer(diagramDescription.getAllLayers());
- migrateStyleOfContainerMapping(diagramDescription.getAllContainerMappings());
- }
- for (DiagramExtensionDescription diagramExtensionDescription : Iterables.filter(viewpoint.getOwnedRepresentationExtensions(), DiagramExtensionDescription.class)) {
- migrateStyleOfContainerMappingInLayer(diagramExtensionDescription.getLayers());
- }
+ // Full migration is required for version in [0.0.0, 3.1.0[
+ // Manual complementary modification might be required for version in
+ // [3.1.0, 3.1.3[
+
+ if (loadedVersion.compareTo(INITIAL_MIGRATION_VERSION) < 0) {
+ // Full migration
+ migrateBorderSizeComputationExpressions(group);
+ } else {
+ // Do nothing:
+ // first level of container mappings have been migrated.
+ // sub container mappings were with the previous version of the
+ // migration but in Sirius 3.1.0, specifier might have
+ // explicitly added styles with a 0 pix border: the migration
+ // cannot take the decision to do the migration or not.
}
}
}
- private void migrateStyleOfContainerMappingInLayer(List<? extends Layer> layers) {
- for (Layer layer : layers) {
- migrateStyleOfContainerMapping(layer.getContainerMappings());
+ private void migrateBorderSizeComputationExpressions(Group group) {
+ for (Viewpoint viewpoint : group.getOwnedViewpoints()) {
+ for (DiagramDescription diagramDescription : Iterables.filter(viewpoint.getOwnedRepresentations(), DiagramDescription.class)) {
+ // Migrate container mappings from default and additional layers
+ for (Layer layer : diagramDescription.getAllLayers()) {
+ // Migrate container mappings contained by the layer (no
+ // need to migrate reused mappings, they will be migrated by
+ // the migration of their containing resource).
+ migrateBorderSizeComputationExpressions(layer.getContainerMappings());
+ }
+
+ // Migrate container mappings contained by the diagram
+ // description (old without layer mode)
+ migrateBorderSizeComputationExpressions(diagramDescription.getContainerMappings());
+ }
+ for (DiagramExtensionDescription diagramExtensionDescription : Iterables.filter(viewpoint.getOwnedRepresentationExtensions(), DiagramExtensionDescription.class)) {
+ for (Layer layer : diagramExtensionDescription.getLayers()) {
+ migrateBorderSizeComputationExpressions(layer.getContainerMappings());
+ }
+ }
}
}
- private void migrateStyleOfContainerMapping(List<ContainerMapping> containerMappings) {
+ /**
+ * Recursively migrate the given containers and their sub containers.
+ *
+ * @param containerMappings
+ * the container mappings to migrate.
+ */
+ private void migrateBorderSizeComputationExpressions(List<ContainerMapping> containerMappings) {
for (ContainerMapping containerMapping : containerMappings) {
- migrateStyleOfContainerMapping(containerMapping.getStyle());
+
+ // Migrate the styles of the current container mapping.
+ migrateBorderSizeComputationExpression(containerMapping.getStyle());
for (ConditionalContainerStyleDescription conditionalStyleDescription : containerMapping.getConditionnalStyles()) {
- migrateStyleOfContainerMapping(conditionalStyleDescription.getStyle());
+ migrateBorderSizeComputationExpression(conditionalStyleDescription.getStyle());
}
+
+ // Migrate the sub container mappings.
+ migrateBorderSizeComputationExpressions(containerMapping.getSubContainerMappings());
}
}
- private void migrateStyleOfContainerMapping(ContainerStyleDescription styleDescription) {
+ private void migrateBorderSizeComputationExpression(ContainerStyleDescription styleDescription) {
if (styleDescription != null && "0".equals(styleDescription.getBorderSizeComputationExpression())) { //$NON-NLS-1$
styleDescription.setBorderSizeComputationExpression("1"); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index 1d39052af6..13fae1863b 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -19,6 +19,9 @@
<a href="#UserVisibleChanges">User-Visible Changes</a>
</li>
<li>
+ <a href="#SpecifierVisibleChanges">Specifier-Visible Changes</a>
+ </li>
+ <li>
<a href="#DeveloperVisibleChanges">Developer-Visible Changes</a>
</li>
</ol>
@@ -27,7 +30,7 @@
<a href="#sirius3.1.1">Changes in Sirius 3.1.1</a>
<ol style="list-style: disc;">
<li>
- <a href="#SpecifierVisibleChanges">Specifier-Visible Changes</a>
+ <a href="#SpecifierVisibleChanges2">Specifier-Visible Changes</a>
</li>
<li>
<a href="#DeveloperVisibleChanges2">Developer-Visible Changes</a>
@@ -41,7 +44,7 @@
<a href="#UserVisibleChanges2">User-Visible Changes</a>
</li>
<li>
- <a href="#SpecifierVisibleChanges2">Specifier-Visible Changes</a>
+ <a href="#SpecifierVisibleChanges3">Specifier-Visible Changes</a>
</li>
<li>
<a href="#DeveloperVisibleChanges3">Developer-Visible Changes</a>
@@ -55,7 +58,7 @@
<a href="#UserVisibleChanges3">User-Visible Changes</a>
</li>
<li>
- <a href="#SpecifierVisibleChanges3">Specifier-Visible Changes</a>
+ <a href="#SpecifierVisibleChanges4">Specifier-Visible Changes</a>
</li>
<li>
<a href="#DeveloperVisibleChanges4">Developer-Visible Changes</a>
@@ -69,7 +72,7 @@
<a href="#UserVisibleChanges4">User-Visible Changes</a>
</li>
<li>
- <a href="#SpecifierVisibleChanges4">Specifier-Visible Changes</a>
+ <a href="#SpecifierVisibleChanges5">Specifier-Visible Changes</a>
</li>
<li>
<a href="#APIChanges">API Changes</a>
@@ -89,6 +92,12 @@
<code>IPermissionAuthority</code>, the properties view will not be editable if this locked object is selected from the Model Explorer view, as it is the case for selection from dialect editors.
</li>
</ul>
+ <h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3>
+ <ul>
+ <li><span class="label label-info">Modified</span> The
+ <code>BorderSizeComputationExpression</code> migration has been corrected to recursively handle the sub container mappings. VSM created or migrated with Sirius 3.1 (3.1.0, 3.1.1 or 3.1.2) might require a manual modification for the style descriptions of sub container mappings with border size computation equals to 0 as we cannot determine if they were added (or updated) after or before the migration: starting with Sirius 3.1.0, no border will be displayed for a 0 pixel value whereas with older version container alwyas had at least a 1 pixel border.
+ </li>
+ </ul>
<h3 id="DeveloperVisibleChanges">Developer-Visible Changes</h3>
<h4 id="Changesinorg.eclipse.sirius.ext.emf.ui">Changes in
<code>org.eclipse.sirius.ext.emf.ui</code>
@@ -113,7 +122,7 @@
</li>
</ul>
<h2 id="sirius3.1.1">Changes in Sirius 3.1.1</h2>
- <h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3>
+ <h3 id="SpecifierVisibleChanges2">Specifier-Visible Changes</h3>
<ul>
<li><span class="label label-info">Modified</span> The use of type literals in operations like filter() or oclIsKindOf() requires to explicitly add the domain meta-models plug-ins to the dependencies of the Viewpoint Specification Project. The documentation has been modified to recommend this.</li>
</ul>
@@ -175,7 +184,7 @@
<em>Arrange Linked Border Nodes</em> as it is border nodes which are layouted and not bordered nodes.
</li>
</ul>
- <h3 id="SpecifierVisibleChanges2">Specifier-Visible Changes</h3>
+ <h3 id="SpecifierVisibleChanges3">Specifier-Visible Changes</h3>
<ul>
<li><span class="label label-info">Modified</span> The
<em>Acceleo Query Language</em> (AQL) interpreter has been improved. AQL, and its support in Sirius, is no longer considered experimental, and instead is now the recommended query language to use for new VSMs. Improvements mostly concern better completion and validation, and more precise error reporting. In particular AQL expressions will now be able to display warnings and errors in the Interpreter view. The message displayed in the Interpreter view after an evaluation has also been improved to display the qualified name of the type of the value computed (
@@ -696,7 +705,7 @@
<em>Viewpoint Selection</em> dialog and wizard page, the &#171;plug-in&#187; decorator for viewpoints loaded from plug-ins is removed, and a &#171;Folder&#187; decorator for viewpoints loaded from the current workspace has been added. This makes the icons more visible in the most common where viewpoints come from installed plug-ins.
</li>
</ul>
- <h3 id="SpecifierVisibleChanges3">Specifier-Visible Changes</h3>
+ <h3 id="SpecifierVisibleChanges4">Specifier-Visible Changes</h3>
<ul>
<li><span class="label label-success">Added</span> <span class="label label-info">Experimental</span> Optional support for the experimental
<em>Acceleo Query Language</em> (AQL) has been added to write interpreted expressions. It is provided by the
@@ -1672,7 +1681,7 @@
<li>Reconnection of an edge will only now move the minimum necessary bendpoints instead of reseting it to default.</li>
<li>A new action has been added to reset the diagram (or container) origin: the diagram (or container) bounds (the rectangle formed by the highest, the leftmost, the lowest and the rightmost children elements) can have a negative origin or can be shifted toward the bottom-right with a blank zone at the top-left. This action aims to move all diagram (or container) elements so that the it retrieves its origin while keeping elements layout.</li>
</ul>
- <h3 id="SpecifierVisibleChanges4">Specifier-Visible Changes</h3>
+ <h3 id="SpecifierVisibleChanges5">Specifier-Visible Changes</h3>
<ul>
<li>The specifier can now choose to hold the edge ends toward the center of the source, target or both. New fields within the &#171;advance&#187; tab of EdgeStyle description have been added to choose for which source or target mappings an edge should be centered. See
<a href="specifier/diagrams/Diagrams.html#edges_styles">Edges Styles &gt; Edge Centering</a> in the specifier manual for more details.
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 687a77492a..f5513b982e 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -10,6 +10,10 @@ h3. User-Visible Changes
* <span class="label label-info">Modified</span> Now if an object is locked and cannot be modified according to @IPermissionAuthority@, the properties view will not be editable if this locked object is selected from the Model Explorer view, as it is the case for selection from dialect editors.
+h3. Specifier-Visible Changes
+
+* <span class="label label-info">Modified</span> The @BorderSizeComputationExpression@ migration has been corrected to recursively handle the sub container mappings. VSM created or migrated with Sirius 3.1 (3.1.0, 3.1.1 or 3.1.2) might require a manual modification for the style descriptions of sub container mappings with border size computation equals to 0 as we cannot determine if they were added (or updated) after or before the migration: starting with Sirius 3.1.0, no border will be displayed for a 0 pixel value whereas with older version container alwyas had at least a 1 pixel border.
+
h3. Developer-Visible Changes
h4. Changes in @org.eclipse.sirius.ext.emf.ui@
@@ -21,8 +25,6 @@ h4. Changes in @org.eclipse.sirius.ui@
* <span class="label label-success">Added</span> @org.eclipse.sirius.ui.tools.api.properties.SiriusExtensiblePropertyDescriptor@ has been added to provide a specific @ExtensiblePropertyDescriptor@ which test @IPermissionAuthority@ to make properties view editable or not.
* <span class="label label-info">Modified</span> @org.eclipse.sirius.ui.tools.api.properties.SiriusExtensiblePropertySource@ has been modified to use @SiriusExtensiblePropertyDescriptor@ to provide not editable properties view when the object, selected from the Model Explorer view, cannot be modified.
-
-
h2(#sirius3.1.1). Changes in Sirius 3.1.1
h3. Specifier-Visible Changes

Back to the top