Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2018-03-13 00:53:45 +0000
committerPatrick Tessier2018-04-17 13:00:08 +0000
commit9af4d71233e9c5248c660e93af74ce25e87fd23b (patch)
treee2c3525c10a0e519aa2b14596ee704542fe8b67b /plugins/infra
parent0e1e73f782b91ea35bbec792d5f8d475945ce4e6 (diff)
downloadorg.eclipse.papyrus-9af4d71233e9c5248c660e93af74ce25e87fd23b.tar.gz
org.eclipse.papyrus-9af4d71233e9c5248c660e93af74ce25e87fd23b.tar.xz
org.eclipse.papyrus-9af4d71233e9c5248c660e93af74ce25e87fd23b.zip
Bug 518695 - [Wizard][AFViewpoints] Viewpoints are not taken into
account when using Templates Switched the architecture context and viewpoints to the selected ones when the new model is created from a template Change-Id: Ice8e59acaa1c8029009e052a716568e26b6cd1ea Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java26
1 files changed, 11 insertions, 15 deletions
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 54ab1d181a9..646a452c115 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
@@ -20,7 +20,6 @@ import java.beans.PropertyChangeSupport;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
-import java.util.Collections;
import java.util.Map;
import org.eclipse.emf.common.notify.Adapter;
@@ -29,7 +28,6 @@ import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.URIConverter;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.papyrus.infra.core.Activator;
@@ -310,22 +308,20 @@ public class SashModel extends EMFLogicalModel implements IModel {
*
*/
protected URI getSashModelURI(URI uriWithoutExtension) {
- URIConverter converter = getModelManager().getURIConverter();
URI legacyURI = getLegacyURI(uriWithoutExtension);
- // If the DI file exists and contains a SashWindowsMngr, this is a legacy model
- if (converter.exists(legacyURI, Collections.emptyMap())) {
- try {
- Resource diResource = getModelManager().getResource(legacyURI, true);
- if (DiUtils.lookupSashWindowsMngr(diResource) != null) {
- return legacyURI;
- }
- } catch (Exception ex) {
- // Temporary workaround: the DI file may exist and be empty
- // (DiModel is currently disabled and doesn't properly init the di file)
- // Log the error and continue
- Activator.log.error(ex);
+ // If the DI model exists and contains a SashWindowsMngr, this is a legacy model
+ // (don't test the DI model on the file system, in case the DI model is not saved yet)
+ try {
+ Resource diResource = getModelManager().getResource(legacyURI, false);
+ if (diResource != null && DiUtils.lookupSashWindowsMngr(diResource) != null) {
+ return legacyURI;
}
+ } catch (Exception ex) {
+ // Temporary workaround: the DI file may exist and be empty
+ // (DiModel is currently disabled and doesn't properly init the di file)
+ // Log the error and continue
+ Activator.log.error(ex);
}
return getSashModelStoreURI(uriWithoutExtension);
}

Back to the top