diff options
Diffstat (limited to 'plugins')
28 files changed, 702 insertions, 44 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java index 2bd33a691c0..37fcac95c9d 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/DependencyManagementHelper.java @@ -144,7 +144,7 @@ public class DependencyManagementHelper { continue; } - Object value = eObject.eGet(reference); + Object value = eObject.eGet(reference, false); if (value instanceof EObject) { EObject eObjectToReplace = (EObject) value; @@ -350,4 +350,122 @@ public class DependencyManagementHelper { return updateDependencies(uriToReplace, targetURI, resourcesToEdit, null); } + /** + * Batch operation for replacing a set of resource URIs with another set of URIs, for a Collection of resources + * + * @param urisToReplace + * The mapping of Resource URIs to replace (Key = SourceURI, Value = TargetURI) + * @param resourcesToRepair + * The list of resources to edit. Only the objects of these resources will be modified. + * @param editingDomain + * The editing domain. May be null. + */ + public static void batchUpdateDependencies(Map<URI, URI> urisToReplace, Collection<Resource> resourcesToRepair, EditingDomain editingDomain) { + for (Resource resource : resourcesToRepair) { + if (EMFHelper.isReadOnly(resource, editingDomain)) { + continue; + } + + batchUpdateDependencies(urisToReplace, resource, editingDomain); + } + } + + /** + * Batch operation for replacing a set of resource URIs with another set of URIs, for a single resource + * + * @param urisToReplace + * The mapping of Resource URIs to replace (Key = SourceURI, Value = TargetURI) + * @param resourcesToRepair + * The list of resources to edit. Only the objects of these resources will be modified. + * @param editingDomain + * The editing domain. May be null. + */ + public static void batchUpdateDependencies(Map<URI, URI> urisToReplace, Resource fromResource, EditingDomain editingDomain) { + Iterator<EObject> allContentsIterator = fromResource.getAllContents(); + + while (allContentsIterator.hasNext()) { + EObject eObject = allContentsIterator.next(); + + for (EReference reference : eObject.eClass().getEAllReferences()) { + if (reference.isContainer() || reference.isContainment()) { + continue; + } + + // Attempts to modify a changeable + derived feature (e.g. Class#general in UML) + // will rely in reverse-derivation algorithms, which may recreate some existing elements + // (Instead of modifying them). This can result in loss of information. Don't change derived values. + if (reference.isDerived() || !reference.isChangeable()) { + continue; + } + + Object value = eObject.eGet(reference, false); + if (value instanceof EObject) { + EObject eObjectToReplace = (EObject) value; + + EObject newEObject = checkAndReplace(eObjectToReplace, urisToReplace); + if (newEObject == null) { + continue; + } + + try { + eObject.eSet(reference, newEObject); + } catch (Exception ex) { + Activator.log.error(ex); + } + + } else if (value instanceof Collection<?>) { + Map<EObject, EObject> previousToNewValue = new HashMap<EObject, EObject>(); + + Collection<?> collection = (Collection<?>) value; + + for (Object collectionElement : (Collection<?>) value) { + if (collectionElement instanceof EObject) { + EObject eObjectToReplace = (EObject) collectionElement; + EObject newEObject = checkAndReplace(eObjectToReplace, urisToReplace); + if (newEObject == null) { + continue; + } + + previousToNewValue.put(eObjectToReplace, newEObject); + } + } + + if (previousToNewValue.isEmpty()) { + continue; + } + + if (collection instanceof EStructuralFeature.Setting) { + EStructuralFeature.Setting setting = (EStructuralFeature.Setting) collection; + for (Map.Entry<EObject, EObject> entry : previousToNewValue.entrySet()) { + EcoreUtil.replace(setting, entry.getKey(), entry.getValue()); + } + } + } + } + } + } + + /** + * Replaces the EObject (Which may be a proxy) by its equivalent in the given Resource's URI. + * Returns null if the "currentValueToReplace" doesn't belong to the resource represented by "urisToReplace". + * + * @param currentValueToReplace + * The current value, to be replaced. May be a proxy + * @param urisToReplace + * The mapping of Resource URIs to replace (Key = SourceURI, Value = TargetURI) + * @return + * The EObject equivalent to the replaced EObject, in the target resource. + */ + private static EObject checkAndReplace(EObject currentValueToReplace, Map<URI, URI> urisToReplace) { + URI eObjectURIToReplace = EcoreUtil.getURI(currentValueToReplace); + URI resourceURI = eObjectURIToReplace.trimFragment(); + + URI targetURI = urisToReplace.get(resourceURI); + if (targetURI == null) { + return null; + } + + return replace(currentValueToReplace, targetURI); + } + } diff --git a/plugins/infra/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF index df665422f34..e15e7398b21 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF +++ b/plugins/infra/org.eclipse.papyrus.infra.onefile/META-INF/MANIFEST.MF @@ -15,7 +15,8 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.1.0", org.eclipse.core.filesystem;bundle-version="1.4.0", org.eclipse.papyrus.infra.emf;bundle-version="1.1.0", org.eclipse.core.expressions, - org.eclipse.emf.ecore + org.eclipse.emf.ecore, + org.eclipse.emf.edit;bundle-version="2.11.0" Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy Bundle-Version: 1.1.0.qualifier diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/configuration/BlockDefinitionDiagram.configuration b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/configuration/BlockDefinitionDiagram.configuration index bd17be795b1..425389ede83 100644 --- a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/configuration/BlockDefinitionDiagram.configuration +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/configuration/BlockDefinitionDiagram.configuration @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <configuration:PapyrusConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmi:id="_ko07IErbEeSdQKzSRatBjg"> <viewpoints xsi:type="configuration:PapyrusViewpoint" xmi:id="_xogdoErbEeSdQKzSRatBjg" name="Default Papyrus Viewpoint"> - <modelKinds xsi:type="configuration:PapyrusDiagram" xmi:id="_ZrBf4JaBEeS8eNvSwD0lgA" name="Sysml 1.4" icon="platform:/plugin/org.eclipse.papyrus.sysml.diagram.blockdefinition/icons/obj16/Diagram_BlockDefinition.gif" implementationID="PapyrusUMLClassDiagram" customPalette="platform:/plugin/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/palette/sysmlBlockDiagram.palette"> + <modelKinds xsi:type="configuration:PapyrusDiagram" xmi:id="_ZrBf4JaBEeS8eNvSwD0lgA" name="SysML 1.4 Block Definition" icon="platform:/plugin/org.eclipse.papyrus.sysml.diagram.blockdefinition/icons/obj16/Diagram_BlockDefinition.gif" implementationID="PapyrusUMLClassDiagram" customPalette="platform:/plugin/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/palette/blockDiagramPalette.xml"> <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//blocks"/> <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows"/> <modelRules xmi:id="_ZrBf4ZaBEeS8eNvSwD0lgA"> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/palette/sysmlBlockDiagram.palette b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/palette/blockDiagramPalette.xml index 22536f400a8..643ec927dd0 100644 --- a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/palette/sysmlBlockDiagram.palette +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources/palette/blockDiagramPalette.xml @@ -54,8 +54,8 @@ <aspectTool description="Create a new Actor" id="blockdefinition_modelelements.tool.actor" name="Actor" refToolId="usecase.tool.actor"> </aspectTool> - <aspectTool description="Create a new Block" id="blockdefinition_modelelements.tool.block" - name="Block" refToolId="clazz.tool.class"> + <aspectTool id="blockdefinition_modelelements.tool.block" name="Block" + refToolId="clazz.tool.class" description="Create a new Block"> <postAction id="org.eclipse.papyrus.applystereotypeactionprovider"> <stereotypesToApply> <stereotype stereotypeName="SysML::Blocks::Block" /> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.classpath b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.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.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.project b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.project new file mode 100644 index 00000000000..752f0331ac8 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml14.diagram.internalblock</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/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +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.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/META-INF/MANIFEST.MF b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..4a00296925c --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: BDD1.4 Configuration for Papyrus +Bundle-SymbolicName: org.eclipse.papyrus.sysml14.diagram.internalblock;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-Activator: org.eclipse.papyrus.sysml14.diagram.internalblock.Activator +Bundle-Vendor: Eclipse Modeling Project +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.1.0", + org.eclipse.papyrus.infra.newchild;bundle-version="1.1.0", + org.eclipse.papyrus.views.properties;bundle-version="1.1.0", + org.eclipse.uml2.uml, + org.eclipse.papyrus.infra.core;bundle-version="1.1.0", + org.eclipse.emf.ecore.editor, + org.eclipse.papyrus.infra.onefile;bundle-version="1.1.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/about.html b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/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>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/build.properties b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/build.properties new file mode 100644 index 00000000000..90aaca604a4 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + about.html,\ + resources/ diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/plugin.xml b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/plugin.xml new file mode 100644 index 00000000000..3d496f6d923 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/plugin.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.papyrus.infra.viewpoints.policy.custom"> + <contribution + file="resources/configuration/InternalBlockDiagram.configuration" + original="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration"> + </contribution> + </extension> +</plugin> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/pom.xml b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/pom.xml new file mode 100644 index 00000000000..296d229f52e --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/pom.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>org.eclipse.papyrus</artifactId> + <groupId>org.eclipse.papyrus</groupId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../../../releng/top-pom-extras.xml</relativePath> + </parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.sysml14.diagram.internalblock</artifactId> + <version>1.1.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project>
\ No newline at end of file diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/configuration/InternalBlockDiagram.configuration b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/configuration/InternalBlockDiagram.configuration new file mode 100644 index 00000000000..d77bf64be0e --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/configuration/InternalBlockDiagram.configuration @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<configuration:PapyrusConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmi:id="_ko07IErbEeSdQKzSRatBjg">
+ <viewpoints xsi:type="configuration:PapyrusViewpoint" xmi:id="_xogdoErbEeSdQKzSRatBjg" name="Default Papyrus Viewpoint">
+ <modelKinds xsi:type="configuration:PapyrusDiagram" xmi:id="_ZrBf4JaBEeS8eNvSwD0lgA" name="SysML 1.4 Internal Block" icon="platform:/plugin/org.eclipse.papyrus.sysml.diagram.internalblock/icons/obj16/Diagram_InternalBlock.gif" implementationID="PapyrusUMLClassDiagram" customPalette="platform:/plugin/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/palette/internalBlockDiagramPalette.xml">
+ <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//blocks"/>
+ <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows"/>
+ <modelRules xmi:id="_ZrBf4ZaBEeS8eNvSwD0lgA">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </modelRules>
+ <owningRules xmi:id="_ZrBf45aBEeS8eNvSwD0lgA">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </owningRules>
+ <categories href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wNb49xhEeOqHvRyiN87hA"/>
+ <childRules xmi:id="_ZrBf5ZaBEeS8eNvSwD0lgA"/>
+ <paletteRules xmi:id="_N4GzIKFQEeSx6MYdei1rKA" permit="false" element="clazz.group.*"/>
+ </modelKinds>
+ </viewpoints>
+ <defaultStakeholder href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wLmkdxhEeOqHvRyiN87hA"/>
+ <metamodel href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
+</configuration:PapyrusConfiguration>
diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/palette/internalBlockDiagramPalette.xml b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/palette/internalBlockDiagramPalette.xml new file mode 100644 index 00000000000..5951dd18d99 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/resources/palette/internalBlockDiagramPalette.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + Copyright (c) 2015 CEA. + + 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 - Initial API and implementation + Benoit Maggi benoit.maggi@cea.fr + +--> +<paletteDefinition> + <content> + + <drawer id="internalblock.drawer.nodes" name="Nodes" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> + + <!-- + <aspectTool description="Create a new Port" id="internalblock_main.tool.port" + name="Port" refToolId="internalblock.tool.port"> + </aspectTool> + <aspectTool description="Create a new FlowPort (IN)" id="internalblock_main.tool.flowport_in" + name="FlowPort (IN)" refToolId="internalblock.tool.flowport_in"> + </aspectTool> + <aspectTool description="Create a new FlowPort (OUT)" id="internalblock_main.tool.flowport_out" + name="FlowPort (OUT)" refToolId="internalblock.tool.flowport_out"> + </aspectTool> + <aspectTool description="Create a new FlowPort (INOUT)" id="internalblock_main.tool.flowport_inout" + name="FlowPort (INOUT)" refToolId="internalblock.tool.flowport_inout"> + </aspectTool> + <aspectTool description="Create a new FlowPort (Non Atomic)" id="internalblock_main.tool.flowport_na" + name="FlowPort (Non Atomic)" refToolId="internalblock.tool.flowport_na"> + </aspectTool> + <aspectTool description="Create a new Property" id="internalblock_main.tool.property" + name="Property" refToolId="internalblock.tool.property"> + </aspectTool> + <aspectTool description="Create a new Part" id="internalblock_main.tool.part" + name="Part" refToolId="internalblock.tool.part"> + </aspectTool> + <aspectTool description="Create a new Reference" id="internalblock_main.tool.reference" + name="Reference" refToolId="internalblock.tool.reference"> + </aspectTool> + <aspectTool description="Create a new ActorPart" id="internalblock_main.tool.actorpart" + name="ActorPart" refToolId="internalblock.tool.actorpart"> + </aspectTool> + <aspectTool description="Create a new Value" id="internalblock_main.tool.value" + name="Value" refToolId="internalblock.tool.value"> + </aspectTool> + --> + + <aspectTool name="Comment" id="internalblock_main.tool.comment" refToolId="clazz.tool.comment" description="Create a new Comment" /> + <aspectTool name="Constraint" id="internalblock_main.tool.constraint" refToolId="clazz.tool.constraint" description="Create a new Constraint" /> + + </drawer> + + <!-- + <drawer id="internalblock.drawer.edges" name="Edges" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> + + <aspectTool description="Create a new Connector" id="internalblock_main.tool.connector" + name="Connector" refToolId="internalblock.tool.connector"> + </aspectTool> + <aspectTool description="Create a new Dependency" id="internalblock_main.tool.dependency" + name="Dependency" refToolId="internalblock.tool.dependency"> + </aspectTool> + <aspectTool description="Create a new Comment / Constraint link" id="internalblock_main.tool.comment_constraint_link" + name="Comment / Constraint link" refToolId="internalblock.tool.comment_constraint_link"> + </aspectTool> + </drawer> + --> + </content> +</paletteDefinition>
\ No newline at end of file diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/src/org/eclipse/papyrus/sysml14/diagram/internalblock/Activator.java b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/src/org/eclipse/papyrus/sysml14/diagram/internalblock/Activator.java new file mode 100644 index 00000000000..8ad9a2c65ec --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.internalblock/src/org/eclipse/papyrus/sysml14/diagram/internalblock/Activator.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * 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: + * Benoit Maggi benoit.maggi@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.sysml14.diagram.internalblock; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml14.diagram.internalblock"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.classpath b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.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.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.project b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.project new file mode 100644 index 00000000000..8bda2440467 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml14.diagram.parametric</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/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +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.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/META-INF/MANIFEST.MF b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..68ac6ef2134 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: BDD1.4 Configuration for Papyrus +Bundle-SymbolicName: org.eclipse.papyrus.sysml14.diagram.parametric;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-Activator: org.eclipse.papyrus.sysml14.diagram.parametric.Activator +Bundle-Vendor: Eclipse Modeling Project +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.1.0", + org.eclipse.papyrus.infra.newchild;bundle-version="1.1.0", + org.eclipse.papyrus.views.properties;bundle-version="1.1.0", + org.eclipse.uml2.uml, + org.eclipse.papyrus.infra.core;bundle-version="1.1.0", + org.eclipse.emf.ecore.editor, + org.eclipse.papyrus.infra.onefile;bundle-version="1.1.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/about.html b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/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>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/build.properties b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/build.properties new file mode 100644 index 00000000000..90aaca604a4 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + about.html,\ + resources/ diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/plugin.xml b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/plugin.xml new file mode 100644 index 00000000000..e929de651b4 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/plugin.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.papyrus.infra.viewpoints.policy.custom"> + <contribution + file="resources/configuration/ParametricDiagram.configuration" + original="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration"> + </contribution> + </extension> +</plugin> diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/pom.xml b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/pom.xml new file mode 100644 index 00000000000..f22e2e2403d --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/pom.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>org.eclipse.papyrus</artifactId> + <groupId>org.eclipse.papyrus</groupId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../../../releng/top-pom-extras.xml</relativePath> + </parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.sysml14.diagram.parametric</artifactId> + <version>1.1.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project>
\ No newline at end of file diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/resources/configuration/ParametricDiagram.configuration b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/resources/configuration/ParametricDiagram.configuration new file mode 100644 index 00000000000..a61cf8c8347 --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/resources/configuration/ParametricDiagram.configuration @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<configuration:PapyrusConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmi:id="_ko07IErbEeSdQKzSRatBjg">
+ <viewpoints xsi:type="configuration:PapyrusViewpoint" xmi:id="_xogdoErbEeSdQKzSRatBjg" name="Default Papyrus Viewpoint">
+ <modelKinds xsi:type="configuration:PapyrusDiagram" xmi:id="_ZrBf4JaBEeS8eNvSwD0lgA" name="SysML 1.4 Parametric" icon="platform:/plugin/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.png" implementationID="CompositeStructure" customPalette="platform:/plugin/org.eclipse.papyrus.sysml14.diagram.parametric/resources/palette/parametricDiagramPalette.xml">
+ <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//blocks"/>
+ <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//portandflows"/>
+ <modelRules xmi:id="_ZrBf4ZaBEeS8eNvSwD0lgA">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </modelRules>
+ <owningRules xmi:id="_ZrBf45aBEeS8eNvSwD0lgA">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </owningRules>
+ <categories href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wNb49xhEeOqHvRyiN87hA"/>
+ <childRules xmi:id="_ZrBf5ZaBEeS8eNvSwD0lgA"/>
+ <paletteRules xmi:id="_N4GzIKFQEeSx6MYdei1rKA" permit="false" element="composite.group.*"/>
+ </modelKinds>
+ </viewpoints>
+ <defaultStakeholder href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wLmkdxhEeOqHvRyiN87hA"/>
+ <metamodel href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
+</configuration:PapyrusConfiguration>
diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/resources/palette/parametricDiagramPalette.xml b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/resources/palette/parametricDiagramPalette.xml new file mode 100644 index 00000000000..16b12294c7e --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/resources/palette/parametricDiagramPalette.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + Copyright (c) 2015 CEA. + + 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 - Initial API and implementation + Benoit Maggi benoit.maggi@cea.fr + +--> +<paletteDefinition> + <content> + <!-- + <drawer id="parametric.drawer.nodes" name="Nodes" + iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> + <aspectTool description="Create a new ConstraintProperty" + id="parametric.tool.constraintblockpropertycomposite" name="ConstraintProperty" + refToolId="parametric.tool.constraintblockpropertycomposite"> + </aspectTool> + <aspectTool description="Create a new ConstraintParameter" + id="parametric.tool.parameter" name="ConstraintParameter" refToolId="parametric.tool.parameter"> + </aspectTool> + <aspectTool description="Create a new Part" + id="parametric.tool.blockpropertycomposite" name="Part" + refToolId="parametric.tool.blockpropertycomposite"> + </aspectTool> + <aspectTool description="Create a new Reference" id="parametric.tool.reference" + name="Reference" refToolId="parametric.tool.reference"> + </aspectTool> + <aspectTool description="Create a new Value" id="parametric.tool.value" + name="Value" refToolId="parametric.tool.value"> + </aspectTool> + </drawer> + + <drawer id="parametric.drawer.edges" name="Edges" + iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> + <aspectTool description="Create a new BindingConnector" + id="parametric.tool.connector" name="BindingConnector" refToolId="parametric.tool.connector"> + </aspectTool> + </drawer> + --> + <drawer id="parametric.drawer.others" name="Others" + iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> + <!-- + <aspectTool description="Create a new Dependency" id="parametric.tool.dependency" + name="Dependency" refToolId="parametric.tool.dependency"> + </aspectTool> + --> + <aspectTool description="Create a new Comment" id="parametric.tool.comment" + name="Comment" refToolId="composite.tool.comment"> + </aspectTool> + <aspectTool description="Create a new Constraint" id="parametric.tool.constraint" + name="Constraint" refToolId="composite.tool.constraint"> + </aspectTool> + <!-- + <aspectTool description="Create a new CommentAnnotatedElement" + id="parametric.tool.commentannotatedelement" name="CommentAnnotatedElement" + refToolId="parametric.tool.comment_constraint_link"> + </aspectTool> + <aspectTool description="Create a new ContextLink" id="parametric.tool.context_link" + name="ContextLink" refToolId="parametric.tool.context_link"> + </aspectTool> + --> + </drawer> + </content> +</paletteDefinition>
\ No newline at end of file diff --git a/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/Activator.java b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/Activator.java new file mode 100644 index 00000000000..8a0f0bccf8e --- /dev/null +++ b/plugins/sysml/sysml14/org.eclipse.papyrus.sysml14.diagram.parametric/src/org/eclipse/papyrus/sysml14/diagram/parametric/Activator.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * 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: + * Benoit Maggi benoit.maggi@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.sysml14.diagram.parametric; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml14.diagram.parametric"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF index e95042a0c62..443b6677fc8 100644 --- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF @@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.1.0",
org.eclipse.papyrus.uml.tools.utils;bundle-version="1.1.0",
org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.newchild;bundle-version="1.1.0"
+ org.eclipse.papyrus.infra.newchild;bundle-version="1.1.0",
+ org.eclipse.emf.edit.ui;bundle-version="2.11.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java index ee4b55eec6d..afafb78478c 100644 --- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java @@ -12,58 +12,23 @@ /*****************************************************************************/ package org.eclipse.papyrus.uml.modelexplorer.queries; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage; import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils; -import org.eclipse.papyrus.emf.facet.custom.ui.internal.query.ImageQuery; import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; -import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue; import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; -import org.eclipse.papyrus.uml.tools.utils.ElementUtil; +import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider; import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Stereotype; /** Create a basic label based on element name */ public class GetImageQuery implements IJavaQuery2<Element, IImage> { // public static final String sysml_plugin_path = "platform:/plugin/org.eclipse.papyrus.sysml/"; - + private static UMLLabelProvider umlLabelProvider = new UMLLabelProvider(); // @Override public IImage evaluate(Element source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { - ParameterValue parameterValue = parameterValues.getParameterValueByName("eObject"); - if (parameterValue.getValue() instanceof EStructuralFeature) { - return ImageQuery.getEObjectImage((EStructuralFeature) parameterValue.getValue()); - } - - String iconPath = ""; - if (!source.getAppliedStereotypes().isEmpty()) { - Stereotype first_stereotype = source.getAppliedStereotypes().get(0); - - if (!first_stereotype.getIcons().isEmpty()) { - org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(source, first_stereotype, "icon"); - if (icon != null) { - iconPath = icon.getLocation(); - } - } - } - - String imagePath = ""; - - if (iconPath != null && !"".equals(iconPath)) { - URI iconURI = URI.createURI(iconPath); - // if(iconURI.isRelative()) { - // imagePath = sysml_plugin_path + iconPath; - // } else { - imagePath = iconURI.toString(); - // } - } - if ("".equals(imagePath)) { - return ImageQuery.getEObjectImage(source); - } - return ImageUtils.wrap(imagePath); + return ImageUtils.wrap(umlLabelProvider.getImage(source)); } } |