Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-01-20 19:07:38 +0000
committerChristian W. Damus2016-01-22 15:57:13 +0000
commit02b052a140cd3c0499700afd5b8a1fdd31782a71 (patch)
treeeb2cf1b4eb11829dcf6d94ffad7644e318eaa804 /plugins
parent929e9738301b35cef5cc1ab00f47047671940bd5 (diff)
downloadorg.eclipse.papyrus-02b052a140cd3c0499700afd5b8a1fdd31782a71.tar.gz
org.eclipse.papyrus-02b052a140cd3c0499700afd5b8a1fdd31782a71.tar.xz
org.eclipse.papyrus-02b052a140cd3c0499700afd5b8a1fdd31782a71.zip
Bug 485220: [Architecture] Provide a more modular architecture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485220 Decouple infra bundles from dependencies on UML, especially for access to the semantic model, using new APIs provided by the ILanguageService and IModel and also by the refined and new implementation of the SemanticService APIs defined in previous releases. Provide generalized access to SemanticEMFContentProviders for the semantic model content in the ModelSet by adaptation of IModels (semantic IModels per new Language Service API) to a new ISemanticContentProviderFactory protocol that creates content providers appropriate to the specific semantic model. Move the identifier of the Papyrus toolbar contribution out of the UML namespace: org.eclipse.papyrus.uml.diagram.ui.toolbar is now just org.eclipse.papyrus.ui.toolbar. Add a new XML enablement expression definition named org.eclipse.papyrus.ui.semanticModelActive as a generalization of the org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel for more than just UML Papyrus editors. Tests all still pass (inasmuch as they do in the nightly master builds). Change-Id: I41af229742134428e9e00f41575c14ef1aaf5e09
Diffstat (limited to 'plugins')
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/plugin.xml2
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/plugin.xml11
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/schema/language.exsd34
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/expressions/ServiceRegistryPropertyTester.java69
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/LanguageModelRegistry.java146
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguage.java16
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguageService.java36
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java33
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResource.java19
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java12
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IEMFModel.java14
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IModel.java17
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/sasheditor/SashModel.java15
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/DiResourceSet.java284
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/plugin.xml6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationModel.java24
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gef/META-INF/MANIFEST.MF3
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java14
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml11
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.controlmode/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF9
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.classpath14
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/Messages.java16
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/messages.properties13
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java21
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/src/org/eclipse/papyrus/infra/extendedtypes/presentation/CustomExtendedtypesEditor.java2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.ui/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes/plugin.xml8
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowDown_16x16.gifbin0 -> 332 bytes
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowLeft_16x16.gifbin0 -> 327 bytes
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowRight_16x16.gifbin0 -> 541 bytes
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowUp_16x16.gifbin0 -> 323 bytes
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/insp_sbook.gifbin0 -> 459 bytes
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/Activator.java39
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkEditor.java5
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkWeb.java10
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/AbstractEditHyperlinkDocumentShell.java6
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/DefaultHyperLinkTab.java9
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/.classpath4
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF8
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/build.properties1
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java46
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/plugin.xml20
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositePapyrusContentProvider.java109
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositeSemanticContentProviderFactory.java63
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/DelegatingPapyrusContentProvider.java170
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/ISemanticContentProviderFactory.java59
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java18
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.classpath14
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/META-INF/MANIFEST.MF8
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/OnDemandLoadingModelSet.java54
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/util/LoadingUtils.java49
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.classpath14
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/src/org/eclipse/papyrus/infra/services/semantic/service/impl/SemanticServiceImpl.java62
-rw-r--r--plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/Profile.gifbin0 -> 154 bytes
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototypeContentProvider.java46
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.gen.xml2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/plugin.gen.xml2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui.perspectiveconfiguration/plugin.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/.classpath7
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/.gitignore1
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/.project28
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/META-INF/MANIFEST.MF41
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/about.html28
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/build.properties18
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/plugin.properties13
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/plugin.xml14
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/pom.xml14
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/internal/adapters/UMLModelAdapterFactory.java51
-rw-r--r--plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/model/CreatedPapyrusProfileModel.java75
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/plugin.xml12
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/model/UmlModel.java23
85 files changed, 1851 insertions, 548 deletions
diff --git a/plugins/editor/org.eclipse.papyrus.editor/plugin.xml b/plugins/editor/org.eclipse.papyrus.editor/plugin.xml
index f930ad22cd4..88bc6cb3de3 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/plugin.xml
+++ b/plugins/editor/org.eclipse.papyrus.editor/plugin.xml
@@ -76,7 +76,7 @@
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
- id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ id="org.eclipse.papyrus.ui.toolbar">
<command
commandId="org.eclipse.papyrus.editor.previousTabCommand"
icon="icons/arrow_left.gif"
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF b/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF
index a7f9bade242..e0d039e4b5b 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF
@@ -3,6 +3,7 @@ Export-Package: org.eclipse.papyrus.infra.core,
org.eclipse.papyrus.infra.core.clipboard,
org.eclipse.papyrus.infra.core.editor,
org.eclipse.papyrus.infra.core.extension,
+ org.eclipse.papyrus.infra.core.internal.expressions;x-internal:=true,
org.eclipse.papyrus.infra.core.internal.sashmodel;x-internal:=true,
org.eclipse.papyrus.infra.core.language,
org.eclipse.papyrus.infra.core.listenerservice,
@@ -23,7 +24,8 @@ Require-Bundle: org.eclipse.core.runtime,
com.google.guava;bundle-version="11.0.0",
org.eclipse.core.filesystem,
org.eclipse.emf.ecore.xmi;bundle-version="2.12.0",
- org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0",
+ org.eclipse.core.expressions;bundle-version="3.5.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/plugin.xml b/plugins/infra/core/org.eclipse.papyrus.infra.core/plugin.xml
index 06e5a11d674..a7a4780781c 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/plugin.xml
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/plugin.xml
@@ -105,4 +105,15 @@
</dependsOn>
</serviceFactory>
</extension>
+
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ id="org.eclipse.papyrus.infra.core.serviceRegistryProperties"
+ type="org.eclipse.papyrus.infra.core.services.ServicesRegistry"
+ namespace="org.eclipse.papyrus.infra.core"
+ properties="hasSemanticModel"
+ class="org.eclipse.papyrus.infra.core.internal.expressions.ServiceRegistryPropertyTester">
+ </propertyTester>
+ </extension>
</plugin>
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/language.exsd b/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/language.exsd
index 516be1d8310..36ab0a0cda8 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/language.exsd
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/schema/language.exsd
@@ -17,9 +17,10 @@
</appInfo>
</annotation>
<complexType>
- <sequence>
+ <choice minOccurs="1" maxOccurs="unbounded">
<element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
+ <element ref="modelBinding"/>
+ </choice>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
@@ -190,6 +191,33 @@ Required if the &lt;tt&gt;&amp;lt;contentType&amp;gt;&lt;/tt&gt; element is spec
</complexType>
</element>
+ <element name="modelBinding">
+ <annotation>
+ <documentation>
+ Binds a Papyrus model to a language that describes its semantic content in the ModelSet.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="language" type="string" use="required">
+ <annotation>
+ <documentation>
+ The Papyrus Modeling Language to which to bind a model.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.papyrus.infra.core.language/provider/language/@id"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="model" type="string" use="required">
+ <annotation>
+ <documentation>
+ References the model, by ID, to which the language is bound.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
<annotation>
<appInfo>
<meta.section type="since"/>
@@ -207,7 +235,7 @@ Required if the &lt;tt&gt;&amp;lt;contentType&amp;gt;&lt;/tt&gt; element is spec
<meta.section type="copyright"/>
</appInfo>
<documentation>
- Copyright (c) 2015 Christian W. Damus and others.
+ Copyright (c) 2015, 2016 Christian W. Damus and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/expressions/ServiceRegistryPropertyTester.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/expressions/ServiceRegistryPropertyTester.java
new file mode 100644
index 00000000000..89d2aec4da3
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/expressions/ServiceRegistryPropertyTester.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2016 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.internal.expressions;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.papyrus.infra.core.language.ILanguage;
+import org.eclipse.papyrus.infra.core.language.ILanguageService;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.tools.util.TypeUtils;
+
+/**
+ * Enablement expression properties for the {@link ServicesRegistry} type. Supported properties are:
+ * <ul>
+ * <li>{@link #hasSemanticModel(ServicesRegistry) hasSemanticModel}: does any {@link ILanguage}
+ * instantiated in the registry's {@link ModelSet} (if there is one) have a corresponding
+ * {@link IModel} providing its content?</li>
+ * </ul>
+ */
+public class ServiceRegistryPropertyTester extends PropertyTester {
+
+ private static final String PROPERTY_HAS_SEMANTIC_MODEL = "hasSemanticModel"; //$NON-NLS-1$
+
+ public ServiceRegistryPropertyTester() {
+ super();
+ }
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ boolean result;
+
+ switch (property) {
+ case PROPERTY_HAS_SEMANTIC_MODEL:
+ result = hasSemanticModel(TypeUtils.as(receiver, ServicesRegistry.class));
+ break;
+ default:
+ result = false;
+ break;
+ }
+
+ return result;
+ }
+
+ protected boolean hasSemanticModel(ServicesRegistry services) {
+ boolean result = false;
+
+ try {
+ ModelSet modelSet = services.getService(ModelSet.class);
+ result = !ILanguageService.getLanguageModels(modelSet).isEmpty();
+ } catch (ServiceException e) {
+ // Fine, there's no model-set
+ }
+
+ return result;
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/LanguageModelRegistry.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/LanguageModelRegistry.java
new file mode 100644
index 00000000000..b28d4bb5be8
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/internal/language/LanguageModelRegistry.java
@@ -0,0 +1,146 @@
+/*****************************************************************************
+ * Copyright (c) 2016 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.internal.language;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.plugin.RegistryReader;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.infra.core.Activator;
+import org.eclipse.papyrus.infra.core.language.ILanguage;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+
+import com.google.common.base.Strings;
+
+/**
+ * A registry of bindings of {@link IModel}s to {@link ILanguage}s, by ID.
+ */
+public class LanguageModelRegistry {
+
+ private static final String EXT_POINT = "language"; //$NON-NLS-1$
+
+ public static final LanguageModelRegistry INSTANCE = new LanguageModelRegistry();
+
+ private final Map<String, String> modelBindings = new HashMap<>();
+
+ private LanguageModelRegistry() {
+ super();
+
+ new MyRegistryReader().readRegistry();
+ }
+
+ public String getModelID(String languageID) {
+ return modelBindings.get(languageID);
+ }
+
+ public String getModelID(ILanguage language) {
+ return getModelID(language.getID());
+ }
+
+ public IModel getModel(ILanguage language, ModelSet modelSet) {
+ String modelID = getModelID(language);
+ return (modelID == null) ? null : modelSet.getModel(modelID);
+ }
+
+ /**
+ * Bind a model to a language. Has no effect it the language is already bound to a model.
+ *
+ * @param languageID
+ * the language to bind
+ * @param modelID
+ * the unique identifier of the model to bind to the language
+ */
+ public void bind(String languageID, String modelID) {
+ String current = modelBindings.putIfAbsent(languageID, modelID);
+ if (current != null) {
+ Activator.log.warn(NLS.bind("Language {0} is already bound to model {1}; ignoring model {2}", new Object[] { languageID, current, modelID }));
+ }
+ }
+
+ /**
+ * Unbind a model from a language. Has no effect if the specified model is not currently
+ * bound to the language.
+ *
+ * @param languageID
+ * the language to unbind
+ * @param modelID
+ * the unique identifier of the model to unbind from the language
+ */
+ public void unbind(String languageID, String modelID) {
+ if (!modelBindings.remove(languageID, modelID)) {
+ Activator.log.warn(NLS.bind("Attempt to unbind model {0} from language {1} to which it is not bound", modelID, languageID));
+ }
+ }
+
+ //
+ // Nested types
+ //
+
+ private class MyRegistryReader extends RegistryReader {
+
+ private static final String E_MODEL_BINDING = "modelBinding"; //$NON-NLS-1$
+
+ private static final String A_LANGUAGE = "language"; //$NON-NLS-1$
+
+ private static final String A_MODEL = "model"; //$NON-NLS-1$
+
+
+ MyRegistryReader() {
+ super(Platform.getExtensionRegistry(), Activator.PLUGIN_ID, EXT_POINT);
+ }
+
+ @Override
+ protected boolean readElement(IConfigurationElement element, boolean add) {
+ return add ? handleAdd(element) : handleRemove(element);
+ }
+
+ private boolean handleAdd(IConfigurationElement element) {
+ boolean result = true;
+
+ if (E_MODEL_BINDING.equals(element.getName())) {
+ String languageID = element.getAttribute(A_LANGUAGE);
+ String modelID = element.getAttribute(A_MODEL);
+
+ if (Strings.isNullOrEmpty(languageID)) {
+ logMissingAttribute(element, A_LANGUAGE);
+ } else if (Strings.isNullOrEmpty(modelID)) {
+ logMissingAttribute(element, A_MODEL);
+ } else {
+ bind(languageID, modelID);
+ }
+ }
+
+ return result;
+ }
+
+ private boolean handleRemove(IConfigurationElement element) {
+ boolean result = true;
+
+ if (E_MODEL_BINDING.equals(element.getName())) {
+ String languageID = element.getAttribute(A_LANGUAGE);
+ String modelID = element.getAttribute(A_MODEL);
+
+ if (!Strings.isNullOrEmpty(languageID) && !Strings.isNullOrEmpty(modelID)) {
+ unbind(languageID, modelID);
+ }
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguage.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguage.java
index 86ce58cfa22..57b9ecf391b 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguage.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
+ * Copyright (c) 2015, 2016 Christian W. Damus and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -13,6 +13,8 @@
package org.eclipse.papyrus.infra.core.language;
+import org.eclipse.papyrus.infra.core.internal.language.LanguageModelRegistry;
+import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
/**
@@ -53,6 +55,18 @@ public interface ILanguage {
String getName();
/**
+ * Obtains the model, if any, that provides the semantic model content described by this language.
+ *
+ * @param modelSet
+ * a model set in which the language is {@linkplain #install(ModelSet) installed}
+ *
+ * @return the language's model in the {code modelSet}, or {@code null} if there is no corresponding model
+ */
+ default IModel getModel(ModelSet modelSet) {
+ return LanguageModelRegistry.INSTANCE.getModel(this, modelSet);
+ }
+
+ /**
* Installs me on a model-set. This performs whatever registrations, listener attachments, etc. that may be necessary
* for the proper functioning of my language in the Papyrus context.
*
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguageService.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguageService.java
index d59d3f87a46..7fa56614980 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguageService.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/language/ILanguageService.java
@@ -13,11 +13,19 @@
package org.eclipse.papyrus.infra.core.language;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
import java.util.Set;
+import java.util.stream.Collectors;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.papyrus.infra.core.editor.ModelSetServiceFactory;
+import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
/**
* <p>
@@ -78,4 +86,32 @@ public interface ILanguageService extends IAdaptable, ILanguageChangeListener {
* a language provider to remove (may be {@code null}, which has no effect)
*/
void removeLanguageProvider(ILanguageProvider provider);
+
+ /**
+ * Obtains all of the {@link IModel}s that are the models for languages instantiated
+ * in a {@code modelSet}.
+ *
+ * @param modelSet
+ * a model-set
+ *
+ * @return its language models, which may be empty if the model-set is not in a
+ * service registry that has a language service
+ */
+ static Collection<IModel> getLanguageModels(ModelSet modelSet) {
+ List<IModel> result;
+
+ ILanguageService service = ServiceUtils.getInstance().getService(ILanguageService.class, ModelSetServiceFactory.getServiceRegistry(modelSet), null);
+ if (service == null) {
+ // No language service? No language models
+ result = Collections.emptyList();
+ } else {
+ result = service.getLanguages(modelSet.getURIWithoutExtension(), false).stream()
+ .map(l -> l.getModel(modelSet))
+ .filter(Objects::nonNull)
+ .distinct() // Only unique models
+ .collect(Collectors.toList());
+ }
+
+ return result;
+ }
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java
index b93d8b805e3..a1742831f77 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractBaseModel.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -10,8 +10,7 @@
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - manage models by URI, not IFile (CDO)
* Christian W. Damus (CEA) - bug 437052
- * Christian W. Damus - bug 399859
- * Christian W. Damus - bug 481149
+ * Christian W. Damus - bugs 399859, 481149, 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
@@ -430,4 +429,32 @@ public abstract class AbstractBaseModel extends AbstractModel implements IVersio
return false;
}
+ @Override
+ public Iterable<? extends EObject> getRootElements() {
+ Iterable<? extends EObject> result;
+
+ Resource resource = getResource();
+ if (resource == null) {
+ result = Collections.emptyList();
+ } else {
+ result = () -> resource.getContents().stream()
+ .filter(this::isRootElement)
+ .iterator();
+ }
+
+ return result;
+ }
+
+ /**
+ * By default, an object is a root of the model if it does not
+ * have a {@linkplain EObject#eContainer() container}.
+ *
+ * @param object
+ * an object in a resource
+ * @return whether it is a root element
+ */
+ protected boolean isRootElement(EObject object) {
+ return object.eContainer() == null;
+ }
+
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResource.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResource.java
index 9ef1316e8a2..ff8fc7986a3 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResource.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResource.java
@@ -1,6 +1,16 @@
-/**
+/*****************************************************************************
+ * Copyright (c) 2011, 2016 LIFL, CEA LIST, Christian W. Damus, 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
+ * http://www.eclipse.org/legal/epl-v10.html
*
- */
+ * Contributors:
+ * LIFL - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
import java.io.IOException;
@@ -193,6 +203,11 @@ public abstract class AbstractModelWithSharedResource<T extends EObject> extends
return roots;
}
+ @Override
+ public Iterable<? extends EObject> getRootElements() {
+ return getModelRoots();
+ }
+
/**
* @see org.eclipse.papyrus.infra.core.resource.EMFLogicalModel#isModelFor(java.lang.Object)
*
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
index d117999cebb..39c41452ec7 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013, 2014 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2013, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,10 +9,9 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 437052
- * Christian W. Damus - bug 399859
+ * Christian W. Damus - bugs 399859, 485220
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 436952
*
- *
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
@@ -171,4 +170,11 @@ public abstract class EMFLogicalModel extends AbstractBaseModel implements IEMFM
}
+ @Override
+ public Iterable<? extends EObject> getRootElements() {
+ return () -> getResources().stream()
+ .flatMap(r -> r.getContents().stream())
+ .filter(this::isRootElement)
+ .iterator();
+ }
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IEMFModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IEMFModel.java
index 964556fda7e..542c8bd2143 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IEMFModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IEMFModel.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,9 +8,12 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
/**
@@ -29,6 +32,15 @@ public interface IEMFModel extends IModel {
public Resource getResource();
/**
+ * Obtains the top-level model elements in the main resource associated with this model.
+ *
+ * @return the model roots, or an empty iterable if either there definitively are none
+ * or they cannot be determined (for example, because the main resource is a controlled
+ * unit and the parent unit is not available)
+ */
+ public Iterable<? extends EObject> getRootElements();
+
+ /**
* Called when a resource is loaded. Implement this method to configure
* the resource or load related resources
*
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IModel.java
index 837eca7ede3..c922fa611d2 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/IModel.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others.
- *
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -11,8 +10,7 @@
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - manage models by URI, not IFile (CDO)
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 436952
- * Christian W. Damus - bug 481149
- *
+ * Christian W. Damus - bugs 481149, 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource;
@@ -21,8 +19,11 @@ import java.io.IOException;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.papyrus.infra.tools.util.TypeUtils;
/**
* A Model is a set of elements defined by a metamodel (preferably an EMF
@@ -35,7 +36,7 @@ import org.eclipse.emf.common.util.URI;
* @author cedric dumoulin
*
*/
-public interface IModel {
+public interface IModel extends IAdaptable {
/**
* Initialize the model and set its associated model manager.
@@ -207,4 +208,10 @@ public interface IModel {
* the to delete on save
*/
public void cleanModel(Set<URI> resourcesToDelete);
+
+ @Override
+ default <T> T getAdapter(Class<T> adapter) {
+ // We really need to get any available adapter
+ return TypeUtils.as(Platform.getAdapterManager().loadAdapter(this, adapter.getName()), adapter);
+ }
}
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 08b531676b3..94a90564047 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
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2009, 2015 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2009, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,10 +9,8 @@
* Contributors:
* Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Rewrite the sash model - store in the plugin's PreferenceStore (Bug 429239)
- * Christian W. Damus (CEA) - bug 429242
- * Christian W. Damus (CEA) - bug 436468
- * Christian W. Damus - bug 434983
- * Christian W. Damus - bug 469188
+ * Christian W. Damus (CEA) - bugs 429242, 436468
+ * Christian W. Damus - bugs 434983, 469188, 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.core.resource.sasheditor;
@@ -26,6 +24,7 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
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;
@@ -34,6 +33,7 @@ import org.eclipse.papyrus.infra.core.Activator;
import org.eclipse.papyrus.infra.core.resource.EMFLogicalModel;
import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr;
import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils;
import com.google.common.base.Objects;
@@ -346,6 +346,11 @@ public class SashModel extends EMFLogicalModel implements IModel {
return (modelURI == null) ? null : modelURI.appendFileExtension(DiModel.MODEL_FILE_EXTENSION);
}
+ @Override
+ protected boolean isRootElement(EObject object) {
+ return super.isRootElement(object) && (object instanceof SashWindowsMngr);
+ }
+
//
// Bean API
//
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/DiResourceSet.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/DiResourceSet.java
index e3d0b46336c..eaf5335d14f 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/DiResourceSet.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/DiResourceSet.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
+ * Copyright (c) 2008, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +8,7 @@
*
* Contributors:
* Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.core.utils;
@@ -40,284 +40,4 @@ public class DiResourceSet extends ModelSet {
reader.readModel(this);
}
- /**
- * Just loads the model into the current resource set.
- *
- * @returns The loaded model or null if the model is not loaded.
- * @deprecated load requested model and get its resource. See implementation
- * for example.
- */
- // @Deprecated
- // public Resource loadModelResource(IFile file) {
- //
- // UmlModel model = null;
- // try {
- // model = (UmlModel)loadModel(UmlModel.MODEL_ID, file);
- // } catch (ModelException e) {
- // return null;
- // }
- // return model.getResource();
- // }
-
- /**
- * Returns the extension of the model. Seem to be unused.
- *
- * @deprecated Use {@link UmlModel#UML_FILE_EXTENSION}
- */
- // @Deprecated
- // public String getModelFileExtension() {
- // throw new UnsupportedOperationException("deprecated method.");
- // // if(modelFileExtension == null) {
- // // modelFileExtension = modelResource.getURI().fileExtension();
- // // }
- // // return modelFileExtension;
- // }
-
- /**
- * Load both files (DI and UML) from an handle on one of the two files.
- *
- * @param file
- * The file to load (no matter the extension)Model
- * @deprecated use {@link ModelSet#loadModels(IFile)} instead.
- */
- // @Deprecated
- // public void loadResources(IFile file) {
- // try {
- // loadModels(file);
- // } catch (ModelMultiException e) {
- // e.printStackTrace();
- // }
- //
- // // // Extract file name, without extension
- // // IPath fullPath = file.getFullPath().removeFileExtension();
- // //
- // // // load DI2
- // // URI diUri =
- // // getPlatformURI(fullPath.addFileExtension(DI_FILE_EXTENSION));
- // // diResource = getResource(diUri, true);
- // //
- // // // load notation
- // // URI notationURI =
- // // getPlatformURI(fullPath.addFileExtension(NOTATION_FILE_EXTENSION));
- // // notationResource = getResource(notationURI, true);
- // //
- // // if(notationResource != null) {
- // // // look for a model associated with a diagram in notation
- // // for(EObject eObject : notationResource.getContents()) {
- // // if(eObject instanceof Diagram) {
- // // Diagram diagram = (Diagram)eObject;
- // // if(diagram.getElement() != null) {
- // // modelResource = diagram.getElement().eResource();
- // // break;
- // // }
- // // }
- // // }
- // // }
- // //
- // //
- // // // if modelResource is still null, we look for a file with the same
- // // name and a supported extension
- // // if(modelResource == null) {
- // // IContainer folder = file.getParent();
- // // try {
- // // IResource[] files = folder.members();
- // // for(IResource r : files) {
- // // String extension = r.getFullPath().getFileExtension();
- // // if(r.getFullPath().removeFileExtension().lastSegment().equals(fullPath.lastSegment())
- // // && !DI_FILE_EXTENSION.equalsIgnoreCase(extension) &&
- // // !NOTATION_FILE_EXTENSION.equalsIgnoreCase(extension)) {
- // // if(Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().get(extension)
- // // != null) {
- // // modelResource = getResource(getPlatformURI(r.getFullPath()), true);
- // // break;
- // // }
- // // }
- // // }
- // // } catch (CoreException e) {
- // // // never happens.
- // // }
- // // }
- // //
- // // modelFileExtension = modelResource.getURI().fileExtension();
- // //
- // // // TODO move next line away from DiResourceSet ? Define a place
- // // // where Resource initialization can take place.
- // // // move this line to centralize all the adapters
- // // modelResource.eAdapters().add(new ModelListenerManager());
- // }
-
- /**
- * Create both files (DI and UML) from a filename.
- *
- * @param newFile
- * The file from which path is extracted to create the new files
- *
- * @deprecated Use {@link ModelSet#createsModels(IFile)} instead.
- */
- // @Deprecated
- // public void createModelResources(IFile newFile, String eContentType, String modelExtension) {
- //
- // // Check if parameters are those expected.
- // // If not, throws an exception to inform the programmer.
- // if(!("org.eclipse.uml2.uml".equals(eContentType) && "uml".equals(modelExtension))) {
- // throw new UnsupportedOperationException("");
- // }
- // // Create models
- // createsModels(newFile);
- //
- // // // create the di resource URI
- // // URI diUri = getPlatformURI(newFile.getFullPath());
- // // // Create the di Resource for the sashcontainer
- // // // The model will be automatically initialized by the SashContainer
- // // if needed (if it is empty).
- // // // Normally the resource should contains models set by previous use
- // // from the SashContainer
- // // diResource = createResource(diUri);
- // //
- // // IPath filenameWithoutExtension =
- // // newFile.getFullPath().removeFileExtension();
- // // // if the model is not loaded, create resource
- // // if(modelResource == null) {
- // // // create the model URI
- // // URI modelUri =
- // // getPlatformURI(filenameWithoutExtension.addFileExtension(modelExtension));
- // // // create the model resource
- // // modelResource = createResource(modelUri, eContentType);
- // // this.modelFileExtension = modelExtension;
- // // }
- // // // create the notation URI
- // // URI notationURI =
- // // getPlatformURI(filenameWithoutExtension.addFileExtension(NOTATION_FILE_EXTENSION));
- // // // create the notation resource
- // // notationResource = createResource(notationURI);
- //
- // }
-
- /**
- * Get a platform resource URI of the given path
- *
- * @param path
- * the path
- * @return the uri
- */
- // private URI getPlatformURI(IPath path) {
- // return URI.createPlatformResourceURI(path.toString(), true);
- // }
-
- /**
- * Returns the notation resource.
- *
- * @return the notationResource
- * @deprecated Use NotationUtils.getNotationModel(this).getResource();
- * instead.
- */
- // public Resource getNotationResource() {
- // return NotationUtils.getNotationModel(this).getResource();
- // }
-
- /**
- *
- *
- * @return the diResource
- * @deprecated Use NotationUtils.getSashModel(this).getResource(); instead.
- */
- // @Deprecated
- // public Resource getDiResource() {
- // return SashModelUtils.getSashModel(this).getResource();
- // }
-
- /**
- * Retrieve the di resource associated with a given model element.
- *
- * @param modelElement
- * @return the di resource or null
- * @deprecated a model should be modified/created to correctly handle
- * controlled resources
- */
- // @Deprecated
- // public Resource getAssociatedDiResource(EObject modelElement) {
- // // return the "base" di since we want the opened tabs in a unique di
- // return getDiResource();
- // }
-
- /**
- * Retrieve the notation resource associated with a given model element.
- *
- * @param modelElement
- * @return the notation resource or null
- * @deprecated a model should be modified/created to correctly handle
- * controlled resources
- */
- // @Deprecated
- // public Resource getAssociatedNotationResource(EObject modelElement) {
- // if(modelElement != null) {
- // Resource modelResource = modelElement.eResource();
- // if(modelResource != null && !modelResource.equals(getModelResource())) {
- // // handle controlled resource
- // return getAssociatedResource(modelResource, NotationModel.NOTATION_FILE_EXTENSION);
- // }
- // }
- // return getNotationResource();
- // }
-
- /**
- * Retrieve the model resource associated with a given model element. Please
- * refers to {@link ResourceSet#getResource(URI, boolean)} for the meaning
- * of loadOnDemand.
- *
- * @param modelElement
- * @return the model resource or null
- * @deprecated a model should be modified/created to correctly handle
- * controlled resources
- */
- // @Deprecated
- // public Resource getAssociatedModelResource(EObject modelElement) {
- // if(modelElement != null && modelElement.eResource() != null) {
- // return modelElement.eResource();
- // }
- // return getModelResource();
- // }
-
- /**
- * Returns the model resource.
- *
- * @return the modelResource
- * @deprecated Use NotationUtils.getUmlModel(this).getResource(); instead.
- */
- // @Deprecated
- // public Resource getModelResource() {
- // return UmlUtils.getUmlModel(this).getResource();
- // }
-
- /**
- * Returns the additional resources.
- *
- * @return The additional resources.
- */
- // public List<Resource> getAdditionalResources() {
- // List<Resource> additionnalResources = new ArrayList<Resource>();
- // for(Resource resource : getResources()) {
- // // ignore di, notation and domain resources
- //
- // if(resource != getDiResource() && resource != getNotationResource() && resource != getModelResource()) {
- // additionnalResources.add(resource);
- // }
- // }
- //
- // return additionnalResources;
- // }
-
- /**
- * Returns the related di file.
- *
- * @param file
- * A file (di, model or notation).
- * @return The associated DI file.
- * @deprecated use {@link DiModelUtils#getRelatedDiFile(IFile)}
- */
- // @Deprecated
- // public static IFile getRelatedDiFile(IFile file) {
- // return DiModelUtils.getRelatedDiFile(file);
- // }
-
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/plugin.xml b/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/plugin.xml
index 05435f04a85..8df2cd1a052 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/plugin.xml
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf/plugin.xml
@@ -64,7 +64,7 @@
style="push"
tooltip="Enable write">
<visibleWhen>
- <reference definitionId="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel"/>
+ <reference definitionId="org.eclipse.papyrus.ui.semanticModelActive"/>
</visibleWhen>
</command>
</menuContribution>
@@ -77,7 +77,7 @@
style="push"
tooltip="Enable write">
<visibleWhen>
- <reference definitionId="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel"/>
+ <reference definitionId="org.eclipse.papyrus.ui.semanticModelActive"/>
</visibleWhen>
</command>
</menuContribution>
@@ -90,7 +90,7 @@
style="push"
tooltip="Enable write">
<visibleWhen>
- <reference definitionId="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel"/>
+ <reference definitionId="org.eclipse.papyrus.ui.semanticModelActive"/>
</visibleWhen>
</command>
</toolbar>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationModel.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationModel.java
index f922566be87..1e1841b2197 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationModel.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/model/NotationModel.java
@@ -1,6 +1,16 @@
-/**
+/*****************************************************************************
+ * Copyright (c) 2011, 2016 LIFL, CEA LIST, Christian W. Damus, 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
+ * http://www.eclipse.org/legal/epl-v10.html
*
- */
+ * Contributors:
+ * LIFL - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.model;
import java.util.Collections;
@@ -17,6 +27,7 @@ import org.eclipse.papyrus.infra.core.resource.EMFLogicalModel;
import org.eclipse.papyrus.infra.core.resource.IEMFModel;
import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
/**
* @author cedric dumoulin
@@ -166,4 +177,13 @@ public class NotationModel extends EMFLogicalModel implements IModel {
// not found
throw new NotFoundException(NLS.bind("No Diagram named '{0}' can be found in Model.",diagramName)); //$NON-NLS-1$
}
+
+ /**
+ * An object is additionally a root element only if it has a corresponding
+ * viewpoint prototope.
+ */
+ @Override
+ protected boolean isRootElement(EObject object) {
+ return super.isRootElement(object) && ViewPrototype.isViewObject(object);
+ }
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gef/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gef/META-INF/MANIFEST.MF
index e556885ead6..2275e528a4f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gef/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.gef/META-INF/MANIFEST.MF
@@ -8,7 +8,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0",
- org.eclipse.emf.edit;bundle-version="2.12.0"
+ org.eclipse.emf.edit;bundle-version="2.12.0",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.7.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java
index 647793abf0b..9a0489833cc 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java
@@ -121,7 +121,7 @@ public abstract class AbstractSynchronizedOnEStructuralFeatureAxisManager extend
/**
*
* @return
- * the list of the objects which are referenced by the listen features
+ * the list of the objects which are referenced by the listen features
*/
@SuppressWarnings("unchecked")
protected List<Object> getFeaturesValue() {
@@ -168,7 +168,7 @@ public abstract class AbstractSynchronizedOnEStructuralFeatureAxisManager extend
* @param objects
* the list of objects
* @return
- * the sorted list of objects
+ * the sorted list of objects
*/
protected List<Object> organizeContents(final List<Object> objects) {
return objects;
@@ -205,7 +205,7 @@ public abstract class AbstractSynchronizedOnEStructuralFeatureAxisManager extend
/**
*
* @return
- * the features to listen according to the current table configuration or <code>null</code> if it is not definedS
+ * the features to listen according to the current table configuration or <code>null</code> if it is not definedS
*/
protected Collection<EStructuralFeature> getListenFeatures() {
if (this.listenFeatures == null) {
@@ -225,7 +225,7 @@ public abstract class AbstractSynchronizedOnEStructuralFeatureAxisManager extend
/**
*
* @return
- * the filling configuration used by the table or <code>null</code> if any is defined
+ * the filling configuration used by the table or <code>null</code> if any is defined
*/
protected Collection<EStructuralFeatureValueFillingConfiguration> getFillingConfigurations() {// FIXME : local configuration not yet managed
final Collection<EStructuralFeatureValueFillingConfiguration> configs = new ArrayList<EStructuralFeatureValueFillingConfiguration>();
@@ -402,12 +402,6 @@ public abstract class AbstractSynchronizedOnEStructuralFeatureAxisManager extend
}
}
- /**
- *
- * @see org.eclipse.papyrus.uml.nattable.manager.axis.AbstractUMLSynchronizedOnFeatureAxisManager#getAllManagedAxis()
- *
- * @return
- */
@Override
public List<Object> getAllManagedAxis() {
return new ArrayList<Object>(this.managedObject);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
index 675a3763d23..80faf87c36f 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
@@ -29,7 +29,7 @@
</menu>
</menuContribution>
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?endof=org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?endof=org.eclipse.papyrus.ui.toolbar">
<toolbar id="org.eclipse.papyrus.infra.nattable.toolbar.createnattable" label="New Table Toolbar (New Version)">
</toolbar>
</menuContribution>
@@ -129,19 +129,16 @@
</activeWhen>
</handler>
</extension>
- <!-- ElementType bindings for diagram duplication with paste command -->
+ <!-- ElementType bindings for table duplication with paste command -->
<extension
point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
- <!--metamodel
- nsURI="http://www.eclipse.org/uml2/5.0.0/UML"-->
<metamodel
- nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ nsURI="http://www.eclipse.org/emf/2002/Ecore">
<adviceBinding
class="org.eclipse.papyrus.infra.nattable.common.helper.advice.NatTableDuplicateEditHelperAdvice"
id="org.eclipse.papyrus.infra.nattable.common.helper.advice.NatTableDuplicateEditHelperAdvice"
inheritance="all"
- typeId="org.eclipse.papyrus.uml.Element">
- <!--typeId="org.eclipse.papyrus.uml.Element"-->
+ typeId="*">
</adviceBinding>
</metamodel>
</extension>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.controlmode/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.controlmode/META-INF/MANIFEST.MF
index c63d8d0574c..e1c725b2ff4 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.controlmode/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.controlmode/META-INF/MANIFEST.MF
@@ -9,7 +9,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
org.eclipse.gmf.runtime.emf.commands.core,
org.eclipse.papyrus.infra.nattable.model;bundle-version="1.2.0",
- org.eclipse.uml2.uml,
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.2.0",
com.google.guava;bundle-version="11.0.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0",
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
index 9c049b82753..afe7fda25dd 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
@@ -11,23 +11,15 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.papyrus.views.modelexplorer;bundle-version="1.2.0",
- org.eclipse.gmf.runtime.notation,
org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
org.eclipse.papyrus.infra.nattable.model;bundle-version="1.2.0",
- org.eclipse.gmf.runtime.common.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
- org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0",
org.eclipse.gmf.runtime.emf.type.core,
org.eclipse.core.expressions,
org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.2.0",
org.eclipse.papyrus.emf.facet.query.java.core;bundle-version="1.2.0",
- org.eclipse.papyrus.emf.facet.efacet;bundle-version="1.2.0",
- org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="1.2.0",
org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="1.2.0",
- org.eclipse.papyrus.emf.facet.util.emf.ui;bundle-version="1.2.0",
org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
@@ -38,4 +30,3 @@ Bundle-Activator: org.eclipse.papyrus.infra.nattable.modelexplorer.Activator
Bundle-ManifestVersion: 2
Bundle-Description: %pluginDescription
Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.modelexplorer;singleton:=true
-Import-Package: org.eclipse.papyrus.uml.diagram.menu.actions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.classpath b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.classpath
index 8a8f1668cdc..eca7bdba8f0 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.classpath
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.settings/org.eclipse.jdt.core.prefs
index 94d61f00da6..b3aa6d60f94 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/META-INF/MANIFEST.MF
index 1f2cb5cd925..95266ff4127 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/META-INF/MANIFEST.MF
@@ -23,7 +23,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
- org.eclipse.papyrus.uml.tools;bundle-version="1.2.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.2.0",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0"
@@ -34,4 +33,4 @@ Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.infra.nattable.views.config.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.views.config;singleton:=true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/Messages.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/Messages.java
index 22fed7d91a3..3bad559b5a9 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/Messages.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/Messages.java
@@ -1,3 +1,16 @@
+/*****************************************************************************
+ * Copyright (c) 2013, 2016 CEA LIST, Christian W. Damus, 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.nattable.views.config.messages;
import org.eclipse.osgi.util.NLS;
@@ -9,6 +22,9 @@ public class Messages extends NLS {
public static String TableViewCreationTester_TheTableViewCanBeCreated;
public static String TableViewCreationTester_TheTableViewCantBeCreated;
+
+ public static String TableViewCreationTester_ServicesUnavailable;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/messages.properties b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/messages.properties
index d2e3e095d46..9ba9e62e2c1 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/messages.properties
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/messages/messages.properties
@@ -1,2 +1,15 @@
+#
+# Copyright (c) 2013, 2016 CEA LIST, Christian W. Damus, 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# CEA LIST - Initial API and implementation
+# Christian W. Damus - bug 485220
+#
TableViewCreationTester_TheTableViewCanBeCreated=The table of view can be created
TableViewCreationTester_TheTableViewCantBeCreated=The table of view can't be created, the context is not an element of the model
+TableViewCreationTester_ServicesUnavailable=The table of view can't be created because the language service is unavailable
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java
index ca821e659a1..5cb742e03c3 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/src/org/eclipse/papyrus/infra/nattable/views/config/utils/TableViewCreationTester.java
@@ -16,10 +16,14 @@ package org.eclipse.papyrus.infra.nattable.views.config.utils;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.core.language.ILanguageService;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
import org.eclipse.papyrus.infra.nattable.tester.ITableTester;
import org.eclipse.papyrus.infra.nattable.views.config.Activator;
import org.eclipse.papyrus.infra.nattable.views.config.messages.Messages;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
public class TableViewCreationTester implements ITableTester {
@@ -29,8 +33,19 @@ public class TableViewCreationTester implements ITableTester {
public IStatus isAllowed(Object context) {
if (context instanceof EObject) {
final EObject current = (EObject) context;
- if (current.eResource() != null && current.eResource().getURI().fileExtension().equals(UmlModel.UML_FILE_EXTENSION)) {
- return new Status(IStatus.OK, Activator.PLUGIN_ID, Messages.TableViewCreationTester_TheTableViewCanBeCreated);
+
+ try {
+ ModelSet modelSet = ServiceUtilsForEObject.getInstance().getModelSet(current);
+ IModel model = modelSet.getModelFor(current);
+ if (model != null) {
+ // This is an element of some model. Is it a semantic model?
+ if (ILanguageService.getLanguageModels(modelSet).contains(model)) {
+ return new Status(IStatus.OK, Activator.PLUGIN_ID, Messages.TableViewCreationTester_TheTableViewCanBeCreated);
+ }
+ }
+ } catch (ServiceException e) {
+ // Okay, no services? Then this isn't an appropriate context
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TableViewCreationTester_ServicesUnavailable);
}
}
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TableViewCreationTester_TheTableViewCantBeCreated);
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/META-INF/MANIFEST.MF
index 44c9ce46e09..d0dd6d2a7e0 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/META-INF/MANIFEST.MF
@@ -5,8 +5,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
- org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.uml2.uml.edit;visibility:=reexport
+ org.eclipse.emf.ecore.edit;visibility:=reexport
Export-Package: org.eclipse.papyrus.infra.extendedtypes.presentation
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/src/org/eclipse/papyrus/infra/extendedtypes/presentation/CustomExtendedtypesEditor.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/src/org/eclipse/papyrus/infra/extendedtypes/presentation/CustomExtendedtypesEditor.java
index 864ce130106..8ab30ef8241 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/src/org/eclipse/papyrus/infra/extendedtypes/presentation/CustomExtendedtypesEditor.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.editor/src/org/eclipse/papyrus/infra/extendedtypes/presentation/CustomExtendedtypesEditor.java
@@ -31,7 +31,6 @@ import org.eclipse.papyrus.infra.extendedtypes.invariantsemantictypeconfiguratio
import org.eclipse.papyrus.infra.extendedtypes.provider.CustomExtendedtypesItemProviderAdapterFactory;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
/**
* Custom editor to support metamodel extensions
@@ -52,7 +51,6 @@ public class CustomExtendedtypesEditor extends ExtendedtypesEditor {
adapterFactory.addAdapterFactory(new CustomInvariantSemanticTypeConfigurationItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new InvariantContainerConfigurationAdapterFactory());
adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.ui/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.ui/META-INF/MANIFEST.MF
index 4e7d229ccec..5d222027660 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.ui/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.ui/META-INF/MANIFEST.MF
@@ -1,7 +1,6 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.2.0",
- org.eclipse.uml2.uml.edit,
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
org.eclipse.gmf.runtime.common.ui.services;bundle-version="1.3.0",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/plugin.xml
index 43bc21c42d9..ab8ef8d6d4c 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/plugin.xml
@@ -104,12 +104,12 @@
<extension
point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
<metamodel
- nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ nsURI="http://www.eclipse.org/emf/2002/Ecore">
<adviceBinding
class="org.eclipse.papyrus.infra.extendedtypes.advices.ExtendedTypesOwnerAdvice"
- id="org.eclipse.papyrus.uml.advice.ExtendedTypesOwnerAdvice"
+ id="org.eclipse.papyrus.infra.extendedtypes.advice.OwnerAdvice"
inheritance="all"
- typeId="org.eclipse.papyrus.uml.Element">
+ typeId="*">
</adviceBinding>
</metamodel>
</extension>
@@ -121,7 +121,7 @@
pattern="org\.eclipse\.papyrus\.uml\.([^d]|$|d([^i]|$)|di([^a]|$)|dia([^g]|$)|diag([^r]|$)|diagr([^a]|$)|diagra([^m]|$))">
</elementType>
<advice
- ref="org.eclipse.papyrus.uml.advice.ExtendedTypesOwnerAdvice">
+ ref="org.eclipse.papyrus.infra.extendedtypes.advice.OwnerAdvice">
</advice>
</binding>
</extension>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowDown_16x16.gif b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowDown_16x16.gif
new file mode 100644
index 00000000000..072b1844572
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowDown_16x16.gif
Binary files differ
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowLeft_16x16.gif b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowLeft_16x16.gif
new file mode 100644
index 00000000000..4fb41501036
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowLeft_16x16.gif
Binary files differ
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowRight_16x16.gif b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowRight_16x16.gif
new file mode 100644
index 00000000000..19567890aa8
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowRight_16x16.gif
Binary files differ
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowUp_16x16.gif b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowUp_16x16.gif
new file mode 100644
index 00000000000..07164754e5c
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/ArrowUp_16x16.gif
Binary files differ
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/insp_sbook.gif b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/insp_sbook.gif
new file mode 100644
index 00000000000..e936fbabfec
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/icons/insp_sbook.gif
Binary files differ
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/Activator.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/Activator.java
index 0417fd36ad8..b0cf956f27f 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/Activator.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/Activator.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
+ * Copyright (c) 2011, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,11 +8,14 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.hyperlink;
+import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -25,6 +27,16 @@ public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.hyperlink"; //$NON-NLS-1$
+ public static final String IMG_LOUPE = "loupe"; //$NON-NLS-1$
+
+ public static final String IMG_ARROW_UP = "arrowUp"; //$NON-NLS-1$
+
+ public static final String IMG_ARROW_DOWN = "arrowDown"; //$NON-NLS-1$
+
+ public static final String IMG_ARROW_LEFT = "arrowLeft"; //$NON-NLS-1$
+
+ public static final String IMG_ARROW_RIGHT = "arrowRight"; //$NON-NLS-1$
+
// The shared instance
private static Activator plugin;
@@ -37,11 +49,6 @@ public class Activator extends AbstractUIPlugin {
public Activator() {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
@@ -49,11 +56,6 @@ public class Activator extends AbstractUIPlugin {
log = new LogHelper(this);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
@@ -69,5 +71,18 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
+ @Override
+ protected void initializeImageRegistry(ImageRegistry reg) {
+ super.initializeImageRegistry(reg);
+ reg.put(IMG_LOUPE, imageDescriptorFromPlugin(PLUGIN_ID, "icons/insp_sbook.gif")); //$NON-NLS-1$
+ reg.put(IMG_ARROW_UP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/ArrowUp_16x16.gif")); //$NON-NLS-1$
+ reg.put(IMG_ARROW_DOWN, imageDescriptorFromPlugin(PLUGIN_ID, "icons/ArrowDown_16x16.gif")); //$NON-NLS-1$
+ reg.put(IMG_ARROW_LEFT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/ArrowLeft_16x16.gif")); //$NON-NLS-1$
+ reg.put(IMG_ARROW_RIGHT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/ArrowRight_16x16.gif")); //$NON-NLS-1$
+ }
+
+ public Image getIcon(String key) {
+ return getImageRegistry().get(key);
+ }
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkEditor.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkEditor.java
index 641e8475a51..aa302885f28 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkEditor.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkEditor.java
@@ -27,11 +27,6 @@ import org.eclipse.papyrus.infra.ui.editorsfactory.IPageIconsRegistry;
public class HyperLinkEditor extends HyperLinkObject {
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.ui.hyperlinkshell.HyperlinkObject#executeSelectPressed()
- *
- */
@Override
public void openLink() {
EObject context = EMFHelper.getEObject(getObject());
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkWeb.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkWeb.java
index 866dc1684d8..40fd9fa284c 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkWeb.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/object/HyperLinkWeb.java
@@ -38,11 +38,6 @@ public class HyperLinkWeb extends HyperLinkObject {
super.setObject(object);
}
- /**
- *
- * @see org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject#executeSelectPressed()
- *
- */
@Override
public void openLink() {
try {
@@ -54,11 +49,6 @@ public class HyperLinkWeb extends HyperLinkObject {
}
- /**
- *
- * @see org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject#executeEditMousePressed(java.util.List, org.eclipse.uml2.uml.Package)
- *
- */
@Override
public void executeEditMousePressed(List<HyperLinkObject> list, EObject amodel) {
EditorHyperLinkWebShell editor = new EditorHyperLinkWebShell();
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/AbstractEditHyperlinkDocumentShell.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/AbstractEditHyperlinkDocumentShell.java
index 5cbb8092703..59780d14db9 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/AbstractEditHyperlinkDocumentShell.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/AbstractEditHyperlinkDocumentShell.java
@@ -13,6 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.hyperlink.ui;
+import org.eclipse.papyrus.infra.hyperlink.Activator;
import org.eclipse.papyrus.infra.hyperlink.messages.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
@@ -24,7 +25,6 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
// TODO: Auto-generated Javadoc
/**
@@ -112,9 +112,7 @@ public class AbstractEditHyperlinkDocumentShell {
ObjectLabeltext.setEditable(true);
ObjectLabeltext.setLayoutData(gridData1);
chooseDiagramButton = new Button(getEditHyperlinkShell(), SWT.NONE);
- // chooseDiagramButton.setImage(new Image(Display.getCurrent(),
- // "C:/Tessier/PROTOTYPE/papyrusII/DEVELOPMENT/GalileoM6/org.eclipse.papyrus.uml.diagram.common/icons/obj16/insp_sbook.gif"));
- chooseDiagramButton.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/insp_sbook.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$
+ chooseDiagramButton.setImage(Activator.getDefault().getIcon(Activator.IMG_LOUPE));
chooseDiagramButton.setLayoutData(gridData51);
chooseDiagramButton.setText(""); //$NON-NLS-1$
tooltipInputLabel = new CLabel(editHyperlinkShell, SWT.NONE);
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/DefaultHyperLinkTab.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/DefaultHyperLinkTab.java
index 8e37df66a6d..3fde695630a 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/DefaultHyperLinkTab.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/DefaultHyperLinkTab.java
@@ -42,7 +42,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
* this is the tab in charge to display the hyperlink for the property defaut
@@ -271,10 +270,10 @@ public class DefaultHyperLinkTab extends AbstractHyperLinkTab {
// associate image to buttons
- defaultHdown.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/ArrowDown_16x16.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$
- defaultHup.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/ArrowUp_16x16.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$
- defaultHleft.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/ArrowLeft_16x16.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$
- defaultHRight.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/ArrowRight_16x16.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$
+ defaultHdown.setImage(Activator.getDefault().getIcon(Activator.IMG_ARROW_DOWN));
+ defaultHup.setImage(Activator.getDefault().getIcon(Activator.IMG_ARROW_UP));
+ defaultHleft.setImage(Activator.getDefault().getIcon(Activator.IMG_ARROW_LEFT));
+ defaultHRight.setImage(Activator.getDefault().getIcon(Activator.IMG_ARROW_RIGHT));
EObject contextElement = EMFHelper.getEObject(element);
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/.classpath b/plugins/infra/org.eclipse.papyrus.infra.newchild/.classpath
index ea6aae6dedb..50aae142c50 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/.classpath
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/.classpath
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/org.eclipse.papyrus.infra.newchild/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF
index b63869cd4ef..967eda06145 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF
@@ -16,8 +16,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
- org.eclipse.papyrus.uml.tools;bundle-version="1.2.0",
- org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.services.semantic;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
@@ -28,4 +30,4 @@ Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.infra.newchild.Activator
Bundle-Description: %pluginDescription
Bundle-SymbolicName: org.eclipse.papyrus.infra.newchild;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/build.properties b/plugins/infra/org.eclipse.papyrus.infra.newchild/build.properties
index 85abf2cc868..ba36fa89f8c 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/build.properties
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/build.properties
@@ -11,7 +11,6 @@ bin.includes = META-INF/,\
src.includes = about.html,\
schema/,\
docs/
-jre.compilation.profile = J2SE-1.5
bin.excludes = docs/ElementCreationMenuModel.di,\
docs/ElementCreationMenuModel.notation,\
docs/ElementCreationMenuModel.uml,\
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java b/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
index 7f61e14c5e0..905147763b1 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
+ * Copyright (c) 2011, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,8 +8,10 @@
*
* Contributors:
*
- * CEA LIST - Initial API and implementation
- * Patrik Nandorf (Ericsson AB) patrik.nandorf@ericsson.com - Bug 425565
+ * CEA LIST - Initial API and implementation
+ * Patrik Nandorf (Ericsson AB) patrik.nandorf@ericsson.com - Bug 425565
+ * Christian W. Damus - bug 485220
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.newchild;
@@ -18,6 +20,9 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.stream.Stream;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.UnexecutableCommand;
@@ -35,6 +40,8 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
import org.eclipse.papyrus.infra.filters.Filter;
@@ -45,8 +52,11 @@ import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.infra.services.edit.utils.RequestCacheEntries;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
+import org.eclipse.papyrus.infra.services.semantic.service.SemanticService;
+import org.eclipse.papyrus.infra.ui.emf.providers.strategy.SemanticEMFContentProvider;
+import org.eclipse.papyrus.infra.ui.providers.DelegatingPapyrusContentProvider;
+import org.eclipse.papyrus.infra.ui.providers.ISemanticContentProviderFactory;
import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
-import org.eclipse.papyrus.uml.tools.providers.SemanticUMLContentProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
@@ -106,7 +116,7 @@ public class CreationMenuFactory {
boolean result = false;
if (currentMenu instanceof Folder) {
result = populateMenu(topMenu, (Folder) currentMenu, selectedObject, topMenu.getItemCount(), adviceCache);
- } else if (currentMenu instanceof CreationMenu && ((CreationMenu) currentMenu).isVisible() && filterMatches((CreationMenu) currentMenu, selectedObject)) {
+ } else if (currentMenu instanceof CreationMenu && ((CreationMenu) currentMenu).isVisible() && filterMatches(currentMenu, selectedObject)) {
CreationMenu currentCreationMenu = (CreationMenu) currentMenu;
EReference reference = null;
String role = currentCreationMenu.getRole();
@@ -371,7 +381,7 @@ public class CreationMenuFactory {
} else {
createGMFCommand = provider.getEditCommand(buildRequest(reference, container, creationMenu, adviceCache));
}
-
+
if (createGMFCommand != null) {
Command emfCommand = org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper.wrap(createGMFCommand);
return emfCommand;
@@ -396,7 +406,7 @@ public class CreationMenuFactory {
}
} else {
if (creationMenu instanceof CreateRelationshipMenu) {
- request = new CreateRelationshipRequest(editingDomain, null,container,null,getElementType(elementTypeId),reference);
+ request = new CreateRelationshipRequest(editingDomain, null, container, null, getElementType(elementTypeId), reference);
} else {
request = new CreateElementRequest(editingDomain, container, getElementType(elementTypeId), reference);
}
@@ -456,7 +466,27 @@ public class CreationMenuFactory {
return null;
}
- SemanticUMLContentProvider contentProvider = new SemanticUMLContentProvider(eobject.eResource().getResourceSet()) {
+ SemanticService semanticService = null;
+
+ try {
+ semanticService = ServiceUtilsForEObject.getInstance().getService(SemanticService.class, eobject);
+ } catch (Exception e) {
+ Activator.log.error("Could not get the SemanticService for " + eobject, e);
+ return null;
+ }
+
+ // Get the primary language-specific content provider
+ IModel[] models = semanticService.getSemanticIModels();
+ Optional<ISemanticContentProviderFactory> factory = Stream.of(models)
+ .map(m -> m.getAdapter(ISemanticContentProviderFactory.class))
+ .filter(Objects::nonNull)
+ .reduce(ISemanticContentProviderFactory::compose);
+
+ ITreeContentProvider delegate = factory.orElse(SemanticEMFContentProvider::new)
+ .createSemanticContentProvider(eobject.eResource().getResourceSet());
+
+ ITreeContentProvider contentProvider = new DelegatingPapyrusContentProvider(delegate) {
+ @Override
public boolean isValidValue(Object element) {
if (element == null) {
return false;
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF
index b6b0ad24536..34b327f9339 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Export-Package: org.eclipse.papyrus.infra.ui,
org.eclipse.papyrus.infra.ui.multidiagram.actionbarcontributor,
org.eclipse.papyrus.infra.ui.preferences,
org.eclipse.papyrus.infra.ui.preferences.dialog,
+ org.eclipse.papyrus.infra.ui.providers,
org.eclipse.papyrus.infra.ui.services,
org.eclipse.papyrus.infra.ui.services.internal;x-internal:=true,
org.eclipse.papyrus.infra.ui.util
@@ -39,7 +40,8 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
org.eclipse.emf.edit.ui;bundle-version="2.12.0",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.9.0",
org.eclipse.ui.views.properties.tabbed;bundle-version="3.7.0",
- org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-Version: 1.2.0.qualifier
Eclipse-BuddyPolicy: dependent
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.ui/plugin.xml
index c61a524a867..7b5b9c5ed7a 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.ui/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/plugin.xml
@@ -162,7 +162,7 @@
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
- id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ id="org.eclipse.papyrus.ui.toolbar">
<command
commandId="org.eclipse.papyrus.infra.core.commands.dropdowncommand"
icon="icons/papyrus/Papyrus_16x16.gif"
@@ -181,7 +181,7 @@
</toolbar>
</menuContribution>
<menuContribution
- locationURI="toolbar:org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ locationURI="toolbar:org.eclipse.papyrus.ui.toolbar">
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.papyrus.infra.core.editor.ui.tabmenu?endof=tabcommands">
@@ -514,4 +514,20 @@
name="Editor">
</page>
</extension>
+
+ <extension
+ point="org.eclipse.core.expressions.definitions">
+ <!-- Is a Papyrus editor active that has a semantic model selection? -->
+ <definition id="org.eclipse.papyrus.ui.semanticModelActive">
+ <with
+ variable="activeEditor">
+ <adapt
+ type="org.eclipse.papyrus.infra.core.services.ServicesRegistry">
+ <test
+ property="org.eclipse.papyrus.infra.core.hasSemanticModel">
+ </test>
+ </adapt>
+ </with>
+ </definition>
+ </extension>
</plugin>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositePapyrusContentProvider.java b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositePapyrusContentProvider.java
new file mode 100644
index 00000000000..b667228dde5
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositePapyrusContentProvider.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * Copyright (c) 2016 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.ui.providers;
+
+import java.util.Objects;
+import java.util.stream.Stream;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.widgets.providers.IAdaptableContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+import com.google.common.collect.Iterables;
+
+/**
+ * A content provider that synthesizes content from multiple other providers.
+ */
+public class CompositePapyrusContentProvider implements IAdaptableContentProvider, IHierarchicContentProvider, IStaticContentProvider {
+
+ private final ITreeContentProvider[] delegates;
+
+ public CompositePapyrusContentProvider(ITreeContentProvider... delegates) {
+ super();
+
+ this.delegates = new ITreeContentProvider[delegates.length];
+ for (int i = 0; i < delegates.length; i++) {
+ // Wrap it or not, as needed
+ this.delegates[i] = DelegatingPapyrusContentProvider.wrap(delegates[i]);
+ }
+ }
+
+ public CompositePapyrusContentProvider(Iterable<? extends ITreeContentProvider> delegates) {
+ this(Iterables.toArray(delegates, ITreeContentProvider.class));
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return Stream.of(delegates)
+ .flatMap(d -> Stream.of(d.getElements(inputElement)))
+ .toArray();
+ }
+
+ @Override
+ public void dispose() {
+ Stream.of(delegates).forEach(ITreeContentProvider::dispose);
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ Stream.of(delegates).forEach(d -> d.inputChanged(viewer, oldInput, newInput));
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ return Stream.of(delegates)
+ .flatMap(d -> Stream.of(d.getChildren(parentElement)))
+ .toArray();
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return Stream.of(delegates)
+ .map(d -> d.getParent(element))
+ .filter(Objects::nonNull)
+ .findAny().orElse(null);
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ return Stream.of(delegates)
+ .anyMatch(d -> d.hasChildren(element));
+ }
+
+ @Override
+ public Object getAdaptedValue(Object containerElement) {
+ return Stream.of(delegates)
+ .map(IAdaptableContentProvider.class::cast)
+ .map(d -> d.getAdaptedValue(containerElement))
+ .filter(Objects::nonNull)
+ .findAny().orElse(containerElement);
+ }
+
+ @Override
+ public boolean isValidValue(Object element) {
+ return Stream.of(delegates)
+ .map(IHierarchicContentProvider.class::cast)
+ .anyMatch(d -> d.isValidValue(element));
+ }
+
+ @Override
+ public Object[] getElements() {
+ return Stream.of(delegates)
+ .map(IStaticContentProvider.class::cast)
+ .flatMap(d -> Stream.of(d.getElements()))
+ .toArray();
+ }
+
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositeSemanticContentProviderFactory.java b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositeSemanticContentProviderFactory.java
new file mode 100644
index 00000000000..71616365e59
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/CompositeSemanticContentProviderFactory.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2016 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.ui.providers;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+
+/**
+ * Default implementation of a composite content-provider factory.
+ */
+class CompositeSemanticContentProviderFactory implements ISemanticContentProviderFactory {
+ private final List<ISemanticContentProviderFactory> factories;
+
+ CompositeSemanticContentProviderFactory(ISemanticContentProviderFactory first, ISemanticContentProviderFactory second) {
+ super();
+
+ factories = Arrays.asList(first, second);
+ }
+
+ private CompositeSemanticContentProviderFactory(CompositeSemanticContentProviderFactory composite, ISemanticContentProviderFactory other) {
+ super();
+
+ if (other instanceof CompositeSemanticContentProviderFactory) {
+ List<ISemanticContentProviderFactory> otherFactories = ((CompositeSemanticContentProviderFactory) other).factories;
+ factories = new ArrayList<>(composite.factories.size() + otherFactories.size());
+ factories.addAll(composite.factories);
+ factories.addAll(otherFactories);
+ } else {
+ factories = new ArrayList<>(composite.factories.size() + 1);
+ factories.addAll(composite.factories);
+ factories.add(other);
+ }
+ }
+
+ @Override
+ public ITreeContentProvider createSemanticContentProvider(ResourceSet resourceSet) {
+ return DelegatingPapyrusContentProvider.compose(factories.stream()
+ .map(f -> f.createSemanticContentProvider(resourceSet))
+ .collect(Collectors.toList()));
+ }
+
+ @Override
+ public ISemanticContentProviderFactory compose(ISemanticContentProviderFactory other) {
+ return new CompositeSemanticContentProviderFactory(this, other);
+ }
+
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/DelegatingPapyrusContentProvider.java b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/DelegatingPapyrusContentProvider.java
new file mode 100644
index 00000000000..de1ddcce51f
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/DelegatingPapyrusContentProvider.java
@@ -0,0 +1,170 @@
+/*****************************************************************************
+ * Copyright (c) 2012, 2016 CEA LIST, Christian W. Damus, 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 410346
+ * Christian W. Damus - bug 485220
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.ui.providers;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.tools.util.TypeUtils;
+import org.eclipse.papyrus.infra.widgets.providers.IAdaptableContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+/**
+ * A content-provider implementing the complete set of Papyrus-specific content-provider APIs that
+ * delegates those APIs to another provider according to its actual capabilities.
+ */
+public class DelegatingPapyrusContentProvider implements IAdaptableContentProvider, IHierarchicContentProvider, IStaticContentProvider {
+
+ private static final Object[] NONE = {};
+
+ private final ITreeContentProvider treeDelegate;
+ private final IAdaptableContentProvider adaptableDelegate;
+ private final IHierarchicContentProvider hierarchicDelegate;
+ private final IStaticContentProvider staticDelegate;
+
+ public DelegatingPapyrusContentProvider(ITreeContentProvider delegate) {
+ super();
+
+ treeDelegate = delegate;
+ adaptableDelegate = TypeUtils.as(delegate, IAdaptableContentProvider.class);
+ hierarchicDelegate = TypeUtils.as(delegate, IHierarchicContentProvider.class);
+ staticDelegate = TypeUtils.as(delegate, IStaticContentProvider.class);
+ }
+
+ /**
+ * Obtains a content-provider based on the given {@code provider} that implements all of the
+ * the Papyrus-specific extension protocols.
+ *
+ * @param provider
+ * a tree-content provider
+ * @return a complete provider, which may be a delegating provider or may be the original
+ * {@code provider} if it is already complete
+ */
+ public static ITreeContentProvider wrap(ITreeContentProvider provider) {
+ return ((provider instanceof IAdaptableContentProvider) && (provider instanceof IHierarchicContentProvider) && (provider instanceof IStaticContentProvider))
+ ? provider
+ : new DelegatingPapyrusContentProvider(provider);
+ }
+
+ /**
+ * Obtains a content-provider based on the given providers that implements all of the
+ * the Papyrus-specific extension protocols.
+ *
+ * @param first,&nbsp;second,&nbsp;rest
+ * two or more tree-content providers
+ * @return a complete provider based on the given providers
+ */
+ public static ITreeContentProvider compose(ITreeContentProvider first, ITreeContentProvider second, ITreeContentProvider... rest) {
+ return compose(Lists.asList(first, second, rest));
+ }
+
+ /**
+ * Obtains a content-provider based on the given {@code providers} that implements all of the
+ * the Papyrus-specific extension protocols.
+ *
+ * @param providers
+ * zero or more tree-content providers
+ * @return a complete provider based on the given {@code providers}
+ */
+ public static ITreeContentProvider compose(Iterable<? extends ITreeContentProvider> providers) {
+ ITreeContentProvider result;
+
+ // Obtain optimal result in case of a single provider
+ if (providers instanceof Collection<?>) {
+ Collection<? extends ITreeContentProvider> collection = (Collection<? extends ITreeContentProvider>) providers;
+ switch (collection.size()) {
+ case 0:
+ result = new CompositePapyrusContentProvider();
+ break;
+ case 1:
+ result = wrap(Iterables.getOnlyElement(collection));
+ break;
+ default:
+ result = new CompositePapyrusContentProvider(providers);
+ break;
+ }
+ } else {
+ Iterator<? extends ITreeContentProvider> iter = providers.iterator();
+ if (!iter.hasNext()) {
+ result = new CompositePapyrusContentProvider();
+ } else {
+ ITreeContentProvider provider = iter.next();
+ if (iter.hasNext()) {
+ result = new CompositePapyrusContentProvider(providers);
+ } else {
+ result = wrap(provider);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return treeDelegate.getElements(inputElement);
+ }
+
+ @Override
+ public void dispose() {
+ treeDelegate.dispose();
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ treeDelegate.inputChanged(viewer, oldInput, newInput);
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ return treeDelegate.getChildren(parentElement);
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return treeDelegate.getParent(element);
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ return treeDelegate.hasChildren(element);
+ }
+
+ @Override
+ public Object getAdaptedValue(Object containerElement) {
+ return (adaptableDelegate == null)
+ ? containerElement
+ : adaptableDelegate.getAdaptedValue(containerElement);
+ }
+
+ @Override
+ public boolean isValidValue(Object element) {
+ return (hierarchicDelegate == null) || hierarchicDelegate.isValidValue(element);
+ }
+
+ @Override
+ public Object[] getElements() {
+ return (staticDelegate == null)
+ ? NONE
+ : staticDelegate.getElements();
+ }
+
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/ISemanticContentProviderFactory.java b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/ISemanticContentProviderFactory.java
new file mode 100644
index 00000000000..05eecf9f087
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/providers/ISemanticContentProviderFactory.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2016 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.ui.providers;
+
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+
+/**
+ * <p>
+ * A protocol for creation of semantic model content providers on EMF resource sets.
+ * </p>
+ * <p>
+ * It is expected that {@link IModel}s representing semantic model content in the
+ * {@link ModelSet} provide adapters of this interface type for the purpose of obtaining
+ * suitable content-providers for presentation of the model content to the user.
+ * Because there there are potentially multiple such {@code IModel}s that have
+ * semantic content, it is possible that multiple content-providers will have to be
+ * combined via the {@link #compose(ISemanticContentProviderFactory)} API.
+ * </p>
+ *
+ * @see IModel
+ * @see #compose(ISemanticContentProviderFactory)
+ */
+@FunctionalInterface
+public interface ISemanticContentProviderFactory {
+ /**
+ * Creates a semantic model content provider on the given {@code ResourceSet}.
+ *
+ * @param resourceSet
+ * a resource set
+ *
+ * @return the semantic model content provider
+ */
+ ITreeContentProvider createSemanticContentProvider(ResourceSet resourceSet);
+
+ /**
+ * Obtains a factory that composes my provider with an{@code other} factory's provider.
+ *
+ * @param other
+ * another semantic content-provider factory
+ * @return the composed factory, which generally creates composed content providers
+ */
+ default ISemanticContentProviderFactory compose(ISemanticContentProviderFactory other) {
+ return new CompositeSemanticContentProviderFactory(this, other);
+ }
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java
index eea097e6062..6918f42b92d 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java
@@ -247,7 +247,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -285,7 +285,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -323,7 +323,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -368,7 +368,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -415,7 +415,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -504,7 +504,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -530,7 +530,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -565,7 +565,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
@@ -600,7 +600,7 @@ public class EditorUtils {
* <li>
* org.eclipse.papyrus.uml.diagram.common.util.ServiceUtilsForGMF</li>
* <li>
- * org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers (to be used with care !)</li>
+ * org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers (to be used with care !)</li>
* </ul>
*/
@Deprecated
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.classpath b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.classpath
index 2d1a4302f04..eca7bdba8f0 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.classpath
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/META-INF/MANIFEST.MF b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/META-INF/MANIFEST.MF
index d21ae07957e..d4c124a0850 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/META-INF/MANIFEST.MF
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/META-INF/MANIFEST.MF
@@ -7,17 +7,11 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
org.eclipse.papyrus.infra.services.controlmode.history;bundle-version="1.2.0",
org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.2.0",
org.eclipse.core.expressions,
- org.eclipse.core.resources;bundle-version="3.7.0",
org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.gef;bundle-version="3.7.1",
- org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
org.eclipse.papyrus.infra.core.sasheditor.di;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0",
- org.eclipse.ui.ide;bundle-version="3.8.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.2.0",
- org.eclipse.papyrus.uml.tools;bundle-version="1.2.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0"
Bundle-Vendor: %providerName
@@ -28,4 +22,4 @@ Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.services.resourceloading.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.services.resourceloading;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/OnDemandLoadingModelSet.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/OnDemandLoadingModelSet.java
index cc8a5d56771..1ec0ea895e9 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/OnDemandLoadingModelSet.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/OnDemandLoadingModelSet.java
@@ -1,6 +1,16 @@
-/**
+/*****************************************************************************
+ * Copyright (c) 2010, 2016 LIFL, CEA LIST, Christian W. Damus, 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
+ * http://www.eclipse.org/legal/epl-v10.html
*
- */
+ * Contributors:
+ * LIFL - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.services.resourceloading;
import java.util.HashSet;
@@ -8,12 +18,13 @@ import java.util.Set;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.core.language.ILanguageService;
+import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.sasheditor.SashModelUtils;
import org.eclipse.papyrus.infra.core.utils.DiResourceSet;
import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
import org.eclipse.papyrus.infra.services.resourceloading.impl.ProxyManager;
-import org.eclipse.papyrus.uml.tools.model.UmlUtils;
/**
@@ -37,6 +48,8 @@ public class OnDemandLoadingModelSet extends DiResourceSet {
*/
private IProxyManager proxyManager;
+ private AbstractBaseModel semanticModel;
+
/**
*
* Constructor.
@@ -57,6 +70,7 @@ public class OnDemandLoadingModelSet extends DiResourceSet {
public void unload() {
super.unload();
proxyManager.dispose();
+ semanticModel = null;
}
@@ -70,8 +84,7 @@ public class OnDemandLoadingModelSet extends DiResourceSet {
URI resourceURI = uri.trimFragment();
// for performance reasons, we check the three initial resources first
- // TODO not use getUMLModel
- if (resourceURI.equals(UmlUtils.getUmlModel(this).getResourceURI()) || resourceURI.equals(NotationUtils.getNotationModel(this).getResourceURI()) || resourceURI.equals(SashModelUtils.getSashModel(this).getResourceURI())
+ if (resourceURI.equals(getSemanticResourceURI()) || resourceURI.equals(NotationUtils.getNotationModel(this).getResourceURI()) || resourceURI.equals(SashModelUtils.getSashModel(this).getResourceURI())
|| uriLoading.contains(resourceURI)) {
// do not manage eObject of the current resources
return super.getEObject(uri, loadOnDemand);
@@ -95,4 +108,35 @@ public class OnDemandLoadingModelSet extends DiResourceSet {
uriLoading.add(alwaysLoadedUri);
}
+ private AbstractBaseModel getSemanticModel() {
+ if (semanticModel == null) {
+ semanticModel = ILanguageService.getLanguageModels(this).stream()
+ .filter(AbstractBaseModel.class::isInstance)
+ .map(AbstractBaseModel.class::cast)
+ .findAny().orElseGet(DummyModel::new);
+ }
+
+ return semanticModel;
+ }
+
+ private URI getSemanticResourceURI() {
+ AbstractBaseModel model = getSemanticModel();
+ return (model == null) ? null : model.getResourceURI();
+ }
+
+ //
+ // Nested types
+ //
+
+ private static class DummyModel extends AbstractBaseModel {
+ @Override
+ public String getIdentifier() {
+ return ""; // Dummy model
+ }
+
+ @Override
+ protected String getModelFileExtension() {
+ return "\0"; // Dummy model
+ }
+ }
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/util/LoadingUtils.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/util/LoadingUtils.java
index 4944ada0793..4565f85eb4a 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/util/LoadingUtils.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading/src/org/eclipse/papyrus/infra/services/resourceloading/util/LoadingUtils.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2014 Atos Origin, CEA, and others.
- *
+ * Copyright (c) 2011, 2016 Atos Origin, CEA, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -10,12 +9,14 @@
* Contributors:
* Vincent Hemery (Atos) vincent.hemery@atos.net - Initial API and implementation
* Christian W. Damus (CEA) - bug 415639
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.services.resourceloading.util;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -38,6 +39,9 @@ import org.eclipse.gef.util.EditPartUtilities;
import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.papyrus.infra.core.language.ILanguageService;
+import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel;
+import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
@@ -49,7 +53,6 @@ import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.infra.ui.util.TransactionUIHelper;
import org.eclipse.papyrus.infra.widgets.toolbox.notification.Type;
import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
@@ -81,6 +84,7 @@ public class LoadingUtils {
runInEditingDomain(modelSet.getTransactionalEditingDomain(), editor, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
IMultiDiagramEditor core = (IMultiDiagramEditor) editor;
@@ -175,6 +179,7 @@ public class LoadingUtils {
if (editor instanceof IMultiDiagramEditor) {
runInEditingDomain(modelSet.getTransactionalEditingDomain(), editor, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
@@ -323,20 +328,6 @@ public class LoadingUtils {
}
/**
- * Common extensions
- * TODO get rid of listing all model's extensions and find a way to deduce them from model set. Then, delete this attribute.
- *
- * @see #getExtensions(ModelSet)
- */
- private static final Set<String> COMMON_EXTENSIONS = new HashSet<String>();
-
- static {
- COMMON_EXTENSIONS.add(UmlModel.UML_FILE_EXTENSION);
- COMMON_EXTENSIONS.add(NotationModel.NOTATION_FILE_EXTENSION);
- COMMON_EXTENSIONS.add(DiModel.DI_FILE_EXTENSION);
- }
-
- /**
* Get list of file extensions existing for this model set
*
* @param modelSet
@@ -344,7 +335,29 @@ public class LoadingUtils {
* @return extensions list to explore
*/
private static Set<String> getExtensions(ModelSet modelSet) {
- return COMMON_EXTENSIONS;
+ Set<String> result = new HashSet<String>();
+ // FIXME: Also need to generalize the notation and DI models
+ result.add(NotationModel.NOTATION_FILE_EXTENSION);
+ result.add(DiModel.DI_FILE_EXTENSION);
+
+ // Get the semantic model extensions
+ Collection<IModel> languageModels = ILanguageService.getLanguageModels(modelSet);
+ if (languageModels.isEmpty()) {
+ // No semantic models? Force UML for compatibility
+ Activator.log.warn("Semantic service unavailable. Assuming a UML model."); //$NON-NLS-1$
+ result.add("uml"); //$NON-NLS-1$
+ } else {
+ for (IModel model : languageModels) {
+ if (model instanceof AbstractBaseModel) {
+ URI uri = ((AbstractBaseModel) model).getResourceURI();
+ if ((uri != null) && (uri.fileExtension() != null)) {
+ result.add(uri.fileExtension());
+ }
+ }
+ }
+ }
+
+ return result;
}
/**
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.classpath b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.classpath
index 2d1a4302f04..eca7bdba8f0 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.classpath
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/META-INF/MANIFEST.MF b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/META-INF/MANIFEST.MF
index 7d052031cae..bd15e784a04 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/META-INF/MANIFEST.MF
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/META-INF/MANIFEST.MF
@@ -13,4 +13,4 @@ Bundle-Name: Semantic Service
Bundle-Activator: org.eclipse.papyrus.infra.services.semantic.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.services.semantic;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/src/org/eclipse/papyrus/infra/services/semantic/service/impl/SemanticServiceImpl.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/src/org/eclipse/papyrus/infra/services/semantic/service/impl/SemanticServiceImpl.java
index 121605b6d3a..a4521e6b7e4 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/src/org/eclipse/papyrus/infra/services/semantic/service/impl/SemanticServiceImpl.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic/src/org/eclipse/papyrus/infra/services/semantic/service/impl/SemanticServiceImpl.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,14 +8,23 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.services.semantic.service.impl;
+import static java.util.stream.StreamSupport.stream;
+
+import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.papyrus.infra.core.language.ILanguageService;
+import org.eclipse.papyrus.infra.core.resource.IEMFModel;
import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.services.ServiceException;
@@ -35,14 +44,17 @@ public class SemanticServiceImpl implements SemanticService {
private ServicesRegistry registry;
+ @Override
public void init(ServicesRegistry servicesRegistry) throws ServiceException {
this.registry = servicesRegistry;
}
+ @Override
public void startService() throws ServiceException {
// Nothing
}
+ @Override
public void disposeService() throws ServiceException {
registry = null;
}
@@ -50,28 +62,52 @@ public class SemanticServiceImpl implements SemanticService {
/**
* The default implements returns all root EObjects
*/
+ @Override
public EObject[] getSemanticRoots() {
- try {
- List<EObject> rootElements = new LinkedList<EObject>();
+ EObject[] result;
+ try {
ModelSet modelSet = ServiceUtils.getInstance().getModelSet(registry);
- for (Resource resource : modelSet.getResources()) {
- rootElements.addAll(resource.getContents());
+ Collection<IEMFModel> emfModels = getEMFModels();
+ if (emfModels.isEmpty()) {
+ List<EObject> rootElements = new LinkedList<EObject>();
+ for (Resource resource : modelSet.getResources()) {
+ rootElements.addAll(resource.getContents());
+ }
+ result = rootElements.toArray(new EObject[rootElements.size()]);
+ } else {
+ result = emfModels.stream()
+ .flatMap(m -> stream(m.getRootElements().spliterator(), false))
+ .toArray(EObject[]::new);
}
-
- return rootElements.toArray(new EObject[rootElements.size()]);
-
} catch (Exception ex) {
Activator.log.error(ex);
- return new EObject[0];
+ result = new EObject[0];
}
+
+ return result;
}
- /**
- * TODO: Unsupported
- */
+ @Override
public IModel[] getSemanticIModels() {
- return new IModel[0]; // Currently, it is not possible to retrieve all registered IModels for a ModelSet
+ IModel[] result;
+
+ try {
+ ModelSet modelSet = ServiceUtils.getInstance().getModelSet(registry);
+ result = ILanguageService.getLanguageModels(modelSet).stream().toArray(IModel[]::new);
+ } catch (Exception e) {
+ Activator.log.error(e);
+ result = new IModel[0];
+ }
+
+ return result;
}
+ protected Collection<IEMFModel> getEMFModels() {
+ return Stream.of(getSemanticIModels())
+ .filter(IEMFModel.class::isInstance)
+ .map(IEMFModel.class::cast)
+ .distinct() // Unique models only
+ .collect(Collectors.toList());
+ }
}
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/Profile.gif b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/Profile.gif
new file mode 100644
index 00000000000..18eed1f5cb9
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/icons/Profile.gif
Binary files differ
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototypeContentProvider.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototypeContentProvider.java
index e261e130614..6a90c6e5358 100755
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototypeContentProvider.java
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototypeContentProvider.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
- *
+ * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +8,7 @@
*
* Contributors:
* Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.infra.viewpoints.policy;
@@ -24,6 +24,8 @@ import java.util.Map;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
@@ -41,22 +43,38 @@ import org.eclipse.swt.graphics.Image;
*/
public class ViewPrototypeContentProvider implements ITreeContentProvider {
- private static Image loadImage(String uri) {
+ private static ImageDescriptor loadImage(String uri) {
URL url = null;
try {
url = new URL(uri);
} catch (MalformedURLException e) {
}
- return ImageDescriptor.createFromURL(url).createImage();
+ return ImageDescriptor.createFromURL(url);
}
public static class LP extends LabelProvider {
+ private static final String IMG_CATEGORY = "imageCategory"; //$NON-NLS-1$
+ private static final String IMG_VIEWPOINT = "imageViewpoint"; //$NON-NLS-1$
+ private static final String IMG_PROFILE = "imageProfile"; //$NON-NLS-1$
+ private static final String IMG_MODEL = "imageModel"; //$NON-NLS-1$
+ private static final String IMG_OWNER = "imageOwner"; //$NON-NLS-1$
+
+ private ImageRegistry images = new ImageRegistry(JFaceResources.getResources());
+
+ {
+ images.put(IMG_CATEGORY, loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusView.png"));
+ images.put(IMG_VIEWPOINT, loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusViewpoint.png"));
+ images.put(IMG_PROFILE, loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/icons/Profile.gif"));
+ images.put(IMG_MODEL, loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ModelRule.png"));
+ images.put(IMG_OWNER, loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/OwningRule.png"));
+ }
- private Image imageCategory = loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusView.png");
- private Image imageViewpoint = loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/PapyrusViewpoint.png");
- private Image imageProfile = loadImage("platform:/plugin/org.eclipse.papyrus.uml.profile/resources/icons/Profile.gif");
- private Image imageModel = loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/ModelRule.png");
- private Image imageOwner = loadImage("platform:/plugin/org.eclipse.papyrus.infra.viewpoints.configuration.edit/icons/full/obj16/OwningRule.png");
+ @Override
+ public void dispose() {
+ super.dispose();
+
+ images.dispose();
+ }
@Override
public String getText(Object element) {
@@ -134,22 +152,22 @@ public class ViewPrototypeContentProvider implements ITreeContentProvider {
@Override
public Image getImage(Object element) {
if (element instanceof Category) {
- return imageCategory;
+ return images.get(IMG_CATEGORY);
}
if (element instanceof ViewPrototype) {
return ((ViewPrototype) element).getIcon();
}
if (element instanceof PapyrusViewpoint) {
- return imageViewpoint;
+ return images.get(IMG_VIEWPOINT);
}
if (element instanceof EPackage) {
- return imageProfile;
+ return images.get(IMG_PROFILE);
}
if (element instanceof ModelRule) {
- return imageModel;
+ return images.get(IMG_MODEL);
}
if (element instanceof OwningRule) {
- return imageOwner;
+ return images.get(IMG_OWNER);
}
return null;
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.gen.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.gen.xml
index ba948d9fabf..337e7e96517 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.gen.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.gen.xml
@@ -53,7 +53,7 @@
</menuContribution>
<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ <toolbar id="org.eclipse.papyrus.ui.toolbar">
<command commandId="org.eclipse.papyrus.sysml.diagram.blockdefinition.CreateCommand"
icon="icons/obj16/Diagram_BlockDefinition.gif" label="Create a new Block Definition Diagram"
style="push" tooltip="Create a new Block Definition Diagram">
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/plugin.gen.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/plugin.gen.xml
index 196e6a6226c..95ee1f0deba 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/plugin.gen.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/plugin.gen.xml
@@ -54,7 +54,7 @@
</menuContribution>
<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ <toolbar id="org.eclipse.papyrus.ui.toolbar">
<command commandId="org.eclipse.papyrus.sysml.diagram.requirement.CreateCommand"
icon="icons/obj16/Diagram_Requirement.gif" label="Create a new Requirement Diagram"
style="push" tooltip="Create a new Requirement Diagram">
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml
index 0d1bdb87bef..1a42a4f00f2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml
@@ -52,7 +52,7 @@
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
- id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ id="org.eclipse.papyrus.ui.toolbar">
<command
commandId="com.cea.papyrus.ui.emftree.createTree"
icon="icons/EmfTree.gif"
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
index c3cad90cecb..b34652eb858 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
@@ -195,7 +195,7 @@
</menu>
</menuContribution>
<menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar?after=org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ locationURI="toolbar:org.eclipse.ui.main.toolbar?after=org.eclipse.papyrus.ui.toolbar">
<toolbar
id="org.eclipes.papyrus.menu.toolbar"
label="Papyrus Toolbar Action">
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui.perspectiveconfiguration/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.ui.perspectiveconfiguration/plugin.xml
index ca3920e33ae..891e0240ff0 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.ui.perspectiveconfiguration/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui.perspectiveconfiguration/plugin.xml
@@ -21,7 +21,7 @@
menuID="help">
</menu>
<toolbar
- toolbarID="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ toolbarID="org.eclipse.papyrus.ui.toolbar">
</toolbar>
<preferencePage
preferencepageID="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory">
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/.classpath b/plugins/uml/org.eclipse.papyrus.uml.ui/.classpath
new file mode 100644
index 00000000000..eca7bdba8f0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/.gitignore b/plugins/uml/org.eclipse.papyrus.uml.ui/.gitignore
new file mode 100644
index 00000000000..5e56e040ec0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/.project b/plugins/uml/org.eclipse.papyrus.uml.ui/.project
new file mode 100644
index 00000000000..1d8aa5623a4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..b3aa6d60f94
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.ui/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..a72f53880c8
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,41 @@
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.uml.ui.internal.adapters;x-internal:=true
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.uml2.uml;bundle-version="4.1.0";visibility:=reexport,
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.emf.databinding;bundle-version="1.2.0",
+ org.eclipse.core.databinding.property;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0",
+ org.eclipse.uml2.common.edit;bundle-version="1.6.0",
+ org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.services.validation;bundle-version="1.2.0",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0",
+ org.eclipse.core.expressions;bundle-version="3.4.0",
+ org.eclipse.uml2.uml,
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.2.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.extensionpoints;bundle-version="1.2.0",
+ org.eclipse.uml2.uml.validation;bundle-version="5.0.0",
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.jface.text;bundle-version="3.10.0",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.services.edit.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.2.0"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.2.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.uml.tools.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.uml.ui;singleton:=true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/about.html b/plugins/uml/org.eclipse.papyrus.uml.ui/about.html
new file mode 100644
index 00000000000..dd3c089a94c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/build.properties b/plugins/uml/org.eclipse.papyrus.uml.ui/build.properties
new file mode 100644
index 00000000000..de0773ae287
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/build.properties
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2016 Christian W. Damus 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Christian W. Damus - Initial API and implementation
+#
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.xml
+src.includes = about.html
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/plugin.properties b/plugins/uml/org.eclipse.papyrus.uml.ui/plugin.properties
new file mode 100644
index 00000000000..44260ac7a3b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/plugin.properties
@@ -0,0 +1,13 @@
+#
+# Copyright (c) 2016 Christian W. Damus 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Christian W. Damus - Initial API and implementation
+#
+pluginName = Papyrus UML UI
+providerName = Eclipse Modeling Project
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.ui/plugin.xml
new file mode 100644
index 00000000000..73bb85e854e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/plugin.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.papyrus.uml.tools.model.UmlModel"
+ class="org.eclipse.papyrus.uml.ui.internal.adapters.UMLModelAdapterFactory">
+ <adapter
+ type="org.eclipse.papyrus.infra.ui.providers.ISemanticContentProviderFactory">
+ </adapter>
+ </factory>
+ </extension>
+</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.ui/pom.xml
new file mode 100644
index 00000000000..10062516175
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.releng</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../../../releng/main</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.ui</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.2.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/internal/adapters/UMLModelAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/internal/adapters/UMLModelAdapterFactory.java
new file mode 100644
index 00000000000..2b8407f43ae
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/internal/adapters/UMLModelAdapterFactory.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2016 Christian W. Damus 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.ui.internal.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.papyrus.infra.ui.providers.ISemanticContentProviderFactory;
+import org.eclipse.papyrus.uml.tools.model.UmlModel;
+import org.eclipse.papyrus.uml.tools.providers.SemanticUMLContentProvider;
+
+/**
+ * Adapter factory for the {@link UmlModel} and possibly other UML things.
+ */
+public class UMLModelAdapterFactory implements IAdapterFactory {
+
+ private final Class<?>[] adapters = { ISemanticContentProviderFactory.class };
+
+ public UMLModelAdapterFactory() {
+ super();
+ }
+
+ @Override
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
+ T result = null;
+
+ if (adapterType == ISemanticContentProviderFactory.class) {
+ if (adaptableObject instanceof UmlModel) {
+ ISemanticContentProviderFactory adapter = SemanticUMLContentProvider::new;
+ result = adapterType.cast(adapter);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Class<?>[] getAdapterList() {
+ return adapters;
+ }
+
+}
diff --git a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/model/CreatedPapyrusProfileModel.java b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/model/CreatedPapyrusProfileModel.java
index d168ceef1fd..3d93552a6a7 100644
--- a/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/model/CreatedPapyrusProfileModel.java
+++ b/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter/src/org/eclipse/papyrus/uml/profile/drafter/model/CreatedPapyrusProfileModel.java
@@ -1,6 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 Cedric Dumoulin.
- *
+ * Copyright (c) 2014, 2016 Cedric Dumoulin, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +8,7 @@
*
* Contributors:
* Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
@@ -18,6 +18,7 @@ import java.util.Collections;
import java.util.Map;
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.papyrus.infra.core.resource.EMFLogicalModel;
@@ -52,13 +53,13 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
public static final String MODEL_ID = CreatedPapyrusProfileModel.class.getName();
public static final String PROFILE_FILE_EXTENSION = "profile";
-
+
protected URI uriWithoutExtension;
protected boolean isAdditionalResourcesRequired;
protected Resource umlResource;
protected Resource diResource;
protected Resource notationResource;
-
+
/**
*
@@ -72,14 +73,14 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
init(owner);
this.uriWithoutExtension = uriWithoutExtension;
this.isAdditionalResourcesRequired = isAdditionalResourcesRequired;
-
+
// add '.profile' to uri if needed
String currentExtension = uriWithoutExtension.fileExtension();
- if( ! PROFILE_FILE_EXTENSION.equals(currentExtension)) {
+ if (!PROFILE_FILE_EXTENSION.equals(currentExtension)) {
// Add extension
uriWithoutExtension.appendFileExtension(PROFILE_FILE_EXTENSION);
}
-
+
// Creates Resources
createModel();
// Register ourself to ModelSet
@@ -112,74 +113,79 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
/**
* Create the model by using the provided fullpath as a hint for the resource
- * URIs.
+ * URIs.
* In this implementation, create 3 resources (profile.uml, di and notation).
*
* @param fullPathWithoutExtension
*/
public void createModel() {
-
-
+
+
umlResource = createUmlResource();
// Initialize resource
- if( umlResource.getContents().isEmpty()) {
+ if (umlResource.getContents().isEmpty()) {
Profile profile = createProfile();
umlResource.getContents().add(profile);
}
-
+
// Set the main resource
resource = umlResource;
// Add additional resources if requested.
- if( isAdditionalResourcesRequired ) {
+ if (isAdditionalResourcesRequired) {
notationResource = createNotationResource();
- diResource = createDiResource();
+ diResource = createDiResource();
}
-
-
+
+
}
/**
* Create
+ *
* @param uriWithoutExtension2
* @return
*/
private Resource createUmlResource() {
- umlResource = createResource( uriWithoutExtension.appendFileExtension("uml"));
+ umlResource = createResource(uriWithoutExtension.appendFileExtension("uml"));
// init model
-
+
return umlResource;
}
private Resource createNotationResource() {
- notationResource = createResource( uriWithoutExtension.appendFileExtension("notation"));
+ notationResource = createResource(uriWithoutExtension.appendFileExtension("notation"));
// init model
-
+
return notationResource;
}
private Resource createDiResource() {
- diResource = createResource( uriWithoutExtension.appendFileExtension("di"));
+ diResource = createResource(uriWithoutExtension.appendFileExtension("di"));
// init model
-
+
return diResource;
}
/**
* Create the specified Profile
- * @param profileName The name of the Profile to create.
+ *
+ * @param profileName
+ * The name of the Profile to create.
*
*/
private Profile createProfile() {
Profile resultProfile = UMLFactory.eINSTANCE.createProfile();
-// resultProfile.setName(profileName);
+ // resultProfile.setName(profileName);
return resultProfile;
}
-
+
/**
- * Get or Create the specified Resource
- * @param resourceURI URI of the {@link Resource} that should be created.
+ * Get or Create the specified Resource
+ *
+ * @param resourceURI
+ * URI of the {@link Resource} that should be created.
* @return The requested Resource with specified URI.
*/
protected Resource createResource(URI resourceURI) {
@@ -187,7 +193,7 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
// Create Resource of appropriate type
ModelSet modelSet = getModelManager();
Resource resource = modelSet.getResource(resourceURI, false);
- if(resource != null) {
+ if (resource != null) {
// it already exists? Best effort to make sure it's loaded
try {
modelSet.getResource(resourceURI, true);
@@ -195,8 +201,8 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
// it commonly happens when creating a new model in the
// workspace that the wizard creates an empty file, first.
Map<String, ?> attributes = modelSet.getURIConverter().getAttributes(resourceURI, Collections.singletonMap(URIConverter.OPTION_REQUESTED_ATTRIBUTES, Collections.singleton(URIConverter.ATTRIBUTE_LENGTH)));
- Number length = (Number)attributes.get(URIConverter.ATTRIBUTE_LENGTH);
- if((length != null) && (length.longValue() > 0L)) {
+ Number length = (Number) attributes.get(URIConverter.ATTRIBUTE_LENGTH);
+ if ((length != null) && (length.longValue() > 0L)) {
// it has some length but isn't readable; fail
throw e;
} // otherwise, it's just empty and we'll fill it
@@ -218,8 +224,9 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
* @param resource
* @return
*/
+ @Override
protected boolean isRelatedResource(Resource resource) {
- if(resource == null) {
+ if (resource == null) {
return false;
}
@@ -231,7 +238,7 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
* @return
*/
public Profile getProfile() {
- return (Profile)umlResource.getContents().get(0);
+ return (Profile) umlResource.getContents().get(0);
}
/**
@@ -242,5 +249,9 @@ public class CreatedPapyrusProfileModel extends EMFLogicalModel {
return umlResource;
}
+ @Override
+ protected boolean isRootElement(EObject object) {
+ return super.isRootElement(object) && (object instanceof Profile);
+ }
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/plugin.xml b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/plugin.xml
index 1150d79dd42..81b8241c2a1 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/plugin.xml
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/plugin.xml
@@ -7,7 +7,7 @@
<!-- Register the UML delegating constraint provider -->
<!-- Bind the UML metamodel constraint provider's constraints to the Papyrus application. -->
-<extension
+ <extension
point="org.eclipse.papyrus.infra.core.model">
<model
classname="org.eclipse.papyrus.uml.tools.model.ExtendedUmlModel"
@@ -18,7 +18,15 @@
description="Complete the UML model.">
</modelSnippet>
</model>
- </extension>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.core.language">
+ <modelBinding
+ language="org.eclipse.papyrus.uml.language"
+ model="org.eclipse.papyrus.infra.core.resource.uml.UmlModel">
+ </modelBinding>
+ </extension>
+
<extension
point="org.eclipse.papyrus.infra.services.labelprovider.labelProvider">
<labelProvider
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/model/UmlModel.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/model/UmlModel.java
index 2f700bee1df..a39fd2b1e33 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/model/UmlModel.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/model/UmlModel.java
@@ -1,6 +1,16 @@
-/**
+/*****************************************************************************
+ * Copyright (c) 2011, 2016 LIFL, CEA LIST, Christian W. Damus, 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
+ * http://www.eclipse.org/legal/epl-v10.html
*
- */
+ * Contributors:
+ * LIFL - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.uml.tools.model;
import org.eclipse.core.runtime.IPath;
@@ -11,6 +21,7 @@ import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
import org.eclipse.uml2.common.util.CacheAdapter;
+import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.UMLPackage;
@@ -129,4 +140,12 @@ public class UmlModel extends EMFLogicalModel implements IModel {
super.unload();
}
+
+ /**
+ * Only UML {@link Element}s are semantic roots, not stereotype applications.
+ */
+ @Override
+ protected boolean isRootElement(EObject object) {
+ return super.isRootElement(object) && (object instanceof Element);
+ }
}

Back to the top