Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2018-03-16 20:06:14 -0400
committerptessier2018-04-19 16:55:57 -0400
commit371756cd59fe03ac08e079a6a98b2b332da6ff92 (patch)
treec50ab6ebf82acaeaf37f372acba864a49a876a04 /plugins/infra/architecture
parent9795d6a6d23ed40a5fe31b89c6868e9c407a5edb (diff)
downloadorg.eclipse.papyrus-371756cd59fe03ac08e079a6a98b2b332da6ff92.tar.gz
org.eclipse.papyrus-371756cd59fe03ac08e079a6a98b2b332da6ff92.tar.xz
org.eclipse.papyrus-371756cd59fe03ac08e079a6a98b2b332da6ff92.zip
Bug 527664 - [AFViewpoints] Architecture Model Editor remove
CreationCommandClass property value Converted the Creation/ConversionCommandClass properties in the architecture editor to be of type string instead of Class. They can now reference class names from the workspace (on their project's class path). Also added validation rules for that. Finally, I added a Browse... button in the property sheet to help put values for them. remove some reexport increase version to take in account API tool Change-Id: I6792449fbee70b089f83780c4935242fff72d50b Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'plugins/infra/architecture')
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF9
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml2
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java1
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF7
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml2
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java7
-rw-r--r--plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java53
8 files changed, 67 insertions, 18 deletions
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF
index 17ca37972d8..f9a16a5a303 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF
@@ -11,13 +11,14 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.papyrus.infra.architecture.representation.provider
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.architecture.representation;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.core.architecture.edit;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.architecture.representation;bundle-version="[1.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.core.architecture.edit;bundle-version="[1.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.constraints;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.constraints.edit;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.types;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.types.edit;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.emf.ecore;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
- org.eclipse.emf.ecore.edit;bundle-version="[2.0.0,3.0.0)";visibility:=reexport
+ org.eclipse.emf.ecore.edit;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF
index f85c58963a2..b0b24a2a2b7 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.infra.architecture.representation;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -14,5 +14,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.constraints;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.types;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,2.0.0)";visibility:=reexport
+ org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,3.0.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml
index db883c5ade1..19c6cf37da5 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.architecture.representation</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java
index 328d69b9ab2..56f916b9b5d 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java
@@ -85,6 +85,7 @@ public interface RepresentationPackage extends EPackage {
* <!-- end-user-doc -->
* @generated
* @ordered
+ * @since 2.0
*/
int PAPYRUS_REPRESENTATION_KIND__ID = ArchitecturePackage.REPRESENTATION_KIND__ID;
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF
index 67d937f9fff..6933a00f79f 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF
@@ -2,15 +2,16 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.infra.architecture;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.papyrus.infra.architecture,
org.eclipse.papyrus.infra.architecture.commands,
org.eclipse.papyrus.infra.architecture.listeners,
org.eclipse.papyrus.infra.core.architecture.merged
-Require-Bundle: org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+Require-Bundle: org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,3.0.0)",
org.eclipse.papyrus.infra.services.edit;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)"
+ org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.infra.types;bundle-version="[3.0.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml
index 50ab4a4ee64..5dc5094e0fe 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.architecture</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java
index d98eb577e6b..4f0221d2e7e 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java
@@ -22,6 +22,7 @@ import java.util.Set;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.command.UnexecutableCommand;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.papyrus.infra.architecture.commands.IModelConversionCommand;
import org.eclipse.papyrus.infra.architecture.commands.IModelCreationCommand;
@@ -209,8 +210,8 @@ public class ArchitectureDescriptionUtils {
*/
protected Command getModelCreationCommand(String contextId) {
final MergedArchitectureContext context = manager.getArchitectureContextById(contextId);
- if (context.getCreationCommandClass() == null)
- return null;
+ if (context.getCreationCommandClassName() == null)
+ return UnexecutableCommand.INSTANCE;
return new RecordingCommand(modelSet.getTransactionalEditingDomain()) {
@Override
protected void doExecute() {
@@ -232,7 +233,7 @@ public class ArchitectureDescriptionUtils {
*/
protected Command getModelConversionCommand(String contextId) {
MergedArchitectureContext context = manager.getArchitectureContextById(contextId);
- if (context.getConversionCommandClass() == null)
+ if (context.getConversionCommandClassName() == null)
return null;
return new RecordingCommand(modelSet.getTransactionalEditingDomain()) {
@Override
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java
index b5d11710836..75442bdb83c 100644
--- a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java
+++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java
@@ -20,10 +20,13 @@ import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.papyrus.infra.core.architecture.ADElement;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureContext;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureViewpoint;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
+import org.osgi.framework.Bundle;
/**
* An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core.
@@ -66,11 +69,17 @@ public abstract class MergedArchitectureContext extends MergedADElement {
*
* @return a creation command class
*/
- public Class<?> getCreationCommandClass() {
+ public Class<?> getCreationCommandClass() throws ClassNotFoundException {
for (ADElement element : elements) {
ArchitectureContext context = (ArchitectureContext) element;
- if (context.getCreationCommandClass() != null)
- return context.getCreationCommandClass();
+ if (context.getCreationCommandClass() != null) {
+ URI uri = context.eResource().getURI();
+ if (uri.isPlatformPlugin()) {
+ String bundleName = uri.segment(1);
+ Bundle bundle = Platform.getBundle(bundleName);
+ return bundle.loadClass(context.getCreationCommandClass());
+ }
+ }
}
return null;
}
@@ -80,7 +89,43 @@ public abstract class MergedArchitectureContext extends MergedADElement {
*
* @return a conversion command class
*/
- public Class<?> getConversionCommandClass() {
+ public Class<?> getConversionCommandClass() throws ClassNotFoundException {
+ for (ADElement element : elements) {
+ ArchitectureContext context = (ArchitectureContext) element;
+ if (context.getConversionCommandClass() != null) {
+ URI uri = context.eResource().getURI();
+ if (uri.isPlatformPlugin()) {
+ String bundleName = uri.segment(1);
+ Bundle bundle = Platform.getBundle(bundleName);
+ return bundle.loadClass(context.getConversionCommandClass());
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the context's creation command class name
+ *
+ * @return a creation command class name
+ * @since 1.1
+ */
+ public String getCreationCommandClassName() {
+ for (ADElement element : elements) {
+ ArchitectureContext context = (ArchitectureContext) element;
+ if (context.getCreationCommandClass() != null)
+ return context.getCreationCommandClass();
+ }
+ return null;
+ }
+
+ /**
+ * Gets the context's conversion command class name
+ *
+ * @return a conversion command class name
+ * @since 1.1
+ */
+ public String getConversionCommandClassName() {
for (ADElement element : elements) {
ArchitectureContext context = (ArchitectureContext) element;
if (context.getConversionCommandClass() != null)

Back to the top