Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2017-04-25 19:12:39 +0000
committerMaged Elaasar2017-04-25 19:12:39 +0000
commit607192140c927b46ad7a9e63575b4f2c0c9f9440 (patch)
tree5c79ddd7589887464897ad37d0302fe98fec2557 /plugins/infra/architecture
parent5498b8bb2230313bc4db89e0d4c0f44f4cb2c4be (diff)
downloadorg.eclipse.papyrus-607192140c927b46ad7a9e63575b4f2c0c9f9440.tar.gz
org.eclipse.papyrus-607192140c927b46ad7a9e63575b4f2c0c9f9440.tar.xz
org.eclipse.papyrus-607192140c927b46ad7a9e63575b4f2c0c9f9440.zip
Bug 510451 - Add the architecture description adapter to the sash
resource as well (as the di resource). Change-Id: I22ead1b772ee5387ec92b212bb8449ec324c79bd Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'plugins/infra/architecture')
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java8
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java15
2 files changed, 16 insertions, 7 deletions
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java
index dc221a27b4e..b2a5aa2c3d5 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java
@@ -69,8 +69,8 @@ public class ArchitectureDescriptionNotifier {
* @param notification the change event
*/
public void fireArchitectureContextChanged(Notification notification) {
- for (IArchitectureDescriptionListener policyCheckerListener : listeners) {
- policyCheckerListener.architectureContextChanged(notification);
+ for (IArchitectureDescriptionListener listener : listeners) {
+ listener.architectureContextChanged(notification);
}
}
@@ -80,8 +80,8 @@ public class ArchitectureDescriptionNotifier {
* @param notification the change event
*/
public void fireArchitectureViewpointsChanged(Notification notification) {
- for (IArchitectureDescriptionListener policyCheckerListener : listeners) {
- policyCheckerListener.architectureViewpointsChanged(notification);
+ for (IArchitectureDescriptionListener listener : listeners) {
+ listener.architectureViewpointsChanged(notification);
}
}
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java
index 2739e936fa6..b37cb714a91 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.infra.architecture.listeners;
import org.eclipse.papyrus.infra.core.resource.IModelSetSnippet;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
+import org.eclipse.papyrus.infra.core.resource.sasheditor.SashModel;
/**
* A model snippet to install the architecture description adapter in the DI model
@@ -27,7 +28,7 @@ public class ArchitectureDescriptionSnippet implements IModelSetSnippet {
/**
* The installed adapter
*/
- private ArchitectureDescriptionAdapter adapter;
+ private ArchitectureDescriptionAdapter adapter = new ArchitectureDescriptionAdapter();
/**
* Installs the architecture adapter model snippet on the given model set
@@ -39,7 +40,11 @@ public class ArchitectureDescriptionSnippet implements IModelSetSnippet {
@Override
public void start(ModelSet modelSet) {
DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID);
- diModel.getResource().eAdapters().add(adapter = new ArchitectureDescriptionAdapter());
+ if (diModel != null)
+ diModel.getResource().eAdapters().add(adapter);
+ SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID);
+ if (sashModel != null)
+ sashModel.getResource().eAdapters().add(adapter);
}
/**
@@ -52,6 +57,10 @@ public class ArchitectureDescriptionSnippet implements IModelSetSnippet {
@Override
public void dispose(ModelSet modelSet) {
DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID);
- diModel.getResource().eAdapters().remove(adapter);
+ if (diModel != null)
+ diModel.getResource().eAdapters().remove(adapter);
+ SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID);
+ if (sashModel != null)
+ sashModel.getResource().eAdapters().remove(adapter);
}
}

Back to the top