Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ModelSet.java8
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java6
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModelProviderManager.java13
3 files changed, 20 insertions, 7 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ModelSet.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ModelSet.java
index e0c17b97958..dcc40516422 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ModelSet.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ModelSet.java
@@ -976,8 +976,12 @@ public class ModelSet extends ResourceSetImpl {
return new Internal() {
@Override
- public void setPrimaryModelResourceURI(URI uri) {
- setURIWithoutExtension(uri.trimFileExtension());
+ public void setPrimaryModelResourceURI(URI uri) { //Bug 434839 : we create a new papyrus sashmodel from an existing model.profile.uml and we are avoiding to trim .profile
+ if(uri.lastSegment().endsWith("profile")) {
+ setURIWithoutExtension(uri);
+ } else {
+ setURIWithoutExtension(uri.trimFileExtension());
+ }
}
@Override
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java
index a940f921411..4b7f81d8a8a 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java
@@ -147,7 +147,11 @@ public class SashModel extends EMFLogicalModel implements IModel {
if(isLegacy(uriWithoutExtension)) {
super.createModel(getSashModelStoreURI(uriWithoutExtension).trimFileExtension());
} else {
- super.createModel(uriWithoutExtension);
+ if(!uriWithoutExtension.lastSegment().endsWith(SASH_MODEL_FILE_EXTENSION)) {//Bug 434839 : we create a new papyrus sashmodel from an existing model.profile.uml and were avoiding to trim .profile
+ super.createModel(getSashModelStoreURI(uriWithoutExtension).trimFileExtension());
+ } else {
+ super.createModel(uriWithoutExtension);
+ }
}
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModelProviderManager.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModelProviderManager.java
index d904a48ed20..36384c5a6e1 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModelProviderManager.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModelProviderManager.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014 CEA and others.
- *
+ *
* 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
@@ -64,9 +64,9 @@ class SashModelProviderManager {
/**
* Obtains the most appropriate sash model provider for the specified URI.
- *
+ *
* @param userModelURI
- *
+ *
* @return the sash model provider, never {@code null} (there is always a default available)
*/
ISashModelProvider getSashModelProvider(final URI userModelURI) {
@@ -118,7 +118,12 @@ class SashModelProviderManager {
@Override
public URI getSashModelURI(URI userModelURI) {
- final URI uriWithoutExtension = userModelURI.trimFileExtension();
+ final URI uriWithoutExtension;
+ if(!userModelURI.lastSegment().endsWith(SashModel.SASH_MODEL_FILE_EXTENSION)) { //Bug 434839 : we create a new papyrus sashmodel from an existing model.profile.uml
+ uriWithoutExtension = userModelURI;
+ } else {
+ uriWithoutExtension = userModelURI.trimFileExtension();
+ }
IPath stateLocation = Activator.getDefault().getStateLocation();

Back to the top