Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common')
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF6
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java40
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/PapyrusPaletteService.java1
3 files changed, 35 insertions, 12 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 99bcffbb8c1..7dfd8dac3e0 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -68,11 +68,13 @@ Require-Bundle: org.eclipse.emf.ecore.edit;bundle-version="[2.9.0,3.0.0)",
org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
org.eclipse.papyrus.infra.gmfdiag.tooling.runtime;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.representation;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.gmfdiag.representation;bundle-version="[1.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.gmfdiag.style;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.filters;bundle-version="1.2.0",
- org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="[2.100.0,3.0.0)"; visibility:=reexport
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="[2.100.0,4.0.0)",
+ org.eclipse.papyrus.infra.architecture.representation;bundle-version="[1.0.0,3.0.0)",
+ org.eclipse.papyrus.infra.architecture;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
index 3b34937389d..21abab70070 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/GMFDiagramViewTypeHelper.java
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.helper;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
@@ -22,6 +24,7 @@ import org.eclipse.papyrus.infra.gmfdiag.representation.PapyrusDiagram;
import org.eclipse.papyrus.infra.viewpoints.policy.AbstractViewTypeHelper;
import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.osgi.framework.Bundle;
/**
* Represents the dynamic contribution of a policy to menus
@@ -49,16 +52,35 @@ public class GMFDiagramViewTypeHelper extends AbstractViewTypeHelper<PapyrusDiag
*/
@Override
protected ViewPrototype doGetPrototypeFor(PapyrusDiagram diagramKind) {
- String language = diagramKind.getLanguage().getId();
- AbstractPapyrusGmfCreateDiagramCommandHandler command;
- try {
- Class<?> creationCommandClass = diagramKind.getCreationCommandClass();
- command = (AbstractPapyrusGmfCreateDiagramCommandHandler) creationCommandClass.newInstance();
- } catch (Exception e) {
- Activator.log.error(e);
- return null;
+ String commandClassName = diagramKind.getCreationCommandClass();
+ if (commandClassName != null) {
+ Class<?> creationCommandClass = null;
+
+ URI uri = diagramKind.eResource().getURI();
+ if (uri.isPlatformPlugin()) {
+ String bundleName = uri.segment(1);
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ creationCommandClass = bundle.loadClass(diagramKind.getCreationCommandClass());
+ } catch (ClassNotFoundException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ if (creationCommandClass != null) {
+ AbstractPapyrusGmfCreateDiagramCommandHandler command;
+ try {
+ command = (AbstractPapyrusGmfCreateDiagramCommandHandler) creationCommandClass.newInstance();
+ } catch (Exception e) {
+ Activator.log.error(e);
+ return null;
+ }
+
+ String language = diagramKind.getLanguage().getId();
+ return new DiagramPrototype(diagramKind, language, command);
+ }
}
- return new DiagramPrototype(diagramKind, language, command);
+ return null;
}
/**
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/PapyrusPaletteService.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/PapyrusPaletteService.java
index 5444bbf2403..f42a5607efe 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/PapyrusPaletteService.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/palette/PapyrusPaletteService.java
@@ -46,7 +46,6 @@ import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.PaletteSeparator;

Back to the top