Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauline DEVILLE2018-09-11 08:48:04 +0000
committerPatrick Tessier2018-09-14 12:54:12 +0000
commitd0de0f6e605c1083f1347a5344542d794931b5b0 (patch)
tree5cbe29bdf6abfbda079ac92e4cdf0b62a195a0a6 /plugins
parent0a67f5ec7e414ed66d21cd52d9ab748c13649b1b (diff)
downloadorg.eclipse.papyrus-d0de0f6e605c1083f1347a5344542d794931b5b0.tar.gz
org.eclipse.papyrus-d0de0f6e605c1083f1347a5344542d794931b5b0.tar.xz
org.eclipse.papyrus-d0de0f6e605c1083f1347a5344542d794931b5b0.zip
Bug 538912 - [Toolsmiths][ProfileMigrationTool] This tool ask for apply
a new profile even if there is no concern stereotype application Change-Id: Ie2316fa6125b17d240fb7a5bad25b4e1b69fba21 Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/META-INF/MANIFEST.MF2
-rw-r--r--plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/pom.xml2
-rw-r--r--plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/src/org/eclipse/papyrus/toolsmiths/profilemigration/internal/migrators/atomic/stereotype/MoveStereotypeMigrator.java17
3 files changed, 11 insertions, 10 deletions
diff --git a/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/META-INF/MANIFEST.MF b/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/META-INF/MANIFEST.MF
index 8628ed79f2d..d6cf47bc92a 100644
--- a/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/META-INF/MANIFEST.MF
+++ b/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.toolsmiths.profilemigration;singleton:=true
-Bundle-Version: 0.7.100.qualifier
+Bundle-Version: 0.7.101.qualifier
Bundle-ClassPath: .
Require-Bundle: org.eclipse.ui,
com.google.guava;bundle-version="21.0.0",
diff --git a/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/pom.xml b/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/pom.xml
index bc9a0aa681f..660ffc67cfd 100644
--- a/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/pom.xml
+++ b/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.toolsmiths.profilemigration</artifactId>
- <version>0.7.100-SNAPSHOT</version>
+ <version>0.7.101-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/src/org/eclipse/papyrus/toolsmiths/profilemigration/internal/migrators/atomic/stereotype/MoveStereotypeMigrator.java b/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/src/org/eclipse/papyrus/toolsmiths/profilemigration/internal/migrators/atomic/stereotype/MoveStereotypeMigrator.java
index 8115a2eb7d2..8c021d24da9 100644
--- a/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/src/org/eclipse/papyrus/toolsmiths/profilemigration/internal/migrators/atomic/stereotype/MoveStereotypeMigrator.java
+++ b/plugins/toolsmiths/profilemigration/org.eclipse.papyrus.toolsmiths.profilemigration/src/org/eclipse/papyrus/toolsmiths/profilemigration/internal/migrators/atomic/stereotype/MoveStereotypeMigrator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2017 CEA LIST.
+ * Copyright (c) 2017, 2018 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -11,6 +11,7 @@
*
* Contributors:
* Pauline DEVILLE (CEA LIST) pauline.deville@cea.fr - Initial API and implementation
+ * Pauline DEVILLE (CEA LIST) pauline.deville@cea.fr - Bug 538912
*
*****************************************************************************/
@@ -73,7 +74,7 @@ public class MoveStereotypeMigrator extends AbstractMigrator implements IMoveSte
* 1] the treeNode is a moved node
* 2] the moved element is a Stereotype
* 3] the new container is in the currently profile use for the migration
- *
+ *
* @param node
* @return true if the treeNode represent the current change
*/
@@ -111,14 +112,14 @@ public class MoveStereotypeMigrator extends AbstractMigrator implements IMoveSte
if (newContainer instanceof Package) {
Profile nearestProfile = getNearestProfile((Package) newContainer);
Profile profile = getAppliedProfile(nearestProfile);
- if (profile == null) { // the new container is in a profile which is not applied yet
+ List<StereotypeApplicationDescriptor> list = StereotypeApplicationRegistry.getStereotypeApplicationDescriptors(stereotype);
+ if (profile == null && !list.isEmpty()) { // the new container is in a profile which is not applied yet
MoveStereotypeDialog dialog = new MoveStereotypeDialog(Display.getDefault().getActiveShell(), stereotype, nearestProfile);
dialog.open();
if (dialog.isReapply()) { // the answer is yes: apply profile
MigratorProfileApplication.profiledModel.applyProfile(nearestProfile);
MigratorProfileApplication.newAppliedProfile.add(nearestProfile);
} else { // the answer is no: delete stereotype application
- List<StereotypeApplicationDescriptor> list = StereotypeApplicationRegistry.getStereotypeApplicationDescriptors(stereotype);
for (StereotypeApplicationDescriptor descriptor : list) {
descriptor.getOwner().unapplyStereotype(descriptor.getStereotype());
}
@@ -170,7 +171,7 @@ public class MoveStereotypeMigrator extends AbstractMigrator implements IMoveSte
/**
* Get the value of the preference for the specific dialog
- *
+ *
* @return true if the dialog should be display
*/
private boolean isDisplayDialogPreference() {
@@ -201,7 +202,7 @@ public class MoveStereotypeMigrator extends AbstractMigrator implements IMoveSte
/**
* Get the new container of the element
- *
+ *
* @return the new container of the element
*/
@Override
@@ -211,7 +212,7 @@ public class MoveStereotypeMigrator extends AbstractMigrator implements IMoveSte
/**
* Get the old container of the element (before the move)
- *
+ *
* @return the old container of the element
*/
@Override
@@ -221,7 +222,7 @@ public class MoveStereotypeMigrator extends AbstractMigrator implements IMoveSte
/**
* Get the moved element
- *
+ *
* @return the moved element
*/
@Override

Back to the top