Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/architecture')
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java36
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java48
2 files changed, 56 insertions, 28 deletions
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 d7b361b9bb7..1ad3accb24a 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
@@ -1,17 +1,17 @@
/**
* Copyright (c) 2017 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Maged Elaasar - Initial API and implementation
- *
- *
+ *
+ *
*/
package org.eclipse.papyrus.infra.architecture.listeners;
@@ -31,38 +31,46 @@ public class ArchitectureDescriptionSnippet implements IModelSetSnippet {
* The installed adapter
*/
private ArchitectureDescriptionAdapter adapter = new ArchitectureDescriptionAdapter();
-
+
/**
* Installs the architecture adapter model snippet on the given model set
- *
+ *
* @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#start(org.eclipse.papyrus.infra.core.resource.ModelSet)
*
- * @param modelSet the given model set
+ * @param modelSet
+ * the given model set
*/
@Override
public void start(ModelSet modelSet) {
DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID);
- if (diModel != null)
+ if (diModel != null) {
diModel.getResource().eAdapters().add(adapter);
+ }
SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID);
- if (sashModel != null)
+ if (sashModel != null) {
sashModel.getResource().eAdapters().add(adapter);
+ }
}
/**
* Removes the architecture adapter model snippet from the given model set
- *
+ *
* @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#dispose(org.eclipse.papyrus.infra.core.resource.ModelSet)
*
- * @param modelSet the given model set
+ * @param modelSet
+ * the given model set
*/
@Override
public void dispose(ModelSet modelSet) {
DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID);
- if (diModel != null)
+ if (diModel != null) {
diModel.getResource().eAdapters().remove(adapter);
+ }
SashModel sashModel = (SashModel) modelSet.getModel(SashModel.MODEL_ID);
- if (sashModel != null)
- sashModel.getResource().eAdapters().remove(adapter);
+ if (sashModel != null) {
+ if (sashModel.getResource() != null) {
+ sashModel.getResource().eAdapters().remove(adapter);
+ }
+ }
}
}
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java
index 57325935a75..b8c855d5c2e 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java
@@ -1,17 +1,17 @@
/**
- * Copyright (c) 2017 CEA LIST.
- *
+ * Copyright (c) 2017, 2020 CEA LIST.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Maged Elaasar - Initial API and implementation
- *
- *
+ * Vincent Lorenzo (CEA LIST) - vincent.lorenzo@cea.fr - bug 565361
+ *
*/
package org.eclipse.papyrus.infra.core.architecture.merged;
@@ -24,15 +24,16 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.papyrus.infra.core.architecture.ADElement;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage;
import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
+import org.eclipse.papyrus.infra.core.architecture.TreeViewerConfiguration;
/**
* An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core.
- * architecture.ArchitectureDescriptionLanguage}s. This allows the definition of architecture
- * description languages to be split across several architectural models (*.architecture).
- *
+ * architecture.ArchitectureDescriptionLanguage}s. This allows the definition of architecture
+ * description languages to be split across several architectural models (*.architecture).
+ *
* This class is a subclass of {@link org.eclipse.papyrus.infra.core.architecture.merged.
* MergedArchitectureContext}s
- *
+ *
* @see org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage
* @since 1.0
*/
@@ -41,29 +42,34 @@ public class MergedArchitectureDescriptionLanguage extends MergedArchitectureCon
/**
* Create a new '<em><b>Merged Architecture Description Language</b></em>'.
*
- * @param domain the merged parent domain of this language
+ * @param domain
+ * the merged parent domain of this language
*/
public MergedArchitectureDescriptionLanguage(MergedArchitectureDomain domain) {
super(domain);
}
+
+
+
/**
* Get the language's metamodel EPackage
- *
+ *
* @return an EPackage
*/
public EPackage getMetamodel() {
for (ADElement element : elements) {
ArchitectureDescriptionLanguage language = (ArchitectureDescriptionLanguage) element;
- if (language.getMetamodel() != null)
+ if (language.getMetamodel() != null) {
return language.getMetamodel();
+ }
}
return null;
}
/**
* Get a merged collection of the language's profile EPackages
- *
+ *
* @return a collection of EPackages
*/
public Collection<EPackage> getProfiles() {
@@ -77,7 +83,7 @@ public class MergedArchitectureDescriptionLanguage extends MergedArchitectureCon
/**
* Get a merged collection of the language's representation kinds
- *
+ *
* @return a collection of representation kinds
*/
public Collection<RepresentationKind> getRepresentationKinds() {
@@ -89,4 +95,18 @@ public class MergedArchitectureDescriptionLanguage extends MergedArchitectureCon
return Collections.unmodifiableCollection(kinds);
}
+ /**
+ *
+ * @return
+ * the a collection of TreeViewerConfiguration
+ */
+ public Collection<TreeViewerConfiguration> getTreeViewerConfigurations() {
+ Set<TreeViewerConfiguration> kinds = new LinkedHashSet<>();
+ for (ADElement element : elements) {
+ ArchitectureDescriptionLanguage language = (ArchitectureDescriptionLanguage) element;
+ kinds.addAll(language.getTreeViewerConfigurations());
+ }
+ return Collections.unmodifiableCollection(kinds);
+ }
+
}

Back to the top