summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Pascual2014-07-18 08:44:15 (EDT)
committerGabriel Pascual2014-08-07 12:57:14 (EDT)
commit710fffcfa0d6982000e4c6ce048b032945f21ea3 (patch)
treeb0e06c19d7203e1b417a9d6f641ea5588ec3d5b1
parentdbfb2fe457b59af141c65fadaba6b06384727f67 (diff)
downloadorg.eclipse.papyrus-710fffcfa0d6982000e4c6ce048b032945f21ea3.zip
org.eclipse.papyrus-710fffcfa0d6982000e4c6ce048b032945f21ea3.tar.gz
org.eclipse.papyrus-710fffcfa0d6982000e4c6ce048b032945f21ea3.tar.bz2
374050: [Properties view] Manage interfaces for ports does not refreshrefs/changes/23/30123/12
"provided" and "required" interfaces immediatly https://bugs.eclipse.org/bugs/show_bug.cgi?id=374050 Composite diagram : - Add adapter for derived attribute - Add actions (add and remove) on observable list of properties view - Connected menu action Interface Manager and Properties view - Refactor Manage interface Handler and UI - Fix several bugs about NewElementRepresentation handling during commands execution. - Clean dependencies after refactor - Manage strictly adapters Change-Id: I3635b1a94f53acb3ef592b741afe76c13d767093 Signed-off-by: Gabriel Pascual <gabriel.pascual@all4tec.net>
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF127
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/messages.properties21
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.xml26
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/BlockDefinitionManageInterfacesHandler.java38
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/ManageProvidedInterfacesHandler.java121
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/messages/Messages.java86
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/BlockDefinitionInterfaceManagerDialog.java82
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java434
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/InterfaceManagerDialog.java1040
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/NewElementRepresentation.java172
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF50
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/messages.properties27
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.xml2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/InternalBlockManageInterfacesHandler.java46
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/ManageProvidedInterfacesHandler.java119
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/messages/Messages.java94
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InternalBlockInterfaceManagerDialog.java76
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/NewElementRepresentation.java172
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/messages.properties17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Messages.java28
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ManagePortInterfacesHandler.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/actions/ManageProvidedInterfacesHandler.java)284
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CreateUmlElementDialog.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java)850
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/ExtendedSelectionEditor.java546
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/IPortInterfaceManagerDialog.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/InterfaceManagerDialog.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InterfaceManagerDialog.java)2032
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/NewElementRepresentation.java (renamed from plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/NewElementRepresentation.java)345
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/SelectionEditorWrapper.java180
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ComponentManageInterfacesHandler.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java99
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/Messages.java125
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/messages.properties39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ComponentInterfaceManagerDialog.java295
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/CreateUmlElementDialog.java404
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/DisplayInterfaceMDialog.java257
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ExtendedSelectionEditor.java545
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/InterfaceManagerDialog.java936
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/NewElementRepresentation.java177
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/plugin.xml1938
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/META-INF/MANIFEST.MF162
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/Messages.java144
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/messages.properties45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java404
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java1008
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/plugin.xml3542
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/UMLModelElement.java599
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/DerivedAttributeAdapter.java270
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java205
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DestroyDependencyWithoutSupplierCommand.java125
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java323
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java307
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/PortInterfaceContentProvider.java97
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLContentProvider.java453
54 files changed, 8055 insertions, 11656 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF
index 707ea91..78f89b8 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF
@@ -1,65 +1,62 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.sysml.diagram.blockdefinition,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.command,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.dnd.helper,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.edit.part,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.edit.policy,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.factory,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.handler,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.helper.advice,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.messages,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.part,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.preferences,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.provider,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.ui,
- org.eclipse.papyrus.sysml.diagram.blockdefinition.utils
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.sysml;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
- org.eclipse.emf.common.ui;bundle-version="2.5.0",
- org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.2.0",
- org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.0.0",
- org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.3.0",
- org.eclipse.core.expressions;bundle-version="3.4.100",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
- org.eclipse.papyrus.sysml.diagram.common;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.service.types;bundle-version="1.0.0",
- org.eclipse.papyrus.sysml.service.types;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.0.0",
- org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
- org.eclipse.gmf.runtime.diagram.core;bundle-version="1.4.1",
- org.eclipse.draw2d;bundle-version="3.7.1",
- org.eclipse.gef;bundle-version="3.7.1",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
- org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="1.0.0",
- org.eclipse.ui.ide;bundle-version="3.8.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.gmf.tooling.runtime;bundle-version="3.1.0",
- org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
- org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.0",
- org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Name: %pluginName
-Bundle-Activator: org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.blockdefinition;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.sysml.diagram.blockdefinition,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.command,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.dnd.helper,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.edit.part,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.edit.policy,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.factory,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.helper.advice,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.messages,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.part,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.preferences,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.provider,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.ui,
+ org.eclipse.papyrus.sysml.diagram.blockdefinition.utils
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.sysml;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
+ org.eclipse.emf.common.ui;bundle-version="2.5.0",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.0.0",
+ org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.3.0",
+ org.eclipse.core.expressions;bundle-version="3.4.100",
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
+ org.eclipse.papyrus.sysml.diagram.common;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.service.types;bundle-version="1.0.0",
+ org.eclipse.papyrus.sysml.service.types;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.0.0",
+ org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
+ org.eclipse.gmf.runtime.diagram.core;bundle-version="1.4.1",
+ org.eclipse.draw2d;bundle-version="3.7.1",
+ org.eclipse.gef;bundle-version="3.7.1",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="1.0.0",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
+ org.eclipse.uml2.uml;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
+ org.eclipse.gmf.tooling.runtime;bundle-version="3.1.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.0.qualifier
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.blockdefinition;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/messages.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/messages.properties
index dffb67c..0fbb20a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/messages.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/messages.properties
@@ -1,21 +1,2 @@
-CreateUmlElementDialog_New_Element_Name=New Element Name
-InterfaceManagerDialog_CreateANewInterface=Create a new Interface
-InterfaceManagerDialog_CreateNewInterface=Create new Interface
-InterfaceManagerDialog_SelectedTheProvidedInterfaces=Select the provided Interfaces
-InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier=Selection has to be a Package or a Classifier
-InterfaceManagerDialog_SelectTheParentOfThisNewInterface=Select the parent of this new Interface
-InterfaceManagerDialog_SelectTheRequiredInterfaces=Select the required Interfaces
-InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage=\nThe managed port is typed with an Interface, so this interface is not available as a provided Interface.\n
-InterfaceManagerDialog_Title=Select the provided and the required Interfaces
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port (should be a Block) is not defined. You need to define it before managing its Interfaces.
-SelectionValidated=Selection validated.
-NoSelectionFound=No selection found.
-
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port (should be a Block) is not defined. You need to define it before managing its Interfaces.
-SelectionValidated=Selection validated.
-NoSelectionFound=No selection found.
-
-Notification_Drop_Title=Drop in diagram
+Notification_Drop_Title=Drop in diagram
Notification_Drop_UMLAssociationWarning=The Association ({0}) can not be dropped in this diagram because it is not a SysML Association.\nIt was probably not created in a SysML Diagram. \ No newline at end of file
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.xml
index ff86695..410f1b4 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/plugin.xml
@@ -970,10 +970,10 @@
</extension>
-<!-- // Start of user code custom extensions
- -->
-
-<!-- Insert custom extensions here. -->
+<!-- // Start of user code custom extensions
+ -->
+
+<!-- Insert custom extensions here. -->
<!-- Palette tool declaration (declares the real palette containment) -->
<extension point="org.eclipse.papyrus.uml.diagram.common.paletteDefinition"
@@ -1032,8 +1032,8 @@
<!-- Specify diagram this palette tools relate to -->
<editor id="org.eclipse.papyrus.sysml.diagram.blockdefinition"/>
- </paletteDefinition>
-</extension>
+ </paletteDefinition>
+</extension>
<!-- Palette tool declaration (declares the real palette containment) -->
<extension point="org.eclipse.papyrus.uml.diagram.common.paletteDefinition"
@@ -1050,12 +1050,12 @@
</paletteDefinition>
</extension>
-<!-- Parser provider declaration -->
-<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders">
- <ParserProvider class="org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ParserProvider">
- <Priority name="Low"/>
- </ParserProvider>
-</extension>
+<!-- Parser provider declaration -->
+<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders">
+ <ParserProvider class="org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ParserProvider">
+ <Priority name="Low"/>
+ </ParserProvider>
+</extension>
<!-- Validation markers declaration -->
<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
@@ -1093,7 +1093,7 @@
<extension
point="org.eclipse.ui.handlers">
<handler
- class="org.eclipse.papyrus.sysml.diagram.blockdefinition.handler.ManageProvidedInterfacesHandler"
+ class="org.eclipse.papyrus.sysml.diagram.blockdefinition.handler.BlockDefinitionManageInterfacesHandler"
commandId="org.eclipse.papyrus.sysml.diagram.blockdefinition.command.manage.interfaces">
<activeWhen>
<and>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/BlockDefinitionManageInterfacesHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/BlockDefinitionManageInterfacesHandler.java
new file mode 100644
index 0000000..7746545
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/BlockDefinitionManageInterfacesHandler.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.handler;
+
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.ui.BlockDefinitionInterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.common.actions.handlers.ManagePortInterfacesHandler;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog;
+import org.eclipse.uml2.uml.Port;
+
+/**
+ * Manage Interface handler for Block Definition diagram.
+ *
+ * @author Gabriel Pascual
+ */
+public class BlockDefinitionManageInterfacesHandler extends ManagePortInterfacesHandler {
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.actions.handlers.ManagePortInterfacesHandler#getInterfaceManagerDialog(org.eclipse.uml2.uml.Port)
+ *
+ * @param port
+ * @return
+ */
+ @Override
+ public InterfaceManagerDialog getInterfaceManagerDialog(Port port) {
+ return new BlockDefinitionInterfaceManagerDialog(DisplayUtils.getDefaultShell(), port);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/ManageProvidedInterfacesHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/ManageProvidedInterfacesHandler.java
deleted file mode 100644
index 38304bd..0000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/handler/ManageProvidedInterfacesHandler.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.blockdefinition.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-import org.eclipse.papyrus.sysml.diagram.blockdefinition.messages.Messages;
-import org.eclipse.papyrus.sysml.diagram.blockdefinition.ui.InterfaceManagerDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.Usage;
-
-
-/**
- * <pre>
- * This handler provides the handler to manage the provided and required {@link Interface}
- * of a {@link Port} without graphically creating {@link InterfaceRealization} and
- * {@link Usage} relationships.
- * </pre>
- */
-public class ManageProvidedInterfacesHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection.isEmpty()) {
- return null;
- }
-
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- EObject selectedElement = EMFHelper.getEObject(structuredSelection.getFirstElement());
- if(selectedElement instanceof Port) {
- Port port = (Port)selectedElement;
- ManageProvidedInterfaceAction action = new ManageProvidedInterfaceAction(port);
- try {
- ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(port).getCommandStack().execute(new GEFtoEMFCommandWrapper(action.getCommand()));
- } catch (ServiceException ex) {
- throw new ExecutionException("An unexpected exception occurred", ex);
- }
- }
- }
-
- return null;
- }
-
- /**
- *
- * This class provides the action to manage the provided and required interfaces
- *
- *
- */
- public class ManageProvidedInterfaceAction {
-
- /** the {@link Port} */
- private Port port;
-
- /** the {@link Type} of the port */
- private Type type;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart of the port
- */
- public ManageProvidedInterfaceAction(Port port) {
- this.port = port;
- this.type = port.getType();
- }
-
- /**
- * Returns the command to add/remove provided/required interfaces
- *
- * @return
- * the command to add/remove provided/required interfaces
- */
- public Command getCommand() {
- if(type != null && !(type instanceof Classifier)) {
- return UnexecutableCommand.INSTANCE;
- } else if(type == null) {
- MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(), Messages.InterfaceManagerDialog_Title, null, Messages.ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined, MessageDialog.WARNING, new String[]{ Messages.ManageProvidedInterfacesHandler_OK }, 0);
- dialog.open();
- } else {
- InterfaceManagerDialog dialog = new InterfaceManagerDialog(DisplayUtils.getDefaultShell(), this.port);
- if(dialog.open() == Dialog.OK) {
- return dialog.getCommand();
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/messages/Messages.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/messages/Messages.java
index e71a3dc..e56007c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/messages/Messages.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/messages/Messages.java
@@ -1,56 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.blockdefinition.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- public static String CreateUmlElementDialog_New_Element_Name;
-
- public static String InterfaceManagerDialog_CreateANewInterface;
-
- public static String InterfaceManagerDialog_CreateNewInterface;
-
- public static String InterfaceManagerDialog_SelectedTheProvidedInterfaces;
-
- public static String InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier;
-
- public static String InterfaceManagerDialog_SelectTheParentOfThisNewInterface;
-
- public static String InterfaceManagerDialog_SelectTheRequiredInterfaces;
-
- public static String InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage;
-
- public static String InterfaceManagerDialog_Title;
-
- public static String ManageProvidedInterfacesHandler_OK;
-
- public static String ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined;
-
- public static String SelectionValidated;
-
- public static String NoSelectionFound;
-
- public static String Notification_Drop_Title;
-
- public static String Notification_Drop_UMLAssociationWarning;
-
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- private Messages() {
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ public static String Notification_Drop_Title;
+
+ public static String Notification_Drop_UMLAssociationWarning;
+
+ static {
+ NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/BlockDefinitionInterfaceManagerDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/BlockDefinitionInterfaceManagerDialog.java
new file mode 100644
index 0000000..76a96fb
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/BlockDefinitionInterfaceManagerDialog.java
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.ui;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * <pre>
+ * This class provides a Dialog to manage easily the provided and
+ * the required Interfaces for a {@link Port}.
+ * </pre>
+ */
+public class BlockDefinitionInterfaceManagerDialog extends InterfaceManagerDialog {
+
+
+ /**
+ * Instantiates a new block definition interface manager dialog.
+ *
+ * @param parentShell
+ * the parent shell
+ * @param port
+ * the port
+ */
+ public BlockDefinitionInterfaceManagerDialog(Shell parentShell, Port port) {
+ super(parentShell, port);
+
+ }
+
+
+ /**
+ * Gets the all available interfaces.
+ *
+ * @param pack
+ * the pack
+ * @return the all available interfaces
+ * @see org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog#getAllAvailableInterfaces(org.eclipse.uml2.uml.Package)
+ */
+ protected List<Interface> getAllAvailableInterfaces(Package pack) {
+ Set<Interface> otherInterfaces = new HashSet<Interface>();
+ List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
+ for(Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
+ interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
+
+ }
+
+ for(Element element : interfaces) {
+ // Test if the interface is a FlowSpecification
+ FlowSpecification flowSpec = UMLUtil.getStereotypeApplication(element, FlowSpecification.class);
+ if(flowSpec == null) {
+ otherInterfaces.add((Interface)element);
+ }
+ }
+
+ return Arrays.asList(otherInterfaces.toArray(new Interface[otherInterfaces.size()]));
+ }
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java
deleted file mode 100644
index 0215eb9..0000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/CreateUmlElementDialog.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.blockdefinition.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.sysml.diagram.blockdefinition.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This dialog allows to create easily a new element in a UML Model.
- */
-public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
-
- /** the hinted type of the element to create. */
- private IHintedType hintedType;
-
- /** the parent container of the element to create. */
- private Object parentContainer;
-
- /** the type of the element to create. */
- private String type;
-
- /** the root of the model. */
- private Package pack;
-
- /** the text field used to display the choose the name of the future element. */
- private Text text;
-
- /** creation request. */
- private CreateElementRequest request;
-
- /** the editing domain. */
- private TransactionalEditingDomain domain;
-
- /** The element to create is represented by this field. */
- private NewElementRepresentation elementToCreate;
-
- /** this Set contains names to exclude from the proposed name. */
- private List<String> forbiddenNames;
-
-
-
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent
- * @param domain
- * the domain
- * @param labelProvider
- * the label provider
- * @param contentProvider
- * the content provider
- * @param pack
- * the pack
- * @param hintedType
- * the hinted type
- */
- public CreateUmlElementDialog(Shell parent, TransactionalEditingDomain domain, ILabelProvider labelProvider, ITreeContentProvider contentProvider, Package pack, IHintedType hintedType) {
- super(parent, labelProvider, contentProvider);
- Assert.isNotNull(pack);
- Assert.isNotNull(hintedType);
- this.pack = pack;
- this.hintedType = hintedType;
- this.domain = domain;
- init();
- }
-
- /**
- * Initializes the field {@link #type};.
- */
- protected void init() {
- EClass eClass = hintedType.getEClass();
- this.type = eClass.getName();
- this.parentContainer = null;
- this.forbiddenNames = null;
- }
-
- /**
- * Sets the forbidden names.
- *
- * @param forbiddenNames
- * the new forbidden names
- */
- public void setForbiddenNames(List<String> forbiddenNames) {
- this.forbiddenNames = forbiddenNames;
- }
-
- /**
- * Creates the dialog area.
- *
- * @param parent
- * the parent
- * @return the control
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
-
- GridData data = (GridData)parent.getLayoutData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 1;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- Composite composite = (Composite)super.createDialogArea(parent);
- composite.setLayout(new GridLayout());
- GridData dat = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(dat);
- createNameSection(parent);
-
- return composite;
- }
-
- /**
- * Creates the name section and put it at the top of the composite.
- *
- * @param parent
- * the composite parent
- */
- protected void createNameSection(Composite parent) {
-
- Composite nameSection = new Composite(parent, SWT.NONE);
-
- //the label
- Label label = new Label(nameSection, SWT.NONE);
- label.setText(Messages.CreateUmlElementDialog_New_Element_Name);
-
- //the text field
- text = new Text(nameSection, SWT.BORDER);
- text.setText(getDefaultName());
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(textData);
-
- //layout for the nameSection
- GridLayout layout = new GridLayout(2, false);
- GridData data = new GridData(GridData.FILL_BOTH);
- nameSection.setLayout(layout);
- nameSection.setLayoutData(data);
-
- //we set the name section in first!
- nameSection.moveAbove(null);
- }
-
- /**
- * Returns the default name for the new Element.
- *
- * @return the default name
- * the default name for the new Element
- */
- protected String getDefaultName() {
-
- boolean existsInterface = false;
- String defaultName;
- int max = 0;
- do {
-
- List<Interface> allInterface = Util.getInstancesFilteredByType(pack, Interface.class, null);
- for(Object object : allInterface) {
- String name = NamedElementUtil.getName((NamedElement)object);
- if(name != null && name.startsWith(type)) {
- name = name.substring(type.length());
- Integer val = null;
- try {
- val = Integer.parseInt(name);
- } catch (NumberFormatException e) {
- //Nothing to do
- }
- if(val != null) {
- max = Math.max(Integer.valueOf(val), max);
- existsInterface = true;
- }
- }
- }
- if(existsInterface) {
- defaultName = type + new Integer(max + 1).toString();
- } else {
- defaultName = type + new Integer(max).toString();
- }
- max++;
- } while(!isCorrectName(defaultName));
- return defaultName;
- }
-
- /**
- * Tests if the proposed name is not forbidden
- *
- * @param name
- * a name
- * @return
- * <code>true</code> if the proposed name is not forbidden
- */
- protected boolean isCorrectName(String name) {
- if(forbiddenNames == null) {
- return true;
- }
- return !forbiddenNames.contains(name);
- }
-
- /**
- * Returns the command to create the new element which the chosen name.
- *
- * @return the command
- * the command to create the new element which the chosen name
- */
- public Command getCommand() {
-
- CompositeCommand cmd = new CompositeCommand("Create new element command"); //$NON-NLS-1$
- //request to create the new Interface
- if(elementToCreate.getCreateElementRequest() != null) {
- ICommand command = getCommand(elementToCreate.getCreateElementRequest());
- if(command.canExecute()) {
- cmd.add(command);
- SetNameCommand nameCommand = new SetNameCommand(domain, "Set Name Command", null, request, elementToCreate); //$NON-NLS-1$
- if(nameCommand.canExecute()) {
- cmd.add(nameCommand);
- }
- }
- return new ICommandProxy(cmd);
- } else {
- return new ICommandProxy(new CustomCreateElementCommand(domain, "CustomCreateElementCommand", null, elementToCreate)); //$NON-NLS-1$
- }
- }
-
- /**
- * Compute result.
- *
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- java.util.List<Object> result = new ArrayList<Object>();
- result.add(elementToCreate);
- setResult(result);
- }
-
- /**
- * Set the value to {@link #name} and {@link #parentContainer}.
- *
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
- */
- @Override
- protected void okPressed() {
- ISelection selection = getTreeViewer().getSelection();
- parentContainer = ((IStructuredSelection)selection).getFirstElement();
- CreateElementRequest request = null;
- if(parentContainer instanceof EObject) {
- request = new CreateElementRequest(domain, (EObject)parentContainer, this.hintedType);
- }
- elementToCreate = new NewElementRepresentation(this.text.getText(), parentContainer, hintedType, request);
- super.okPressed();
- }
-
- /**
- * Returns a command corresponding to this request.
- *
- * @param request
- * a request
- * @return the command
- * The command corresponding to this request or an {@link UnexecutableCommand} when the command can not be build
- */
- private ICommand getCommand(IEditCommandRequest request) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(UMLPackage.eINSTANCE.getNamedElement());
- {
- if(provider != null) {
- ICommand cmd = provider.getEditCommand(request);
- if(cmd != null && cmd.canExecute()) {
- return cmd;
- }
- }
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This command is used to set the chosen name to the new element.
- */
- public class SetNameCommand extends AbstractTransactionalCommand {
-
- /** the representation that will own the new element when it will be created. */
- private NewElementRepresentation representation;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param previousRequest
- * the previous request
- * @param representation
- * the representation
- */
- public SetNameCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, CreateElementRequest previousRequest, NewElementRepresentation representation) {
- super(domain, label, affectedFiles);
- this.representation = representation;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(representation.getEObject() instanceof NamedElement) {
- NamedElement el = (NamedElement)representation.getEObject();
- el.setName(representation.getName());
- }
-
- return CommandResult.newOKCommandResult(representation);
- }
-
- }
-
- /**
- * This command allows to create a new element when its parent is not yet created when the command is build
- *
- * We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
- * executed.
- */
- public class CustomCreateElementCommand extends AbstractTransactionalCommand {
-
- /** the representation of the element to create. */
- private NewElementRepresentation elementToCreate;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param elementToCreate
- * the element to create
- */
- public CustomCreateElementCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, NewElementRepresentation elementToCreate) {
- super(domain, label, affectedFiles);
- this.elementToCreate = elementToCreate;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- EObject container = elementToCreate.getEObjectParent();
- CreateElementRequest request = new CreateElementRequest(domain, container, hintedType);
- ICommand command = getCommand(request);
- command.execute(new NullProgressMonitor(), null);
- EObject newEl = request.getNewElement();
-
- if(newEl instanceof NamedElement) {
- ((NamedElement)newEl).setName(elementToCreate.getName());
- }
-
- elementToCreate.setCreateElement(request.getNewElement());
- return CommandResult.newOKCommandResult(elementToCreate);
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/InterfaceManagerDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/InterfaceManagerDialog.java
deleted file mode 100644
index ce699e9..0000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/InterfaceManagerDialog.java
+++ /dev/null
@@ -1,1040 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.blockdefinition.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
-import org.eclipse.papyrus.infra.widgets.editors.SelectionEditor;
-import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
-import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
-import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
-import org.eclipse.papyrus.sysml.diagram.blockdefinition.messages.Messages;
-import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Realization;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-
-/**
- * <pre>
- * This class provides a Dialog to manage easily the provided and
- * the required Interfaces for a {@link Port}.
- * </pre>
- */
-public class InterfaceManagerDialog extends SelectionDialog {
-
- /** the selected port */
- private Port port;
-
- /** the list of the provided interfaces */
- private List<Object> providedInterfaces;
-
- /** the list of the required interfaces */
- private List<Object> requiredInterfaces;
-
- /** the {@link ReferenceSelector} for the provided interfaces */
- private ReferenceSelector providedSelector;
-
- /** the {@link ReferenceSelector} for the required interfaces */
- private ReferenceSelector requiredSelector;
-
- /** the Editor for the provided interfaces */
- private SelectionEditor providedEditor;
-
- /** the Editor for the required interfaces */
- private SelectionEditor requiredEditor;
-
- /**
- * In this map, we link the {@link Interface} with their {@link Usage} This map is used when we want remove an Interface from a Usage
- */
- private Map<Interface, List<Usage>> requiredInterfacesMappedWithUsage = new HashMap<Interface, List<Usage>>();
-
- /**
- * In this map, we link the {@link Interface} with their {@link Realization} This map is used when we want remove an Interface from a Realization
- */
- private Map<Interface, List<Realization>> providedInterfacesMappedWithRealization = new HashMap<Interface, List<Realization>>();
-
- /** the label provider for selector */
- private final ILabelProvider selectorLabelProvider = new SelectorLabelProvider();
-
- /** the label provider for the create new element dialog */
- private final ILabelProvider newElementLabelProvider = new CreateElementLabelProvider();
-
- /** the domain used for the commands */
- private TransactionalEditingDomain domain;
-
- /** the model */
- private Package model = null;
-
- /** this command contains the list of the command to create the new Interfaces */
- private CompoundCommand interfaceCreationCommand = new CompoundCommand("Create Interfaces Commands"); //$NON-NLS-1$
-
- /** This list contains representation of the Interface before their creation */
- private List<NewElementRepresentation> interfaceRepresentations;
-
- /** boolean used to know if the {@link Port} is typed with an {@link Interface} */
- private boolean typedWithInterface;
-
- /** path for the warning icons */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
-
- /**
- * This list contains the names used for the new elements.
- * We need to remember these names are used in order don't suggest them when we create other new elements
- */
- private List<String> forbiddenNames;
-
- /**
- *
- * Constructor.
- *
- * @param parentShell
- * the parent {@link Shell}
- * @param port
- * the {@link Port} for which we want manage the Interfaces
- */
- public InterfaceManagerDialog(Shell parentShell, Port port) {
- super(parentShell);
- this.setTitle(Messages.InterfaceManagerDialog_Title);
- this.port = port;
- Assert.isTrue(this.port.getType() instanceof Classifier);
- this.typedWithInterface = (this.port.getType() instanceof Interface);
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#create()
- *
- */
- @Override
- public void create() {
- super.create();
- init();
- }
-
- /**
- * This method initialize some fields of the class
- */
- protected void init() {
-
- this.forbiddenNames = new ArrayList<String>();
- this.interfaceRepresentations = new ArrayList<NewElementRepresentation>();
- EList<Namespace> namespaces = port.allNamespaces();
- Element el = namespaces.get(namespaces.size() - 1);
- if(el instanceof Package) {
- model = (Package)el;
- } else {
- model = el.getNearestPackage();
- }
-
- //fill the hashmap to link Interfaces with Usage and InterfaceRealization
- buildProvidedInterfaces();
- buildRequiredInterfaces();
-
- //we build the list of the provided interfaces
- this.providedInterfaces = new ArrayList<Object>();
- for(Interface current : this.port.getProvideds()) {
- this.providedInterfaces.add(current);
- }
- //when the port is typed by an Interface, we don't propose this interface in the possible Provided Interfaces list.
- if(typedWithInterface) {
- this.providedInterfaces.remove(this.port.getType());
- }
-
- //we build the list of the required interfaces
- this.requiredInterfaces = new ArrayList<Object>();
- for(Interface current : this.port.getRequireds()) {
- this.requiredInterfaces.add(current);
- }
-
- //initialize the transactional editing domain
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = activePage.getActiveEditor();
- if(editor instanceof IMultiDiagramEditor) {
- try {
- this.domain = ServiceUtils.getInstance().getTransactionalEditingDomain(((IMultiDiagramEditor)editor).getServicesRegistry());
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
-
- //selectors creation
- createSelectors();
- //editors creation
- createEditors();
-
- }
-
-
- /**
- * This method fills the map {@link #requiredInterfacesMappedWithUsage}
- */
- protected void buildRequiredInterfaces() {
- List<?> allUsage = Util.getInstancesFilteredByType(this.model, Usage.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier)this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
-
-
- for(Object current : allUsage) {
- Usage usage = (Usage)current;
- for(Classifier classifier : classifiers) {//we test if the current Usage is linked with the type of the Port
- if(usage.getClients().contains(classifier)) {//this Usage concerns the current port
- for(EObject target : usage.getSuppliers()) {
- if(this.port.getRequireds().contains(target)) {
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(target);
- if(usages != null) {
- usages.add(usage);
- } else {
- usages = new ArrayList<Usage>();
- usages.add(usage);
- this.requiredInterfacesMappedWithUsage.put((Interface)target, usages);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method fills the map {@link #providedInterfacesMappedWithRealization}
- */
- protected void buildProvidedInterfaces() {
- List<?> allRealization = Util.getInstancesFilteredByType(this.model, Realization.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier)this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
-
-
- for(Object current : allRealization) {
- Realization realization = (Realization)current;
- for(Classifier classifier : classifiers) {//we test if the current Realization is linked with the type of the Port
- if(realization.getClients().contains(classifier)) {//this Realization concerns the current port
- for(EObject target : realization.getSuppliers()) {
- if(this.port.getProvideds().contains(target)) {
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(target);
- if(realizations != null) {
- realizations.add(realization);
- } else {
- realizations = new ArrayList<Realization>();
- realizations.add(realization);
- this.providedInterfacesMappedWithRealization.put((Interface)target, realizations);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method creates the selectors {@link #providedSelector} and {@link #requiredSelector}
- */
- protected void createSelectors() {
- //the provided selector
- this.providedSelector = new ReferenceSelector(true);
- this.providedSelector.setLabelProvider(selectorLabelProvider);
- this.providedSelector.setContentProvider(new IStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- public void dispose() {
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
- if(typedWithInterface) {
- tmp.remove(port.getType());
- }
- //we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
-
- public Object[] getElements(Object inputElement) {
- return getElements();
- }
- });
- //the required selector
- this.requiredSelector = new ReferenceSelector(true);
- this.requiredSelector.setLabelProvider(selectorLabelProvider);
- this.requiredSelector.setContentProvider(new AbstractStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
-
- //we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- }
-
-
- /**
- * This method create the 2 Editors {@link #providedEditor} and {@link #requiredEditor} and provides the listener for the button of these editors
- */
- protected void createEditors() {
- Composite parent = (Composite)getDialogArea();
- CreateButtonListener listener = new CreateButtonListener();
- //we set a specific message if the port is typed with an Interface
- if(typedWithInterface) {
- Composite messageSection = new Composite(parent, SWT.BORDER);
- CLabel label = new CLabel(messageSection, SWT.NONE);
-
- label.setText(Messages.InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage);
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- label.setImage(errorImage);
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- messageSection.setLayout(layout);
- messageSection.setLayoutData(data);
- messageSection.setEnabled(false);
- }
- this.providedEditor = createEditor(parent, providedSelector, Messages.InterfaceManagerDialog_SelectedTheProvidedInterfaces, false, listener, this.providedInterfaces);
- this.requiredEditor = createEditor(parent, requiredSelector, Messages.InterfaceManagerDialog_SelectTheRequiredInterfaces, true, listener, this.requiredInterfaces);
-
- this.providedEditor.create();
- this.requiredEditor.create();
-
- GridLayout layout = (GridLayout)parent.getLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- this.providedEditor.setLayoutData(data);
- this.requiredEditor.setLayoutData(data);
- getShell().setSize(950, 700);
- getShell().layout();
- }
-
- /**
- * Creates a {@link SelectionEditor} and returns it
- *
- * @param parent
- * the composite parent
- * @param selector
- * the selector used by the created editor
- * @param message
- * the message to display in the created editor
- * @param withCreateButton
- * indicates if the editor provides an additional button for a specific action
- * @param listener
- * the listener for the button
- * @param initialSelection
- * the initial selection for this editor
- * @return
- * the created {@link SelectionEditor}
- */
- protected SelectionEditor createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
- SelectionEditor editor = new SelectionEditor(parent, selector, selectorLabelProvider, initialSelection);
- editor.setMessage(message);
- editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
- return editor;
- }
-
- /**
- * Returns all the available Interfaces (except {@link FlowSpecification})
- *
- * @return
- * all the available Interfaces
- * //TODO add the interfaces from the package import!
- */
- @SuppressWarnings("unchecked")
- protected List<Interface> getAllAvailableInterfaces(Package pack) {
- List<Interface> otherInterfaces = new ArrayList<Interface>();
- List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
- for(Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
- interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
-
- }
-
- for(Element element : interfaces) {
- // Test if the interface is a FlowSpecification
- FlowSpecification flowSpec = UMLUtil.getStereotypeApplication(element, FlowSpecification.class);
- if(flowSpec == null) {
- otherInterfaces.add((Interface)element);
- }
- }
-
- return otherInterfaces;
- }
-
- /**
- * Returns the commands to apply the changes
- *
- * @return
- * the commands to apply the changes
- */
- public Command getCommand() {
- CompoundCommand command = new CompoundCommand("Command to manage interfaces on Port"); //$NON-NLS-1$
- if(!interfaceCreationCommand.isEmpty()) {
- command.add(interfaceCreationCommand);
- }
- Command cmd = getCommandsToCreateElements();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- cmd = getCommandToRemoveReferencedInterfaces();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- return command;
- }
-
- /**
- * Returns the command to remove referenced Interfaces in Usage and InterfaceRealization
- *
- * @return
- * The command to remove referenced Interfaces the Usage and InterfaceRealization.
- * Moreover, we add a command to destroy Usage and InterfaceRealization when they have any Suppliers after this action
- */
- protected Command getCommandToRemoveReferencedInterfaces() {
- CompoundCommand command = new CompoundCommand("Command to destroy Usage and InterfaceRealization"); //$NON-NLS-1$
-
- Set<Dependency> relationshipToDestroy = new HashSet<Dependency>();
- //commands to destroy Usage
- for(Object current : this.requiredEditor.getElementToRemove()) {
- //we get all usage associated with this interface
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(current);
- for(Usage currentUsage : usages) {
- //we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentUsage, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentUsage);
- }
- }
- }
-
- //commands to destroy InterfaceRealization
- for(Object current : this.providedEditor.getElementToRemove()) {
- //we get all usage associated with this interface
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(current);
- for(Realization currentRealization : realizations) {
- //we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentRealization, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentRealization);
- }
- }
- }
- if(!relationshipToDestroy.isEmpty()) {
- command.add(new ICommandProxy(new DestroyDependencyWithoutSupplierCommand(this.domain, null, relationshipToDestroy)));
- return command;
- }
-
- //nothing to do
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Returns the command to create new Usage and new InterfaceRealization
- *
- * @return
- * the command to create new Usage and new InterfaceRealization
- */
- protected Command getCommandsToCreateElements() {
- CompoundCommand command = new CompoundCommand("Command to create Usage and InterfaceRealization"); //$NON-NLS-1$
- //commands for Usage Creation
- for(Object current : this.requiredEditor.getElementToAdd()) {
- if(current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject)current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- } else {//its an NewElementRepresentation
-
- CreateUsageCommand cmd = new CreateUsageCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation)current, null);
- if(cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
-
- //commands for InterfaceRealization Creation
- for(Object current : providedEditor.getElementToAdd()) {
- if(current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject)current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- } else {//its an NewElementRepresentation
- CreateInterfaceRealizationCommand cmd = new CreateInterfaceRealizationCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation)current, null);
- if(cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
- if(!command.isEmpty()) {
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-
- /**
- * Return the command corresponding to the request
- *
- * @param req
- * a request
- * @return
- * the command corresponding to the request
- */
- protected Command getCommand(AbstractEditCommandRequest req) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(model);
- if(provider != null) {
- ICommand setCommand = provider.getEditCommand(req);
- if(setCommand != null) {
- return new ICommandProxy(setCommand.reduce());
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This listener is used to know when the user clicks on the Button to create a new {@link Interface}
- *
- *
- *
- */
- public class CreateButtonListener implements SelectionListener {
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetSelected(SelectionEvent e) {
- CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, UMLElementTypes.INTERFACE);
- dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
- dialog.setMessage(Messages.InterfaceManagerDialog_SelectTheParentOfThisNewInterface);
- dialog.setHelpAvailable(false);
- dialog.setForbiddenNames(forbiddenNames);
- List<Object> input = new ArrayList<Object>();
- input.add(model);
- dialog.setInput(input);
- dialog.setValidator(new ParentInterfaceValidator());
- if(dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
- interfaceCreationCommand.add(dialog.getCommand());
- Object[] res = dialog.getResult();
- for(Object current : res) {
- if(current instanceof NewElementRepresentation) {
- interfaceRepresentations.add((NewElementRepresentation)current);
- forbiddenNames.add(((NewElementRepresentation)current).getName());
- }
- }
- providedSelector.refresh();
- requiredSelector.refresh();
- }
- }
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
- }
-
-
- /**
- *
- * This class provides a validator for the selection of the parent of the new Interface
- *
- *
- */
- public class ParentInterfaceValidator implements ISelectionStatusValidator {
-
- /**
- * Selection has to be a Classifier or an Interface to allow creation
- *
- * @see org.eclipse.ui.dialogs.ISelectionStatusValidator#validate(java.lang.Object[])
- *
- * @param selection
- * @return
- */
- public IStatus validate(Object[] selection) {
-
- IStatus status = new Status(IStatus.ERROR, org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator.PLUGIN_ID, Messages.NoSelectionFound);
- if(selection.length >= 1) {
- for(int i = 0; i < selection.length; i++) {
- if(selection[i] instanceof Package || selection[i] instanceof Classifier || selection[i] instanceof NewElementRepresentation)
- status = new Status(IStatus.OK, org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator.PLUGIN_ID, Messages.SelectionValidated);
- else {
- status = new Status(IStatus.ERROR, org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator.PLUGIN_ID, Messages.InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier);
- break;
- }
- }
- }
- return status;
- }
- }
-
- /**
- *
- * This class provides a CustomLabelProvider for this dialog.
- * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
- *
- *
- */
- public class SelectorLabelProvider extends CreateElementLabelProvider {
-
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if(element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)element).getQualifiedName();
- } else if(element instanceof NamedElement) {
- return ((NamedElement)element).getQualifiedName();
- }
- return super.getText(element);
- }
-
- }
-
- public class CreateElementLabelProvider extends UMLLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Image getImage(Object element) {
- if(element instanceof NewElementRepresentation) {
- return org.eclipse.papyrus.uml.tools.Activator.getDefault().getImageForUMLMetaclass(UMLPackage.eINSTANCE.getInterface());
- }
- return super.getImage(element);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if(element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)element).getName();
- }
- return super.getText(element);
- }
-
- }
-
- /**
- *
- * This content provider is used in this dialog. It returns the available element in the model + the future element which are
- * {@link NewElementRepresentation}
- *
- *
- */
- public class CustomContentProvider implements ITreeContentProvider {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- public void dispose() {
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- *
- * @param inputElement
- * @return
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List<?>) {
- return ((List<?>)inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- *
- * @param parentElement
- * @return
- */
- public Object[] getChildren(Object parentElement) {
- List<Object> children = new ArrayList<Object>();
- List<?> tmp = null;
- if(parentElement instanceof Package) {
- tmp = ((Package)parentElement).getOwnedMembers();
- } else if(parentElement instanceof Classifier) {
- tmp = ((Classifier)parentElement).getOwnedMembers();
- }
- if(tmp != null) {
- for(Object current : tmp) {
- if(current instanceof Classifier || current instanceof Package) {
- children.add(current);
- }
- }
- }
- //we add the future Interfaces to this selection
- for(NewElementRepresentation current : interfaceRepresentations) {
- if(current.getParent() == parentElement) {
- children.add(current);
- }
- }
- return children.toArray();
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- *
- * @param element
- * @return
- */
- public Object getParent(Object element) {
- if(element == model) {
- return model;
- } else if(element instanceof NamedElement) {
- return ((NamedElement)element).eContainer();
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- *
- * @param element
- * @return
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length != 0;
- }
-
- }
-
- /**
- *
- * This command is used to create a New Usage, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateUsageCommand extends AbstractTransactionalCommand {
-
- /** The container for the new Usage */
- private EObject container;
-
- /** the source of this Usage */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the Usage
- * @param source
- * the source for the Usage
- * @param target
- * the target for the Usage
- * @param affectedFiles
- * the affected files
- */
- public CreateUsageCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create Usage Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), UMLElementTypes.USAGE);
- Command command = getCommand(request);
- if(command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to create a New InterfaceRealition, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateInterfaceRealizationCommand extends AbstractTransactionalCommand {
-
- /** The container for the new InterfaceRealization */
- private EObject container;
-
- /** The source for the new InterfaceRealization */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the InterfaceRealization
- * @param source
- * the source for the InterfaceRealization
- * @param target
- * the target for the InterfaceRealization
- * @param affectedFiles
- * the affected files
- */
- public CreateInterfaceRealizationCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create InterfaceRealization Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), UMLElementTypes.INTERFACE_REALIZATION);
- Command command = getCommand(request);
- if(command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to destroy Dependencies which have any supplier before the deletion of the Interface
- *
- *
- */
- public class DestroyDependencyWithoutSupplierCommand extends AbstractTransactionalCommand {
-
- /**
- * the dependencies to test
- */
- private Set<Dependency> dependencies;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param affectedFiles
- * the affected files
- * @param dependencies
- * the dependencies to test
- */
- public DestroyDependencyWithoutSupplierCommand(TransactionalEditingDomain domain, List<?> affectedFiles, Set<Dependency> dependencies) {
- super(domain, "Destroy the empty elements", affectedFiles); //$NON-NLS-1$
- this.dependencies = dependencies;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CompoundCommand command = new CompoundCommand("Destroy relationship without suppliers"); //$NON-NLS-1$
- for(Dependency current : dependencies) {
- if(current.getSuppliers().isEmpty()) {
- DestroyElementRequest request = new DestroyElementRequest(domain, current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- }
- }
-
- if(!command.isEmpty() && command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult();
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/NewElementRepresentation.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/NewElementRepresentation.java
deleted file mode 100644
index 219df03..0000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/ui/NewElementRepresentation.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.blockdefinition.ui;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * This class provides facilities to represent a New Element before its real creation.
- * We can store in this class :
- * <ul>
- * <li>the name of the new element</li>
- * <li>the parent of the new element</li>
- * <li>the {@link IHintedType} of the new element</li>
- * <li>the request to build the new element (optional)</li>
- * <li>the element itself when it has been created</li>
- * </ul>
- *
- *
- *
- */
-public class NewElementRepresentation {
-
- /** the name of the new element */
- private String name;
-
- /** the parent of the new element */
- private Object parent;
-
- /** the created element itself */
- private EObject createdElement;
-
- /** the {@link IHintedType} of the new element */
- private IHintedType hintedType;
-
- /** this field is used only when the element have an existing parent */
- private CreateElementRequest request;
-
- /**
- *
- * Constructor.
- *
- * @param name
- * the name of the new element
- * @param parent
- * the parent of the new element
- * @param hintedType
- * the hinted type of the new element
- * @param request
- * the request to build the new element (can be <code>null</code>)
- */
- public NewElementRepresentation(String name, Object parent, IHintedType hintedType, CreateElementRequest request) {
- this.name = name;
- this.parent = parent;
- this.createdElement = null;
- this.hintedType = hintedType;
- this.request = request;
- }
-
- /**
- * Getter for {@link #hintedType}
- *
- * @return
- * {@link #hintedType}
- */
- public IHintedType getHintedType() {
- return this.hintedType;
- }
-
- /**
- * Getter for {@link #name}
- *
- * @return
- * {@link #name}
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Getter for {@link #parent}
- *
- * @return
- * {@link #parent}
- */
- public Object getParent() {
- return this.parent;
- }
-
- /**
- * Returns the parent of this element
- *
- * @return
- * the parent of this element or <code>null</code> if the parent is a {@link NewElementRepresentation} itself and if it has not been
- * created
- */
- public EObject getEObjectParent() {
- if(parent instanceof EObject) {
- return (EObject)this.parent;
- } else if(parent instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)parent).getEObject();
- }
- return null;
- }
-
- /**
- * Returns the created object
- *
- * @return
- * the created Object or <code>null</code> if the object has not been created
- */
- public EObject getEObject() {
- if(this.request != null) {
- return this.request.getNewElement();
- }
- return this.createdElement;
- }
-
- /**
- * Setter for {@link #createdElement}
- *
- * @param newElement
- *
- */
- public void setCreateElement(EObject newElement) {
- this.createdElement = newElement;
- }
-
- /**
- * Setter for {@link #request}
- *
- * @return
- * {@link #request}
- */
- public CreateElementRequest getCreateElementRequest() {
- return this.request;
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- @Override
- public String toString() {
- return "Name : " + this.name + ", parent : " + this.parent;
- }
-
- public String getQualifiedName() {
- String qualifiedName = "";
- if(parent instanceof NewElementRepresentation) {
- qualifiedName = ((NewElementRepresentation)parent).getQualifiedName();
- } else if(parent instanceof NamedElement) {
- qualifiedName = ((NamedElement)parent).getQualifiedName() + "::" + this.name;
- }
- return qualifiedName;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF
index b4e48de..a593df7 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF
@@ -1,18 +1,18 @@
Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.sysml.diagram.internalblock,
- org.eclipse.papyrus.sysml.diagram.internalblock.compatibility,
- org.eclipse.papyrus.sysml.diagram.internalblock.dnd.helper,
- org.eclipse.papyrus.sysml.diagram.internalblock.edit.part,
- org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy,
- org.eclipse.papyrus.sysml.diagram.internalblock.factory,
- org.eclipse.papyrus.sysml.diagram.internalblock.handler,
- org.eclipse.papyrus.sysml.diagram.internalblock.helper.advice,
- org.eclipse.papyrus.sysml.diagram.internalblock.messages,
- org.eclipse.papyrus.sysml.diagram.internalblock.part,
- org.eclipse.papyrus.sysml.diagram.internalblock.preferences,
- org.eclipse.papyrus.sysml.diagram.internalblock.provider,
- org.eclipse.papyrus.sysml.diagram.internalblock.ui,
- org.eclipse.papyrus.sysml.diagram.internalblock.utils
+Export-Package: org.eclipse.papyrus.sysml.diagram.internalblock,
+ org.eclipse.papyrus.sysml.diagram.internalblock.compatibility,
+ org.eclipse.papyrus.sysml.diagram.internalblock.dnd.helper,
+ org.eclipse.papyrus.sysml.diagram.internalblock.edit.part,
+ org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy,
+ org.eclipse.papyrus.sysml.diagram.internalblock.factory,
+ org.eclipse.papyrus.sysml.diagram.internalblock.handler,
+ org.eclipse.papyrus.sysml.diagram.internalblock.helper.advice,
+ org.eclipse.papyrus.sysml.diagram.internalblock.messages,
+ org.eclipse.papyrus.sysml.diagram.internalblock.part,
+ org.eclipse.papyrus.sysml.diagram.internalblock.preferences,
+ org.eclipse.papyrus.sysml.diagram.internalblock.provider,
+ org.eclipse.papyrus.sysml.diagram.internalblock.ui,
+ org.eclipse.papyrus.sysml.diagram.internalblock.utils
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.papyrus.sysml;bundle-version="1.0.0",
@@ -44,19 +44,17 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
org.eclipse.gmf.tooling.runtime;bundle-version="3.1.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
- org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.0",
- org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0",
org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Name: %pluginName
-Bundle-Activator: org.eclipse.papyrus.sysml.diagram.internalblock.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.internalblock;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.0.qualifier
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.sysml.diagram.internalblock.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.internalblock;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/messages.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/messages.properties
index d3a328f..66027e5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/messages.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/messages.properties
@@ -1,24 +1,5 @@
-CreateUmlElementDialog_New_Element_Name=New Element Name
-InterfaceManagerDialog_CreateANewInterface=Create a new Interface
-InterfaceManagerDialog_CreateNewInterface=Create new Interface
-InterfaceManagerDialog_SelectedTheProvidedInterfaces=Select the provided Interfaces
-InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier=Selection has to be a Package or a Classifier
-InterfaceManagerDialog_SelectTheParentOfThisNewInterface=Select the parent of this new Interface
-InterfaceManagerDialog_SelectTheRequiredInterfaces=Select the required Interfaces
-InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage=\nThe managed port is typed with an Interface, so this interface is not available as a provided Interface.\n
-InterfaceManagerDialog_Title=Select the provided and the required Interfaces
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port (should be a Block) is not defined. You need to define it before managing its Interfaces.
-SelectionValidated=Selection validated.
-NoSelectionFound=No selection found.
-
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port (should be a Block) is not defined. You need to define it before managing its Interfaces.
-SelectionValidated=Selection validated.
-NoSelectionFound=No selection found.
-
-Notification_Drop_Title=Drop in diagram
-Notification_Drop_UMLAssociationWarning=The Association ({0}) can not be dropped in this diagram because it is not a SysML Association.\nIt was probably not created in a SysML Diagram.
-
-ShowHideRelatedContentsAction_Message=Choose the elements to show
+Notification_Drop_Title=Drop in diagram
+Notification_Drop_UMLAssociationWarning=The Association ({0}) can not be dropped in this diagram because it is not a SysML Association.\nIt was probably not created in a SysML Diagram.
+
+ShowHideRelatedContentsAction_Message=Choose the elements to show
ShowHideRelatedContentsAction_Title=Show/Hide Related Contents \ No newline at end of file
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.xml
index 773dfa5..7767ab3 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.xml
@@ -355,7 +355,7 @@
-->
<extension point="org.eclipse.ui.handlers">
- <handler commandId="org.eclipse.papyrus.sysml.diagram.internalblock.command.manage.interfaces" class="org.eclipse.papyrus.sysml.diagram.internalblock.handler.ManageProvidedInterfacesHandler">
+ <handler commandId="org.eclipse.papyrus.sysml.diagram.internalblock.command.manage.interfaces" class="org.eclipse.papyrus.sysml.diagram.internalblock.handler.InternalBlockManageInterfacesHandler">
<activeWhen>
<and>
<with variable="selection">
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/InternalBlockManageInterfacesHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/InternalBlockManageInterfacesHandler.java
new file mode 100644
index 0000000..8a4c4d2
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/InternalBlockManageInterfacesHandler.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.sysml.diagram.internalblock.handler;
+
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.papyrus.sysml.diagram.internalblock.ui.InternalBlockInterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.common.actions.handlers.ManagePortInterfacesHandler;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.IPortInterfaceManagerDialog;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.InterfaceRealization;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Usage;
+
+/**
+ * <pre>
+ * This handler provides the handler to manage the provided and required {@link Interface}
+ * of a {@link Port} without graphically creating {@link InterfaceRealization} and
+ * {@link Usage} relationships.
+ * </pre>
+ */
+public class InternalBlockManageInterfacesHandler extends ManagePortInterfacesHandler {
+
+
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.actions.handlers.ManagePortInterfacesHandler#getInterfaceManagerDialog(org.eclipse.uml2.uml.Port)
+ *
+ * @param port
+ * @return
+ */
+ @Override
+ public IPortInterfaceManagerDialog getInterfaceManagerDialog(Port port) {
+ return new InternalBlockInterfaceManagerDialog(DisplayUtils.getDefaultShell(), port);
+
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/ManageProvidedInterfacesHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/ManageProvidedInterfacesHandler.java
deleted file mode 100644
index 7214786..0000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/handler/ManageProvidedInterfacesHandler.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-import org.eclipse.papyrus.sysml.diagram.internalblock.messages.Messages;
-import org.eclipse.papyrus.sysml.diagram.internalblock.ui.InterfaceManagerDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.InterfaceRealization;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- * <pre>
- * This handler provides the handler to manage the provided and required {@link Interface}
- * of a {@link Port} without graphically creating {@link InterfaceRealization} and
- * {@link Usage} relationships.
- * </pre>
- */
-public class ManageProvidedInterfacesHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection.isEmpty()) {
- return null;
- }
-
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- EObject selectedElement = EMFHelper.getEObject(structuredSelection.getFirstElement());
- if(selectedElement instanceof Port) {
- Port port = (Port)selectedElement;
- ManageProvidedInterfaceAction action = new ManageProvidedInterfaceAction(port);
- try {
- ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(port).getCommandStack().execute(new GEFtoEMFCommandWrapper(action.getCommand()));
- } catch (ServiceException ex) {
- throw new ExecutionException("An unexpected exception occurred", ex);
- }
- }
- }
-
- return null;
- }
-
- /**
- * This class provides the action to manage the provided and required interfaces
- */
- public class ManageProvidedInterfaceAction {
-
- /** the {@link Port} */
- private Port port;
-
- /** the {@link Type} of the port */
- private Type type;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart of the port
- */
- public ManageProvidedInterfaceAction(Port port) {
- this.port = port;
- this.type = port.getType();
- }
-
-
- /**
- * Returns the command to add/remove provided/required interfaces
- *
- * @return
- * the command to add/remove provided/required interfaces
- */
- public Command getCommand() {
- if(type != null && !(type instanceof Classifier)) {
- return UnexecutableCommand.INSTANCE;
- } else if(type == null) {
- MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(), Messages.InterfaceManagerDialog_Title, null, Messages.ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined, MessageDialog.WARNING, new String[]{ Messages.ManageProvidedInterfacesHandler_OK }, 0);
- dialog.open();
- } else {
- InterfaceManagerDialog dialog = new InterfaceManagerDialog(DisplayUtils.getDefaultShell(), this.port);
- if(dialog.open() == Dialog.OK) {
- return dialog.getCommand();
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/messages/Messages.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/messages/Messages.java
index d092310..4b47caf 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/messages/Messages.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/messages/Messages.java
@@ -1,60 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- public static String CreateUmlElementDialog_New_Element_Name;
-
- public static String InterfaceManagerDialog_CreateANewInterface;
-
- public static String InterfaceManagerDialog_CreateNewInterface;
-
- public static String InterfaceManagerDialog_SelectedTheProvidedInterfaces;
-
- public static String InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier;
-
- public static String InterfaceManagerDialog_SelectTheParentOfThisNewInterface;
-
- public static String InterfaceManagerDialog_SelectTheRequiredInterfaces;
-
- public static String InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage;
-
- public static String InterfaceManagerDialog_Title;
-
- public static String ManageProvidedInterfacesHandler_OK;
-
- public static String ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined;
-
- public static String SelectionValidated;
-
- public static String NoSelectionFound;
-
- public static String Notification_Drop_Title;
-
- public static String Notification_Drop_UMLAssociationWarning;
-
- public static String ShowHideRelatedContentsAction_Title;
-
- public static String ShowHideRelatedContentsAction_Message;
-
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- private Messages() {
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.internalblock.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ public static String Notification_Drop_Title;
+
+ public static String Notification_Drop_UMLAssociationWarning;
+
+ public static String ShowHideRelatedContentsAction_Title;
+
+ public static String ShowHideRelatedContentsAction_Message;
+
+ static {
+ NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InternalBlockInterfaceManagerDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InternalBlockInterfaceManagerDialog.java
new file mode 100644
index 0000000..4c83559
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InternalBlockInterfaceManagerDialog.java
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.sysml.diagram.internalblock.ui;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * <pre>
+ * This class provides a Dialog to manage easily the provided and
+ * the required Interfaces for a {@link Port}.
+ * </pre>
+ */
+public class InternalBlockInterfaceManagerDialog extends InterfaceManagerDialog {
+
+
+ /**
+ * Constructor.
+ *
+ * @param parentShell
+ * @param port
+ */
+ public InternalBlockInterfaceManagerDialog(Shell parentShell, Port port) {
+ super(parentShell, port);
+ }
+
+ /**
+ * Returns all the available Interfaces (except {@link FlowSpecification})
+ *
+ * @return
+ * all the available Interfaces
+ * //TODO add the interfaces from the package import!
+ */
+ protected List<Interface> getAllAvailableInterfaces(Package pack) {
+ Set<Interface> otherInterfaces = new HashSet<Interface>();
+ List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
+ for(Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
+ interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
+
+ }
+
+ for(Element element : interfaces) {
+ // Test if the interface is a FlowSpecification
+ FlowSpecification flowSpec = UMLUtil.getStereotypeApplication(element, FlowSpecification.class);
+ if(flowSpec == null) {
+ otherInterfaces.add((Interface)element);
+ }
+ }
+
+ return Arrays.asList(otherInterfaces.toArray(new Interface[otherInterfaces.size()]));
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/NewElementRepresentation.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/NewElementRepresentation.java
deleted file mode 100644
index 5d44337..0000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/NewElementRepresentation.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.ui;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * This class provides facilities to represent a New Element before its real creation.
- * We can store in this class :
- * <ul>
- * <li>the name of the new element</li>
- * <li>the parent of the new element</li>
- * <li>the {@link IHintedType} of the new element</li>
- * <li>the request to build the new element (optional)</li>
- * <li>the element itself when it has been created</li>
- * </ul>
- *
- *
- *
- */
-public class NewElementRepresentation {
-
- /** the name of the new element */
- private String name;
-
- /** the parent of the new element */
- private Object parent;
-
- /** the created element itself */
- private EObject createdElement;
-
- /** the {@link IHintedType} of the new element */
- private IHintedType hintedType;
-
- /** this field is used only when the element have an existing parent */
- private CreateElementRequest request;
-
- /**
- *
- * Constructor.
- *
- * @param name
- * the name of the new element
- * @param parent
- * the parent of the new element
- * @param hintedType
- * the hinted type of the new element
- * @param request
- * the request to build the new element (can be <code>null</code>)
- */
- public NewElementRepresentation(String name, Object parent, IHintedType hintedType, CreateElementRequest request) {
- this.name = name;
- this.parent = parent;
- this.createdElement = null;
- this.hintedType = hintedType;
- this.request = request;
- }
-
- /**
- * Getter for {@link #hintedType}
- *
- * @return
- * {@link #hintedType}
- */
- public IHintedType getHintedType() {
- return this.hintedType;
- }
-
- /**
- * Getter for {@link #name}
- *
- * @return
- * {@link #name}
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Getter for {@link #parent}
- *
- * @return
- * {@link #parent}
- */
- public Object getParent() {
- return this.parent;
- }
-
- /**
- * Returns the parent of this element
- *
- * @return
- * the parent of this element or <code>null</code> if the parent is a {@link NewElementRepresentation} itself and if it has not been
- * created
- */
- public EObject getEObjectParent() {
- if(parent instanceof EObject) {
- return (EObject)this.parent;
- } else if(parent instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)parent).getEObject();
- }
- return null;
- }
-
- /**
- * Returns the created object
- *
- * @return
- * the created Object or <code>null</code> if the object has not been created
- */
- public EObject getEObject() {
- if(this.request != null) {
- return this.request.getNewElement();
- }
- return this.createdElement;
- }
-
- /**
- * Setter for {@link #createdElement}
- *
- * @param newElement
- *
- */
- public void setCreateElement(EObject newElement) {
- this.createdElement = newElement;
- }
-
- /**
- * Setter for {@link #request}
- *
- * @return
- * {@link #request}
- */
- public CreateElementRequest getCreateElementRequest() {
- return this.request;
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- @Override
- public String toString() {
- return "Name : " + this.name + ", parent : " + this.parent;
- }
-
- public String getQualifiedName() {
- String qualifiedName = "";
- if(parent instanceof NewElementRepresentation) {
- qualifiedName = ((NewElementRepresentation)parent).getQualifiedName();
- } else if(parent instanceof NamedElement) {
- qualifiedName = ((NamedElement)parent).getQualifiedName() + "::" + this.name;
- }
- return qualifiedName;
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
index 82f0144..fb293e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
@@ -99,7 +99,8 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.paletteconfiguration;bundle-version="1.0.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.modelrepair;bundle-version="1.0.0"
+ org.eclipse.papyrus.uml.modelrepair;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Ant-Version: Apache Ant 1.7.0
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/messages.properties
index 39a8a5f..cf04fa5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/messages.properties
@@ -171,3 +171,20 @@ PartActivationListener_RemovedTitle=Resource removal
########### Execution exception messages ##########
CommonDeferredCreateConnectionViewCommand_NullConnectionCommand=Connection creation command is null.
+
+
+CreateUmlElementDialog_New_Element_Name=New Element Name
+
+ManageProvidedInterfacesHandler_OK=OK
+ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port is not defined. You need to define it before managing its Interfaces.
+
+InterfaceManagerDialog_CreateANewInterface=Create a new Interface
+InterfaceManagerDialog_CreateNewInterface=Create new Interface
+InterfaceManagerDialog_SelectedTheProvidedInterfaces=Select the provided Interfaces
+InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier=Selection has to be a Package or a Classifier
+InterfaceManagerDialog_SelectTheParentOfThisNewInterface=Select the parent of this new Interface
+InterfaceManagerDialog_SelectTheRequiredInterfaces=Select the required Interfaces
+InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage=\nThe managed port is typed with an Interface, so this interface is not available as a provided Interface.\n
+InterfaceManagerDialog_Title=Select the provided and the required Interfaces
+SelectionValidated=Selection validated.
+NoSelectionFound=No selection found. \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Messages.java
index 3df0996..b31c97e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Messages.java
@@ -8,7 +8,7 @@
*
* Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
* Emilien Perico (Atos Origin) - add tags for links with keywords
- *
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
******************************************************************************/
package org.eclipse.papyrus.uml.diagram.common;
@@ -18,6 +18,8 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
+ public static String CreateUmlElementDialog_New_Element_Name;
+
public static String ElementImportParser_undefined_value;
public static String IconStylePreferencePage_cheerful_style;
@@ -26,8 +28,32 @@ public class Messages extends NLS {
public static String IconStylePreferencePage_icon_style_group;
+ public static String InterfaceManagerDialog_CreateANewInterface;
+
+ public static String InterfaceManagerDialog_CreateNewInterface;
+
+ public static String InterfaceManagerDialog_SelectedTheProvidedInterfaces;
+
+ public static String InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier;
+
+ public static String InterfaceManagerDialog_SelectTheParentOfThisNewInterface;
+
+ public static String InterfaceManagerDialog_SelectTheRequiredInterfaces;
+
+ public static String InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage;
+
+ public static String InterfaceManagerDialog_Title;
+
public static String ModelElementSelectionPageMessage;
+ public static String ManageProvidedInterfacesHandler_OK;
+
+ public static String ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined;
+
+ public static String SelectionValidated;
+
+ public static String NoSelectionFound;
+
public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/actions/ManageProvidedInterfacesHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ManagePortInterfacesHandler.java
index 5b977e4..9bb6838 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/actions/ManageProvidedInterfacesHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ManagePortInterfacesHandler.java
@@ -1,112 +1,172 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 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:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.composite.custom.actions;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-import org.eclipse.papyrus.uml.diagram.composite.custom.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.composite.custom.ui.InterfaceManagerDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This handler provides the action to manage the provided and required {@link Interface} for a {@link Port}.
- */
-public class ManageProvidedInterfacesHandler extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection.isEmpty()) {
- return null;
- }
-
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- EObject selectedElement = EMFHelper.getEObject(structuredSelection.getFirstElement());
- if(selectedElement instanceof Port) {
- Port port = (Port)selectedElement;
- ManageProvidedInterfaceAction action = new ManageProvidedInterfaceAction(port);
- try {
- ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(port).getCommandStack().execute(new GEFtoEMFCommandWrapper(action.getCommand()));
- } catch (ServiceException ex) {
- throw new ExecutionException("An unexpected exception occurred", ex);
- }
- }
- }
-
- return null;
- }
-
- /**
- * This class provides the action to manage the provided and required interfaces.
- */
- public class ManageProvidedInterfaceAction {
-
- /** the {@link Port}. */
- private Port port;
-
- /** the {@link Type} of the port. */
- private Type type;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart of the port
- */
- public ManageProvidedInterfaceAction(Port port) {
- this.port = port;
- this.type = port.getType();
- }
-
- /**
- * Returns the command to add/remove provided/required interfaces.
- *
- * @return the command
- * the command to add/remove provided/required interfaces
- */
- public Command getCommand() {
- if(type != null && !(type instanceof Classifier)) {
- return UnexecutableCommand.INSTANCE;
- } else if(type == null) {
- MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(), Messages.InterfaceManagerDialog_Title, null, Messages.ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined, MessageDialog.WARNING, new String[]{ Messages.ManageProvidedInterfacesHandler_OK }, 0);
- dialog.open();
- } else {
- InterfaceManagerDialog dialog = new InterfaceManagerDialog(DisplayUtils.getDefaultShell(), this.port);
- if(dialog.open() == Dialog.OK) {
- return dialog.getCommand();
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 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:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.IPortInterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * This handler provides the action to manage the provided and required {@link Interface} for a {@link Port}.
+ */
+public class ManagePortInterfacesHandler extends AbstractHandler {
+
+ /** The port edit part. */
+ private EditPart portEditPart = null;
+
+
+ /**
+ * Instantiates a new manage port interfaces handler.
+ */
+ public ManagePortInterfacesHandler() {
+ super();
+ }
+
+ /**
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ // Do something only if there is a selection
+ if(selection.isEmpty()) {
+ return null;
+ }
+
+ // Handle structured selection
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+
+ // Verify if selection is an EditPart
+ Object firstElement = structuredSelection.getFirstElement();
+ if(firstElement instanceof EditPart) {
+ portEditPart = (EditPart)firstElement;
+
+ // Verify if semantic element is a Port
+ EObject selectedElement = EMFHelper.getEObject(portEditPart);
+ if(selectedElement instanceof Port) {
+ Port port = (Port)selectedElement;
+
+ // Run action
+ ManageProvidedInterfaceAction action = new ManageProvidedInterfaceAction(port);
+ try {
+ ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(port).getCommandStack().execute(new GEFtoEMFCommandWrapper(action.getCommand()));
+ } catch (ServiceException ex) {
+ throw new ExecutionException("An unexpected exception occurred", ex);
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Gets the interface manager dialog.
+ * <p>
+ * Default implementation returns {@link InterfaceManagerDialog}.
+ * </p>
+ *
+ * @param port
+ * the port
+ * @return the interface manager dialog
+ */
+ public IPortInterfaceManagerDialog getInterfaceManagerDialog(Port port) {
+ return new InterfaceManagerDialog(DisplayUtils.getDefaultShell(), port);
+ }
+
+ /**
+ * Gets the port edit part.
+ *
+ * @return the port edit part
+ */
+ protected EditPart getPortEditPart() {
+ return portEditPart;
+ }
+
+ /**
+ * This class provides the action to manage the provided and required interfaces.
+ */
+ public class ManageProvidedInterfaceAction {
+
+ /** the {@link Port}. */
+ private Port port = null;
+
+ /** the {@link Type} of the port. */
+ private Type type = null;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editpart
+ * the editpart of the port
+ */
+ public ManageProvidedInterfaceAction(Port port) {
+ this.port = port;
+ this.type = port.getType();
+ }
+
+ /**
+ * Returns the command to add/remove provided/required interfaces.
+ *
+ * @return the command
+ * the command to add/remove provided/required interfaces
+ */
+ public Command getCommand() {
+ if(type != null && !(type instanceof Classifier)) {
+ return UnexecutableCommand.INSTANCE;
+ } else if(type == null) {
+ // Display message if Port type is undefined
+ MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(), Messages.InterfaceManagerDialog_Title, null, Messages.ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined, MessageDialog.WARNING, new String[]{ Messages.ManageProvidedInterfacesHandler_OK }, 0);
+ dialog.open();
+
+ } else {
+
+ // Launch manager
+ IPortInterfaceManagerDialog dialog = getInterfaceManagerDialog(port);
+ if(dialog.open() == Dialog.OK) {
+ return dialog.getCommand();
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CreateUmlElementDialog.java
index 090a098..b2b92eb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/CreateUmlElementDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CreateUmlElementDialog.java
@@ -1,433 +1,417 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.sysml.diagram.internalblock.messages.Messages;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This dialog allows to create easily a new element in a UML Model.
- */
-public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
-
- /** the hinted type of the element to create. */
- private IHintedType hintedType;
-
- /** the parent container of the element to create. */
- private Object parentContainer;
-
- /** the type of the element to create. */
- private String type;
-
- /** the root of the model. */
- private Package pack;
-
- /** the text field used to display the choose the name of the future element. */
- private Text text;
-
- /** creation request. */
- private CreateElementRequest request;
-
- /** the editing domain. */
- private TransactionalEditingDomain domain;
-
- /** The element to create is represented by this field. */
- private NewElementRepresentation elementToCreate;
-
- /** this Set contains names to exclude from the proposed name. */
- private List<String> forbiddenNames;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent
- * @param domain
- * the domain
- * @param labelProvider
- * the label provider
- * @param contentProvider
- * the content provider
- * @param pack
- * the pack
- * @param hintedType
- * the hinted type
- */
- public CreateUmlElementDialog(Shell parent, TransactionalEditingDomain domain, ILabelProvider labelProvider, ITreeContentProvider contentProvider, Package pack, IHintedType hintedType) {
- super(parent, labelProvider, contentProvider);
- Assert.isNotNull(pack);
- Assert.isNotNull(hintedType);
- this.pack = pack;
- this.hintedType = hintedType;
- this.domain = domain;
- init();
- }
-
- /**
- * Initializes the field {@link #type};.
- */
- protected void init() {
- EClass eClass = hintedType.getEClass();
- this.type = eClass.getName();
- this.parentContainer = null;
- this.forbiddenNames = null;
- }
-
- /**
- * Sets the forbidden names.
- *
- * @param forbiddenNames
- * the new forbidden names
- */
- public void setForbiddenNames(List<String> forbiddenNames) {
- this.forbiddenNames = forbiddenNames;
- }
-
- /**
- * Creates the dialog area.
- *
- * @param parent
- * the parent
- * @return the control
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
-
- GridData data = (GridData)parent.getLayoutData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 1;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- Composite composite = (Composite)super.createDialogArea(parent);
- composite.setLayout(new GridLayout());
- GridData dat = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(dat);
- createNameSection(parent);
-
- return composite;
- }
-
- /**
- * Creates the name section and put it at the top of the composite.
- *
- * @param parent
- * the composite parent
- */
- protected void createNameSection(Composite parent) {
-
- Composite nameSection = new Composite(parent, SWT.NONE);
-
- //the label
- Label label = new Label(nameSection, SWT.NONE);
- label.setText(Messages.CreateUmlElementDialog_New_Element_Name);
-
- //the text field
- text = new Text(nameSection, SWT.BORDER);
- text.setText(getDefaultName());
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(textData);
-
- //layout for the nameSection
- GridLayout layout = new GridLayout(2, false);
- GridData data = new GridData(GridData.FILL_BOTH);
- nameSection.setLayout(layout);
- nameSection.setLayoutData(data);
-
- //we set the name section in first!
- nameSection.moveAbove(null);
- }
-
- /**
- * Returns the default name for the new Element.
- *
- * @return the default name
- * the default name for the new Element
- */
- protected String getDefaultName() {
-
- boolean existsInterface = false;
- String defaultName;
- int max = 0;
- do {
-
- List<Interface> allInterface = ElementUtil.getInstancesFilteredByType(pack, Interface.class, null);
- for(Object object : allInterface) {
- String name = NamedElementUtil.getName((NamedElement)object);
- if(name != null && name.startsWith(type)) {
- name = name.substring(type.length());
- Integer val = null;
- try {
- val = Integer.parseInt(name);
- } catch (NumberFormatException e) {
- //Nothing to do
- }
- if(val != null) {
- max = Math.max(Integer.valueOf(val), max);
- existsInterface = true;
- }
- }
- }
- if(existsInterface) {
- defaultName = type + new Integer(max + 1).toString();
- } else {
- defaultName = type + new Integer(max).toString();
- }
- max++;
- } while(!isCorrectName(defaultName));
- return defaultName;
- }
-
- /**
- * Tests if the proposed name is not forbidden
- *
- * @param name
- * a name
- * @return
- * <code>true</code> if the proposed name is not forbidden
- */
- protected boolean isCorrectName(String name) {
- if(forbiddenNames == null) {
- return true;
- }
- return !forbiddenNames.contains(name);
- }
-
- /**
- * Returns the command to create the new element which the chosen name.
- *
- * @return the command
- * the command to create the new element which the chosen name
- */
- public Command getCommand() {
-
- CompositeCommand cmd = new CompositeCommand("Create new element command"); //$NON-NLS-1$
- //request to create the new Interface
- if(elementToCreate.getCreateElementRequest() != null) {
- ICommand command = getCommand(elementToCreate.getCreateElementRequest());
- if(command.canExecute()) {
- cmd.add(command);
- SetNameCommand nameCommand = new SetNameCommand(domain, "Set Name Command", null, request, elementToCreate); //$NON-NLS-1$
- if(nameCommand.canExecute()) {
- cmd.add(nameCommand);
- }
- }
- return new ICommandProxy(cmd);
- } else {
- return new ICommandProxy(new CustomCreateElementCommand(domain, "CustomCreateElementCommand", null, elementToCreate)); //$NON-NLS-1$
- }
- }
-
- /**
- * Compute result.
- *
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- java.util.List<Object> result = new ArrayList<Object>();
- result.add(elementToCreate);
- setResult(result);
- }
-
- /**
- * Set the value to {@link #name} and {@link #parentContainer}.
- *
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
- */
- @Override
- protected void okPressed() {
- ISelection selection = getTreeViewer().getSelection();
- parentContainer = ((IStructuredSelection)selection).getFirstElement();
- CreateElementRequest request = null;
- if(parentContainer instanceof EObject) {
- request = new CreateElementRequest(domain, (EObject)parentContainer, this.hintedType);
- }
- elementToCreate = new NewElementRepresentation(this.text.getText(), parentContainer, hintedType, request);
- super.okPressed();
- }
-
- /**
- * Returns a command corresponding to this request.
- *
- * @param request
- * a request
- * @return the command
- * The command corresponding to this request or an {@link UnexecutableCommand} when the command can not be build
- */
- private ICommand getCommand(IEditCommandRequest request) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(UMLPackage.eINSTANCE.getNamedElement());
- {
- if(provider != null) {
- ICommand cmd = provider.getEditCommand(request);
- if(cmd != null && cmd.canExecute()) {
- return cmd;
- }
- }
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This command is used to set the chosen name to the new element.
- */
- public class SetNameCommand extends AbstractTransactionalCommand {
-
- /** the representation that will own the new element when it will be created. */
- private NewElementRepresentation representation;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param previousRequest
- * the previous request
- * @param representation
- * the representation
- */
- public SetNameCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, CreateElementRequest previousRequest, NewElementRepresentation representation) {
- super(domain, label, affectedFiles);
- this.representation = representation;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(representation.getEObject() instanceof NamedElement) {
- NamedElement el = (NamedElement)representation.getEObject();
- el.setName(representation.getName());
- }
-
- return CommandResult.newOKCommandResult(representation);
- }
-
- }
-
- /**
- * This command allows to create a new element when its parent is not yet created when the command is build
- *
- * We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
- * executed.
- */
- public class CustomCreateElementCommand extends AbstractTransactionalCommand {
-
- /** the representation of the element to create. */
- private NewElementRepresentation elementToCreate;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param elementToCreate
- * the element to create
- */
- public CustomCreateElementCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, NewElementRepresentation elementToCreate) {
- super(domain, label, affectedFiles);
- this.elementToCreate = elementToCreate;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- EObject container = elementToCreate.getEObjectParent();
- CreateElementRequest request = new CreateElementRequest(domain, container, hintedType);
- ICommand command = getCommand(request);
- command.execute(new NullProgressMonitor(), null);
- EObject newEl = request.getNewElement();
-
- if(newEl instanceof NamedElement) {
- ((NamedElement)newEl).setName(elementToCreate.getName());
- }
-
- elementToCreate.setCreateElement(request.getNewElement());
- return CommandResult.newOKCommandResult(elementToCreate);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 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:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This dialog allows to create easily a new element in a UML Model.
+ */
+public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
+
+ /** the hinted type of the element to create. */
+ private IElementType hintedType;
+
+ /** the parent container of the element to create. */
+ private Object parentContainer;
+
+ /** the type of the element to create. */
+ private String type;
+
+ /** the root of the model. */
+ private Package pack;
+
+ /** the text field used to display the choose the name of the future element. */
+ private Text text;
+
+ /** the editing domain. */
+ private TransactionalEditingDomain domain;
+
+ /** The element to create is represented by this field. */
+ private NewElementRepresentation elementToCreate;
+
+ /** this Set contains names to exclude from the proposed name. */
+ private List<String> forbiddenNames;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent
+ * @param domain
+ * the domain
+ * @param labelProvider
+ * the label provider
+ * @param contentProvider
+ * the content provider
+ * @param pack
+ * the pack
+ * @param hintedType
+ * the hinted type
+ */
+ public CreateUmlElementDialog(Shell parent, TransactionalEditingDomain domain, ILabelProvider labelProvider, ITreeContentProvider contentProvider, Package pack, IElementType hintedType) {
+ super(parent, labelProvider, contentProvider);
+ Assert.isNotNull(pack);
+ Assert.isNotNull(hintedType);
+ this.pack = pack;
+ this.hintedType = hintedType;
+ this.domain = domain;
+ init();
+ }
+
+ /**
+ * Initializes the field {@link #type};.
+ */
+ protected void init() {
+ EClass eClass = hintedType.getEClass();
+ this.type = eClass.getName();
+ this.parentContainer = null;
+ this.forbiddenNames = null;
+ }
+
+ /**
+ * Sets the forbidden names.
+ *
+ * @param forbiddenNames
+ * the new forbidden names
+ */
+ public void setForbiddenNames(List<String> forbiddenNames) {
+ this.forbiddenNames = forbiddenNames;
+ }
+
+ /**
+ * Creates the dialog area.
+ *
+ * @param parent
+ * the parent
+ * @return the control
+ * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ GridData data = (GridData)parent.getLayoutData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalSpan = 1;
+ data.horizontalAlignment = SWT.FILL;
+ data.verticalAlignment = SWT.FILL;
+ Composite composite = (Composite)super.createDialogArea(parent);
+ composite.setLayout(new GridLayout());
+ GridData dat = new GridData(GridData.FILL_BOTH);
+ composite.setLayoutData(dat);
+ createNameSection(parent);
+ return composite;
+ }
+
+ /**
+ * Creates the name section and put it at the top of the composite.
+ *
+ * @param parent
+ * the composite parent
+ */
+ protected void createNameSection(Composite parent) {
+ Composite nameSection = new Composite(parent, SWT.NONE);
+ // the label
+ Label label = new Label(nameSection, SWT.NONE);
+ label.setText(Messages.CreateUmlElementDialog_New_Element_Name);
+ // the text field
+ text = new Text(nameSection, SWT.BORDER);
+ text.setText(getDefaultName());
+ GridData textData = new GridData(GridData.FILL_HORIZONTAL);
+ text.setLayoutData(textData);
+ // layout for the nameSection
+ GridLayout layout = new GridLayout(2, false);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ nameSection.setLayout(layout);
+ nameSection.setLayoutData(data);
+ // we set the name section in first!
+ nameSection.moveAbove(null);
+ }
+
+ /**
+ * Returns the default name for the new Element.
+ *
+ * @return the default name
+ * the default name for the new Element
+ */
+ protected String getDefaultName() {
+ boolean existsInterface = false;
+ String defaultName;
+ int max = 0;
+ do {
+ List<Interface> allInterface = ElementUtil.getInstancesFilteredByType(pack, Interface.class, null);
+ for(Object object : allInterface) {
+ String name = NamedElementUtil.getName((NamedElement)object);
+ if(name != null && name.startsWith(type)) {
+ name = name.substring(type.length());
+ Integer val = null;
+ try {
+ val = Integer.parseInt(name);
+ } catch (NumberFormatException e) {
+ // Nothing to do
+ }
+ if(val != null) {
+ max = Math.max(Integer.valueOf(val), max);
+ existsInterface = true;
+ }
+ }
+ }
+ if(existsInterface) {
+ defaultName = type + new Integer(max + 1).toString();
+ } else {
+ defaultName = type + new Integer(max).toString();
+ }
+ max++;
+ } while(!isCorrectName(defaultName));
+ return defaultName;
+ }
+
+ /**
+ * Tests if the proposed name is not forbidden
+ *
+ * @param name
+ * a name
+ * @return
+ * <code>true</code> if the proposed name is not forbidden
+ */
+ protected boolean isCorrectName(String name) {
+ if(forbiddenNames == null) {
+ return true;
+ }
+ return !forbiddenNames.contains(name);
+ }
+
+ /**
+ * Returns the command to create the new element which the chosen name.
+ *
+ * @return the command
+ * the command to create the new element which the chosen name
+ */
+ public Command getCommand() {
+ CompositeCommand cmd = new CompositeCommand("Create new element command"); //$NON-NLS-1$
+ // request to create the new Interface
+ if(elementToCreate.getCreateElementRequest() != null) {
+ CreateElementRequest request = elementToCreate.getCreateElementRequest();
+ ICommand command = getCommand(request);
+ if(command.canExecute()) {
+ cmd.add(command);
+ SetNameCommand nameCommand = new SetNameCommand(domain, "Set Name Command", null, request, elementToCreate); //$NON-NLS-1$
+ if(nameCommand.canExecute()) {
+ cmd.add(nameCommand);
+ }
+ }
+ return new ICommandProxy(cmd);
+ } else {
+ return new ICommandProxy(new CustomCreateElementCommand(domain, "CustomCreateElementCommand", null, elementToCreate)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Compute result.
+ *
+ * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
+ */
+ @Override
+ protected void computeResult() {
+ java.util.List<Object> result = new ArrayList<Object>();
+ result.add(elementToCreate);
+ setResult(result);
+ }
+
+ /**
+ * Set the value to {@link #name} and {@link #parentContainer}.
+ *
+ * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
+ */
+ @Override
+ protected void okPressed() {
+ ISelection selection = getTreeViewer().getSelection();
+ parentContainer = ((IStructuredSelection)selection).getFirstElement();
+ CreateElementRequest request = null;
+ if(parentContainer instanceof EObject) {
+ request = new CreateElementRequest(domain, (EObject)parentContainer, this.hintedType);
+ }
+ elementToCreate = new NewElementRepresentation(this.text.getText(), parentContainer, hintedType, request);
+ super.okPressed();
+ }
+
+ /**
+ * Returns a command corresponding to this request.
+ *
+ * @param request
+ * a request
+ * @return the command
+ * The command corresponding to this request or an {@link UnexecutableCommand} when the command can not be build
+ */
+ private ICommand getCommand(IEditCommandRequest request) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(UMLPackage.eINSTANCE.getNamedElement());
+ {
+ if(provider != null) {
+ ICommand cmd = provider.getEditCommand(request);
+ if(cmd != null && cmd.canExecute()) {
+ return cmd;
+ }
+ }
+ }
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * This command is used to set the chosen name to the new element.
+ */
+ public class SetNameCommand extends AbstractTransactionalCommand {
+
+ /** the representation that will own the new element when it will be created. */
+ private NewElementRepresentation representation;
+
+ /**
+ * Constructor.
+ *
+ * @param domain
+ * the domain
+ * @param label
+ * the label
+ * @param affectedFiles
+ * the affected files
+ * @param previousRequest
+ * the previous request
+ * @param representation
+ * the representation
+ */
+ public SetNameCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, CreateElementRequest previousRequest, NewElementRepresentation representation) {
+ super(domain, label, affectedFiles);
+ this.representation = representation;
+ }
+
+ /**
+ * Do execute with result.
+ *
+ * @param monitor
+ * the monitor
+ * @param info
+ * the info
+ * @return the command result
+ * @throws ExecutionException
+ * the execution exception
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(representation.getEObject() instanceof NamedElement) {
+ NamedElement el = (NamedElement)representation.getEObject();
+ el.setName(representation.getName());
+ }
+ return CommandResult.newOKCommandResult(representation);
+ }
+ }
+
+ /**
+ * This command allows to create a new element when its parent is not yet created when the command is build
+ *
+ * We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
+ * executed.
+ */
+ public class CustomCreateElementCommand extends AbstractTransactionalCommand {
+
+ /** the representation of the element to create. */
+ private NewElementRepresentation elementToCreate;
+
+ /**
+ * Constructor.
+ *
+ * @param domain
+ * the domain
+ * @param label
+ * the label
+ * @param affectedFiles
+ * the affected files
+ * @param elementToCreate
+ * the element to create
+ */
+ public CustomCreateElementCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, NewElementRepresentation elementToCreate) {
+ super(domain, label, affectedFiles);
+ this.elementToCreate = elementToCreate;
+ }
+
+ /**
+ * Do execute with result.
+ *
+ * @param monitor
+ * the monitor
+ * @param info
+ * the info
+ * @return the command result
+ * @throws ExecutionException
+ * the execution exception
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ EObject container = elementToCreate.getEObjectParent();
+ CreateElementRequest request = new CreateElementRequest(domain, container, hintedType);
+ ICommand command = getCommand(request);
+ command.execute(new NullProgressMonitor(), null);
+ EObject newEl = request.getNewElement();
+ if(newEl instanceof NamedElement) {
+ ((NamedElement)newEl).setName(elementToCreate.getName());
+ }
+ elementToCreate.setCreateElement(request.getNewElement());
+ return CommandResult.newOKCommandResult(elementToCreate);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/ExtendedSelectionEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/ExtendedSelectionEditor.java
new file mode 100644
index 0000000..378c68c
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/ExtendedSelectionEditor.java
@@ -0,0 +1,546 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.papyrus.infra.widgets.Activator;
+import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
+import org.eclipse.papyrus.infra.widgets.messages.Messages;
+import org.eclipse.papyrus.infra.widgets.providers.CollectionContentProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+
+/**
+ * Extension of selection editor with a table to display icon of element
+ * normally this class must inherits of SelectionEditor but list and table are type that are not compatible, so entire creation of this class was
+ * needed
+ */
+public class ExtendedSelectionEditor extends Composite implements SelectionListener {
+
+
+ /** the initial selection */
+ protected final java.util.List<Object> initialSelection;
+
+ /** The object selector */
+ private IElementSelector selector;
+
+ /** The SWT Composite in which the selector is drawn */
+ protected Composite selectorSection;
+
+ /** The message section */
+ protected Composite messageSection;
+
+ /** The additional button section */
+ protected Composite createAdditionalButtonSection;
+
+ /** The up/down buttons section */
+ protected Composite rightButtonsSection;
+
+ /** The listViewer for chosen elements */
+ protected TableViewer selectedElementsViewer;
+
+ /** The list for chosen elements */
+ protected Table selectedElements;
+
+ /** The add action button */
+ private Button add;
+
+ /** The remove action button */
+ private Button remove;
+
+ /** The add all action button */
+ private Button addAll;
+
+ /** The remove all action button */
+ private Button removeAll;
+
+ /** the up action button */
+ private Button up;
+
+ /** the down action button */
+ private Button down;
+
+ /** The label provider for the listViewer of chosen elements */
+ private ILabelProvider labelProvider;
+
+ /** The currently chosen elements */
+ protected final Collection<Object> currentSelection;
+
+ /** the listener for the additional button */
+ private SelectionListener additionalButtonSelectionListener;
+
+ /** the message for the editor */
+ private String message;
+
+
+ /*
+ * This dialog can provide a Button to do some optional action
+ */
+
+ /** Indicates if the dialog provides a button */
+ private boolean withAdditionalButton = false;
+
+ /** the label of the button */
+ private String additionalButtonLabel = null;
+
+ /** the button */
+ private Button additionalButton;
+
+ /** The add/remove/addAll buttons section */
+ protected Composite buttonSection;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this composite
+ * @param selector
+ * the selector
+ * @param labelProvider
+ * the label provider
+ * @param initialSelection
+ * the initial selection
+ */
+ public ExtendedSelectionEditor(Composite parent, IElementSelector selector, ILabelProvider labelProvider, java.util.List<Object> initialSelection) {
+ super(parent, SWT.NONE);
+ this.selector = selector;
+ this.labelProvider = labelProvider;
+ this.initialSelection = new ArrayList<Object>();
+ for(Object current : initialSelection) {
+ this.initialSelection.add(current);
+ }
+ currentSelection = initialSelection;
+ }
+
+ /**
+ * This methods create this editor
+ */
+ public void create() {
+ Composite parent = this;
+ GridLayout layout = new GridLayout(1, true);
+ GridData data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.grabExcessVerticalSpace = true;
+ parent.setLayout(layout);
+ createMessageSection(parent);
+ createBody(parent);
+ createCreateButtonSection(parent);
+ }
+
+ /**
+ * This method create the body of the editor :
+ * <ul>
+ * <li>the selector</li>
+ * <li>the list</li>
+ * <li>the buttons Add, AddAll, Remove, RemoveAll, Up, Down</li>
+ * </ul>
+ *
+ * @param parent
+ * the parent composite
+ */
+ protected void createBody(Composite parent) {
+
+ Composite par = new Composite(parent, SWT.NONE);
+ createSelectorSection(par);
+ createControlsSection(par);
+ createListSection(par);
+ createRightButtonsSection(par);
+ GridLayout layout = new GridLayout();
+ layout.makeColumnsEqualWidth = false;
+ layout.numColumns = 4;
+ par.setLayout(layout);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ par.setLayoutData(data);
+
+ }
+
+ /**
+ * Creates the Message section
+ *
+ * @param parent
+ * the parent of the {@link Composite}
+ */
+ protected void createMessageSection(Composite parent) {
+ messageSection = new Composite(parent, SWT.NONE);
+ Label label = new Label(messageSection, SWT.NONE);
+ label.setText(message);
+ messageSection.setLayout(new FillLayout(SWT.HORIZONTAL));
+ }
+
+ /**
+ * Creates the button section
+ *
+ * @param parent
+ * the parent of the {@link Composite}
+ */
+ protected void createCreateButtonSection(Composite parent) {
+ if(this.withAdditionalButton) {
+ buttonSection = new Composite(parent, SWT.NONE);
+ additionalButton = new Button(buttonSection, SWT.PUSH);
+ if(additionalButtonLabel != null) {
+ additionalButton.setText(additionalButtonLabel);
+ }
+ buttonSection.setLayout(new FillLayout());
+ this.additionalButton.addSelectionListener(additionalButtonSelectionListener);
+ }
+ }
+
+ /**
+ * Creates the selector section
+ *
+ * @param parent
+ * The composite in which the section is created
+ */
+ protected void createSelectorSection(Composite parent) {
+ selectorSection = new Composite(parent, SWT.NONE);
+ selectorSection.setLayout(new FillLayout());
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ data.widthHint = 400;
+
+ // data.exclude = true;
+ selectorSection.setLayoutData(data);
+ selector.createControls(selectorSection);
+
+ }
+
+ /**
+ * Creates the main controls section (Add, remove, Add all, remove all)
+ *
+ * @param parent
+ * The composite in which the section is created
+ */
+ protected void createControlsSection(Composite parent) {
+ buttonSection = new Composite(parent, SWT.NONE);
+ buttonSection.setLayout(new GridLayout(1, true));
+
+ add = new Button(buttonSection, SWT.PUSH);
+ add.setImage(Activator.getDefault().getImage("/icons/arrow_right.gif")); //$NON-NLS-1$
+ add.addSelectionListener(this);
+ add.setToolTipText(Messages.MultipleValueSelectorDialog_AddSelectedElements);
+
+ remove = new Button(buttonSection, SWT.PUSH);
+ remove.setImage(Activator.getDefault().getImage("/icons/arrow_left.gif")); //$NON-NLS-1$
+ remove.addSelectionListener(this);
+ remove.setToolTipText(Messages.MultipleValueEditor_RemoveSelectedElements);
+
+ addAll = new Button(buttonSection, SWT.PUSH);
+ addAll.setImage(Activator.getDefault().getImage("/icons/arrow_double.gif")); //$NON-NLS-1$
+ addAll.addSelectionListener(this);
+ addAll.setToolTipText(Messages.MultipleValueSelectorDialog_AddAllElements);
+
+ removeAll = new Button(buttonSection, SWT.PUSH);
+ removeAll.setImage(Activator.getDefault().getImage("/icons/arrow_left_double.gif")); //$NON-NLS-1$
+ removeAll.addSelectionListener(this);
+ removeAll.setToolTipText(Messages.MultipleValueSelectorDialog_RemoveAllElements);
+ }
+
+
+ /**
+ * Creates the list displaying the currently selected elements
+ *
+ * @param parent
+ * The composite in which the section is created
+ */
+ protected void createListSection(Composite parent) {
+ Composite listSection = new Composite(parent, SWT.NONE);
+ selectedElements = new Table(listSection, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ data.widthHint = 400;
+ listSection.setLayout(new FillLayout());
+ listSection.setLayoutData(data);
+
+ selectedElementsViewer = new TableViewer(selectedElements);
+
+ selectedElementsViewer.setContentProvider(CollectionContentProvider.instance);
+
+ if(labelProvider != null)
+ selectedElementsViewer.setLabelProvider(labelProvider);
+
+ selectedElementsViewer.setInput(currentSelection);
+ selector.setSelectedElements(currentSelection.toArray());
+
+ }
+
+ /**
+ * Creates the up/down controls section
+ *
+ * @param parent
+ * The composite in which the section is created
+ */
+ protected void createRightButtonsSection(Composite parent) {
+ rightButtonsSection = new Composite(parent, SWT.NONE);
+ rightButtonsSection.setLayout(new GridLayout(1, true));
+
+ up = new Button(rightButtonsSection, SWT.PUSH);
+ up.setImage(Activator.getDefault().getImage("/icons/Up_12x12.gif")); //$NON-NLS-1$
+ up.addSelectionListener(this);
+ up.setToolTipText(Messages.MultipleValueEditor_MoveSelectedElementsUp);
+
+ down = new Button(rightButtonsSection, SWT.PUSH);
+ down.setImage(Activator.getDefault().getImage("/icons/Down_12x12.gif")); //$NON-NLS-1$
+ down.addSelectionListener(this);
+ down.setToolTipText(Messages.MultipleValueEditor_MoveSelectedElementsDown);
+ }
+
+
+
+ /**
+ * {@inheritDoc} Handles the events on one of the control buttons
+ *
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ *
+ * @param e
+ * The event that occurred
+ */
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget == add) {
+ addAction();
+ } else if(e.widget == remove) {
+ removeAction();
+ } else if(e.widget == addAll) {
+ addAllAction();
+ } else if(e.widget == removeAll) {
+ removeAllAction();
+ } else if(e.widget == up) {
+ upAction();
+ } else if(e.widget == down) {
+ downAction();
+ }
+ }
+
+ /**
+ * Handles the "Add" action
+ */
+ protected void addAction() {
+ Object[] elements = selector.getSelectedElements();
+ addElements(elements);
+ }
+
+ /**
+ * Handles the "Up" action
+ */
+ protected void upAction() {
+ IStructuredSelection selection = (IStructuredSelection)selectedElementsViewer.getSelection();
+
+ //We need a list to move objects. LinkedHashSet can't do that
+ java.util.List<Object> list = new LinkedList<Object>(currentSelection);
+ for(Object o : selection.toArray()) {
+ int oldIndex = list.indexOf(o);
+ if(oldIndex > 0)
+ move(list, oldIndex, oldIndex - 1);
+ }
+
+ currentSelection.clear();
+ currentSelection.addAll(list);
+
+ IStructuredSelection selectionCopy = new StructuredSelection(selection.toArray());
+ selectedElementsViewer.setSelection(selectionCopy);
+ selectedElementsViewer.refresh();
+ }
+
+ /**
+ * Handles the "Down" action
+ */
+ protected void downAction() {
+ IStructuredSelection selection = (IStructuredSelection)selectedElementsViewer.getSelection();
+
+ //We need a list to move objects. LinkedHashSet can't do that
+ java.util.List<Object> list = new LinkedList<Object>(currentSelection);
+
+ int maxIndex = list.size() - 1;
+
+ Object[] selectionArray = selection.toArray();
+ for(int i = selectionArray.length - 1; i >= 0; i--) {
+ Object o = selectionArray[i];
+ int oldIndex = list.indexOf(o);
+ if(oldIndex < maxIndex)
+ move(list, oldIndex, oldIndex + 1);
+ }
+
+ currentSelection.clear();
+ currentSelection.addAll(list);
+
+ IStructuredSelection selectionCopy = new StructuredSelection(selection.toArray());
+ selectedElementsViewer.setSelection(selectionCopy);
+ selectedElementsViewer.refresh();
+ }
+
+ /**
+ * Moves an element from oldIndex to newIndex
+ *
+ * @param list
+ * The list in which to move the object
+ * @param oldIndex
+ * @param newIndex
+ */
+ protected void move(java.util.List<Object> list, int oldIndex, int newIndex) {
+ int size = list.size();
+
+ if(oldIndex < 0 || oldIndex >= size)
+ throw new IndexOutOfBoundsException("oldIndex: " + oldIndex + ", size:" + size); //$NON-NLS-1$ //$NON-NLS-2$
+ if(newIndex < 0 || newIndex >= size)
+ throw new IndexOutOfBoundsException("newIndex: " + newIndex + ", size:" + size); //$NON-NLS-1$ //$NON-NLS-2$
+ Object element = list.remove(oldIndex);
+ list.add(newIndex, element);
+ }
+
+ /**
+ * Handles the "Remove" action
+ */
+ protected void removeAction() {
+ IStructuredSelection selection = (IStructuredSelection)selectedElementsViewer.getSelection();
+ if(selection.isEmpty())
+ return;
+
+ for(Object element : selection.toArray()) {
+ currentSelection.remove(element);
+ }
+
+ selector.setSelectedElements(currentSelection.toArray());
+ selectedElementsViewer.setSelection(null);
+ selectedElementsViewer.refresh();
+ }
+
+ /**
+ * Handles the "Remove all" action
+ */
+ protected void removeAllAction() {
+ currentSelection.clear();
+ selector.setSelectedElements(new Object[0]);
+ selectedElementsViewer.setSelection(null);
+ selectedElementsViewer.refresh();
+ }
+
+ /**
+ * Handles the "Add All" action
+ */
+ protected void addAllAction() {
+ Object[] elements = selector.getAllElements();
+ addElements(elements);
+ }
+
+ /**
+ * Adds the specified elements to the currently selected elements (For
+ * "Add" and "Add all" actions)
+ *
+ * @param elements
+ * The elements to be added
+ */
+ protected void addElements(Object[] elements) {
+ if(elements != null) {
+ currentSelection.addAll(Arrays.asList(elements));
+ selectedElementsViewer.refresh();
+ }
+ }
+
+
+ /**
+ *
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ *
+ * @param e
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //Nothing to do
+ }
+
+ /**
+ *
+ * @param withAdditionalButton
+ * @param messageButton
+ * @param listener
+ */
+ public void setAdditionalButton(boolean withAdditionalButton, String messageButton, SelectionListener listener) {
+ this.withAdditionalButton = withAdditionalButton;
+ this.additionalButtonLabel = messageButton;
+ this.additionalButtonSelectionListener = listener;
+ }
+
+ /**
+ * Set the message displayed by the Editor
+ *
+ * @param string
+ * the message displayed by the editor
+ */
+ public void setMessage(String string) {
+ this.message = string;
+ }
+
+ /**
+ * Returns all selected elements
+ *
+ * @return
+ * all selected elements
+ */
+ public Collection<?> getSelectedElements() {
+ return currentSelection;
+ }
+
+
+ /**
+ * Returns the list of the elements to remove
+ *
+ * @return
+ * the list of the elements to remove
+ */
+ public java.util.List<Object> getElementToRemove() {
+ java.util.List<Object> removedObject = new ArrayList<Object>();
+ for(Object current : this.initialSelection) {
+ if(!getSelectedElements().contains(current)) {
+ removedObject.add(current);
+ }
+ }
+ return removedObject;
+ }
+
+ /**
+ * Returns the list of the elements to add
+ *
+ * @return
+ * the list of the elements to add
+ */
+ public java.util.List<Object> getElementToAdd() {
+ java.util.List<Object> addedObject = new ArrayList<Object>();
+ for(Object current : getSelectedElements()) {
+ if(!this.initialSelection.contains(current)) {
+ addedObject.add(current);
+ }
+ }
+ return addedObject;
+ }
+
+ /**
+ *
+ * @return the table viewer in order to get the element selection
+ */
+ public TableViewer getSelectedElementsViewer() {
+ return selectedElementsViewer;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/IPortInterfaceManagerDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/IPortInterfaceManagerDialog.java
new file mode 100644
index 0000000..1184293
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/IPortInterfaceManagerDialog.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import org.eclipse.gef.commands.Command;
+
+
+/**
+ * Interface for Port interface manager dialog.
+ */
+public interface IPortInterfaceManagerDialog {
+
+ /**
+ * Returns the commands to apply the changes.
+ *
+ * @return the commands to apply the changes
+ */
+ Command getCommand();
+
+ /**
+ * @see org.eclipse.jface.dialogs.Dialog#open()
+ *
+ * @return
+ */
+ int open();
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InterfaceManagerDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/InterfaceManagerDialog.java
index 8420500..d5dcde4 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/ui/InterfaceManagerDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/InterfaceManagerDialog.java
@@ -1,1008 +1,1024 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.internalblock.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
-import org.eclipse.papyrus.infra.widgets.editors.SelectionEditor;
-import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
-import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
-import org.eclipse.papyrus.sysml.diagram.internalblock.messages.Messages;
-import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Realization;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * <pre>
- * This class provides a Dialog to manage easily the provided and
- * the required Interfaces for a {@link Port}.
- * </pre>
- */
-public class InterfaceManagerDialog extends SelectionDialog {
-
- /** the selected port */
- private Port port;
-
- /** the list of the provided interfaces */
- private List<Object> providedInterfaces;
-
- /** the list of the required interfaces */
- private List<Object> requiredInterfaces;
-
- /** the {@link ReferenceSelector} for the provided interfaces */
- private ReferenceSelector providedSelector;
-
- /** the {@link ReferenceSelector} for the required interfaces */
- private ReferenceSelector requiredSelector;
-
- /** the Editor for the provided interfaces */
- private SelectionEditor providedEditor;
-
- /** the Editor for the required interfaces */
- private SelectionEditor requiredEditor;
-
- /**
- * In this map, we link the {@link Interface} with their {@link Usage} This map is used when we want remove an Interface from a Usage
- */
- private Map<Interface, List<Usage>> requiredInterfacesMappedWithUsage = new HashMap<Interface, List<Usage>>();
-
- /**
- * In this map, we link the {@link Interface} with their {@link Realization} This map is used when we want remove an Interface from a Realization
- */
- private Map<Interface, List<Realization>> providedInterfacesMappedWithRealization = new HashMap<Interface, List<Realization>>();
-
- /** the label provider for selector */
- private final ILabelProvider selectorLabelProvider = new SelectorLabelProvider();
-
- /** the label provider for the create new element dialog */
- private final ILabelProvider newElementLabelProvider = new CreateElementLabelProvider();
-
- /** the domain used for the commands */
- private TransactionalEditingDomain domain;
-
- /** the model */
- private Package model = null;
-
- /** this command contains the list of the command to create the new Interfaces */
- private CompoundCommand interfaceCreationCommand = new CompoundCommand("Create Interfaces Commands"); //$NON-NLS-1$
-
- /** This list contains representation of the Interface before their creation */
- private List<NewElementRepresentation> interfaceRepresentations;
-
- /** boolean used to know if the {@link Port} is typed with an {@link Interface} */
- private boolean typedWithInterface;
-
- /** path for the warning icons */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
-
- /**
- * This list contains the names used for the new elements.
- * We need to remember these names are used in order don't suggest them when we create other new elements
- */
- private List<String> forbiddenNames;
-
- /**
- *
- * Constructor.
- *
- * @param parentShell
- * the parent {@link Shell}
- * @param port
- * the {@link Port} for which we want manage the Interfaces
- */
- public InterfaceManagerDialog(Shell parentShell, Port port) {
- super(parentShell);
- this.setTitle(Messages.InterfaceManagerDialog_Title);
- this.port = port;
- Assert.isTrue(this.port.getType() instanceof Classifier);
- this.typedWithInterface = (this.port.getType() instanceof Interface);
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#create()
- *
- */
- @Override
- public void create() {
- super.create();
- init();
- }
-
- /**
- * This method initialize some fields of the class
- */
- protected void init() {
-
- this.forbiddenNames = new ArrayList<String>();
- this.interfaceRepresentations = new ArrayList<NewElementRepresentation>();
- EList<Namespace> namespaces = port.allNamespaces();
- Element el = namespaces.get(namespaces.size() - 1);
- if(el instanceof Package) {
- model = (Package)el;
- } else {
- model = el.getNearestPackage();
- }
-
- //fill the hashmap to link Interfaces with Usage and InterfaceRealization
- buildProvidedInterfaces();
- buildRequiredInterfaces();
-
- //we build the list of the provided interfaces
- this.providedInterfaces = new ArrayList<Object>();
- for(Interface current : this.port.getProvideds()) {
- this.providedInterfaces.add(current);
- }
- //when the port is typed by an Interface, we don't propose this interface in the possible Provided Interfaces list.
- if(typedWithInterface) {
- this.providedInterfaces.remove(this.port.getType());
- }
-
- //we build the list of the required interfaces
- this.requiredInterfaces = new ArrayList<Object>();
- for(Interface current : this.port.getRequireds()) {
- this.requiredInterfaces.add(current);
- }
-
- //initialize the transactional editing domain
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = activePage.getActiveEditor();
- if(editor instanceof IMultiDiagramEditor) {
- try {
- this.domain = ServiceUtils.getInstance().getTransactionalEditingDomain(((IMultiDiagramEditor)editor).getServicesRegistry());
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
-
- //selectors creation
- createSelectors();
- //editors creation
- createEditors();
-
- }
-
- /**
- * This method fills the map {@link #requiredInterfacesMappedWithUsage}
- */
- protected void buildRequiredInterfaces() {
- List<?> allUsage = Util.getInstancesFilteredByType(this.model, Usage.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier)this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
-
- for(Object current : allUsage) {
- Usage usage = (Usage)current;
- for(Classifier classifier : classifiers) {//we test if the current Usage is linked with the type of the Port
- if(usage.getClients().contains(classifier)) {//this Usage concerns the current port
- for(EObject target : usage.getSuppliers()) {
- if(this.port.getRequireds().contains(target)) {
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(target);
- if(usages != null) {
- usages.add(usage);
- } else {
- usages = new ArrayList<Usage>();
- usages.add(usage);
- this.requiredInterfacesMappedWithUsage.put((Interface)target, usages);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method fills the map {@link #providedInterfacesMappedWithRealization}
- */
- protected void buildProvidedInterfaces() {
- List<?> allRealization = Util.getInstancesFilteredByType(this.model, Realization.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier)this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
-
- for(Object current : allRealization) {
- Realization realization = (Realization)current;
- for(Classifier classifier : classifiers) {//we test if the current Realization is linked with the type of the Port
- if(realization.getClients().contains(classifier)) {//this Realization concerns the current port
- for(EObject target : realization.getSuppliers()) {
- if(this.port.getProvideds().contains(target)) {
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(target);
- if(realizations != null) {
- realizations.add(realization);
- } else {
- realizations = new ArrayList<Realization>();
- realizations.add(realization);
- this.providedInterfacesMappedWithRealization.put((Interface)target, realizations);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method creates the selectors {@link #providedSelector} and {@link #requiredSelector}
- */
- protected void createSelectors() {
- //the provided selector
- this.providedSelector = new ReferenceSelector(true);
- this.providedSelector.setLabelProvider(selectorLabelProvider);
- this.providedSelector.setContentProvider(new AbstractStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
- if(typedWithInterface) {
- tmp.remove(port.getType());
- }
- //we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- //the required selector
- this.requiredSelector = new ReferenceSelector(true);
- this.requiredSelector.setLabelProvider(selectorLabelProvider);
- this.requiredSelector.setContentProvider(new AbstractStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
-
- //we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- }
-
- /**
- * This method create the 2 Editors {@link #providedEditor} and {@link #requiredEditor} and provides the listener for the button of these editors
- */
- protected void createEditors() {
- Composite parent = (Composite)getDialogArea();
- CreateButtonListener listener = new CreateButtonListener();
- //we set a specific message if the port is typed with an Interface
- if(typedWithInterface) {
- Composite messageSection = new Composite(parent, SWT.BORDER);
- CLabel label = new CLabel(messageSection, SWT.NONE);
-
- label.setText(Messages.InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage);
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- label.setImage(errorImage);
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- messageSection.setLayout(layout);
- messageSection.setLayoutData(data);
- messageSection.setEnabled(false);
- }
- this.providedEditor = createEditor(parent, providedSelector, Messages.InterfaceManagerDialog_SelectedTheProvidedInterfaces, false, listener, this.providedInterfaces);
- this.requiredEditor = createEditor(parent, requiredSelector, Messages.InterfaceManagerDialog_SelectTheRequiredInterfaces, true, listener, this.requiredInterfaces);
-
- this.providedEditor.create();
- this.requiredEditor.create();
-
- GridLayout layout = (GridLayout)parent.getLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- this.providedEditor.setLayoutData(data);
- this.requiredEditor.setLayoutData(data);
- getShell().setSize(950, 700);
- getShell().layout();
- }
-
- /**
- * Creates a {@link SelectionEditor} and returns it
- *
- * @param parent
- * the composite parent
- * @param selector
- * the selector used by the created editor
- * @param message
- * the message to display in the created editor
- * @param withCreateButton
- * indicates if the editor provides an additional button for a specific action
- * @param listener
- * the listener for the button
- * @param initialSelection
- * the initial selection for this editor
- * @return
- * the created {@link SelectionEditor}
- */
- protected SelectionEditor createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
- SelectionEditor editor = new SelectionEditor(parent, selector, selectorLabelProvider, initialSelection);
- editor.setMessage(message);
- editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
- return editor;
- }
-
- /**
- * Returns all the available Interfaces (except {@link FlowSpecification})
- *
- * @return
- * all the available Interfaces
- * //TODO add the interfaces from the package import!
- */
- protected List<Interface> getAllAvailableInterfaces(Package pack) {
- List<Interface> otherInterfaces = new ArrayList<Interface>();
- List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
- for(Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
- interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
-
- }
-
- for(Element element : interfaces) {
- // Test if the interface is a FlowSpecification
- FlowSpecification flowSpec = UMLUtil.getStereotypeApplication(element, FlowSpecification.class);
- if(flowSpec == null) {
- otherInterfaces.add((Interface)element);
- }
- }
-
- return otherInterfaces;
- }
-
- /**
- * Returns the commands to apply the changes
- *
- * @return
- * the commands to apply the changes
- */
- public Command getCommand() {
- CompoundCommand command = new CompoundCommand("Command to manage interfaces on Port"); //$NON-NLS-1$
- if(!interfaceCreationCommand.isEmpty()) {
- command.add(interfaceCreationCommand);
- }
- Command cmd = getCommandsToCreateElements();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- cmd = getCommandToRemoveReferencedInterfaces();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- return command;
- }
-
- /**
- * Returns the command to remove referenced Interfaces in Usage and InterfaceRealization
- *
- * @return
- * The command to remove referenced Interfaces the Usage and InterfaceRealization.
- * Moreover, we add a command to destroy Usage and InterfaceRealization when they have any Suppliers after this action
- */
- protected Command getCommandToRemoveReferencedInterfaces() {
- CompoundCommand command = new CompoundCommand("Command to destroy Usage and InterfaceRealization"); //$NON-NLS-1$
-
- Set<Dependency> relationshipToDestroy = new HashSet<Dependency>();
- //commands to destroy Usage
- for(Object current : this.requiredEditor.getElementToRemove()) {
- //we get all usage associated with this interface
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(current);
- for(Usage currentUsage : usages) {
- //we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentUsage, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentUsage);
- }
- }
- }
-
- //commands to destroy InterfaceRealization
- for(Object current : this.providedEditor.getElementToRemove()) {
- //we get all usage associated with this interface
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(current);
- for(Realization currentRealization : realizations) {
- //we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentRealization, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentRealization);
- }
- }
- }
- if(!relationshipToDestroy.isEmpty()) {
- command.add(new ICommandProxy(new DestroyDependencyWithoutSupplierCommand(this.domain, null, relationshipToDestroy)));
- return command;
- }
-
- //nothing to do
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Returns the command to create new Usage and new InterfaceRealization
- *
- * @return
- * the command to create new Usage and new InterfaceRealization
- */
- protected Command getCommandsToCreateElements() {
- CompoundCommand command = new CompoundCommand("Command to create Usage and InterfaceRealization"); //$NON-NLS-1$
- //commands for Usage Creation
- for(Object current : this.requiredEditor.getElementToAdd()) {
- if(current instanceof EObject) {
- CreateRelationshipRequest request =
- new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject)current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- } else {//its an NewElementRepresentation
-
- CreateUsageCommand cmd = new CreateUsageCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation)current, null);
- if(cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
-
- //commands for InterfaceRealization Creation
- for(Object current : providedEditor.getElementToAdd()) {
- if(current instanceof EObject) {
- CreateRelationshipRequest request =
- new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject)current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- } else {//its an NewElementRepresentation
- CreateInterfaceRealizationCommand cmd =
- new CreateInterfaceRealizationCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation)current, null);
- if(cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
- if(!command.isEmpty()) {
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Return the command corresponding to the request
- *
- * @param req
- * a request
- * @return
- * the command corresponding to the request
- */
- protected Command getCommand(AbstractEditCommandRequest req) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(model);
- if(provider != null) {
- ICommand setCommand = provider.getEditCommand(req);
- if(setCommand != null) {
- return new ICommandProxy(setCommand.reduce());
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This listener is used to know when the user clicks on the Button to create a new {@link Interface}
- *
- *
- *
- */
- public class CreateButtonListener implements SelectionListener {
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetSelected(SelectionEvent e) {
- CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, UMLElementTypes.INTERFACE);
- dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
- dialog.setMessage(Messages.InterfaceManagerDialog_SelectTheParentOfThisNewInterface);
- dialog.setHelpAvailable(false);
- dialog.setForbiddenNames(forbiddenNames);
- List<Object> input = new ArrayList<Object>();
- input.add(model);
- dialog.setInput(input);
- dialog.setValidator(new ParentInterfaceValidator());
- if(dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
- interfaceCreationCommand.add(dialog.getCommand());
- Object[] res = dialog.getResult();
- for(Object current : res) {
- if(current instanceof NewElementRepresentation) {
- interfaceRepresentations.add((NewElementRepresentation)current);
- forbiddenNames.add(((NewElementRepresentation)current).getName());
- }
- }
- providedSelector.refresh();
- requiredSelector.refresh();
- }
- }
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
- }
-
- /**
- *
- * This class provides a validator for the selection of the parent of the new Interface
- *
- *
- */
- public class ParentInterfaceValidator implements ISelectionStatusValidator {
-
- /**
- * Selection has to be a Classifier or an Interface to allow creation
- *
- * @see org.eclipse.ui.dialogs.ISelectionStatusValidator#validate(java.lang.Object[])
- *
- * @param selection
- * @return
- */
- public IStatus validate(Object[] selection) {
-
- IStatus status = new Status(IStatus.ERROR, org.eclipse.papyrus.sysml.diagram.internalblock.Activator.PLUGIN_ID, Messages.NoSelectionFound);
- if(selection.length >= 1) {
- for(int i = 0; i < selection.length; i++) {
- if(selection[i] instanceof Package || selection[i] instanceof Classifier || selection[i] instanceof NewElementRepresentation)
- status = new Status(IStatus.OK, org.eclipse.papyrus.sysml.diagram.internalblock.Activator.PLUGIN_ID, Messages.SelectionValidated);
- else {
- status = new Status(IStatus.ERROR, org.eclipse.papyrus.sysml.diagram.internalblock.Activator.PLUGIN_ID, Messages.InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier);
- break;
- }
- }
- }
- return status;
- }
- }
-
- /**
- *
- * This class provides a CustomLabelProvider for this dialog.
- * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
- *
- *
- */
- public class SelectorLabelProvider extends CreateElementLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if(element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)element).getQualifiedName();
- } else if(element instanceof NamedElement) {
- return ((NamedElement)element).getQualifiedName();
- }
- return super.getText(element);
- }
-
- }
-
- public class CreateElementLabelProvider extends UMLLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Image getImage(Object element) {
- if(element instanceof NewElementRepresentation) {
- return org.eclipse.papyrus.uml.tools.Activator.getDefault().getImageForUMLMetaclass(UMLPackage.eINSTANCE.getInterface());
- }
- return super.getImage(element);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if(element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)element).getName();
- }
- return super.getText(element);
- }
-
- }
-
- /**
- *
- * This content provider is used in this dialog. It returns the available element in the model + the future element which are
- * {@link NewElementRepresentation}
- *
- *
- */
- public class CustomContentProvider implements ITreeContentProvider {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- public void dispose() {
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- *
- * @param inputElement
- * @return
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List<?>) {
- return ((List<?>)inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- *
- * @param parentElement
- * @return
- */
- public Object[] getChildren(Object parentElement) {
- List<Object> children = new ArrayList<Object>();
- List<?> tmp = null;
- if(parentElement instanceof Package) {
- tmp = ((Package)parentElement).getOwnedMembers();
- } else if(parentElement instanceof Classifier) {
- tmp = ((Classifier)parentElement).getOwnedMembers();
- }
- if(tmp != null) {
- for(Object current : tmp) {
- if(current instanceof Classifier || current instanceof Package) {
- children.add(current);
- }
- }
- }
- //we add the future Interfaces to this selection
- for(NewElementRepresentation current : interfaceRepresentations) {
- if(current.getParent() == parentElement) {
- children.add(current);
- }
- }
- return children.toArray();
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- *
- * @param element
- * @return
- */
- public Object getParent(Object element) {
- if(element == model) {
- return model;
- } else if(element instanceof NamedElement) {
- return ((NamedElement)element).eContainer();
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- *
- * @param element
- * @return
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length != 0;
- }
-
- }
-
- /**
- *
- * This command is used to create a New Usage, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateUsageCommand extends AbstractTransactionalCommand {
-
- /** The container for the new Usage */
- private EObject container;
-
- /** the source of this Usage */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the Usage
- * @param source
- * the source for the Usage
- * @param target
- * the target for the Usage
- * @param affectedFiles
- * the affected files
- */
- public CreateUsageCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create Usage Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), UMLElementTypes.USAGE);
- Command command = getCommand(request);
- if(command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to create a New InterfaceRealition, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateInterfaceRealizationCommand extends AbstractTransactionalCommand {
-
- /** The container for the new InterfaceRealization */
- private EObject container;
-
- /** The source for the new InterfaceRealization */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the InterfaceRealization
- * @param source
- * the source for the InterfaceRealization
- * @param target
- * the target for the InterfaceRealization
- * @param affectedFiles
- * the affected files
- */
- public CreateInterfaceRealizationCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create InterfaceRealization Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), UMLElementTypes.INTERFACE_REALIZATION);
- Command command = getCommand(request);
- if(command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to destroy Dependencies which have any supplier before the deletion of the Interface
- *
- *
- */
- public class DestroyDependencyWithoutSupplierCommand extends AbstractTransactionalCommand {
-
- /**
- * the dependencies to test
- */
- private Set<Dependency> dependencies;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param affectedFiles
- * the affected files
- * @param dependencies
- * the dependencies to test
- */
- public DestroyDependencyWithoutSupplierCommand(TransactionalEditingDomain domain, List<?> affectedFiles, Set<Dependency> dependencies) {
- super(domain, "Destroy the empty elements", affectedFiles); //$NON-NLS-1$
- this.dependencies = dependencies;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CompoundCommand command = new CompoundCommand("Destroy relationship without suppliers"); //$NON-NLS-1$
- for(Dependency current : dependencies) {
- if(current.getSuppliers().isEmpty()) {
- DestroyElementRequest request = new DestroyElementRequest(domain, current, false);
- Command cmd = getCommand(request);
- if(cmd.canExecute()) {
- command.add(cmd);
- }
- }
- }
-
- if(!command.isEmpty() && command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult();
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
+import org.eclipse.papyrus.infra.widgets.editors.SelectionEditor;
+import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
+import org.eclipse.papyrus.uml.tools.commands.DestroyDependencyWithoutSupplierCommand;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.dialogs.SelectionDialog;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Realization;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.Usage;
+import org.eclipse.uml2.uml.edit.providers.ImageItemProvider;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+
+
+/**
+ * This class provides a Dialog to manage easily the provided and the required Interfaces for a {@link Port}.
+ */
+public class InterfaceManagerDialog extends SelectionDialog implements IPortInterfaceManagerDialog {
+
+ /** the selected port. */
+ private Port port;
+
+ /** the list of the provided interfaces. */
+ private List<Object> providedInterfaces;
+
+ /** the list of the required interfaces. */
+ private List<Object> requiredInterfaces;
+
+ /** the {@link ReferenceSelector} for the provided interfaces. */
+ private ReferenceSelector providedSelector;
+
+ /** the {@link ReferenceSelector} for the required interfaces. */
+ private ReferenceSelector requiredSelector;
+
+ /** the Editor for the provided interfaces. */
+ private SelectionEditorWrapper providedEditor;
+
+ /** the Editor for the required interfaces. */
+ private SelectionEditorWrapper requiredEditor;
+
+ /** In this map, we link the {@link Interface} with their {@link Usage} This map is used when we want remove an Interface from a Usage. */
+ private Map<Interface, List<Usage>> requiredInterfacesMappedWithUsage = new HashMap<Interface, List<Usage>>();
+
+ /**
+ * In this map, we link the {@link Interface} with their {@link Realization} This map is used when we want remove an Interface from a Realization.
+ */
+ private Map<Interface, List<Realization>> providedInterfacesMappedWithRealization = new HashMap<Interface, List<Realization>>();
+
+ /** the label provider for selector. */
+ private ILabelProvider selectorLabelProvider = new SelectorLabelProvider();
+
+ /** the label provider for the create new element dialog. */
+ private final ILabelProvider newElementLabelProvider = new CreateElementLabelProvider();
+
+ /** the domain used for the commands. */
+ private TransactionalEditingDomain domain;
+
+ /** the model. */
+ private Package model = null;
+
+ /** this command contains the list of the command to create the new Interfaces. */
+ private CompoundCommand interfaceCreationCommand = new CompoundCommand("Create Interfaces Commands"); //$NON-NLS-1$
+
+ /** This list contains representation of the Interface before their creation. */
+ private List<NewElementRepresentation> interfaceRepresentations;
+
+ /** boolean used to know if the {@link Port} is typed with an {@link Interface}. */
+ private boolean typedWithInterface;
+
+ /** path for the warning icons. */
+ private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
+
+ /**
+ * This list contains the names used for the new elements.
+ * We need to remember these names are used in order don't suggest them when we create other new elements
+ */
+ private List<String> forbiddenNames;
+
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parentShell
+ * the parent {@link Shell}
+ * @param port
+ * the {@link Port} for which we want manage the Interfaces
+ */
+ public InterfaceManagerDialog(Shell parentShell, Port port) {
+ super(parentShell);
+ this.setTitle(Messages.InterfaceManagerDialog_Title);
+ this.port = port;
+ Assert.isTrue(this.port.getType() instanceof Classifier);
+ this.typedWithInterface = (this.port.getType() instanceof Interface);
+ }
+
+ /**
+ * Creates the dialog.
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#create()
+ */
+ @Override
+ public void create() {
+ super.create();
+ init();
+ }
+
+
+
+ /**
+ * This method initialize some fields of the class.
+ */
+ protected void init() {
+
+ this.forbiddenNames = new ArrayList<String>();
+ this.interfaceRepresentations = new ArrayList<NewElementRepresentation>();
+ EList<Namespace> namespaces = port.allNamespaces();
+ Element el = namespaces.get(namespaces.size() - 1);
+ if(el instanceof Package) {
+ model = (Package)el;
+ } else {
+ model = el.getNearestPackage();
+ }
+
+ // fill the hashmap to link Interfaces with Usage and InterfaceRealization
+ buildProvidedInterfaces();
+ buildRequiredInterfaces();
+
+ // we build the list of the provided interfaces
+ this.providedInterfaces = new ArrayList<Object>();
+ for(Interface current : this.port.getProvideds()) {
+ this.providedInterfaces.add(current);
+ }
+ // when the port is typed by an Interface, we don't propose this interface in the possible Provided Interfaces list.
+ if(typedWithInterface) {
+ this.providedInterfaces.remove(this.port.getType());
+ }
+
+ // we build the list of the required interfaces
+ this.requiredInterfaces = new ArrayList<Object>();
+ for(Interface current : this.port.getRequireds()) {
+ this.requiredInterfaces.add(current);
+ }
+
+ // initialize the transactional editing domain
+ IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editor = activePage.getActiveEditor();
+ if(editor instanceof IMultiDiagramEditor) {
+ try {
+ this.domain = ServiceUtils.getInstance().getTransactionalEditingDomain(((IMultiDiagramEditor)editor).getServicesRegistry());
+ } catch (ServiceException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // selectors creation
+ createSelectors();
+ // editors creation
+ createEditors();
+
+ }
+
+ /**
+ * This method fills the map {@link #requiredInterfacesMappedWithUsage}.
+ */
+ protected void buildRequiredInterfaces() {
+ List<Usage> allUsage = ElementUtil.getInstancesFilteredByType(this.model, Usage.class, null);
+ List<Classifier> classifiers = new ArrayList<Classifier>();
+ classifiers.add((Classifier)this.port.getType());
+
+ classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
+
+ for(Object current : allUsage) {
+ Usage usage = (Usage)current;
+ for(Classifier classifier : classifiers) {// we test if the current Usage is linked with the type of the Port
+ if(usage.getClients().contains(classifier)) {// this Usage concerns the current port
+ for(EObject target : usage.getSuppliers()) {
+ if(this.port.getRequireds().contains(target)) {
+ List<Usage> usages = requiredInterfacesMappedWithUsage.get(target);
+ if(usages != null) {
+ usages.add(usage);
+ } else {
+ usages = new ArrayList<Usage>();
+ usages.add(usage);
+ this.requiredInterfacesMappedWithUsage.put((Interface)target, usages);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * This method fills the map {@link #providedInterfacesMappedWithRealization}.
+ */
+ protected void buildProvidedInterfaces() {
+ List<Realization> allRealization = ElementUtil.getInstancesFilteredByType(this.model, Realization.class, null);
+ List<Classifier> classifiers = new ArrayList<Classifier>();
+ classifiers.add((Classifier)this.port.getType());
+
+ classifiers.addAll(Util.getAllSuperClasses(null, (Classifier)this.port.getType()));
+
+ for(Object current : allRealization) {
+ Realization realization = (Realization)current;
+ for(Classifier classifier : classifiers) {// we test if the current Realization is linked with the type of the Port
+ if(realization.getClients().contains(classifier)) {// this Realization concerns the current port
+ for(EObject target : realization.getSuppliers()) {
+ if(this.port.getProvideds().contains(target)) {
+ List<Realization> realizations = providedInterfacesMappedWithRealization.get(target);
+ if(realizations != null) {
+ realizations.add(realization);
+ } else {
+ realizations = new ArrayList<Realization>();
+ realizations.add(realization);
+ this.providedInterfacesMappedWithRealization.put((Interface)target, realizations);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * This method creates the selectors {@link #providedSelector} and {@link #requiredSelector}.
+ */
+ protected void createSelectors() {
+ // the provided selector
+ this.providedSelector = new ReferenceSelector(true);
+ this.providedSelector.setLabelProvider(selectorLabelProvider);
+ this.providedSelector.setContentProvider(new AbstractStaticContentProvider() {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
+ *
+ * @return
+ */
+ @Override
+ public Object[] getElements() {
+ List<Object> tmp = new ArrayList<Object>();
+ tmp.addAll(getAllAvailableInterfaces(model));
+ if(typedWithInterface) {
+ tmp.remove(port.getType());
+ }
+ // we add the new interfaces which are not yet created
+ tmp.addAll(interfaceRepresentations);
+ return tmp.toArray();
+ }
+ });
+ // the required selector
+ this.requiredSelector = new ReferenceSelector(true);
+ this.requiredSelector.setLabelProvider(selectorLabelProvider);
+ this.requiredSelector.setContentProvider(new AbstractStaticContentProvider() {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
+ *
+ * @return
+ */
+ @Override
+ public Object[] getElements() {
+ List<Object> tmp = new ArrayList<Object>();
+ tmp.addAll(getAllAvailableInterfaces(model));
+
+ // we add the new interfaces which are not yet created
+ tmp.addAll(interfaceRepresentations);
+ return tmp.toArray();
+ }
+ });
+ }
+
+ /**
+ * This method create the 2 Editors {@link #providedEditor} and {@link #requiredEditor} and provides the listener for the button of these editors.
+ */
+ protected void createEditors() {
+ Composite parent = (Composite)getDialogArea();
+ CreateButtonListener listener = new CreateButtonListener();
+ // we set a specific message if the port is typed with an Interface
+ if(typedWithInterface) {
+ Composite messageSection = new Composite(parent, SWT.BORDER);
+ CLabel label = new CLabel(messageSection, SWT.NONE);
+
+ label.setText(Messages.InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage);
+ Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
+ label.setImage(errorImage);
+ GridLayout layout = new GridLayout(1, true);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
+ messageSection.setLayout(layout);
+ messageSection.setLayoutData(data);
+ messageSection.setEnabled(false);
+ }
+ this.providedEditor = createEditor(parent, providedSelector, Messages.InterfaceManagerDialog_SelectedTheProvidedInterfaces, false, listener, this.providedInterfaces);
+ this.requiredEditor = createEditor(parent, requiredSelector, Messages.InterfaceManagerDialog_SelectTheRequiredInterfaces, true, listener, this.requiredInterfaces);
+
+ this.providedEditor.create();
+ this.requiredEditor.create();
+
+ GridLayout layout = (GridLayout)parent.getLayout();
+ layout.numColumns = 1;
+ layout.makeColumnsEqualWidth = true;
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ this.providedEditor.setLayoutData(data);
+ this.requiredEditor.setLayoutData(data);
+ getShell().setSize(950, 700);
+ getShell().layout();
+ }
+
+ /**
+ * Creates a {@link SelectionEditor} and returns it.
+ *
+ * @param parent
+ * the composite parent
+ * @param selector
+ * the selector used by the created editor
+ * @param message
+ * the message to display in the created editor
+ * @param withCreateButton
+ * indicates if the editor provides an additional button for a specific action
+ * @param listener
+ * the listener for the button
+ * @param initialSelection
+ * the initial selection for this editor
+ * @return the created {@link SelectionEditor}
+ */
+ protected SelectionEditorWrapper createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
+ SelectionEditor editor = new SelectionEditor(parent, selector, selectorLabelProvider, initialSelection);
+ editor.setMessage(message);
+ editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
+ return new SelectionEditorWrapper(editor, editor.getClass());
+ }
+
+ /**
+ * Returns all the available Interfaces.
+ *
+ * @param pack
+ * the pack
+ * @return all the available Interfaces
+ * //TODO add the interfaces of the package import!
+ */
+ protected List<Interface> getAllAvailableInterfaces(Package pack) {
+
+ // Set ensure there is not duplicated interface
+ Set<Interface> otherInterfaces = new HashSet<Interface>();
+
+ List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
+ for(Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
+ interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
+
+ }
+
+ for(Element element : interfaces) {
+ otherInterfaces.add((Interface)element);
+ }
+
+ return Arrays.asList(otherInterfaces.toArray(new Interface[otherInterfaces.size()]));
+ }
+
+
+ /**
+ * Gets the command.
+ *
+ * @return the command
+ * @see org.eclipse.papyrus.uml.diagram.common.dialogs.IPortInterfaceManagerDialog#getCommand()
+ */
+ public Command getCommand() {
+ CompoundCommand command = new CompoundCommand("Command to manage interfaces on Port"); //$NON-NLS-1$
+ if(!interfaceCreationCommand.isEmpty()) {
+ command.add(interfaceCreationCommand);
+ }
+ Command cmd = getCommandsToCreateElements();
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ }
+ cmd = getCommandToRemoveReferencedInterfaces();
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ }
+ return command;
+ }
+
+ /**
+ * Returns the command to remove referenced Interfaces in Usage and InterfaceRealization.
+ *
+ * @return The command to remove referenced Interfaces the Usage and InterfaceRealization.
+ * Moreover, we add a command to destroy Usage and InterfaceRealization when they have any Suppliers after this action
+ */
+ protected Command getCommandToRemoveReferencedInterfaces() {
+ CompoundCommand command = new CompoundCommand("Command to destroy Usage and InterfaceRealization"); //$NON-NLS-1$
+
+ Set<Dependency> relationshipToDestroy = new HashSet<Dependency>();
+ // commands to destroy Usage
+ for(Object current : this.requiredEditor.getElementToRemove()) {
+ // we get all usage associated with this interface
+ List<Usage> usages = requiredInterfacesMappedWithUsage.get(current);
+ for(Usage currentUsage : usages) {
+ // we remove the reference to the Interface in the Usage
+ DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentUsage, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
+ Command cmd = getCommand(request);
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ relationshipToDestroy.add(currentUsage);
+ }
+ }
+ }
+
+ // commands to destroy InterfaceRealization
+ for(Object current : this.providedEditor.getElementToRemove()) {
+ // we get all usage associated with this interface
+ List<Realization> realizations = providedInterfacesMappedWithRealization.get(current);
+ for(Realization currentRealization : realizations) {
+ // we remove the reference to the Interface in the Usage
+ DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentRealization, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject)current, false);
+ Command cmd = getCommand(request);
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ relationshipToDestroy.add(currentRealization);
+ }
+ }
+ }
+ if(!relationshipToDestroy.isEmpty()) {
+ command.add(new ICommandProxy(new DestroyDependencyWithoutSupplierCommand(this.domain, relationshipToDestroy, getCommandProvider())));
+ return command;
+ }
+
+ // nothing to do
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Returns the command to create new Usage and new InterfaceRealization.
+ *
+ * @return the command to create new Usage and new InterfaceRealization
+ */
+ protected Command getCommandsToCreateElements() {
+ CompoundCommand command = new CompoundCommand("Command to create Usage and InterfaceRealization"); //$NON-NLS-1$
+ // commands for Usage Creation
+ for(Object current : this.requiredEditor.getElementToAdd()) {
+ if(current instanceof EObject) {
+ CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject)current, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.Usage"));
+ Command cmd = getCommand(request);
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ }
+ } else {// its an NewElementRepresentation
+
+ CreateUsageCommand cmd = new CreateUsageCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation)current, null);
+ if(cmd.canExecute()) {
+ command.add(new ICommandProxy(cmd));
+ }
+ }
+ }
+
+ // commands for InterfaceRealization Creation
+ for(Object current : this.providedEditor.getElementToAdd()) {
+ if(current instanceof EObject) {
+ CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType(), this.port.getType(), (EObject)current, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.InterfaceRealization"));
+ Command cmd = getCommand(request);
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ }
+ } else {// its an NewElementRepresentation
+ CreateInterfaceRealizationCommand cmd = new CreateInterfaceRealizationCommand(this.domain, this.port.getType(), this.port.getType(), (NewElementRepresentation)current, null);
+ if(cmd.canExecute()) {
+ command.add(new ICommandProxy(cmd));
+ }
+ }
+ }
+ if(!command.isEmpty()) {
+ return command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Return the command corresponding to the request.
+ *
+ * @param req
+ * a request
+ * @return the command corresponding to the request
+ */
+ protected Command getCommand(AbstractEditCommandRequest req) {
+ IElementEditService provider = getCommandProvider();
+ if(provider != null) {
+ ICommand setCommand = provider.getEditCommand(req);
+ if(setCommand != null) {
+ return new ICommandProxy(setCommand.reduce());
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Gets the command provider.
+ *
+ * @return the command provider
+ */
+ private IElementEditService getCommandProvider() {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(model);
+ return provider;
+ }
+
+
+
+ /**
+ * Gets the selector label provider.
+ *
+ * @return the selector label provider
+ */
+ public ILabelProvider getSelectorLabelProvider() {
+ return selectorLabelProvider;
+ }
+
+
+ /**
+ * Sets the selector label provider.
+ *
+ * @param selectorLabelProvider
+ * the new selector label provider
+ */
+ public void setSelectorLabelProvider(ILabelProvider selectorLabelProvider) {
+ this.selectorLabelProvider = selectorLabelProvider;
+ }
+
+
+
+ /**
+ * Gets the provided editor.
+ *
+ * @return the provided editor
+ */
+ public SelectionEditorWrapper getProvidedEditor() {
+ return providedEditor;
+ }
+
+
+ /**
+ * Gets the required editor.
+ *
+ * @return the required editor
+ */
+ public SelectionEditorWrapper getRequiredEditor() {
+ return requiredEditor;
+ }
+
+
+ /**
+ * This listener is used to know when the user clicks on the Button to create a new {@link Interface}.
+ *
+ * @see CreateButtonEvent
+ */
+ public class CreateButtonListener implements SelectionListener {
+
+ /**
+ * Widget selected.
+ *
+ * @param e
+ * the e
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+
+ CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.Interface"));
+ dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
+ dialog.setMessage(Messages.InterfaceManagerDialog_SelectTheParentOfThisNewInterface);
+ dialog.setHelpAvailable(false);
+ dialog.setForbiddenNames(forbiddenNames);
+ List<Object> input = new ArrayList<Object>();
+ input.add(model);
+ dialog.setInput(input);
+ dialog.setValidator(new ParentInterfaceValidator());
+ if(dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
+ interfaceCreationCommand.add(dialog.getCommand());
+ Object[] res = dialog.getResult();
+ for(Object current : res) {
+ if(current instanceof NewElementRepresentation) {
+ interfaceRepresentations.add((NewElementRepresentation)current);
+ forbiddenNames.add(((NewElementRepresentation)current).getName());
+ }
+ }
+ providedSelector.refresh();
+ requiredSelector.refresh();
+ }
+ }
+
+ /**
+ * Widget default selected.
+ *
+ * @param e
+ * the e
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ }
+
+ /**
+ * This class provides a validator for the selection of the parent of the new Interface.
+ */
+ public class ParentInterfaceValidator implements ISelectionStatusValidator {
+
+ /**
+ * Selection has to be a Classifier or an Interface to allow creation.
+ *
+ * @param selection
+ * the selection
+ * @return the i status
+ * @see org.eclipse.ui.dialogs.ISelectionStatusValidator#validate(java.lang.Object[])
+ */
+ @Override
+ public IStatus validate(Object[] selection) {
+
+ IStatus status = new Status(IStatus.ERROR, Activator.ID, Messages.NoSelectionFound);
+ if(selection.length >= 1) {
+ for(int i = 0; i < selection.length; i++) {
+ if(selection[i] instanceof Package || selection[i] instanceof Classifier || selection[i] instanceof NewElementRepresentation) {
+ status = new Status(IStatus.OK, Activator.ID, Messages.SelectionValidated);
+ } else {
+ status = new Status(IStatus.ERROR, Activator.ID, Messages.InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier);
+ break;
+ }
+ }
+ }
+ return status;
+ }
+ }
+
+ /**
+ *
+ * This class provides a CustomLabelProvider for this dialog.
+ * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
+ *
+ *
+ */
+ public class SelectorLabelProvider extends CreateElementLabelProvider {
+
+ /**
+ * Gets the text.
+ *
+ * @param element
+ * the element
+ * @return the text
+ * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ if(element instanceof NewElementRepresentation) {
+ return ((NewElementRepresentation)element).getQualifiedName();
+ } else if(element instanceof NamedElement) {
+ return ((NamedElement)element).getQualifiedName();
+ }
+ return super.getText(element);
+ }
+
+ }
+
+ /**
+ * The Class CreateElementLabelProvider.
+ */
+ public class CreateElementLabelProvider extends UMLLabelProvider {
+
+ /**
+ * Gets the image.
+ *
+ * @param element
+ * the element
+ * @return the image
+ * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof NewElementRepresentation) {
+
+ ImageItemProvider imageProvider = new ImageItemProvider(new UMLItemProviderAdapterFactory());
+ Object obj = imageProvider.getImage(((NewElementRepresentation)element).getEObject());
+ return org.eclipse.papyrus.uml.tools.Activator.getDefault().getImageForUMLMetaclass(UMLPackage.eINSTANCE.getInterface());
+ }
+ return super.getImage(element);
+ }
+
+ /**
+ * Gets the text.
+ *
+ * @param element
+ * the element
+ * @return the text
+ * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ if(element instanceof NewElementRepresentation) {
+ return ((NewElementRepresentation)element).getName();
+ }
+ return super.getText(element);
+ }
+
+ }
+
+ /**
+ *
+ * This content provider is used in this dialog. It returns the available element in the model + the future element which are
+ * {@link NewElementRepresentation}
+ *
+ *
+ */
+ public class CustomContentProvider implements ITreeContentProvider {
+
+ /**
+ * Dispose.
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ }
+
+ /**
+ * Input changed.
+ *
+ * @param viewer
+ * the viewer
+ * @param oldInput
+ * the old input
+ * @param newInput
+ * the new input
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ /**
+ * Gets the elements.
+ *
+ * @param inputElement
+ * the input element
+ * @return the elements
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List<?>) {
+ return ((List<?>)inputElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ /**
+ * Gets the children.
+ *
+ * @param parentElement
+ * the parent element
+ * @return the children
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ List<Object> children = new ArrayList<Object>();
+ List<?> tmp = null;
+ if(parentElement instanceof Package) {
+ tmp = ((Package)parentElement).getOwnedMembers();
+ } else if(parentElement instanceof Classifier) {
+ tmp = ((Classifier)parentElement).getOwnedMembers();
+ }
+ if(tmp != null) {
+ for(Object current : tmp) {
+ if(current instanceof Classifier || current instanceof Package) {
+ children.add(current);
+ }
+ }
+ }
+ // we add the future Interfaces to this selection
+ for(NewElementRepresentation current : interfaceRepresentations) {
+ if(current.getParent() == parentElement) {
+ children.add(current);
+ }
+ }
+ return children.toArray();
+ }
+
+ /**
+ * Gets the parent.
+ *
+ * @param element
+ * the element
+ * @return the parent
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ @Override
+ public Object getParent(Object element) {
+ if(element == model) {
+ return model;
+ } else if(element instanceof NamedElement) {
+ return ((NamedElement)element).eContainer();
+ }
+ return null;
+ }
+
+ /**
+ * Checks for children.
+ *
+ * @param element
+ * the element
+ * @return true, if successful
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length != 0;
+ }
+
+ }
+
+ /**
+ * This command is used to create a New Usage, when its target (an Interface) doesn't exist when the command is created
+ * (but this Interface will exist when the command will be executed).
+ */
+ public class CreateUsageCommand extends AbstractTransactionalCommand {
+
+ /** The container for the new Usage. */
+ private EObject container;
+
+ /** the source of this Usage. */
+ private EObject source;
+
+ /** the target : the representation of the new interface. */
+ private NewElementRepresentation target;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param domain
+ * the domain
+ * @param container
+ * the container for the Usage
+ * @param source
+ * the source for the Usage
+ * @param target
+ * the target for the Usage
+ * @param affectedFiles
+ * the affected files
+ */
+ public CreateUsageCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
+ super(domain, "Create Usage Command", affectedFiles); //$NON-NLS-1$
+ this.container = container;
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * Do execute with result.
+ *
+ * @param monitor
+ * the monitor
+ * @param info
+ * the info
+ * @return the command result
+ * @throws ExecutionException
+ * the execution exception
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.Usage"));
+ Command command = getCommand(request);
+ if(command.canExecute()) {
+ command.execute();
+ }
+ return CommandResult.newOKCommandResult(request.getNewElement());
+ }
+
+ }
+
+ /**
+ * This command is used to create a New InterfaceRealition, when its target (an Interface) doesn't exist when the command is created
+ * (but this Interface will exist when the command will be executed).
+ */
+ public class CreateInterfaceRealizationCommand extends AbstractTransactionalCommand {
+
+ /** The container for the new InterfaceRealization. */
+ private EObject container;
+
+ /** The source for the new InterfaceRealization. */
+ private EObject source;
+
+ /** the target : the representation of the new interface. */
+ private NewElementRepresentation target;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param domain
+ * the domain
+ * @param container
+ * the container for the InterfaceRealization
+ * @param source
+ * the source for the InterfaceRealization
+ * @param target
+ * the target for the InterfaceRealization
+ * @param affectedFiles
+ * the affected files
+ */
+ public CreateInterfaceRealizationCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
+ super(domain, "Create InterfaceRealization Command", affectedFiles); //$NON-NLS-1$
+ this.container = container;
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * Do execute with result.
+ *
+ * @param monitor
+ * the monitor
+ * @param info
+ * the info
+ * @return the command result
+ * @throws ExecutionException
+ * the execution exception
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.InterfaceRealization"));
+ Command command = getCommand(request);
+ if(command.canExecute()) {
+ command.execute();
+ }
+ return CommandResult.newOKCommandResult(request.getNewElement());
+ }
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/NewElementRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/NewElementRepresentation.java
index 5befe27..4371796 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/NewElementRepresentation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/NewElementRepresentation.java
@@ -1,172 +1,173 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 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:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.composite.custom.ui;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * This class provides facilities to represent a New Element before its real creation.
- * We can store in this class :
- * <ul>
- * <li>the name of the new element</li>
- * <li>the parent of the new element</li>
- * <li>the {@link IHintedType} of the new element</li>
- * <li>the request to build the new element (optional)</li>
- * <li>the element itself when it has been created</li>
- * </ul>
- *
- *
- *
- */
-public class NewElementRepresentation {
-
- /** the name of the new element */
- private String name;
-
- /** the parent of the new element */
- private Object parent;
-
- /** the created element itself */
- private EObject createdElement;
-
- /** the {@link IHintedType} of the new element */
- private IHintedType hintedType;
-
- /** this field is used only when the element have an existing parent */
- private CreateElementRequest request;
-
- /**
- *
- * Constructor.
- *
- * @param name
- * the name of the new element
- * @param parent
- * the parent of the new element
- * @param hintedType
- * the hinted type of the new element
- * @param request
- * the request to build the new element (can be <code>null</code>)
- */
- public NewElementRepresentation(String name, Object parent, IHintedType hintedType, CreateElementRequest request) {
- this.name = name;
- this.parent = parent;
- this.createdElement = null;
- this.hintedType = hintedType;
- this.request = request;
- }
-
- /**
- * Getter for {@link #hintedType}
- *
- * @return
- * {@link #hintedType}
- */
- public IHintedType getHintedType() {
- return this.hintedType;
- }
-
- /**
- * Getter for {@link #name}
- *
- * @return
- * {@link #name}
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Getter for {@link #parent}
- *
- * @return
- * {@link #parent}
- */
- public Object getParent() {
- return this.parent;
- }
-
- /**
- * Returns the parent of this element
- *
- * @return
- * the parent of this element or <code>null</code> if the parent is a {@link NewElementRepresentation} itself and if it has not been
- * created
- */
- public EObject getEObjectParent() {
- if(parent instanceof EObject) {
- return (EObject)this.parent;
- } else if(parent instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)parent).getEObject();
- }
- return null;
- }
-
- /**
- * Returns the created object
- *
- * @return
- * the created Object or <code>null</code> if the object has not been created
- */
- public EObject getEObject() {
- if(this.request != null) {
- return this.request.getNewElement();
- }
- return this.createdElement;
- }
-
- /**
- * Setter for {@link #createdElement}
- *
- * @param newElement
- *
- */
- public void setCreateElement(EObject newElement) {
- this.createdElement = newElement;
- }
-
- /**
- * Setter for {@link #request}
- *
- * @return
- * {@link #request}
- */
- public CreateElementRequest getCreateElementRequest() {
- return this.request;
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- @Override
- public String toString() {
- return "Name : " + this.name + ", parent : " + this.parent;
- }
-
- public String getQualifiedName() {
- String qualifiedName = "";
- if(parent instanceof NewElementRepresentation) {
- qualifiedName = ((NewElementRepresentation)parent).getQualifiedName();
- } else if(parent instanceof NamedElement) {
- qualifiedName = ((NamedElement)parent).getQualifiedName() + "::" + this.name;
- }
- return qualifiedName;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 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:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * This class provides facilities to represent a New Element before its real creation.
+ * We can store in this class :
+ * <ul>
+ * <li>the name of the new element</li>
+ * <li>the parent of the new element</li>
+ * <li>the {@link IHintedType} of the new element</li>
+ * <li>the request to build the new element (optional)</li>
+ * <li>the element itself when it has been created</li>
+ * </ul>
+ *
+ *
+ *
+ */
+public class NewElementRepresentation {
+
+ /** the name of the new element */
+ private String name;
+
+ /** the parent of the new element */
+ private Object parent;
+
+ /** the created element itself */
+ private EObject createdElement;
+
+ /** the {@link IHintedType} of the new element */
+ private IElementType hintedType;
+
+ /** this field is used only when the element have an existing parent */
+ private CreateElementRequest request;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param name
+ * the name of the new element
+ * @param parent
+ * the parent of the new element
+ * @param hintedType
+ * the hinted type of the new element
+ * @param request
+ * the request to build the new element (can be <code>null</code>)
+ */
+ public NewElementRepresentation(String name, Object parent, IElementType hintedType, CreateElementRequest request) {
+ this.name = name;
+ this.parent = parent;
+ this.createdElement = null;
+ this.hintedType = hintedType;
+ this.request = request;
+ }
+
+ /**
+ * Getter for {@link #hintedType}
+ *
+ * @return
+ * {@link #hintedType}
+ */
+ public IElementType getHintedType() {
+ return this.hintedType;
+ }
+
+ /**
+ * Getter for {@link #name}
+ *
+ * @return
+ * {@link #name}
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Getter for {@link #parent}
+ *
+ * @return
+ * {@link #parent}
+ */
+ public Object getParent() {
+ return this.parent;
+ }
+
+ /**
+ * Returns the parent of this element
+ *
+ * @return
+ * the parent of this element or <code>null</code> if the parent is a {@link NewElementRepresentation} itself and if it has not been
+ * created
+ */
+ public EObject getEObjectParent() {
+ if(parent instanceof EObject) {
+ return (EObject)this.parent;
+ } else if(parent instanceof NewElementRepresentation) {
+ return ((NewElementRepresentation)parent).getEObject();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the created object
+ *
+ * @return
+ * the created Object or <code>null</code> if the object has not been created
+ */
+ public EObject getEObject() {
+ if(this.request != null) {
+ return this.request.getNewElement();
+ }
+ return this.createdElement;
+ }
+
+ /**
+ * Setter for {@link #createdElement}
+ *
+ * @param newElement
+ *
+ */
+ public void setCreateElement(EObject newElement) {
+ this.createdElement = newElement;
+ }
+
+ /**
+ * Setter for {@link #request}
+ *
+ * @return
+ * {@link #request}
+ */
+ public CreateElementRequest getCreateElementRequest() {
+ return this.request;
+ }
+
+ /**
+ *
+ * @see java.lang.Object#toString()
+ *
+ * @return
+ */
+ @Override
+ public String toString() {
+ return "Name : " + this.name + ", parent : " + this.parent;
+ }
+
+ public String getQualifiedName() {
+ String qualifiedName = "";
+ if(parent instanceof NewElementRepresentation) {
+ qualifiedName = ((NewElementRepresentation)parent).getQualifiedName();
+ } else if(parent instanceof NamedElement) {
+ qualifiedName = ((NamedElement)parent).getQualifiedName() + "::" + this.name;
+ }
+ return qualifiedName;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/SelectionEditorWrapper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/SelectionEditorWrapper.java
new file mode 100644
index 0000000..8b04a1a
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/SelectionEditorWrapper.java
@@ -0,0 +1,180 @@
+/*****************************************************************************
+ * Copyright (c) 2014 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:
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.papyrus.infra.widgets.editors.SelectionEditor;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+
+
+/**
+ * Wrapper for both selection editor.
+ * <ul>
+ * <li>SelectionEditor</li>
+ * <li>ExtendedSelectionEditor</li>
+ * </ul>
+ *
+ * @author Gabriel Pascual (ALL4TEC)
+ *
+ */
+public class SelectionEditorWrapper implements SelectionListener {
+
+ /** The wrapped selection editor. */
+ private SelectionListener wrappedSelectionEditor = null;
+
+ /** The wrapped editor class. */
+ private Class<?> wrappedEditorClass = null;
+
+ /**
+ * Instantiates a new selection editor wrapper.
+ *
+ * @param selectionEditor
+ * the selection editor
+ * @param editorClass
+ * the editor class
+ */
+ public SelectionEditorWrapper(SelectionListener selectionEditor, Class<?> editorClass) {
+ wrappedSelectionEditor = selectionEditor;
+ wrappedEditorClass = editorClass;
+ }
+
+ /**
+ * Creates the.
+ */
+ public void create() {
+ if(SelectionEditor.class.equals(wrappedEditorClass)) {
+ ((SelectionEditor)wrappedSelectionEditor).create();
+ } else if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ ((ExtendedSelectionEditor)wrappedSelectionEditor).create();
+ }
+
+ }
+
+ /**
+ * Sets the layout data.
+ *
+ * @param layoutData
+ * the new layout data
+ */
+ public void setLayoutData(Object layoutData) {
+ if(SelectionEditor.class.equals(wrappedEditorClass)) {
+ ((SelectionEditor)wrappedSelectionEditor).setLayoutData(layoutData);
+ } else if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ ((ExtendedSelectionEditor)wrappedSelectionEditor).setLayoutData(layoutData);
+ }
+
+ }
+
+ /**
+ * Gets the selected elements.
+ *
+ * @return the selected elements
+ */
+ public Collection<?> getSelectedElements() {
+
+ Collection<?> selectedElements = null;
+ if(SelectionEditor.class.equals(wrappedEditorClass)) {
+ selectedElements = ((SelectionEditor)wrappedSelectionEditor).getSelectedElements();
+ } else if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ selectedElements = ((ExtendedSelectionEditor)wrappedSelectionEditor).getSelectedElements();
+ }
+
+ return selectedElements;
+ }
+
+ /**
+ * Gets the element to remove.
+ *
+ * @return the element to remove
+ */
+ public List<Object> getElementToRemove() {
+ List<Object> elementsToRemove = null;
+ if(SelectionEditor.class.equals(wrappedEditorClass)) {
+ elementsToRemove = ((SelectionEditor)wrappedSelectionEditor).getElementToRemove();
+ } else if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ elementsToRemove = ((ExtendedSelectionEditor)wrappedSelectionEditor).getElementToRemove();
+ } else {
+ elementsToRemove = new ArrayList<Object>();
+ }
+
+ return elementsToRemove;
+ }
+
+ /**
+ * Gets the element to add.
+ *
+ * @return the element to add
+ */
+ public List<Object> getElementToAdd() {
+ List<Object> elementsToAdd = null;
+ if(SelectionEditor.class.equals(wrappedEditorClass)) {
+ elementsToAdd = ((SelectionEditor)wrappedSelectionEditor).getElementToAdd();
+ } else if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ elementsToAdd = ((ExtendedSelectionEditor)wrappedSelectionEditor).getElementToAdd();
+ } else {
+ elementsToAdd = new ArrayList<Object>();
+ }
+
+ return elementsToAdd;
+ }
+
+ /**
+ * Gets the selection.
+ *
+ * @return the selection
+ */
+ public ISelection getSelection() {
+ if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ return ((ExtendedSelectionEditor)wrappedSelectionEditor).getSelectedElementsViewer().getSelection();
+ }
+ return null;
+ }
+
+ /**
+ * Refresh.
+ */
+ public void refresh() {
+ if(ExtendedSelectionEditor.class.equals(wrappedEditorClass)) {
+ ((ExtendedSelectionEditor)wrappedSelectionEditor).getSelectedElementsViewer().refresh();
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ *
+ * @param e
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ wrappedSelectionEditor.widgetSelected(e);
+
+ }
+
+ /**
+ * Widget default selected.
+ *
+ * @param e
+ * the e
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ wrappedSelectionEditor.widgetDefaultSelected(e);
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ComponentManageInterfacesHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ComponentManageInterfacesHandler.java
new file mode 100644
index 0000000..845ae66
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ComponentManageInterfacesHandler.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Gabriel Pascual (ALL4TEc) gabriel.pascual@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.component.custom.actions;
+
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.papyrus.uml.diagram.common.actions.handlers.ManagePortInterfacesHandler;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.IPortInterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.component.custom.ui.ComponentInterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.component.edit.parts.PortEditPart;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Port;
+
+/**
+ * This handler provides the action to manage the provided and required {@link Interface} for a {@link Port}.
+ */
+public class ComponentManageInterfacesHandler extends ManagePortInterfacesHandler {
+
+ public ComponentManageInterfacesHandler() {
+ super();
+ }
+
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.actions.handlers.ManagePortInterfacesHandler#getInterfaceManagerDialog(org.eclipse.uml2.uml.Port)
+ *
+ * @param port
+ * @return
+ */
+ @Override
+ public IPortInterfaceManagerDialog getInterfaceManagerDialog(Port port) {
+ return new ComponentInterfaceManagerDialog(DisplayUtils.getDefaultShell(), (PortEditPart)getPortEditPart());
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java
deleted file mode 100644
index 9c9e9c5..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/actions/ManageProvidedInterfacesHandler.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.actions;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-import org.eclipse.papyrus.uml.diagram.component.custom.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.component.custom.ui.DisplayInterfaceMDialog;
-import org.eclipse.papyrus.uml.diagram.component.custom.ui.InterfaceManagerDialog;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This handler provides the action to manage the provided and required {@link Interface} for a {@link Port}.
- */
-public class ManageProvidedInterfacesHandler extends AbstractHandler {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection.isEmpty()) {
- return null;
- }
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- if (structuredSelection.getFirstElement() instanceof PortEditPart) {
- EObject selectedElement = EMFHelper.getEObject(structuredSelection.getFirstElement());
- if (selectedElement instanceof Port) {
- Port port = (Port) selectedElement;
- ManageProvidedInterfaceAction action = new ManageProvidedInterfaceAction(port, (EditPart) structuredSelection.getFirstElement());
- try {
- ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(port).getCommandStack().execute(new GEFtoEMFCommandWrapper(action.getCommand()));
- } catch (ServiceException ex) {
- throw new ExecutionException("An unexpected exception occurred", ex);
- }
- }
- }
- }
- return null;
- }
-
- /**
- * This class provides the action to manage the provided and required interfaces.
- */
- public class ManageProvidedInterfaceAction {
- /** the {@link Type} of the port. */
- private Type type;
- private EditPart portEditPart;
-
- /**
- *
- * Constructor.
- *
- * @param port
- * the semantic port
- *
- * @param aportEditpart
- * the editpart of the port
- */
- public ManageProvidedInterfaceAction(Port port, EditPart aportEditpart) {
- this.type = port.getType();
- this.portEditPart = aportEditpart;
- }
-
- /**
- * Returns the command to add/remove provided/required interfaces.
- *
- * @return the command
- * the command to add/remove provided/required interfaces
- */
- public Command getCommand() {
- if (type != null && !(type instanceof Classifier)) {
- return UnexecutableCommand.INSTANCE;
- } else if (type == null) {
- MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(), Messages.InterfaceManagerDialog_Title, null, Messages.ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined, MessageDialog.WARNING,
- new String[] { Messages.ManageProvidedInterfacesHandler_OK }, 0);
- dialog.open();
- } else {
- InterfaceManagerDialog dialog = new DisplayInterfaceMDialog(DisplayUtils.getDefaultShell(), (PortEditPart) portEditPart);
- if (dialog.open() == Dialog.OK) {
- return dialog.getCommand();
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java
index 76cf791..58e763e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/command/CreateLollipopPortCommand.java
@@ -9,16 +9,19 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) - Initial API and implementation
+ * Gabriel Pascual (ALL4TEC) - Initial API and implementation
/*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.component.custom.command;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPart;
@@ -31,17 +34,20 @@ import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.NotationFactory;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.NewElementRepresentation;
import org.eclipse.papyrus.uml.diagram.component.edit.parts.PortEditPart;
import org.eclipse.papyrus.uml.diagram.component.providers.UMLViewProvider;
-import org.eclipse.uml2.uml.Interface;
/**
* this class is used to create the lollipop interface from a port
*
*/
public class CreateLollipopPortCommand extends RecordingCommand {
- protected ArrayList<Interface> providedInterface = new ArrayList<Interface>();
- protected ArrayList<Interface> requiredInterface = new ArrayList<Interface>();
+
+ protected List<Object> providedInterface = new ArrayList<Object>();
+
+ protected List<Object> requiredInterface = new ArrayList<Object>();
+
protected PortEditPart porteditPart = null;
/**
@@ -49,15 +55,15 @@ public class CreateLollipopPortCommand extends RecordingCommand {
* Constructor.
*
* @param domain
- * the transactional editing domain
+ * the transactional editing domain
* @param provided
- * a list of provided interface to display
+ * a list of provided interface to display
* @param required
- * a list of required interface to display
+ * a list of required interface to display
* @param portEditpart
- * the port editpart form which interfaces will be displayed
+ * the port editpart form which interfaces will be displayed
*/
- public CreateLollipopPortCommand(TransactionalEditingDomain domain, Collection<Interface> provided, Collection<Interface> required, PortEditPart portEditpart) {
+ public CreateLollipopPortCommand(TransactionalEditingDomain domain, Collection<Object> provided, Collection<Object> required, PortEditPart portEditpart) {
super(domain, "Creation of lollipop for ports");
providedInterface.addAll(provided);
requiredInterface.addAll(required);
@@ -68,21 +74,39 @@ public class CreateLollipopPortCommand extends RecordingCommand {
protected void doExecute() {
UMLViewProvider umlViewProvider = new UMLViewProvider();
// get the position of the port around its container...
- IFigure parentFigure = ((GraphicalEditPart) porteditPart.getParent()).getFigure();
+ IFigure parentFigure = ((GraphicalEditPart)porteditPart.getParent()).getFigure();
Rectangle bounds = parentFigure.getBounds();
Rectangle insideRect = bounds.getCopy().shrink(new Insets(30));
int position = insideRect.getPosition(porteditPart.getLocation());
// take the great parent of the port
EditPart componentEditPart = porteditPart.getParent();
EditPart container = componentEditPart.getParent();
- for (Interface currentRequired : requiredInterface) {
- Node node = createInterfacenode(umlViewProvider, container, currentRequired);
+ for(Object currentRequired : requiredInterface) {
+
+
+ EObject interfaceRequired = null;
+ if(currentRequired instanceof NewElementRepresentation) {
+ interfaceRequired = ((NewElementRepresentation)currentRequired).getEObject();
+ } else {
+ interfaceRequired = (EObject)currentRequired;
+ }
+
+ Node node = createInterfacenode(umlViewProvider, container, interfaceRequired);
setPositionNode(node, position);
String kind = "REQUIRED";
createEdge(umlViewProvider, node, kind);
}
- for (Interface currentprovided : providedInterface) {
- Node node = createInterfacenode(umlViewProvider, container, currentprovided);
+ for(Object currentprovided : providedInterface) {
+
+
+ EObject interfaceProvided = null;
+ if(currentprovided instanceof NewElementRepresentation) {
+ interfaceProvided = ((NewElementRepresentation)currentprovided).getEObject();
+ } else {
+ interfaceProvided = (EObject)currentprovided;
+ }
+
+ Node node = createInterfacenode(umlViewProvider, container, interfaceProvided);
setPositionNode(node, position);
String kind = "PROVIDED";
createEdge(umlViewProvider, node, kind);
@@ -94,20 +118,20 @@ public class CreateLollipopPortCommand extends RecordingCommand {
*
* @param umlViewProvider
* @param node
- * the node that represent the interface
+ * the node that represent the interface
* @param kind
- * kind of the interface REQUIRED or PROVIDED
+ * kind of the interface REQUIRED or PROVIDED
*/
protected void createEdge(UMLViewProvider umlViewProvider, Node node, String kind) {
- Edge edge = umlViewProvider.createLink_4018(((View) porteditPart.getModel()).getDiagram(), -1, true, porteditPart.getDiagramPreferencesHint());
+ Edge edge = umlViewProvider.createLink_4018(((View)porteditPart.getModel()).getDiagram(), -1, true, porteditPart.getDiagramPreferencesHint());
IdentityAnchor anchor = NotationFactory.eINSTANCE.createIdentityAnchor();
edge.setSourceAnchor(anchor);
anchor = NotationFactory.eINSTANCE.createIdentityAnchor();
edge.setTargetAnchor(anchor);
- edge.setSource((View) porteditPart.getModel());
+ edge.setSource((View)porteditPart.getModel());
edge.setTarget(node);
edge.setElement(null);
- EObjectValueStyle eObjectValueStyle = (EObjectValueStyle) edge.createStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
+ EObjectValueStyle eObjectValueStyle = (EObjectValueStyle)edge.createStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
eObjectValueStyle.setName(kind);
}
@@ -116,15 +140,15 @@ public class CreateLollipopPortCommand extends RecordingCommand {
*
* @param umlViewProvider
* @param container
- * the container of the interface node
+ * the container of the interface node
* @param currentInterface
- * the interface
+ * the interface
* @return the node
*/
- protected Node createInterfacenode(UMLViewProvider umlViewProvider, EditPart container, Interface currentInterface) {
- Node node = umlViewProvider.createInterface_2003(currentInterface, (View) container.getModel(), -1, true, porteditPart.getDiagramPreferencesHint());
- ((Bounds) node.getLayoutConstraint()).setWidth(20);
- ((Bounds) node.getLayoutConstraint()).setHeight(20);
+ protected Node createInterfacenode(UMLViewProvider umlViewProvider, EditPart container, EObject currentInterface) {
+ Node node = umlViewProvider.createInterface_2003(currentInterface, (View)container.getModel(), -1, true, porteditPart.getDiagramPreferencesHint());
+ ((Bounds)node.getLayoutConstraint()).setWidth(20);
+ ((Bounds)node.getLayoutConstraint()).setHeight(20);
return node;
}
@@ -132,25 +156,22 @@ public class CreateLollipopPortCommand extends RecordingCommand {
* use to place the interface node around the component form the port
*
* @param node
- * the interface node
+ * the interface node
* @param position
- * the position where is the port NORTH SOUTH, EAST, WEST
+ * the position where is the port NORTH SOUTH, EAST, WEST
*/
protected void setPositionNode(Node node, int position) {
- ((Bounds) node.getLayoutConstraint()).setX(porteditPart.getLocation().x);
- ((Bounds) node.getLayoutConstraint()).setY(porteditPart.getLocation().y);
+ ((Bounds)node.getLayoutConstraint()).setX(porteditPart.getLocation().x);
+ ((Bounds)node.getLayoutConstraint()).setY(porteditPart.getLocation().y);
int distance = 60;
- if (position == PositionConstants.SOUTH) {
- ((Bounds) node.getLayoutConstraint()).setY(((Bounds) node.getLayoutConstraint()).getY() + distance);
- }
- else if (position == PositionConstants.NORTH) {
- ((Bounds) node.getLayoutConstraint()).setY(((Bounds) node.getLayoutConstraint()).getY() - distance);
- }
- else if (position == PositionConstants.EAST) {
- ((Bounds) node.getLayoutConstraint()).setX(((Bounds) node.getLayoutConstraint()).getX() + distance);
- }
- else if (position == PositionConstants.WEST) {
- ((Bounds) node.getLayoutConstraint()).setX(((Bounds) node.getLayoutConstraint()).getX() - distance);
+ if(position == PositionConstants.SOUTH) {
+ ((Bounds)node.getLayoutConstraint()).setY(((Bounds)node.getLayoutConstraint()).getY() + distance);
+ } else if(position == PositionConstants.NORTH) {
+ ((Bounds)node.getLayoutConstraint()).setY(((Bounds)node.getLayoutConstraint()).getY() - distance);
+ } else if(position == PositionConstants.EAST) {
+ ((Bounds)node.getLayoutConstraint()).setX(((Bounds)node.getLayoutConstraint()).getX() + distance);
+ } else if(position == PositionConstants.WEST) {
+ ((Bounds)node.getLayoutConstraint()).setX(((Bounds)node.getLayoutConstraint()).getX() - distance);
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/Messages.java
index 81dae95..34a8479 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/Messages.java
@@ -1,82 +1,43 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class Messages.
- */
-public class Messages extends NLS {
-
- /** The Constant BUNDLE_NAME. */
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.component.custom.messages.messages"; //$NON-NLS-1$
-
-
- /** The Create uml element dialog_ new_ element_ name. */
- public static String CreateUmlElementDialog_New_Element_Name;
-
- /** The Selection validated. */
- public static String SelectionValidated;
-
- /** The Show hide related contents action_ message. */
- public static String ShowHideRelatedContentsAction_Message;
-
- /** The Show hide related contents action_ title. */
- public static String ShowHideRelatedContentsAction_Title;
-
- /** The Interface manager dialog_ create a new interface. */
- public static String InterfaceManagerDialog_CreateANewInterface;
-
- /** The Interface manager dialog_ create new interface. */
- public static String InterfaceManagerDialog_CreateNewInterface;
-
- /** The Interface manager dialog_ selected the provided interfaces. */
- public static String InterfaceManagerDialog_SelectedTheProvidedInterfaces;
-
- /** The Interface manager dialog_ selection has to be a package or a classifier. */
- public static String InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier;
-
- /** The Interface manager dialog_ select the parent of this new interface. */
- public static String InterfaceManagerDialog_SelectTheParentOfThisNewInterface;
-
- /** The Interface manager dialog_ select the required interfaces. */
- public static String InterfaceManagerDialog_SelectTheRequiredInterfaces;
-
- /** The Interface manager dialog_ the port is typed with an interface warning message. */
- public static String InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage;
-
- /** The Interface manager dialog_ title. */
- public static String InterfaceManagerDialog_Title;
-
- /** The Manage provided interfaces handler_ ok. */
- public static String ManageProvidedInterfacesHandler_OK;
-
- /** The Manage provided interfaces handler_ the type of the port is not defined. */
- public static String ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined;
-
- /** The No selection found. */
- public static String NoSelectionFound;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * Instantiates a new messages.
- */
- private Messages() {
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Amine EL KOUHEN (CEA LIST/INRIA DaRT) amine.el_kouhen@inria.fr
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.component.custom.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Messages.
+ */
+public class Messages extends NLS {
+
+ /** The Constant BUNDLE_NAME. */
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.component.custom.messages.messages"; //$NON-NLS-1$
+
+ /** The Show hide related contents action_ message. */
+ public static String ShowHideRelatedContentsAction_Message;
+
+ /** The Show hide related contents action_ title. */
+ public static String ShowHideRelatedContentsAction_Title;
+
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * Instantiates a new messages.
+ */
+ private Messages() {
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/messages.properties
index 3093958..6542cfe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/messages/messages.properties
@@ -1,26 +1,13 @@
-###############################################################################
-# Copyright (c) 2011 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:
-# Amine EL KOUHEN (CEA LIST) amine.el_kouhen@cea.fr
-###############################################################################
-CreateUmlElementDialog_New_Element_Name=New Element Name
-SelectionValidated=Selection validated.
-ShowHideRelatedContentsAction_Message=Choose the elements to show
-ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
-InterfaceManagerDialog_CreateANewInterface=Create a new Interface
-InterfaceManagerDialog_CreateNewInterface=Create new Interface
-InterfaceManagerDialog_SelectedTheProvidedInterfaces=Select the provided Interfaces
-InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier=Selection has to be a Package or a Classifier
-InterfaceManagerDialog_SelectTheParentOfThisNewInterface=Select the parent of this new Interface
-InterfaceManagerDialog_SelectTheRequiredInterfaces=Select the required Interfaces
-InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage=\nThe managed port is typed with an Interface, so this interface is not available as a provided Interface.\n
-InterfaceManagerDialog_Title=Select the provided and the required Interfaces
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port is not defined. You need to define it before managing its Interfaces.
-NoSelectionFound=No selection found. \ No newline at end of file
+###############################################################################
+# Copyright (c) 2011 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:
+# Amine EL KOUHEN (CEA LIST) amine.el_kouhen@cea.fr
+###############################################################################
+ShowHideRelatedContentsAction_Message=Choose the elements to show
+ShowHideRelatedContentsAction_Title=Show/Hide Related Contents \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ComponentInterfaceManagerDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ComponentInterfaceManagerDialog.java
new file mode 100644
index 0000000..87af5f5
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ComponentInterfaceManagerDialog.java
@@ -0,0 +1,295 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.component.custom.ui;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.EObjectValueStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.ExtendedSelectionEditor;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.NewElementRepresentation;
+import org.eclipse.papyrus.uml.diagram.common.dialogs.SelectionEditorWrapper;
+import org.eclipse.papyrus.uml.diagram.component.custom.command.CreateLollipopPortCommand;
+import org.eclipse.papyrus.uml.diagram.component.edit.parts.PortEditPart;
+import org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Port;
+
+/**
+ * This interface is used to displayed required and provided interfaces
+ *
+ */
+public class ComponentInterfaceManagerDialog extends InterfaceManagerDialog {
+
+ protected HashSet<Object> displayedRequiredInterfacesList = new HashSet<Object>();
+
+ protected HashSet<Object> displayedProvidedInterfacesList = new HashSet<Object>();
+
+ protected PortEditPart portEditPart = null;
+
+ protected HashMap<Interface, GraphicalEditPart> initialList = new HashMap<Interface, GraphicalEditPart>();
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parentShell
+ * @param portEditPart
+ */
+ public ComponentInterfaceManagerDialog(Shell parentShell, PortEditPart portEditPart) {
+ super(parentShell, (Port)portEditPart.resolveSemanticElement());
+ this.portEditPart = portEditPart;
+ setSelectorLabelProvider(new DisplayedSelectorLabelProvider());
+ initDisplayInterfaceList();
+ }
+
+ /**
+ * init the collection to detect displayed interfaces
+ */
+ protected void initDisplayInterfaceList() {
+
+ if((portEditPart.getSourceConnections().size() > 0)) {
+
+ for(Object currentConnection : portEditPart.getSourceConnections()) {
+ ConnectionEditPart connection = (ConnectionEditPart)currentConnection;
+ EObjectValueStyle valueStyle = (EObjectValueStyle)((View)connection.getModel()).getStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
+ if(valueStyle != null) {
+ if(valueStyle.getName().equals("REQUIRED")) {
+ displayedRequiredInterfacesList.add((Interface)((GraphicalEditPart)connection.getTarget()).resolveSemanticElement());
+ } else {
+ displayedProvidedInterfacesList.add((Interface)((GraphicalEditPart)connection.getTarget()).resolveSemanticElement());
+ }
+ initialList.put((Interface)((GraphicalEditPart)connection.getTarget()).resolveSemanticElement(), ((GraphicalEditPart)connection.getTarget()));
+
+ }
+ }
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.dialogs.InterfaceManagerDialog#getCommand()
+ *
+ * @return
+ */
+ @Override
+ public Command getCommand() {
+ CompoundCommand cmd = new CompoundCommand();
+ Command supCmd = super.getCommand();
+ if(supCmd.canExecute()) {
+ cmd.add(super.getCommand());
+ }
+ cmd.add(createDisplayedInterfaceCommand());
+ return cmd;
+ }
+
+ @Override
+ protected void createEditors() {
+ Composite parent = (Composite)getDialogArea();
+ Composite subComposite = new Composite(parent, SWT.NONE);
+
+ subComposite.setLayout(new FormLayout());
+ //createDisplay button
+ Button Displaybutton = new Button(subComposite, SWT.PUSH);
+ Displaybutton.setText("Display seletected Interface");
+ DisplayInterfaceListener displayInterfaceListener = new DisplayInterfaceListener();
+ Displaybutton.addSelectionListener(displayInterfaceListener);
+
+
+ FormData formData = new FormData();
+ formData.left = new FormAttachment(0, 700);
+ Displaybutton.setLayoutData(formData);
+
+ //create Remove
+ Button RemoveDisplaybutton = new Button(subComposite, SWT.PUSH);
+ RemoveDisplaybutton.setText(" Do not Display selected Interface");
+ RemoveDisplayInterfaceListener removeDisplayInterfaceListener = new RemoveDisplayInterfaceListener();
+ RemoveDisplaybutton.addSelectionListener(removeDisplayInterfaceListener);
+
+ formData = new FormData();
+ formData.left = new FormAttachment(0, 500);
+ RemoveDisplaybutton.setLayoutData(formData);
+
+ super.createEditors();
+ }
+
+ /**
+ *
+ * @return the command that will be used to display interfaces
+ */
+ protected Command createDisplayedInterfaceCommand() {
+ // Update list from initial List
+ HashMap<Object, GraphicalEditPart> viewToRemove = new HashMap<Object, GraphicalEditPart>();
+ HashSet<Object> requiredInterfaceToDisplay = new HashSet<Object>();
+ HashSet<Object> providedInterfaceToDisplay = new HashSet<Object>();
+ // create the list of provided interface to display
+ for(Object currentInterface : displayedProvidedInterfacesList) {
+ if(!initialList.keySet().contains(currentInterface)) {
+ providedInterfaceToDisplay.add(currentInterface);
+ }
+ }
+ // create the list of required interface to display
+ for(Object currentInterface : displayedRequiredInterfacesList) {
+ if(!initialList.keySet().contains(currentInterface)) {
+ requiredInterfaceToDisplay.add(currentInterface);
+ }
+ }
+ // create the list of interface to not display
+ for(Interface currentInterface : initialList.keySet()) {
+ if((!displayedRequiredInterfacesList.contains(currentInterface)) && (!displayedProvidedInterfacesList.contains(currentInterface))) {
+ viewToRemove.put(currentInterface, initialList.get(currentInterface));
+ }
+ }
+
+ CompoundCommand cmd = new CompoundCommand();
+ CreateLollipopPortCommand comd = new CreateLollipopPortCommand(this.portEditPart.getEditingDomain(), providedInterfaceToDisplay, requiredInterfaceToDisplay, this.portEditPart);
+ cmd.add(new org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper(comd));
+ if(viewToRemove.values().size() > 0) {
+ cmd.add(deleteDisplayInterface(viewToRemove.values()));
+ }
+ return cmd;
+ }
+
+ @Override
+ protected SelectionEditorWrapper createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
+ ExtendedSelectionEditor editor = new ExtendedSelectionEditor(parent, selector, getSelectorLabelProvider(), initialSelection);
+ editor.setMessage(message);
+ editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
+ return new SelectionEditorWrapper(editor, editor.getClass());
+ }
+
+ /**
+ * @param editPartToRemove
+ * list of editpart that represents displayed interfaces, never null
+ * @return the command of interface representation to remove, never null
+ */
+ protected Command deleteDisplayInterface(Collection<GraphicalEditPart> editPartToRemove) {
+ CompoundCommand cmd = new CompoundCommand();
+ Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
+
+
+ for(GraphicalEditPart editPart : editPartToRemove) {
+ cmd.add(editPart.getCommand(deleteViewRequest));
+ }
+
+ return cmd;
+ }
+
+ /**
+ * inner to class attached to a button to display interfaces
+ *
+ */
+ class DisplayInterfaceListener extends SelectionAdapter {
+
+ public void widgetSelected(SelectionEvent event) {
+ IStructuredSelection selection = (IStructuredSelection)getProvidedEditor().getSelection();
+ for(Object o : selection.toArray()) {
+
+ displayedProvidedInterfacesList.add(o);
+ }
+
+
+ selection = (IStructuredSelection)getRequiredEditor().getSelection();
+ for(Object o : selection.toArray()) {
+ displayedRequiredInterfacesList.add(o);
+ }
+ getProvidedEditor().refresh();
+ getRequiredEditor().refresh();
+ }
+
+ }
+
+ /**
+ * inner to class attached to a button to remove displayed interfaces
+ *
+ */
+ class RemoveDisplayInterfaceListener extends SelectionAdapter {
+
+ public void widgetSelected(SelectionEvent event) {
+
+ // Handle provided interfaces selection
+ IStructuredSelection structuredSelection = (IStructuredSelection)getProvidedEditor().getSelection();
+ for(Object selection : structuredSelection.toArray()) {
+ displayedProvidedInterfacesList.remove(selection);
+ }
+
+ // Handle required interfaces selection
+ structuredSelection = (IStructuredSelection)getRequiredEditor().getSelection();
+ for(Object o : structuredSelection.toArray()) {
+
+ displayedRequiredInterfacesList.remove(o);
+ }
+
+ // Refresh both list
+ getProvidedEditor().refresh();
+ getRequiredEditor().refresh();
+ }
+
+ }
+
+
+ /**
+ *
+ * This class provides a CustomLabelProvider for this dialog.
+ * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
+ *
+ *
+ */
+ public class DisplayedSelectorLabelProvider extends SelectorLabelProvider {
+
+ private static final String ICONS_OBJ16_LOLLIPOP_GIF = "icons/obj16/lollipop.gif"; //$NON-NLS-1$
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.component.custom.ui.InterfaceManagerDialog.CreateElementLabelProvider#getImage(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ public Image getImage(Object element) {
+
+ if(displayedRequiredInterfacesList.contains(element) || displayedProvidedInterfacesList.contains(element)) {
+ return org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage(UMLDiagramEditorPlugin.ID, ICONS_OBJ16_LOLLIPOP_GIF);
+ }
+ return super.getImage(element);
+ }
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/CreateUmlElementDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/CreateUmlElementDialog.java
deleted file mode 100644
index faecb5a..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/CreateUmlElementDialog.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.component.custom.messages.Messages;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-// TODO: Auto-generated Javadoc
-/**
- * This dialog allows to create easily a new element in a UML Model.
- */
-public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
- /** the hinted type of the element to create. */
- private IHintedType hintedType;
- /** the parent container of the element to create. */
- private Object parentContainer;
- /** the type of the element to create. */
- private String type;
- /** the root of the model. */
- private Package pack;
- /** the text field used to display the choose the name of the future element. */
- private Text text;
- /** the editing domain. */
- private TransactionalEditingDomain domain;
- /** The element to create is represented by this field. */
- private NewElementRepresentation elementToCreate;
- /** this Set contains names to exclude from the proposed name. */
- private List<String> forbiddenNames;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent
- * @param domain
- * the domain
- * @param labelProvider
- * the label provider
- * @param contentProvider
- * the content provider
- * @param pack
- * the pack
- * @param hintedType
- * the hinted type
- */
- public CreateUmlElementDialog(Shell parent, TransactionalEditingDomain domain, ILabelProvider labelProvider, ITreeContentProvider contentProvider, Package pack, IHintedType hintedType) {
- super(parent, labelProvider, contentProvider);
- Assert.isNotNull(pack);
- Assert.isNotNull(hintedType);
- this.pack = pack;
- this.hintedType = hintedType;
- this.domain = domain;
- init();
- }
-
- /**
- * Initializes the field {@link #type};.
- */
- protected void init() {
- EClass eClass = hintedType.getEClass();
- this.type = eClass.getName();
- this.parentContainer = null;
- this.forbiddenNames = null;
- }
-
- /**
- * Sets the forbidden names.
- *
- * @param forbiddenNames
- * the new forbidden names
- */
- public void setForbiddenNames(List<String> forbiddenNames) {
- this.forbiddenNames = forbiddenNames;
- }
-
- /**
- * Creates the dialog area.
- *
- * @param parent
- * the parent
- * @return the control
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- GridData data = (GridData) parent.getLayoutData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 1;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- Composite composite = (Composite) super.createDialogArea(parent);
- composite.setLayout(new GridLayout());
- GridData dat = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(dat);
- createNameSection(parent);
- return composite;
- }
-
- /**
- * Creates the name section and put it at the top of the composite.
- *
- * @param parent
- * the composite parent
- */
- protected void createNameSection(Composite parent) {
- Composite nameSection = new Composite(parent, SWT.NONE);
- // the label
- Label label = new Label(nameSection, SWT.NONE);
- label.setText(Messages.CreateUmlElementDialog_New_Element_Name);
- // the text field
- text = new Text(nameSection, SWT.BORDER);
- text.setText(getDefaultName());
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(textData);
- // layout for the nameSection
- GridLayout layout = new GridLayout(2, false);
- GridData data = new GridData(GridData.FILL_BOTH);
- nameSection.setLayout(layout);
- nameSection.setLayoutData(data);
- // we set the name section in first!
- nameSection.moveAbove(null);
- }
-
- /**
- * Returns the default name for the new Element.
- *
- * @return the default name
- * the default name for the new Element
- */
- protected String getDefaultName() {
- boolean existsInterface = false;
- String defaultName;
- int max = 0;
- do {
- List<Interface> allInterface = ElementUtil.getInstancesFilteredByType(pack, Interface.class, null);
- for (Object object : allInterface) {
- String name = NamedElementUtil.getName((NamedElement) object);
- if (name != null && name.startsWith(type)) {
- name = name.substring(type.length());
- Integer val = null;
- try {
- val = Integer.parseInt(name);
- } catch (NumberFormatException e) {
- // Nothing to do
- }
- if (val != null) {
- max = Math.max(Integer.valueOf(val), max);
- existsInterface = true;
- }
- }
- }
- if (existsInterface) {
- defaultName = type + new Integer(max + 1).toString();
- } else {
- defaultName = type + new Integer(max).toString();
- }
- max++;
- } while (!isCorrectName(defaultName));
- return defaultName;
- }
-
- /**
- * Tests if the proposed name is not forbidden.
- *
- * @param name
- * a name
- * @return true, if is correct name <code>true</code> if the proposed name is not forbidden
- */
- protected boolean isCorrectName(String name) {
- if (forbiddenNames == null) {
- return true;
- }
- return !forbiddenNames.contains(name);
- }
-
- /**
- * Returns the command to create the new element which the chosen name.
- *
- * @return the command
- * the command to create the new element which the chosen name
- */
- public Command getCommand() {
- CompositeCommand cmd = new CompositeCommand("Create new element command"); //$NON-NLS-1$
- // request to create the new Interface
- if (elementToCreate.getCreateElementRequest() != null) {
- ICommand command = getCommand(elementToCreate.getCreateElementRequest());
- if (command.canExecute()) {
- cmd.add(command);
- SetNameCommand nameCommand = new SetNameCommand(domain, "Set Name Command", null, null, elementToCreate); //$NON-NLS-1$
- if (nameCommand.canExecute()) {
- cmd.add(nameCommand);
- }
- }
- return new ICommandProxy(cmd);
- } else {
- return new ICommandProxy(new CustomCreateElementCommand(domain, "CustomCreateElementCommand", null, elementToCreate)); //$NON-NLS-1$
- }
- }
-
- /**
- * Compute result.
- *
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- java.util.List<Object> result = new ArrayList<Object>();
- result.add(elementToCreate);
- setResult(result);
- }
-
- /**
- * Set the value to {@link #name} and {@link #parentContainer}.
- *
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
- */
- @Override
- protected void okPressed() {
- ISelection selection = getTreeViewer().getSelection();
- parentContainer = ((IStructuredSelection) selection).getFirstElement();
- CreateElementRequest request = null;
- if (parentContainer instanceof EObject) {
- request = new CreateElementRequest(domain, (EObject) parentContainer, this.hintedType);
- }
- elementToCreate = new NewElementRepresentation(this.text.getText(), parentContainer, hintedType, request);
- super.okPressed();
- }
-
- /**
- * Returns a command corresponding to this request.
- *
- * @param request
- * a request
- * @return the command
- * The command corresponding to this request or an {@link UnexecutableCommand} when the command can not be build
- */
- private ICommand getCommand(IEditCommandRequest request) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(UMLPackage.eINSTANCE.getNamedElement());
- {
- if (provider != null) {
- ICommand cmd = provider.getEditCommand(request);
- if (cmd != null && cmd.canExecute()) {
- return cmd;
- }
- }
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This command is used to set the chosen name to the new element.
- */
- public class SetNameCommand extends AbstractTransactionalCommand {
- /** the representation that will own the new element when it will be created. */
- private NewElementRepresentation representation;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param previousRequest
- * the previous request
- * @param representation
- * the representation
- */
- public SetNameCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, CreateElementRequest previousRequest, NewElementRepresentation representation) {
- super(domain, label, affectedFiles);
- this.representation = representation;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if (representation.getEObject() instanceof NamedElement) {
- NamedElement el = (NamedElement) representation.getEObject();
- el.setName(representation.getName());
- }
- return CommandResult.newOKCommandResult(representation);
- }
- }
-
- /**
- * This command allows to create a new element when its parent is not yet created when the command is build
- *
- * We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
- * executed.
- */
- public class CustomCreateElementCommand extends AbstractTransactionalCommand {
- /** the representation of the element to create. */
- private NewElementRepresentation elementToCreate;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param elementToCreate
- * the element to create
- */
- public CustomCreateElementCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, NewElementRepresentation elementToCreate) {
- super(domain, label, affectedFiles);
- this.elementToCreate = elementToCreate;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- EObject container = elementToCreate.getEObjectParent();
- CreateElementRequest request = new CreateElementRequest(domain, container, hintedType);
- ICommand command = getCommand(request);
- command.execute(new NullProgressMonitor(), null);
- EObject newEl = request.getNewElement();
- if (newEl instanceof NamedElement) {
- ((NamedElement) newEl).setName(elementToCreate.getName());
- }
- elementToCreate.setCreateElement(request.getNewElement());
- return CommandResult.newOKCommandResult(elementToCreate);
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/DisplayInterfaceMDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/DisplayInterfaceMDialog.java
deleted file mode 100644
index 10c6708..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/DisplayInterfaceMDialog.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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:
- * Patrick Tessier (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.ui;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.EObjectValueStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.uml.diagram.component.custom.command.CreateLollipopPortCommand;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.PortEditPart;
-import org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.Port;
-
-/**
- * this interface is used to displayed required and provided interfaces
- *
- */
-public class DisplayInterfaceMDialog extends InterfaceManagerDialog {
-
- protected HashSet<Interface> displayedRequiredInterface=new HashSet<Interface>();
- protected HashSet<Interface> displayedProvidedInterface=new HashSet<Interface>();
- protected PortEditPart portEditPart=null;
- protected HashMap<Interface, GraphicalEditPart> initialList=new HashMap<Interface, GraphicalEditPart>();
-
- /**
- *
- * Constructor.
- *
- * @param parentShell
- * @param portEditPart
- */
- public DisplayInterfaceMDialog(Shell parentShell, PortEditPart portEditPart) {
- super(parentShell, (Port)portEditPart.resolveSemanticElement());
- this.portEditPart=portEditPart;
- this.selectorLabelProvider=new DisplayedSelectorLabelProvider();
- initDisplayInterfaceList();
- }
-
- /**
- * init the collection to detect displayed interfaces
- */
- protected void initDisplayInterfaceList(){
-
- if((portEditPart.getSourceConnections().size()>0) ){
-
- for(Object currentConnection : portEditPart.getSourceConnections()) {
- ConnectionEditPart connection=(ConnectionEditPart) currentConnection;
- EObjectValueStyle valueStyle=(EObjectValueStyle)((View)connection.getModel()).getStyle(NotationPackage.eINSTANCE.getEObjectValueStyle());
- if( valueStyle!=null){
- if(valueStyle.getName().equals("REQUIRED")){
- displayedRequiredInterface.add((Interface)((GraphicalEditPart)connection.getTarget()).resolveSemanticElement());
- }
- else{
- displayedProvidedInterface.add((Interface)((GraphicalEditPart)connection.getTarget()).resolveSemanticElement());
- }
- initialList.put((Interface)((GraphicalEditPart)connection.getTarget()).resolveSemanticElement(),((GraphicalEditPart)connection.getTarget()));
-
- }
- }
- }
-
- }
-
- /**
- * Overload the result in order to display provided and required interfaces
- * @see org.eclipse.papyrus.uml.diagram.component.custom.ui.InterfaceManagerDialog#getCommand()
- *
- */
- @Override
- public Command getCommand() {
- CompoundCommand cmd= new CompoundCommand();
- Command supCmd=super.getCommand();
- if( supCmd.canExecute()){
- cmd.add(super.getCommand());
- }
- cmd.add(createDisplayedInterfaceCommand());
- return cmd;
- }
- @Override
- protected void createEditors() {
- Composite parent = (Composite)getDialogArea();
- Composite subComposite= new Composite(parent, SWT.NONE);
-
- subComposite.setLayout(new FormLayout());
- //createDisplay button
- Button Displaybutton = new Button(subComposite, SWT.PUSH);
- Displaybutton.setText("Display seletected Interface");
- DisplayInterfaceListener displayInterfaceListener= new DisplayInterfaceListener();
- Displaybutton.addSelectionListener(displayInterfaceListener);
-
-
- FormData formData = new FormData();
- formData.left = new FormAttachment(0,700);
- Displaybutton.setLayoutData(formData);
-
- //create Remove
- Button RemoveDisplaybutton = new Button(subComposite, SWT.PUSH);
- RemoveDisplaybutton.setText(" Do not Display selected Interface");
- RemoveDisplayInterfaceListener removeDisplayInterfaceListener= new RemoveDisplayInterfaceListener();
- RemoveDisplaybutton.addSelectionListener(removeDisplayInterfaceListener);
-
- formData = new FormData();
- formData.left = new FormAttachment(0,500);
- RemoveDisplaybutton.setLayoutData(formData);
-
- super.createEditors();
- }
-
- /**
- *
- * @return teh command that will be used to display interfaces
- */
- protected Command createDisplayedInterfaceCommand(){
- //update list from initial List
- HashMap<Interface, GraphicalEditPart> viewToRemove= new HashMap<Interface, GraphicalEditPart>();
- HashSet<Interface>requiredInterfaceToDisplay= new HashSet<Interface>();
- HashSet<Interface>providedInterfaceToDisplay= new HashSet<Interface>();
- // create the list of provided interface to display
- for(Interface currentInterface : displayedProvidedInterface) {
- if(!initialList.keySet().contains(currentInterface)){
- providedInterfaceToDisplay.add(currentInterface);
- }
- }
- // create the list of required interface to display
- for(Interface currentInterface : displayedRequiredInterface) {
- if(!initialList.keySet().contains(currentInterface)){
- requiredInterfaceToDisplay.add(currentInterface);
- }
- }
- // create the list of interface to not display
- for(Interface currentInterface : initialList.keySet()) {
- if((!displayedRequiredInterface.contains(currentInterface))&&(!displayedProvidedInterface.contains(currentInterface))){
- viewToRemove.put(currentInterface, initialList.get(currentInterface));
- }
- }
-
- CompoundCommand cmd= new CompoundCommand();
- CreateLollipopPortCommand comd= new CreateLollipopPortCommand(this.portEditPart.getEditingDomain(),providedInterfaceToDisplay, requiredInterfaceToDisplay , this.portEditPart);
- cmd.add( new org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper(comd));
- if(viewToRemove.values().size()>0 ){
- cmd.add(deleteDisplayInterface(viewToRemove.values()));
- }
- return cmd;
- }
-
- /**
- * @param editPartToRemove list of editpart that represents displayed interfaces, never null
- * @return the command of interface representation to remove, never null
- */
- protected Command deleteDisplayInterface(Collection<GraphicalEditPart> editPartToRemove){
- CompoundCommand cmd= new CompoundCommand();
- Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
-
-
- for(GraphicalEditPart editPart : editPartToRemove) {
- cmd.add(editPart.getCommand(deleteViewRequest));
- }
-
- return cmd;
- }
-
- /**
- * inner to class attached to a button to display interfaces
- *
- */
- class DisplayInterfaceListener extends SelectionAdapter {
- public void widgetSelected(SelectionEvent event) {
- IStructuredSelection selection = (IStructuredSelection)providedEditor.getSelectedElementsViewer().getSelection();
- for(Object o : selection.toArray()) {
- displayedProvidedInterface.add((Interface)o);
- }
- selection = (IStructuredSelection)requiredEditor.getSelectedElementsViewer().getSelection();
- for(Object o : selection.toArray()) {
- displayedRequiredInterface.add((Interface)o);
- }
- providedEditor.getSelectedElementsViewer().refresh();
- requiredEditor.getSelectedElementsViewer().refresh();
- }
-
- }
-
- /**
- * inner to class attached to a button to remove displayed interfaces
- *
- */
- class RemoveDisplayInterfaceListener extends SelectionAdapter {
- public void widgetSelected(SelectionEvent event) {
-
- IStructuredSelection selection = (IStructuredSelection)providedEditor.getSelectedElementsViewer().getSelection();
- for(Object o : selection.toArray()) {
- displayedProvidedInterface.remove((Interface)o);
- }
- selection = (IStructuredSelection)requiredEditor.getSelectedElementsViewer().getSelection();
- for(Object o : selection.toArray()) {
- displayedRequiredInterface.remove((Interface)o);
- }
- providedEditor.getSelectedElementsViewer().refresh();
- requiredEditor.getSelectedElementsViewer().refresh();
- }
-
- }
-
-
- /**
- *
- * This class provides a CustomLabelProvider for this dialog.
- * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
- *
- *
- */
- public class DisplayedSelectorLabelProvider extends SelectorLabelProvider {
-
- private static final String ICONS_OBJ16_LOLLIPOP_GIF = "icons/obj16/lollipop.gif"; //$NON-NLS-1$
-
- @Override
- protected Image getImage(EObject element) {
- if(displayedRequiredInterface.contains(element)||displayedProvidedInterface.contains(element)){
- return org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage(UMLDiagramEditorPlugin.ID, ICONS_OBJ16_LOLLIPOP_GIF);
- }
- return super.getImage(element);
- }
-
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ExtendedSelectionEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ExtendedSelectionEditor.java
deleted file mode 100644
index 748c329..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/ExtendedSelectionEditor.java
+++ /dev/null
@@ -1,545 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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:
- * Patrick Tessier (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.papyrus.infra.widgets.Activator;
-import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
-import org.eclipse.papyrus.infra.widgets.messages.Messages;
-import org.eclipse.papyrus.infra.widgets.providers.CollectionContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-/**
- * Extension of selection editor with a table to display icon of element
- *normally this class must inherits of SelectionEditor but list and table are type that are not compatible, so entire creation of this class was needed
- */
-
-public class ExtendedSelectionEditor extends Composite implements SelectionListener {
-
-
- /** the initial selection */
- protected final java.util.List<Object> initialSelection;
-
- /** The object selector */
- private IElementSelector selector;
-
- /** The SWT Composite in which the selector is drawn */
- protected Composite selectorSection;
-
- /** The message section */
- protected Composite messageSection;
-
- /** The additional button section */
- protected Composite createAdditionalButtonSection;
-
- /** The up/down buttons section */
- protected Composite rightButtonsSection;
-
- /** The listViewer for chosen elements */
- protected TableViewer selectedElementsViewer;
-
- /**
- *
- * @return the table viewer in order to get the element selection
- */
- public TableViewer getSelectedElementsViewer() {
- return selectedElementsViewer;
- }
-
- /** The list for chosen elements */
- protected Table selectedElements;
-
- /** The add action button */
- private Button add;
-
- /** The remove action button */
- private Button remove;
-
- /** The add all action button */
- private Button addAll;
-
- /** The remove all action button */
- private Button removeAll;
-
- /** the up action button */
- private Button up;
-
- /** the down action button */
- private Button down;
-
- /** The label provider for the listViewer of chosen elements */
- private ILabelProvider labelProvider;
-
- /** The currently chosen elements */
- protected final Collection<Object> currentSelection;
-
- /** the listener for the additional button */
- private SelectionListener additionalButtonSelectionListener;
-
- /** the message for the editor */
- private String message;
-
-
- /*
- * This dialog can provide a Button to do some optional action
- */
-
- /** Indicates if the dialog provides a button */
- private boolean withAdditionalButton = false;
-
- /** the label of the button */
- private String additionalButtonLabel = null;
-
- /** the button */
- private Button additionalButton;
-
- /** The add/remove/addAll buttons section */
- protected Composite buttonSection;
-
- /**
- *
- * Constructor.
- *
- * @param parent
- * the parent of this composite
- * @param selector
- * the selector
- * @param labelProvider
- * the label provider
- * @param initialSelection
- * the initial selection
- */
- public ExtendedSelectionEditor(Composite parent, IElementSelector selector, ILabelProvider labelProvider, java.util.List<Object> initialSelection) {
- super(parent, SWT.NONE);
- this.selector = selector;
- this.labelProvider = labelProvider;
- this.initialSelection = new ArrayList<Object>();
- for(Object current : initialSelection) {
- this.initialSelection.add(current);
- }
- currentSelection = initialSelection;
- }
-
- /**
- * This methods create this editor
- */
- public void create() {
- Composite parent = this;
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- parent.setLayout(layout);
- createMessageSection(parent);
- createBody(parent);
- createCreateButtonSection(parent);
- }
-
- /**
- * This method create the body of the editor :
- * <ul>
- * <li>the selector</li>
- * <li>the list</li>
- * <li>the buttons Add, AddAll, Remove, RemoveAll, Up, Down</li>
- * </ul>
- *
- * @param parent
- * the parent composite
- */
- protected void createBody(Composite parent) {
-
- Composite par = new Composite(parent, SWT.NONE);
- createSelectorSection(par);
- createControlsSection(par);
- createListSection(par);
- createRightButtonsSection(par);
- GridLayout layout = new GridLayout();
- layout.makeColumnsEqualWidth = false;
- layout.numColumns = 4;
- par.setLayout(layout);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- par.setLayoutData(data);
-
- }
-
- /**
- * Creates the Message section
- *
- * @param parent
- * the parent of the {@link Composite}
- */
- protected void createMessageSection(Composite parent) {
- messageSection = new Composite(parent, SWT.NONE);
- Label label = new Label(messageSection, SWT.NONE);
- label.setText(message);
- messageSection.setLayout(new FillLayout(SWT.HORIZONTAL));
- }
-
- /**
- * Creates the button section
- *
- * @param parent
- * the parent of the {@link Composite}
- */
- protected void createCreateButtonSection(Composite parent) {
- if(this.withAdditionalButton) {
- buttonSection = new Composite(parent, SWT.NONE);
- additionalButton = new Button(buttonSection, SWT.PUSH);
- if(additionalButtonLabel != null) {
- additionalButton.setText(additionalButtonLabel);
- }
- buttonSection.setLayout(new FillLayout());
- this.additionalButton.addSelectionListener(additionalButtonSelectionListener);
- }
- }
-
- /**
- * Creates the selector section
- *
- * @param parent
- * The composite in which the section is created
- */
- protected void createSelectorSection(Composite parent) {
- selectorSection = new Composite(parent, SWT.NONE);
- selectorSection.setLayout(new FillLayout());
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.widthHint = 400;
-
- // data.exclude = true;
- selectorSection.setLayoutData(data);
- selector.createControls(selectorSection);
-
- }
-
- /**
- * Creates the main controls section (Add, remove, Add all, remove all)
- *
- * @param parent
- * The composite in which the section is created
- */
- protected void createControlsSection(Composite parent) {
- buttonSection = new Composite(parent, SWT.NONE);
- buttonSection.setLayout(new GridLayout(1, true));
-
- add = new Button(buttonSection, SWT.PUSH);
- add.setImage(Activator.getDefault().getImage("/icons/arrow_right.gif")); //$NON-NLS-1$
- add.addSelectionListener(this);
- add.setToolTipText(Messages.MultipleValueSelectorDialog_AddSelectedElements);
-
- remove = new Button(buttonSection, SWT.PUSH);
- remove.setImage(Activator.getDefault().getImage("/icons/arrow_left.gif")); //$NON-NLS-1$
- remove.addSelectionListener(this);
- remove.setToolTipText(Messages.MultipleValueEditor_RemoveSelectedElements);
-
- addAll = new Button(buttonSection, SWT.PUSH);
- addAll.setImage(Activator.getDefault().getImage("/icons/arrow_double.gif")); //$NON-NLS-1$
- addAll.addSelectionListener(this);
- addAll.setToolTipText(Messages.MultipleValueSelectorDialog_AddAllElements);
-
- removeAll = new Button(buttonSection, SWT.PUSH);
- removeAll.setImage(Activator.getDefault().getImage("/icons/arrow_left_double.gif")); //$NON-NLS-1$
- removeAll.addSelectionListener(this);
- removeAll.setToolTipText(Messages.MultipleValueSelectorDialog_RemoveAllElements);
- }
-
-
- /**
- * Creates the list displaying the currently selected elements
- *
- * @param parent
- * The composite in which the section is created
- */
- protected void createListSection(Composite parent) {
- Composite listSection = new Composite(parent, SWT.NONE);
- selectedElements = new Table(listSection, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.widthHint = 400;
- listSection.setLayout(new FillLayout());
- listSection.setLayoutData(data);
-
- selectedElementsViewer = new TableViewer(selectedElements);
-
- selectedElementsViewer.setContentProvider(CollectionContentProvider.instance);
-
- if(labelProvider != null)
- selectedElementsViewer.setLabelProvider(labelProvider);
-
- selectedElementsViewer.setInput(currentSelection);
- selector.setSelectedElements(currentSelection.toArray());
-
- }
-
- /**
- * Creates the up/down controls section
- *
- * @param parent
- * The composite in which the section is created
- */
- protected void createRightButtonsSection(Composite parent) {
- rightButtonsSection = new Composite(parent, SWT.NONE);
- rightButtonsSection.setLayout(new GridLayout(1, true));
-
- up = new Button(rightButtonsSection, SWT.PUSH);
- up.setImage(Activator.getDefault().getImage("/icons/Up_12x12.gif")); //$NON-NLS-1$
- up.addSelectionListener(this);
- up.setToolTipText(Messages.MultipleValueEditor_MoveSelectedElementsUp);
-
- down = new Button(rightButtonsSection, SWT.PUSH);
- down.setImage(Activator.getDefault().getImage("/icons/Down_12x12.gif")); //$NON-NLS-1$
- down.addSelectionListener(this);
- down.setToolTipText(Messages.MultipleValueEditor_MoveSelectedElementsDown);
- }
-
-
-
- /**
- * {@inheritDoc} Handles the events on one of the control buttons
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- * The event that occurred
- */
- public void widgetSelected(SelectionEvent e) {
- if(e.widget == add) {
- addAction();
- } else if(e.widget == remove) {
- removeAction();
- } else if(e.widget == addAll) {
- addAllAction();
- } else if(e.widget == removeAll) {
- removeAllAction();
- } else if(e.widget == up) {
- upAction();
- } else if(e.widget == down) {
- downAction();
- }
- }
-
- /**
- * Handles the "Add" action
- */
- protected void addAction() {
- Object[] elements = selector.getSelectedElements();
- addElements(elements);
- }
-
- /**
- * Handles the "Up" action
- */
- protected void upAction() {
- IStructuredSelection selection = (IStructuredSelection)selectedElementsViewer.getSelection();
-
- //We need a list to move objects. LinkedHashSet can't do that
- java.util.List<Object> list = new LinkedList<Object>(currentSelection);
- for(Object o : selection.toArray()) {
- int oldIndex = list.indexOf(o);
- if(oldIndex > 0)
- move(list, oldIndex, oldIndex - 1);
- }
-
- currentSelection.clear();
- currentSelection.addAll(list);
-
- IStructuredSelection selectionCopy = new StructuredSelection(selection.toArray());
- selectedElementsViewer.setSelection(selectionCopy);
- selectedElementsViewer.refresh();
- }
-
- /**
- * Handles the "Down" action
- */
- protected void downAction() {
- IStructuredSelection selection = (IStructuredSelection)selectedElementsViewer.getSelection();
-
- //We need a list to move objects. LinkedHashSet can't do that
- java.util.List<Object> list = new LinkedList<Object>(currentSelection);
-
- int maxIndex = list.size() - 1;
-
- Object[] selectionArray = selection.toArray();
- for(int i = selectionArray.length - 1; i >= 0; i--) {
- Object o = selectionArray[i];
- int oldIndex = list.indexOf(o);
- if(oldIndex < maxIndex)
- move(list, oldIndex, oldIndex + 1);
- }
-
- currentSelection.clear();
- currentSelection.addAll(list);
-
- IStructuredSelection selectionCopy = new StructuredSelection(selection.toArray());
- selectedElementsViewer.setSelection(selectionCopy);
- selectedElementsViewer.refresh();
- }
-
- /**
- * Moves an element from oldIndex to newIndex
- *
- * @param list
- * The list in which to move the object
- * @param oldIndex
- * @param newIndex
- */
- protected void move(java.util.List<Object> list, int oldIndex, int newIndex) {
- int size = list.size();
-
- if(oldIndex < 0 || oldIndex >= size)
- throw new IndexOutOfBoundsException("oldIndex: " + oldIndex + ", size:" + size); //$NON-NLS-1$ //$NON-NLS-2$
- if(newIndex < 0 || newIndex >= size)
- throw new IndexOutOfBoundsException("newIndex: " + newIndex + ", size:" + size); //$NON-NLS-1$ //$NON-NLS-2$
- Object element = list.remove(oldIndex);
- list.add(newIndex, element);
- }
-
- /**
- * Handles the "Remove" action
- */
- protected void removeAction() {
- IStructuredSelection selection = (IStructuredSelection)selectedElementsViewer.getSelection();
- if(selection.isEmpty())
- return;
-
- for(Object element : selection.toArray()) {
- currentSelection.remove(element);
- }
-
- selector.setSelectedElements(currentSelection.toArray());
- selectedElementsViewer.setSelection(null);
- selectedElementsViewer.refresh();
- }
-
- /**
- * Handles the "Remove all" action
- */
- protected void removeAllAction() {
- currentSelection.clear();
- selector.setSelectedElements(new Object[0]);
- selectedElementsViewer.setSelection(null);
- selectedElementsViewer.refresh();
- }
-
- /**
- * Handles the "Add All" action
- */
- protected void addAllAction() {
- Object[] elements = selector.getAllElements();
- addElements(elements);
- }
-
- /**
- * Adds the specified elements to the currently selected elements (For
- * "Add" and "Add all" actions)
- *
- * @param elements
- * The elements to be added
- */
- protected void addElements(Object[] elements) {
- if(elements != null) {
- currentSelection.addAll(Arrays.asList(elements));
- selectedElementsViewer.refresh();
- }
- }
-
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- //Nothing to do
- }
-
- /**
- *
- * @param withAdditionalButton
- * @param messageButton
- * @param listener
- */
- public void setAdditionalButton(boolean withAdditionalButton, String messageButton, SelectionListener listener) {
- this.withAdditionalButton = withAdditionalButton;
- this.additionalButtonLabel = messageButton;
- this.additionalButtonSelectionListener = listener;
- }
-
- /**
- * Set the message displayed by the Editor
- *
- * @param string
- * the message displayed by the editor
- */
- public void setMessage(String string) {
- this.message = string;
- }
-
- /**
- * Returns all selected elements
- *
- * @return
- * all selected elements
- */
- public Collection<?> getSelectedElements() {
- return currentSelection;
- }
-
-
- /**
- * Returns the list of the elements to remove
- *
- * @return
- * the list of the elements to remove
- */
- public java.util.List<Object> getElementToRemove() {
- java.util.List<Object> removedObject = new ArrayList<Object>();
- for(Object current : this.initialSelection) {
- if(!getSelectedElements().contains(current)) {
- removedObject.add(current);
- }
- }
- return removedObject;
- }
-
- /**
- * Returns the list of the elements to add
- *
- * @return
- * the list of the elements to add
- */
- public java.util.List<Object> getElementToAdd() {
- java.util.List<Object> addedObject = new ArrayList<Object>();
- for(Object current : getSelectedElements()) {
- if(!this.initialSelection.contains(current)) {
- addedObject.add(current);
- }
- }
- return addedObject;
- }
- }
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/InterfaceManagerDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/InterfaceManagerDialog.java
deleted file mode 100644
index db6fe9a..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/InterfaceManagerDialog.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
-import org.eclipse.papyrus.infra.widgets.editors.SelectionEditor;
-import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
-import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
-import org.eclipse.papyrus.uml.diagram.component.custom.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Realization;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- * This class provides a Dialog to manage easily the provided and the required Interfaces for a {@link Port}.
- */
-public class InterfaceManagerDialog extends SelectionDialog {
- /** the selected port. */
- private Port port;
- /** the list of the provided interfaces. */
- private List<Object> providedInterfaces;
- /** the list of the required interfaces. */
- private List<Object> requiredInterfaces;
- /** the {@link ReferenceSelector} for the provided interfaces. */
- private ReferenceSelector providedSelector;
- /** the {@link ReferenceSelector} for the required interfaces. */
- private ReferenceSelector requiredSelector;
- /** the Editor for the provided interfaces. */
- protected ExtendedSelectionEditor providedEditor;
- /** the Editor for the required interfaces. */
- protected ExtendedSelectionEditor requiredEditor;
- /** In this map, we link the {@link Interface} with their {@link Usage} This map is used when we want remove an Interface from a Usage. */
- private Map<Interface, List<Usage>> requiredInterfacesMappedWithUsage = new HashMap<Interface, List<Usage>>();
- /**
- * In this map, we link the {@link Interface} with their {@link Realization} This map is used when we want remove an Interface from a Realization.
- */
- private Map<Interface, List<Realization>> providedInterfacesMappedWithRealization = new HashMap<Interface, List<Realization>>();
- /** the label provider for selector. */
- protected ILabelProvider selectorLabelProvider = new SelectorLabelProvider();
- /** the label provider for the create new element dialog. */
- private final ILabelProvider newElementLabelProvider = new CreateElementLabelProvider();
- /** the domain used for the commands. */
- private TransactionalEditingDomain domain;
- /** the model. */
- private Package model = null;
- /** this command contains the list of the command to create the new Interfaces. */
- private CompoundCommand interfaceCreationCommand = new CompoundCommand("Create Interfaces Commands"); //$NON-NLS-1$
- /** This list contains representation of the Interface before their creation. */
- private List<NewElementRepresentation> interfaceRepresentations;
- /** boolean used to know if the {@link Port} is typed with an {@link Interface}. */
- private boolean typedWithInterface;
- /** path for the warning icons. */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
- /**
- * This list contains the names used for the new elements.
- * We need to remember these names are used in order don't suggest them when we create other new elements
- */
- private List<String> forbiddenNames;
-
- /**
- *
- * Constructor.
- *
- * @param parentShell
- * the parent {@link Shell}
- * @param port
- * the {@link Port} for which we want manage the Interfaces
- */
- public InterfaceManagerDialog(Shell parentShell, Port port) {
- super(parentShell);
- this.setTitle(Messages.InterfaceManagerDialog_Title);
- this.port = port;
- Assert.isTrue(this.port.getType() instanceof Classifier);
- this.typedWithInterface = (this.port.getType() instanceof Interface);
- }
-
- /**
- * Creates the.
- *
- * @see org.eclipse.jface.dialogs.Dialog#create()
- */
- @Override
- public void create() {
- super.create();
- init();
- }
-
- /**
- * This method initialize some fields of the class.
- */
- protected void init() {
- this.forbiddenNames = new ArrayList<String>();
- this.interfaceRepresentations = new ArrayList<NewElementRepresentation>();
- EList<Namespace> namespaces = port.allNamespaces();
- Element el = namespaces.get(namespaces.size() - 1);
- if (el instanceof Package) {
- model = (Package) el;
- } else {
- model = el.getNearestPackage();
- }
- // fill the hashmap to link Interfaces with Usage and InterfaceRealization
- buildProvidedInterfaces();
- buildRequiredInterfaces();
- // we build the list of the provided interfaces
- this.providedInterfaces = new ArrayList<Object>();
- for (Interface current : this.port.getProvideds()) {
- this.providedInterfaces.add(current);
- }
- // when the port is typed by an Interface, we don't propose this interface in the possible Provided Interfaces list.
- if (typedWithInterface) {
- this.providedInterfaces.remove(this.port.getType());
- }
- // we build the list of the required interfaces
- this.requiredInterfaces = new ArrayList<Object>();
- for (Interface current : this.port.getRequireds()) {
- this.requiredInterfaces.add(current);
- }
- // initialize the transactional editing domain
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = activePage.getActiveEditor();
- if (editor instanceof IMultiDiagramEditor) {
- try {
- this.domain = ServiceUtils.getInstance().getTransactionalEditingDomain(((IMultiDiagramEditor) editor).getServicesRegistry());
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
- // selectors creation
- createSelectors();
- // editors creation
- createEditors();
- }
-
- /**
- * This method fills the map {@link #requiredInterfacesMappedWithUsage}.
- */
- protected void buildRequiredInterfaces() {
- List<?> allUsage = org.eclipse.papyrus.uml.tools.utils.ElementUtil.getInstancesFilteredByType(this.model, Usage.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier) this.port.getType());
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier) this.port.getType()));
- for (Object current : allUsage) {
- Usage usage = (Usage) current;
- for (Classifier classifier : classifiers) {// we test if the current Usage is linked with the type of the Port
- if (usage.getClients().contains(classifier)) {// this Usage concerns the current port
- for (EObject target : usage.getSuppliers()) {
- if (this.port.getRequireds().contains(target)) {
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(target);
- if (usages != null) {
- usages.add(usage);
- } else {
- usages = new ArrayList<Usage>();
- usages.add(usage);
- this.requiredInterfacesMappedWithUsage.put((Interface) target, usages);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method fills the map {@link #providedInterfacesMappedWithRealization}.
- */
- protected void buildProvidedInterfaces() {
- List<?> allRealization = org.eclipse.papyrus.uml.tools.utils.ElementUtil.getInstancesFilteredByType(this.model, Realization.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier) this.port.getType());
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier) this.port.getType()));
- for (Object current : allRealization) {
- Realization realization = (Realization) current;
- for (Classifier classifier : classifiers) {// we test if the current Realization is linked with the type of the Port
- if (realization.getClients().contains(classifier)) {// this Realization concerns the current port
- for (EObject target : realization.getSuppliers()) {
- if (this.port.getProvideds().contains(target)) {
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(target);
- if (realizations != null) {
- realizations.add(realization);
- } else {
- realizations = new ArrayList<Realization>();
- realizations.add(realization);
- this.providedInterfacesMappedWithRealization.put((Interface) target, realizations);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method creates the selectors {@link #providedSelector} and {@link #requiredSelector}.
- */
- protected void createSelectors() {
- // the provided selector
- this.providedSelector = new ReferenceSelector(true);
- this.providedSelector.setLabelProvider(selectorLabelProvider);
- this.providedSelector.setContentProvider(new AbstractStaticContentProvider() {
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
- if (typedWithInterface) {
- tmp.remove(port.getType());
- }
- // we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- // the required selector
- this.requiredSelector = new ReferenceSelector(true);
- this.requiredSelector.setLabelProvider(selectorLabelProvider);
- this.requiredSelector.setContentProvider(new AbstractStaticContentProvider() {
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
- // we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- }
-
- /**
- * This method create the 2 Editors {@link #providedEditor} and {@link #requiredEditor} and provides the listener for the button of these editors.
- */
- protected void createEditors() {
- Composite parent = (Composite) getDialogArea();
- CreateButtonListener listener = new CreateButtonListener();
- // we set a specific message if the port is typed with an Interface
- if (typedWithInterface) {
- Composite messageSection = new Composite(parent, SWT.BORDER);
- CLabel label = new CLabel(messageSection, SWT.NONE);
- label.setText(Messages.InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage);
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- label.setImage(errorImage);
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- messageSection.setLayout(layout);
- messageSection.setLayoutData(data);
- messageSection.setEnabled(false);
- }
- this.providedEditor = createEditor(parent, providedSelector, Messages.InterfaceManagerDialog_SelectedTheProvidedInterfaces, false, listener, this.providedInterfaces);
- this.requiredEditor = createEditor(parent, requiredSelector, Messages.InterfaceManagerDialog_SelectTheRequiredInterfaces, true, listener, this.requiredInterfaces);
- this.providedEditor.create();
- this.requiredEditor.create();
- GridLayout layout = (GridLayout) parent.getLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- this.providedEditor.setLayoutData(data);
- this.requiredEditor.setLayoutData(data);
- getShell().setSize(950, 700);
- getShell().layout();
- }
-
- /**
- * Creates a {@link SelectionEditor} and returns it.
- *
- * @param parent
- * the composite parent
- * @param selector
- * the selector used by the created editor
- * @param message
- * the message to display in the created editor
- * @param withCreateButton
- * indicates if the editor provides an additional button for a specific action
- * @param listener
- * the listener for the button
- * @param initialSelection
- * the initial selection for this editor
- * @return the selection editor
- * the created {@link SelectionEditor}
- */
- protected ExtendedSelectionEditor createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
- ExtendedSelectionEditor editor = new ExtendedSelectionEditor(parent, selector, selectorLabelProvider, initialSelection);
- editor.setMessage(message);
- editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
- return editor;
- }
-
- /**
- * Returns all the available Interfaces.
- *
- * @param pack
- * the pack
- * @return the all available interfaces
- * all the available Interfaces
- * //TODO add the interfaces of the package import!
- */
- protected List<Interface> getAllAvailableInterfaces(Package pack) {
- List<Interface> otherInterfaces = new ArrayList<Interface>();
- List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
- for (Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
- interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
- }
- for (Element element : interfaces) {
- otherInterfaces.add((Interface) element);
- }
- return otherInterfaces;
- }
-
- /**
- * Returns the commands to apply the changes.
- *
- * @return the command
- * the commands to apply the changes
- */
- public Command getCommand() {
- CompoundCommand command = new CompoundCommand("Command to manage interfaces on Port"); //$NON-NLS-1$
- if (!interfaceCreationCommand.isEmpty()) {
- command.add(interfaceCreationCommand);
- }
- Command cmd = getCommandsToCreateElements();
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- cmd = getCommandToRemoveReferencedInterfaces();
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- return command;
- }
-
- /**
- * Returns the command to remove referenced Interfaces in Usage and InterfaceRealization.
- *
- * @return the command to remove referenced interfaces
- * The command to remove referenced Interfaces the Usage and InterfaceRealization.
- * Moreover, we add a command to destroy Usage and InterfaceRealization when they have any Suppliers after this action
- */
- protected Command getCommandToRemoveReferencedInterfaces() {
- CompoundCommand command = new CompoundCommand("Command to destroy Usage and InterfaceRealization"); //$NON-NLS-1$
- Set<Dependency> relationshipToDestroy = new HashSet<Dependency>();
- // commands to destroy Usage
- for (Object current : this.requiredEditor.getElementToRemove()) {
- // we get all usage associated with this interface
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(current);
- for (Usage currentUsage : usages) {
- // we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentUsage, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject) current, false);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentUsage);
- }
- }
- }
- // commands to destroy InterfaceRealization
- for (Object current : this.providedEditor.getElementToRemove()) {
- // we get all usage associated with this interface
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(current);
- for (Realization currentRealization : realizations) {
- // we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentRealization, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject) current, false);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentRealization);
- }
- }
- }
- if (!relationshipToDestroy.isEmpty()) {
- command.add(new ICommandProxy(new DestroyDependencyWithoutSupplierCommand(this.domain, null, relationshipToDestroy)));
- return command;
- }
- // nothing to do
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Returns the command to create new Usage and new InterfaceRealization.
- *
- * @return the commands to create elements
- * the command to create new Usage and new InterfaceRealization
- */
- protected Command getCommandsToCreateElements() {
- CompoundCommand command = new CompoundCommand("Command to create Usage and InterfaceRealization"); //$NON-NLS-1$
- // commands for Usage Creation
- for (Object current : this.requiredEditor.getElementToAdd()) {
- if (current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject) current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- } else {// its an NewElementRepresentation
- CreateUsageCommand cmd = new CreateUsageCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation) current, null);
- if (cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
- // commands for InterfaceRealization Creation
- for (Object current : providedEditor.getElementToAdd()) {
- if (current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType(), this.port.getType(), (EObject) current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- } else {// its an NewElementRepresentation
- CreateInterfaceRealizationCommand cmd = new CreateInterfaceRealizationCommand(this.domain, this.port.getType(), this.port.getType(), (NewElementRepresentation) current, null);
- if (cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
- if (!command.isEmpty()) {
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Return the command corresponding to the request.
- *
- * @param req
- * a request
- * @return the command
- * the command corresponding to the request
- */
- protected Command getCommand(AbstractEditCommandRequest req) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(model);
- if (provider != null) {
- ICommand setCommand = provider.getEditCommand(req);
- if (setCommand != null) {
- return new ICommandProxy(setCommand.reduce());
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This listener is used to know when the user clicks on the Button to create a new {@link Interface}.
- *
- * @see CreateButtonEvent
- */
- public class CreateButtonListener implements SelectionListener {
- /**
- * Widget selected.
- *
- * @param e
- * the e
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, UMLElementTypes.INTERFACE);
- dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
- dialog.setMessage(Messages.InterfaceManagerDialog_SelectTheParentOfThisNewInterface);
- dialog.setHelpAvailable(false);
- dialog.setForbiddenNames(forbiddenNames);
- List<Object> input = new ArrayList<Object>();
- input.add(model);
- dialog.setInput(input);
- dialog.setValidator(new ParentInterfaceValidator());
- if (dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
- interfaceCreationCommand.add(dialog.getCommand());
- Object[] res = dialog.getResult();
- for (Object current : res) {
- if (current instanceof NewElementRepresentation) {
- interfaceRepresentations.add((NewElementRepresentation) current);
- forbiddenNames.add(((NewElementRepresentation) current).getName());
- }
- }
- providedSelector.refresh();
- requiredSelector.refresh();
- }
- }
-
- /**
- * Widget default selected.
- *
- * @param e
- * the e
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- }
-
- /**
- * This class provides a validator for the selection of the parent of the new Interface.
- */
- public class ParentInterfaceValidator implements ISelectionStatusValidator {
- /**
- * Selection has to be a Classifier or an Interface to allow creation.
- *
- * @param selection
- * the selection
- * @return the i status
- * @see org.eclipse.ui.dialogs.ISelectionStatusValidator#validate(java.lang.Object[])
- */
- public IStatus validate(Object[] selection) {
- IStatus status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.NoSelectionFound);
- if (selection.length >= 1) {
- for (int i = 0; i < selection.length; i++) {
- if (selection[i] instanceof Package || selection[i] instanceof Classifier || selection[i] instanceof NewElementRepresentation) {
- status = new Status(IStatus.OK, UMLDiagramEditorPlugin.ID, Messages.SelectionValidated);
- } else {
- status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier);
- break;
- }
- }
- }
- return status;
- }
- }
-
- /**
- *
- * This class provides a CustomLabelProvider for this dialog.
- * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
- *
- *
- */
- public class SelectorLabelProvider extends CreateElementLabelProvider {
- /**
- * Gets the text.
- *
- * @param element
- * the element
- * @return the text
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation) element).getQualifiedName();
- } else if (element instanceof NamedElement) {
- return ((NamedElement) element).getQualifiedName();
- }
- return super.getText(element);
- }
- }
-
- /**
- * The Class CreateElementLabelProvider.
- */
- public class CreateElementLabelProvider extends UMLLabelProvider {
- /**
- * Gets the image.
- *
- * @param element
- * the element
- * @return the image
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage(Object element) {
- if (element instanceof NewElementRepresentation) {
- return org.eclipse.papyrus.uml.tools.Activator.getDefault().getImageForUMLMetaclass(UMLPackage.eINSTANCE.getInterface());
- }
- return super.getImage(element);
- }
-
- /**
- * Gets the text.
- *
- * @param element
- * the element
- * @return the text
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation) element).getName();
- }
- return super.getText(element);
- }
- }
-
- /**
- *
- * This content provider is used in this dialog. It returns the available element in the model + the future element which are {@link NewElementRepresentation}
- *
- *
- */
- public class CustomContentProvider implements ITreeContentProvider {
- /**
- * Dispose.
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * Input changed.
- *
- * @param viewer
- * the viewer
- * @param oldInput
- * the old input
- * @param newInput
- * the new input
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /**
- * Gets the elements.
- *
- * @param inputElement
- * the input element
- * @return the elements
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof List<?>) {
- return ((List<?>) inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- * Gets the children.
- *
- * @param parentElement
- * the parent element
- * @return the children
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement) {
- List<Object> children = new ArrayList<Object>();
- List<?> tmp = null;
- if (parentElement instanceof Package) {
- tmp = ((Package) parentElement).getOwnedMembers();
- } else if (parentElement instanceof Classifier) {
- tmp = ((Classifier) parentElement).getOwnedMembers();
- }
- if (tmp != null) {
- for (Object current : tmp) {
- if (current instanceof Classifier || current instanceof Package) {
- children.add(current);
- }
- }
- }
- // we add the future Interfaces to this selection
- for (NewElementRepresentation current : interfaceRepresentations) {
- if (current.getParent() == parentElement) {
- children.add(current);
- }
- }
- return children.toArray();
- }
-
- /**
- * Gets the parent.
- *
- * @param element
- * the element
- * @return the parent
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
- if (element == model) {
- return model;
- } else if (element instanceof NamedElement) {
- return ((NamedElement) element).eContainer();
- }
- return null;
- }
-
- /**
- * Checks for children.
- *
- * @param element
- * the element
- * @return true, if successful
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length != 0;
- }
- }
-
- /**
- * This command is used to create a New Usage, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed).
- */
- public class CreateUsageCommand extends AbstractTransactionalCommand {
- /** The container for the new Usage. */
- private EObject container;
- /** the source of this Usage. */
- private EObject source;
- /** the target : the representation of the new interface. */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the Usage
- * @param source
- * the source for the Usage
- * @param target
- * the target for the Usage
- * @param affectedFiles
- * the affected files
- */
- public CreateUsageCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create Usage Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command command = getCommand(request);
- if (command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
- }
-
- /**
- * This command is used to create a New InterfaceRealition, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed).
- */
- public class CreateInterfaceRealizationCommand extends AbstractTransactionalCommand {
- /** The container for the new InterfaceRealization. */
- private EObject container;
- /** The source for the new InterfaceRealization. */
- private EObject source;
- /** the target : the representation of the new interface. */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the InterfaceRealization
- * @param source
- * the source for the InterfaceRealization
- * @param target
- * the target for the InterfaceRealization
- * @param affectedFiles
- * the affected files
- */
- public CreateInterfaceRealizationCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create InterfaceRealization Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command command = getCommand(request);
- if (command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
- }
-
- /**
- * This command is used to destroy Dependencies which have any supplier before the deletion of the Interface.
- */
- public class DestroyDependencyWithoutSupplierCommand extends AbstractTransactionalCommand {
- /** the dependencies to test. */
- private Set<Dependency> dependencies;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param affectedFiles
- * the affected files
- * @param dependencies
- * the dependencies to test
- */
- public DestroyDependencyWithoutSupplierCommand(TransactionalEditingDomain domain, List<?> affectedFiles, Set<Dependency> dependencies) {
- super(domain, "Destroy the empty elements", affectedFiles); //$NON-NLS-1$
- this.dependencies = dependencies;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CompoundCommand command = new CompoundCommand("Destroy relationship without suppliers"); //$NON-NLS-1$
- for (Dependency current : dependencies) {
- if (current.getSuppliers().isEmpty()) {
- DestroyElementRequest request = new DestroyElementRequest(domain, current, false);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- }
- }
- if (!command.isEmpty() && command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult();
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/NewElementRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/NewElementRepresentation.java
deleted file mode 100644
index bfe1061..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/ui/NewElementRepresentation.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.component.custom.ui;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.uml2.uml.NamedElement;
-
-// TODO: Auto-generated Javadoc
-/**
- * This class provides facilities to represent a New Element before its real creation.
- * We can store in this class :
- * <ul>
- * <li>the name of the new element</li>
- * <li>the parent of the new element</li>
- * <li>the {@link IHintedType} of the new element</li>
- * <li>the request to build the new element (optional)</li>
- * <li>the element itself when it has been created</li>
- * </ul>
- *
- *
- *
- */
-public class NewElementRepresentation {
-
- /** the name of the new element. */
- private String name;
-
- /** the parent of the new element. */
- private Object parent;
-
- /** the created element itself. */
- private EObject createdElement;
-
- /** the {@link IHintedType} of the new element. */
- private IHintedType hintedType;
-
- /** this field is used only when the element have an existing parent. */
- private CreateElementRequest request;
-
- /**
- *
- * Constructor.
- *
- * @param name
- * the name of the new element
- * @param parent
- * the parent of the new element
- * @param hintedType
- * the hinted type of the new element
- * @param request
- * the request to build the new element (can be <code>null</code>)
- */
- public NewElementRepresentation(String name, Object parent, IHintedType hintedType, CreateElementRequest request) {
- this.name = name;
- this.parent = parent;
- this.createdElement = null;
- this.hintedType = hintedType;
- this.request = request;
- }
-
- /**
- * Getter for {@link #hintedType}.
- *
- * @return the hinted type
- * {@link #hintedType}
- */
- public IHintedType getHintedType() {
- return this.hintedType;
- }
-
- /**
- * Getter for {@link #name}.
- *
- * @return the name
- * {@link #name}
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Getter for {@link #parent}.
- *
- * @return the parent
- * {@link #parent}
- */
- public Object getParent() {
- return this.parent;
- }
-
- /**
- * Returns the parent of this element.
- *
- * @return the e object parent
- * the parent of this element or <code>null</code> if the parent is a {@link NewElementRepresentation} itself and if it has not been
- * created
- */
- public EObject getEObjectParent() {
- if(parent instanceof EObject) {
- return (EObject)this.parent;
- } else if(parent instanceof NewElementRepresentation) {
- return ((NewElementRepresentation)parent).getEObject();
- }
- return null;
- }
-
- /**
- * Returns the created object.
- *
- * @return the e object
- * the created Object or <code>null</code> if the object has not been created
- */
- public EObject getEObject() {
- if(this.request != null) {
- return this.request.getNewElement();
- }
- return this.createdElement;
- }
-
- /**
- * Setter for {@link #createdElement}.
- *
- * @param newElement the new creates the element
- */
- public void setCreateElement(EObject newElement) {
- this.createdElement = newElement;
- }
-
- /**
- * Setter for {@link #request}.
- *
- * @return the creates the element request
- * {@link #request}
- */
- public CreateElementRequest getCreateElementRequest() {
- return this.request;
- }
-
- /**
- * To string.
- *
- * @return the string
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "Name : " + this.name + ", parent : " + this.parent;
- }
-
- /**
- * Gets the qualified name.
- *
- * @return the qualified name
- */
- public String getQualifiedName() {
- String qualifiedName = "";
- if(parent instanceof NewElementRepresentation) {
- qualifiedName = ((NewElementRepresentation)parent).getQualifiedName();
- } else if(parent instanceof NamedElement) {
- qualifiedName = ((NamedElement)parent).getQualifiedName() + "::" + this.name;
- }
- return qualifiedName;
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/plugin.xml
index 0743da3..328b861 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/plugin.xml
@@ -75,7 +75,7 @@
<extension
point="org.eclipse.ui.handlers">
<handler
- class="org.eclipse.papyrus.uml.diagram.component.custom.actions.ManageProvidedInterfacesHandler"
+ class="org.eclipse.papyrus.uml.diagram.component.custom.actions.ComponentManageInterfacesHandler"
commandId="org.eclipse.papyrus.uml.diagram.component.command.manage.interfaces">
<activeWhen>
<with
@@ -134,612 +134,612 @@
</extension>
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- <?gmfgen generated="true"?>
- <context
- description="%context.description"
- id="org.eclipse.papyrus.uml.diagram.component.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- </extension>
+ <extension point="org.eclipse.ui.contexts" id="ui-context">
+ <?gmfgen generated="true"?>
+ <context
+ description="%context.description"
+ id="org.eclipse.papyrus.uml.diagram.component.ui.diagramContext"
+ name="%context.name"
+ parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
+ </context>
+ </extension>
- <extension point="org.eclipse.ui.preferencePages" id="prefpages">
- <?gmfgen generated="true"?>
-<page
- id="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLComponentDiagram"
- name="PapyrusUMLComponentDiagram Diagram"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
- class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramGeneralPreferencePage">
-</page>
-<page
- id="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramPrintingPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.printing"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramPrintingPreferencePage">
-</page>
-<page
- id="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramRulersAndGridPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.rulersAndGrid"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLComponentDiagram"
- class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramRulersAndGridPreferencePage">
-</page>
- </extension>
+ <extension point="org.eclipse.ui.preferencePages" id="prefpages">
+ <?gmfgen generated="true"?>
+<page
+ id="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLComponentDiagram"
+ name="PapyrusUMLComponentDiagram Diagram"
+ category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
+ class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramGeneralPreferencePage">
+</page>
+<page
+ id="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramPrintingPreferencePage"
+ name="%prefpage.org.eclipse.uml2.uml.diagram.printing"
+ category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLComponentDiagram"
+ class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramPrintingPreferencePage">
+</page>
+<page
+ id="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramRulersAndGridPreferencePage"
+ name="%prefpage.org.eclipse.uml2.uml.diagram.rulersAndGrid"
+ category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLComponentDiagram"
+ class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramRulersAndGridPreferencePage">
+</page>
+ </extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
- <?gmfgen generated="true"?>
- <propertyContributor
- contributorId="org.eclipse.papyrus.uml.diagram.component"
- labelProvider="org.eclipse.papyrus.uml.diagram.component.sheet.UMLSheetLabelProvider">
- <propertyCategory category="domain"/>
- <propertyCategory category="visual"/>
- <propertyCategory category="extra"/>
- </propertyContributor>
- </extension>
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
+ <?gmfgen generated="true"?>
+ <propertyContributor
+ contributorId="org.eclipse.papyrus.uml.diagram.component"
+ labelProvider="org.eclipse.papyrus.uml.diagram.component.sheet.UMLSheetLabelProvider">
+ <propertyCategory category="domain"/>
+ <propertyCategory category="visual"/>
+ <propertyCategory category="extra"/>
+ </propertyContributor>
+ </extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
- <?gmfgen generated="true"?>
- <propertyTabs contributorId="org.eclipse.papyrus.uml.diagram.component">
- <propertyTab
- category="visual"
- id="property.tab.AppearancePropertySection"
- label="%tab.appearance"/>
- <propertyTab
- category="visual"
- id="property.tab.DiagramPropertySection"
- label="%tab.diagram"/>
- <propertyTab
- category="domain"
- id="property.tab.domain"
- label="%tab.domain"/>
- </propertyTabs>
- </extension>
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
+ <?gmfgen generated="true"?>
+ <propertyTabs contributorId="org.eclipse.papyrus.uml.diagram.component">
+ <propertyTab
+ category="visual"
+ id="property.tab.AppearancePropertySection"
+ label="%tab.appearance"/>
+ <propertyTab
+ category="visual"
+ id="property.tab.DiagramPropertySection"
+ label="%tab.diagram"/>
+ <propertyTab
+ category="domain"
+ id="property.tab.domain"
+ label="%tab.domain"/>
+ </propertyTabs>
+ </extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
- <?gmfgen generated="true"?>
- <propertySections contributorId="org.eclipse.papyrus.uml.diagram.component">
- <propertySection id="property.section.ConnectorAppearancePropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.ShapeColorAndFontPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.RulerGridPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
- tab="property.tab.DiagramPropertySection">
- </propertySection>
- <propertySection
- id="property.section.domain"
- tab="property.tab.domain"
- class="org.eclipse.papyrus.uml.diagram.component.sheet.UMLPropertySection">
- <input type="org.eclipse.gmf.runtime.notation.View"/>
- <input type="org.eclipse.gef.EditPart"/>
- </propertySection>
- </propertySections>
- </extension>
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
+ <?gmfgen generated="true"?>
+ <propertySections contributorId="org.eclipse.papyrus.uml.diagram.component">
+ <propertySection id="property.section.ConnectorAppearancePropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
+ tab="property.tab.AppearancePropertySection">
+ </propertySection>
+ <propertySection id="property.section.ShapeColorAndFontPropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
+ tab="property.tab.AppearancePropertySection">
+ </propertySection>
+ <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
+ tab="property.tab.AppearancePropertySection">
+ </propertySection>
+ <propertySection id="property.section.RulerGridPropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
+ tab="property.tab.DiagramPropertySection">
+ </propertySection>
+ <propertySection
+ id="property.section.domain"
+ tab="property.tab.domain"
+ class="org.eclipse.papyrus.uml.diagram.component.sheet.UMLPropertySection">
+ <input type="org.eclipse.gmf.runtime.notation.View"/>
+ <input type="org.eclipse.gef.EditPart"/>
+ </propertySection>
+ </propertySections>
+ </extension>
- <extension point="org.eclipse.core.runtime.preferences" id="prefs">
- <?gmfgen generated="true"?>
- <initializer class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramPreferenceInitializer"/>
- </extension>
+ <extension point="org.eclipse.core.runtime.preferences" id="prefs">
+ <?gmfgen generated="true"?>
+ <initializer class="org.eclipse.papyrus.uml.diagram.component.preferences.DiagramPreferenceInitializer"/>
+ </extension>
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLComponentDiagram"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="3203,2002,3202,3200,3205,3201,3199,3204,2003,3069,3077,3076,3078,3070,3071,3074,3075,1,5,6,3072,3079"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4006,4003,4012,4014,4007,4013,4016,4015,4009,4010,4017,4018,4019"/>
- </viewProvider>
- </extension>
+ <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
+ <?gmfgen generated="true"?>
+ <viewProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLViewProvider">
+ <Priority name="Lowest"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLComponentDiagram"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="3203,2002,3202,3200,3205,3201,3199,3204,2003,3069,3077,3076,3078,3070,3071,3074,3075,1,5,6,3072,3079"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4006,4003,4012,4014,4007,4013,4016,4015,4009,4010,4017,4018,4019"/>
+ </viewProvider>
+ </extension>
- <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- <?gmfgen generated="true"?>
- <editpartProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLEditPartProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="PapyrusUMLComponentDiagram"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="3203,2002,3202,3200,3205,3201,3199,3204,2003,3069,3077,3076,3078,3070,3071,3074,3075,1,5,6,3072,3079"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4001,4006,4003,4012,4014,4007,4013,4016,4015,4009,4010,4017,4018,4019"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="5008,5004,5262,5254,5266,5255,5252,5253,5265,5005,5006,5007,5264,5261,5267,5256,5257,5258,5259,5260,0,5268"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="7001,7006,7002,7007,7005,7003,7004,7008,7009,7010,7011"/>
- </object>
- <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- </editpartProvider>
- </extension>
+ <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
+ <?gmfgen generated="true"?>
+ <editpartProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLEditPartProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
+ <method name="getType()" value="PapyrusUMLComponentDiagram"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
+ <method name="getType()" value="3203,2002,3202,3200,3205,3201,3199,3204,2003,3069,3077,3076,3078,3070,3071,3074,3075,1,5,6,3072,3079"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
+ <method name="getType()" value="4001,4006,4003,4012,4014,4007,4013,4016,4015,4009,4010,4017,4018,4019"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
+ <method name="getType()" value="5008,5004,5262,5254,5266,5255,5252,5253,5265,5005,5006,5007,5264,5261,5267,5256,5257,5258,5259,5260,0,5268"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
+ <method name="getType()" value="7001,7006,7002,7007,7005,7003,7004,7008,7009,7010,7011"/>
+ </object>
+ <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
+ </editpartProvider>
+ </extension>
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLIconProvider">
- <Priority name="Low"/>
- </IconProvider>
- </extension>
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
+ <?gmfgen generated="true"?>
+ <IconProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLIconProvider">
+ <Priority name="Low"/>
+ </IconProvider>
+ </extension>
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- <?gmfgen generated="true"?>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Model_1000"
- name="%metatype.name.Package_1000"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Package"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ModelEditHelper">
- <param name="semanticHint" value="1000"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"
- name="%metatype.name.Dependency_3203"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Dependency"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.DependencyEditHelper">
- <param name="semanticHint" value="3203"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Component_2002"
- name="%metatype.name.Component_2002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Component"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ComponentEditHelper">
- <param name="semanticHint" value="2002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Model_3202"
- name="%metatype.name.Model_3202"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Model"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ModelEditHelper">
- <param name="semanticHint" value="3202"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Package_3200"
- name="%metatype.name.Package_3200"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Package"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PackageEditHelper">
- <param name="semanticHint" value="3200"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Interface_3205"
- name="%metatype.name.Interface_3205"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interface"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceEditHelper">
- <param name="semanticHint" value="3205"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Comment_3201"
- name="%metatype.name.Comment_3201"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Comment"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.CommentEditHelper">
- <param name="semanticHint" value="3201"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Comment_3199"
- name="%metatype.name.Constraint_3199"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Constraint"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ConstraintEditHelper">
- <param name="semanticHint" value="3199"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.DefaultNamedElement_3204"
- name="%metatype.name.NamedElement_3204"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="NamedElement"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.DefaultNamedElementEditHelper">
- <param name="semanticHint" value="3204"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Interface_2003"
- name="%metatype.name.Interface_2003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interface"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceEditHelper">
- <param name="semanticHint" value="2003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Port_3069"
- name="%metatype.name.Port_3069"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Port"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PortEditHelper">
- <param name="semanticHint" value="3069"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Model_3077"
- name="%metatype.name.Model_3077"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Model"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ModelEditHelper">
- <param name="semanticHint" value="3077"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Package_3076"
- name="%metatype.name.Package_3076"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Package"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PackageEditHelper">
- <param name="semanticHint" value="3076"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Interface_3078"
- name="%metatype.name.Interface_3078"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interface"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceEditHelper">
- <param name="semanticHint" value="3078"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Component_3070"
- name="%metatype.name.Component_3070"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.Component_2002"/>
- <param name="semanticHint" value="3070"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Component_3071"
- name="%metatype.name.Component_3071"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.Component_2002"/>
- <param name="semanticHint" value="3071"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Comment_3074"
- name="%metatype.name.Comment_3074"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.Comment_3201"/>
- <param name="semanticHint" value="3074"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Constraint_3075"
- name="%metatype.name.Constraint_3075"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.Comment_3199"/>
- <param name="semanticHint" value="3075"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Property_1"
- name="%metatype.name.Property_1"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Property"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PropertyEditHelper">
- <param name="semanticHint" value="1"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Operation_5"
- name="%metatype.name.Operation_5"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Operation"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.OperationEditHelper">
- <param name="semanticHint" value="5"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Reception_6"
- name="%metatype.name.Reception_6"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Reception"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ReceptionEditHelper">
- <param name="semanticHint" value="6"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Interface_3072"
- name="%metatype.name.Interface_3072"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.Interface_2003"/>
- <param name="semanticHint" value="3072"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Property_3079"
- name="%metatype.name.Property_3079"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Property"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PropertyEditHelper">
- <param name="semanticHint" value="3079"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Usage_4001"
- name="%metatype.name.Usage_4001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Usage"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.UsageEditHelper">
- <param name="semanticHint" value="4001"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.InterfaceRealization_4006"
- name="%metatype.name.InterfaceRealization_4006"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="InterfaceRealization"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceRealizationEditHelper">
- <param name="semanticHint" value="4006"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Generalization_4003"
- name="%metatype.name.Generalization_4003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Generalization"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.GeneralizationEditHelper">
- <param name="semanticHint" value="4003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Substitution_4012"
- name="%metatype.name.Substitution_4012"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Substitution"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.SubstitutionEditHelper">
- <param name="semanticHint" value="4012"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Manifestation_4014"
- name="%metatype.name.Manifestation_4014"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Manifestation"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ManifestationEditHelper">
- <param name="semanticHint" value="4014"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.ComponentRealization_4007"
- name="%metatype.name.ComponentRealization_4007"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ComponentRealization"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ComponentRealizationEditHelper">
- <param name="semanticHint" value="4007"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Abstraction_4013"
- name="%metatype.name.Abstraction_4013"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Abstraction"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.AbstractionEditHelper">
- <param name="semanticHint" value="4013"/>
- </metamodelType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Link_4016"
- name="%metatype.name.Link_4016"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4016"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.CommentAnnotatedElement_4008"
- name="%metatype.name.CommentAnnotatedElement_4015"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4015"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.ConstraintConstrainedElement_4009"
- name="%metatype.name.ConstraintConstrainedElement_4009"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4009"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Dependency_4010"
- name="%metatype.name.Dependency_4010"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"/>
- <param name="semanticHint" value="4010"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Dependency_4017"
- name="%metatype.name.Dependency_4017"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- edithelperadvice="org.eclipse.papyrus.uml.diagram.component.edit.helpers.DependencyBranchLink">
- <specializes id="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"/>
- <param name="semanticHint" value="4017"/>
- </specializationType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.component.Link_4018"
- name="%metatype.name.Link_4018"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4018"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.component.Connector_4019"
- name="%metatype.name.Connector_4019"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Connector"
- edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ConnectorEditHelper">
- <param name="semanticHint" value="4019"/>
- </metamodelType>
- </metamodel>
- </extension>
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
+ <?gmfgen generated="true"?>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Model_1000"
+ name="%metatype.name.Package_1000"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Package"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ModelEditHelper">
+ <param name="semanticHint" value="1000"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"
+ name="%metatype.name.Dependency_3203"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Dependency"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.DependencyEditHelper">
+ <param name="semanticHint" value="3203"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Component_2002"
+ name="%metatype.name.Component_2002"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Component"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ComponentEditHelper">
+ <param name="semanticHint" value="2002"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Model_3202"
+ name="%metatype.name.Model_3202"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Model"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ModelEditHelper">
+ <param name="semanticHint" value="3202"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Package_3200"
+ name="%metatype.name.Package_3200"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Package"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PackageEditHelper">
+ <param name="semanticHint" value="3200"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Interface_3205"
+ name="%metatype.name.Interface_3205"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Interface"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceEditHelper">
+ <param name="semanticHint" value="3205"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Comment_3201"
+ name="%metatype.name.Comment_3201"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Comment"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.CommentEditHelper">
+ <param name="semanticHint" value="3201"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Comment_3199"
+ name="%metatype.name.Constraint_3199"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Constraint"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ConstraintEditHelper">
+ <param name="semanticHint" value="3199"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.DefaultNamedElement_3204"
+ name="%metatype.name.NamedElement_3204"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="NamedElement"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.DefaultNamedElementEditHelper">
+ <param name="semanticHint" value="3204"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Interface_2003"
+ name="%metatype.name.Interface_2003"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Interface"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceEditHelper">
+ <param name="semanticHint" value="2003"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Port_3069"
+ name="%metatype.name.Port_3069"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Port"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PortEditHelper">
+ <param name="semanticHint" value="3069"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Model_3077"
+ name="%metatype.name.Model_3077"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Model"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ModelEditHelper">
+ <param name="semanticHint" value="3077"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Package_3076"
+ name="%metatype.name.Package_3076"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Package"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PackageEditHelper">
+ <param name="semanticHint" value="3076"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Interface_3078"
+ name="%metatype.name.Interface_3078"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Interface"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceEditHelper">
+ <param name="semanticHint" value="3078"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Component_3070"
+ name="%metatype.name.Component_3070"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.Component_2002"/>
+ <param name="semanticHint" value="3070"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Component_3071"
+ name="%metatype.name.Component_3071"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.Component_2002"/>
+ <param name="semanticHint" value="3071"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Comment_3074"
+ name="%metatype.name.Comment_3074"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.Comment_3201"/>
+ <param name="semanticHint" value="3074"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Constraint_3075"
+ name="%metatype.name.Constraint_3075"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.Comment_3199"/>
+ <param name="semanticHint" value="3075"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Property_1"
+ name="%metatype.name.Property_1"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Property"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PropertyEditHelper">
+ <param name="semanticHint" value="1"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Operation_5"
+ name="%metatype.name.Operation_5"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Operation"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.OperationEditHelper">
+ <param name="semanticHint" value="5"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Reception_6"
+ name="%metatype.name.Reception_6"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Reception"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ReceptionEditHelper">
+ <param name="semanticHint" value="6"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Interface_3072"
+ name="%metatype.name.Interface_3072"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.Interface_2003"/>
+ <param name="semanticHint" value="3072"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Property_3079"
+ name="%metatype.name.Property_3079"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Property"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.PropertyEditHelper">
+ <param name="semanticHint" value="3079"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Usage_4001"
+ name="%metatype.name.Usage_4001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Usage"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.UsageEditHelper">
+ <param name="semanticHint" value="4001"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.InterfaceRealization_4006"
+ name="%metatype.name.InterfaceRealization_4006"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="InterfaceRealization"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.InterfaceRealizationEditHelper">
+ <param name="semanticHint" value="4006"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Generalization_4003"
+ name="%metatype.name.Generalization_4003"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Generalization"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.GeneralizationEditHelper">
+ <param name="semanticHint" value="4003"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Substitution_4012"
+ name="%metatype.name.Substitution_4012"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Substitution"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.SubstitutionEditHelper">
+ <param name="semanticHint" value="4012"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Manifestation_4014"
+ name="%metatype.name.Manifestation_4014"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Manifestation"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ManifestationEditHelper">
+ <param name="semanticHint" value="4014"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.ComponentRealization_4007"
+ name="%metatype.name.ComponentRealization_4007"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="ComponentRealization"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ComponentRealizationEditHelper">
+ <param name="semanticHint" value="4007"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Abstraction_4013"
+ name="%metatype.name.Abstraction_4013"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Abstraction"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.AbstractionEditHelper">
+ <param name="semanticHint" value="4013"/>
+ </metamodelType>
+ </metamodel>
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Link_4016"
+ name="%metatype.name.Link_4016"
+ kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4016"/>
+ </specializationType>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.CommentAnnotatedElement_4008"
+ name="%metatype.name.CommentAnnotatedElement_4015"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4015"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.ConstraintConstrainedElement_4009"
+ name="%metatype.name.ConstraintConstrainedElement_4009"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4009"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Dependency_4010"
+ name="%metatype.name.Dependency_4010"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"/>
+ <param name="semanticHint" value="4010"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Dependency_4017"
+ name="%metatype.name.Dependency_4017"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ edithelperadvice="org.eclipse.papyrus.uml.diagram.component.edit.helpers.DependencyBranchLink">
+ <specializes id="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"/>
+ <param name="semanticHint" value="4017"/>
+ </specializationType>
+ </metamodel>
+ <specializationType
+ id="org.eclipse.papyrus.uml.diagram.component.Link_4018"
+ name="%metatype.name.Link_4018"
+ kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4018"/>
+ </specializationType>
+ <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.uml.diagram.component.Connector_4019"
+ name="%metatype.name.Connector_4019"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Connector"
+ edithelper="org.eclipse.papyrus.uml.diagram.component.edit.helpers.ConnectorEditHelper">
+ <param name="semanticHint" value="4019"/>
+ </metamodelType>
+ </metamodel>
+ </extension>
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
- <?gmfgen generated="true"?>
- <clientContext id="org.eclipse.papyrus.uml.diagram.component.TypeContext">
- <enablement>
- <test
- property="org.eclipse.gmf.runtime.emf.core.editingDomain"
- value="org.eclipse.papyrus.uml.diagram.component.EditingDomain"/>
- </enablement>
- </clientContext>
- <binding context="org.eclipse.papyrus.uml.diagram.component.TypeContext">
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Model_1000"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Component_2002"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Model_3202"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Package_3200"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_3205"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Comment_3201"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Comment_3199"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.DefaultNamedElement_3204"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_2003"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Port_3069"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Model_3077"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Package_3076"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_3078"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Component_3070"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Component_3071"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Comment_3074"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Constraint_3075"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Property_1"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Operation_5"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Reception_6"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_3072"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Property_3079"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Usage_4001"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.InterfaceRealization_4006"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Generalization_4003"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Substitution_4012"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Manifestation_4014"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.ComponentRealization_4007"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Abstraction_4013"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Link_4016"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.CommentAnnotatedElement_4008"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.ConstraintConstrainedElement_4009"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Dependency_4010"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Dependency_4017"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Link_4018"/>
- <elementType ref="org.eclipse.papyrus.uml.diagram.component.Connector_4019"/>
- <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
- </binding>
- </extension>
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
+ <?gmfgen generated="true"?>
+ <clientContext id="org.eclipse.papyrus.uml.diagram.component.TypeContext">
+ <enablement>
+ <test
+ property="org.eclipse.gmf.runtime.emf.core.editingDomain"
+ value="org.eclipse.papyrus.uml.diagram.component.EditingDomain"/>
+ </enablement>
+ </clientContext>
+ <binding context="org.eclipse.papyrus.uml.diagram.component.TypeContext">
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Model_1000"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.DependencyNode_3203"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Component_2002"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Model_3202"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Package_3200"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_3205"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Comment_3201"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Comment_3199"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.DefaultNamedElement_3204"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_2003"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Port_3069"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Model_3077"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Package_3076"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_3078"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Component_3070"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Component_3071"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Comment_3074"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Constraint_3075"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Property_1"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Operation_5"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Reception_6"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Interface_3072"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Property_3079"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Usage_4001"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.InterfaceRealization_4006"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Generalization_4003"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Substitution_4012"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Manifestation_4014"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.ComponentRealization_4007"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Abstraction_4013"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Link_4016"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.CommentAnnotatedElement_4008"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.ConstraintConstrainedElement_4009"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Dependency_4010"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Dependency_4017"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Link_4018"/>
+ <elementType ref="org.eclipse.papyrus.uml.diagram.component.Connector_4019"/>
+ <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
+ </binding>
+ </extension>
- <extension point="org.eclipse.ui.commands" id="update-cmd">
- <?gmfgen generated="true"?>
- <command
- categoryId="org.eclipse.ui.category.edit"
- defaultHandler="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramUpdateCommand"
- description="%update.diagram.description"
- id="org.eclipse.papyrus.uml.diagram.component.updateDiagram"
- name="%update.diagram.name"/>
- </extension>
+ <extension point="org.eclipse.ui.commands" id="update-cmd">
+ <?gmfgen generated="true"?>
+ <command
+ categoryId="org.eclipse.ui.category.edit"
+ defaultHandler="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramUpdateCommand"
+ description="%update.diagram.description"
+ id="org.eclipse.papyrus.uml.diagram.component.updateDiagram"
+ name="%update.diagram.name"/>
+ </extension>
- <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
- <?gmfgen generated="true"?>
- <key
- commandId="org.eclipse.papyrus.uml.diagram.component.updateDiagram"
- contextId="org.eclipse.papyrus.uml.diagram.component.ui.diagramContext"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="F5"/>
- </extension>
+ <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
+ <?gmfgen generated="true"?>
+ <key
+ commandId="org.eclipse.papyrus.uml.diagram.component.updateDiagram"
+ contextId="org.eclipse.papyrus.uml.diagram.component.ui.diagramContext"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="F5"/>
+ </extension>
- <extension point="org.eclipse.ui.menus" id="context-menus">
- <?gmfgen generated="true"?>
- <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
- </menuContribution>
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
- </menuContribution -->
- <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
- <command commandId="org.eclipse.papyrus.uml.diagram.component.LoadResourceAction">
- <visibleWhen>
- <and>
- <with variable="activePartId"><equals value="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorID"/></with>
- <with variable="selection"><iterate ifEmpty="false">
- <instanceof value="org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentDiagramEditPart"/>
- </iterate></with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
+ <extension point="org.eclipse.ui.menus" id="context-menus">
+ <?gmfgen generated="true"?>
+ <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
+ </menuContribution>
+ <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
+ </menuContribution -->
+ <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
+ <command commandId="org.eclipse.papyrus.uml.diagram.component.LoadResourceAction">
+ <visibleWhen>
+ <and>
+ <with variable="activePartId"><equals value="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorID"/></with>
+ <with variable="selection"><iterate ifEmpty="false">
+ <instanceof value="org.eclipse.papyrus.uml.diagram.component.edit.parts.ComponentDiagramEditPart"/>
+ </iterate></with>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
- <extension point="org.eclipse.ui.commands" id="menu-commands">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
- <command id="org.eclipse.papyrus.uml.diagram.component.LoadResourceAction"
- name="Load Resource"
- categoryId="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorID"
- defaultHandler="org.eclipse.papyrus.uml.diagram.component.part.LoadResourceAction"/>
- </extension>
+ <extension point="org.eclipse.ui.commands" id="menu-commands">
+ <?gmfgen generated="true"?>
+ <category id="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
+ <command id="org.eclipse.papyrus.uml.diagram.component.LoadResourceAction"
+ name="Load Resource"
+ categoryId="org.eclipse.papyrus.uml.diagram.component.part.UMLDiagramEditorID"
+ defaultHandler="org.eclipse.papyrus.uml.diagram.component.part.LoadResourceAction"/>
+ </extension>
- <extension point="org.eclipse.ui.handlers" id="menu-handlers">
- <?gmfgen generated="true"?>
- </extension>
+ <extension point="org.eclipse.ui.handlers" id="menu-handlers">
+ <?gmfgen generated="true"?>
+ </extension>
@@ -758,395 +758,395 @@
-<extension
- id="Papyrus Component Diagram .palettedefinition"
- name="Papyrus Component Diagram Predefined Entries"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Lowest"/>
- <contribution
- factoryClass="org.eclipse.papyrus.uml.diagram.component.part.UMLPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
-
- <entry
- defineOnly="true"
- description="Create a Constraint"
- id="component.tool.constraint"
- kind="tool"
- label="Constraint"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Comment"
- id="component.tool.comment"
- kind="tool"
- label="Comment"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Component"
- id="component.tool.component"
- kind="tool"
- label="Component"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Component.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Component.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Interface"
- id="component.tool.interface"
- kind="tool"
- label="Interface"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a model"
- id="component.tool.model"
- kind="tool"
- label="Model"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Property"
- id="component.tool.property"
- kind="tool"
- label="Property"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Operation"
- id="component.tool.operation"
- kind="tool"
- label="Operation"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Package"
- id="component.tool.package"
- kind="tool"
- label="Package"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Port"
- id="component.tool.port"
- kind="tool"
- label="Port"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Reception"
- id="component.tool.reception"
- kind="tool"
- label="Reception"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Link (Comment / Constraint)"
- id="component.tool.link"
- kind="tool"
- label="Link"
- large_icon="icons/obj16/Link.gif"
- path=""
- small_icon="icons/obj16/Link.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Connector"
- id="component.tool.connector"
- kind="tool"
- label="Connector"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Dependency"
- id="component.tool.dependency"
- kind="tool"
- label="Dependency"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a dependency branch"
- id="component.tool.dependencybranch"
- kind="tool"
- label="DependencyBranch"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Abstraction"
- id="component.tool.abstraction"
- kind="tool"
- label="Abstraction"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Manifestation"
- id="component.tool.manifestation"
- kind="tool"
- label="Manifestation"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Manifestation.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Manifestation.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Generalization link"
- id="component.tool.generalization"
- kind="tool"
- label="Generalization"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Usage"
- id="component.tool.usage"
- kind="tool"
- label="Usage"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Substitution"
- id="component.tool.substitution"
- kind="tool"
- label="Substitution"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Substitution.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Substitution.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create an Interface Realization"
- id="component.tool.interfaceRealization"
- kind="tool"
- label="Interface Realization"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create a Component Realization"
- id="component.tool.componentRealization"
- kind="tool"
- label="Component Realization"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ComponentRealization.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ComponentRealization.gif">
- </entry>
-
- </contribution>
- </paletteProvider>
-
- </extension>
+<extension
+ id="Papyrus Component Diagram .palettedefinition"
+ name="Papyrus Component Diagram Predefined Entries"
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+
+ <?gmfgen generated="true"?>
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Lowest"/>
+ <contribution
+ factoryClass="org.eclipse.papyrus.uml.diagram.component.part.UMLPaletteFactory">
+ <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
+
+ <entry
+ defineOnly="true"
+ description="Create a Constraint"
+ id="component.tool.constraint"
+ kind="tool"
+ label="Constraint"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Comment"
+ id="component.tool.comment"
+ kind="tool"
+ label="Comment"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Component"
+ id="component.tool.component"
+ kind="tool"
+ label="Component"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Component.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Component.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Interface"
+ id="component.tool.interface"
+ kind="tool"
+ label="Interface"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a model"
+ id="component.tool.model"
+ kind="tool"
+ label="Model"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Property"
+ id="component.tool.property"
+ kind="tool"
+ label="Property"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Operation"
+ id="component.tool.operation"
+ kind="tool"
+ label="Operation"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Package"
+ id="component.tool.package"
+ kind="tool"
+ label="Package"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Port"
+ id="component.tool.port"
+ kind="tool"
+ label="Port"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Reception"
+ id="component.tool.reception"
+ kind="tool"
+ label="Reception"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Link (Comment / Constraint)"
+ id="component.tool.link"
+ kind="tool"
+ label="Link"
+ large_icon="icons/obj16/Link.gif"
+ path=""
+ small_icon="icons/obj16/Link.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create new Connector"
+ id="component.tool.connector"
+ kind="tool"
+ label="Connector"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Dependency"
+ id="component.tool.dependency"
+ kind="tool"
+ label="Dependency"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a dependency branch"
+ id="component.tool.dependencybranch"
+ kind="tool"
+ label="DependencyBranch"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Abstraction"
+ id="component.tool.abstraction"
+ kind="tool"
+ label="Abstraction"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Manifestation"
+ id="component.tool.manifestation"
+ kind="tool"
+ label="Manifestation"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Manifestation.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Manifestation.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Generalization link"
+ id="component.tool.generalization"
+ kind="tool"
+ label="Generalization"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Usage"
+ id="component.tool.usage"
+ kind="tool"
+ label="Usage"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Substitution"
+ id="component.tool.substitution"
+ kind="tool"
+ label="Substitution"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Substitution.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Substitution.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Interface Realization"
+ id="component.tool.interfaceRealization"
+ kind="tool"
+ label="Interface Realization"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Component Realization"
+ id="component.tool.componentRealization"
+ kind="tool"
+ label="Component Realization"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ComponentRealization.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ComponentRealization.gif">
+ </entry>
+
+ </contribution>
+ </paletteProvider>
+
+ </extension>
-<extension
- id="Papyrus Component Diagram .standard"
- name="Papyrus Component Diagram Standard Palette"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Low"/>
- <contribution
- factoryClass="org.eclipse.papyrus.uml.diagram.component.part.UMLPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
-
- <entry
- description="Diagram Nodes"
- id="component.group.nodes"
- kind="drawer"
- label="Nodes"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
- <predefinedEntry
- id="component.tool.constraint"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.comment"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.component"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.interface"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.model"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.property"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.operation"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.package"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.port"
- path="/component.group.nodes">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.reception"
- path="/component.group.nodes">
- </predefinedEntry>
- <entry
- description="Diagram Links"
- id="component.group.links"
- kind="drawer"
- label="Links"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
- <predefinedEntry
- id="component.tool.link"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.connector"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.dependency"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.dependencybranch"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.abstraction"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.manifestation"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.generalization"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.usage"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.substitution"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.interfaceRealization"
- path="/component.group.links">
- </predefinedEntry>
- <predefinedEntry
- id="component.tool.componentRealization"
- path="/component.group.links">
- </predefinedEntry>
- </contribution>
- <editor id="org.eclipse.papyrus.uml.diagram.component"/>
- </paletteProvider>
-
-</extension>
+<extension
+ id="Papyrus Component Diagram .standard"
+ name="Papyrus Component Diagram Standard Palette"
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+
+ <?gmfgen generated="true"?>
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Low"/>
+ <contribution
+ factoryClass="org.eclipse.papyrus.uml.diagram.component.part.UMLPaletteFactory">
+ <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
+
+ <entry
+ description="Diagram Nodes"
+ id="component.group.nodes"
+ kind="drawer"
+ label="Nodes"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <expand
+ force="true">
+ </expand>
+ </entry>
+ <predefinedEntry
+ id="component.tool.constraint"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.comment"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.component"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.interface"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.model"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.property"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.operation"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.package"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.port"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.reception"
+ path="/component.group.nodes">
+ </predefinedEntry>
+ <entry
+ description="Diagram Links"
+ id="component.group.links"
+ kind="drawer"
+ label="Links"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <expand
+ force="true">
+ </expand>
+ </entry>
+ <predefinedEntry
+ id="component.tool.link"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.connector"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.dependency"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.dependencybranch"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.abstraction"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.manifestation"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.generalization"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.usage"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.substitution"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.interfaceRealization"
+ path="/component.group.links">
+ </predefinedEntry>
+ <predefinedEntry
+ id="component.tool.componentRealization"
+ path="/component.group.links">
+ </predefinedEntry>
+ </contribution>
+ <editor id="org.eclipse.papyrus.uml.diagram.component"/>
+ </paletteProvider>
+
+</extension>
-<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- <?gmfgen generated="true"?>
- <ParserProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
+<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
+ <?gmfgen generated="true"?>
+ <ParserProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLParserProvider">
+ <Priority name="Lowest"/>
+ </ParserProvider>
+ </extension>
<!-- optionally, specify keybindings -->
-<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
- <?gmfgen generated="true"?>
- <MarkerNavigationProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLMarkerNavigationProvider">
- <MarkerType name="org.eclipse.papyrus.uml.diagram.component.diagnostic"/>
- <Priority name="Lowest"/>
- </MarkerNavigationProvider>
- </extension>
+<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
+ <?gmfgen generated="true"?>
+ <MarkerNavigationProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLMarkerNavigationProvider">
+ <MarkerType name="org.eclipse.papyrus.uml.diagram.component.diagnostic"/>
+ <Priority name="Lowest"/>
+ </MarkerNavigationProvider>
+ </extension>
-<extension id="diagnostic" name="Papyrus Component Diagram problems" point="org.eclipse.core.resources.markers">
- <?gmfgen generated="true"?>
- <super type="org.eclipse.core.resources.problemmarker"/>
- <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
- <persistent value="true"/>
- </extension><extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- <?gmfgen generated="true"?>
- <decoratorProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLValidationDecoratorProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
- <context decoratorTargets="PRIMARY_VIEW"/>
- </decoratorProvider>
- </extension>
+<extension id="diagnostic" name="Papyrus Component Diagram problems" point="org.eclipse.core.resources.markers">
+ <?gmfgen generated="true"?>
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
+ <persistent value="true"/>
+ </extension><extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
+ <?gmfgen generated="true"?>
+ <decoratorProvider class="org.eclipse.papyrus.uml.diagram.component.providers.UMLValidationDecoratorProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
+ <context decoratorTargets="PRIMARY_VIEW"/>
+ </decoratorProvider>
+ </extension>
<extension
point="org.eclipse.ui.commands">
<command
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/META-INF/MANIFEST.MF
index a77fe93..4a88ef5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/META-INF/MANIFEST.MF
@@ -1,82 +1,80 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.uml.diagram.composite,
- org.eclipse.papyrus.uml.diagram.composite.custom.actions,
- org.eclipse.papyrus.uml.diagram.composite.custom.edit.command,
- org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies,
- org.eclipse.papyrus.uml.diagram.composite.custom.figures,
- org.eclipse.papyrus.uml.diagram.composite.custom.helper,
- org.eclipse.papyrus.uml.diagram.composite.custom.locators,
- org.eclipse.papyrus.uml.diagram.composite.custom.parts,
- org.eclipse.papyrus.uml.diagram.composite.edit.commands,
- org.eclipse.papyrus.uml.diagram.composite.edit.helpers,
- org.eclipse.papyrus.uml.diagram.composite.edit.parts,
- org.eclipse.papyrus.uml.diagram.composite.edit.policies,
- org.eclipse.papyrus.uml.diagram.composite.parsers,
- org.eclipse.papyrus.uml.diagram.composite.part,
- org.eclipse.papyrus.uml.diagram.composite.preferences,
- org.eclipse.papyrus.uml.diagram.composite.providers,
- org.eclipse.papyrus.uml.diagram.composite.sheet
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.eclipse.emf.ecore,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.expressions,
- org.eclipse.jface,
- org.eclipse.ui.views,
- org.eclipse.gmf.runtime.emf.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.gmf.runtime.emf.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.gmf.runtime.diagram.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui.providers,
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
- org.eclipse.gmf.runtime.diagram.ui.render,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
- org.eclipse.uml2.uml,
- org.eclipse.gmf.runtime.draw2d.ui,
- org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0",
- org.eclipse.papyrus.extensionpoints.editors;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.service.types;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.emf.appearance;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.appearance;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
- org.eclipse.ui.ide;bundle-version="3.8.0",
- org.eclipse.papyrus.uml.tools.extendedtypes;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
- org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit.ui,
- org.eclipse.draw2d;visibility:=reexport,
- org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.ocl.ecore;visibility:=reexport,
- org.eclipse.emf.validation;visibility:=reexport,
- org.eclipse.gef,
- org.eclipse.gmf.tooling.runtime;bundle-version="3.0.0",
- org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.0",
- org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
- org.eclipse.papyrus.views.properties;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.diagram.synchronizeview;bundle-version="1.0.0"
-Bundle-Vendor: %providerName
-Eclipse-LazyStart: true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.composite; singleton:=true
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.uml.diagram.composite,
+ org.eclipse.papyrus.uml.diagram.composite.custom.actions,
+ org.eclipse.papyrus.uml.diagram.composite.custom.edit.command,
+ org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies,
+ org.eclipse.papyrus.uml.diagram.composite.custom.figures,
+ org.eclipse.papyrus.uml.diagram.composite.custom.helper,
+ org.eclipse.papyrus.uml.diagram.composite.custom.locators,
+ org.eclipse.papyrus.uml.diagram.composite.custom.parts,
+ org.eclipse.papyrus.uml.diagram.composite.edit.commands,
+ org.eclipse.papyrus.uml.diagram.composite.edit.helpers,
+ org.eclipse.papyrus.uml.diagram.composite.edit.parts,
+ org.eclipse.papyrus.uml.diagram.composite.edit.policies,
+ org.eclipse.papyrus.uml.diagram.composite.parsers,
+ org.eclipse.papyrus.uml.diagram.composite.part,
+ org.eclipse.papyrus.uml.diagram.composite.preferences,
+ org.eclipse.papyrus.uml.diagram.composite.providers,
+ org.eclipse.papyrus.uml.diagram.composite.sheet
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.emf.ecore,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.core.expressions,
+ org.eclipse.jface,
+ org.eclipse.ui.views,
+ org.eclipse.gmf.runtime.emf.core,
+ org.eclipse.gmf.runtime.emf.commands.core,
+ org.eclipse.gmf.runtime.emf.ui.properties,
+ org.eclipse.gmf.runtime.diagram.ui,
+ org.eclipse.gmf.runtime.diagram.ui.properties,
+ org.eclipse.gmf.runtime.diagram.ui.providers,
+ org.eclipse.gmf.runtime.diagram.ui.providers.ide,
+ org.eclipse.gmf.runtime.diagram.ui.render,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
+ org.eclipse.uml2.uml,
+ org.eclipse.gmf.runtime.draw2d.ui,
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0",
+ org.eclipse.papyrus.extensionpoints.editors;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.service.types;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.emf.appearance;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.appearance;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.uml.tools.extendedtypes;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
+ org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.emf.edit.ui,
+ org.eclipse.draw2d;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.ocl.ecore;visibility:=reexport,
+ org.eclipse.emf.validation;visibility:=reexport,
+ org.eclipse.gef,
+ org.eclipse.gmf.tooling.runtime;bundle-version="3.0.0",
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="1.0.0",
+ org.eclipse.papyrus.views.properties;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.diagram.synchronizeview;bundle-version="1.0.0"
+Bundle-Vendor: %providerName
+Eclipse-LazyStart: true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.composite; singleton:=true
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/Messages.java
index 6530efa..02a8c29 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/Messages.java
@@ -1,83 +1,61 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 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:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.composite.custom.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.composite.custom.messages.messages"; //$NON-NLS-1$
-
- public static String CollaborationRoleSelectionDialog_Title;
-
- public static String CollaborationRoleSelectionDialog_Message;
-
- public static String ConnectorCreateCommand_INVALID_ARGS_MSG;
-
- public static String ConnectorCreateCommand_INVALID_SOURCE_MSG;
-
- public static String ConnectorCreateCommand_INVALID_TARGET_MSG;
-
- public static String CreateUmlElementDialog_New_Element_Name;
-
- public static String RoleBindingCreateCommand_INVALID_ARGS_MSG;
-
- public static String RoleBindingRoleSelectionDialog_Title;
-
- public static String RoleBindingRoleSelectionDialog_Message;
-
- public static String InformationFlowSelectionDialog_Title;
-
- public static String InformationFlowSelectionDialog_Message;
-
- public static String InformationItemGetNameDialog_Error_Message;
-
- public static String SelectionValidated;
-
- public static String ShowHideRelatedContentsAction_Message;
-
- public static String ShowHideRelatedContentsAction_Title;
-
- public static String InformationFlowSelectInformationItem_ERROR;
-
- public static String InterfaceManagerDialog_CreateANewInterface;
-
- public static String InterfaceManagerDialog_CreateNewInterface;
-
- public static String InterfaceManagerDialog_SelectedTheProvidedInterfaces;
-
- public static String InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier;
-
- public static String InterfaceManagerDialog_SelectTheParentOfThisNewInterface;
-
- public static String InterfaceManagerDialog_SelectTheRequiredInterfaces;
-
- public static String InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage;
-
- public static String InterfaceManagerDialog_Title;
-
- public static String ManageProvidedInterfacesHandler_OK;
-
- public static String ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined;
-
- public static String NoSelectionFound;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 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:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.composite.custom.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.composite.custom.messages.messages"; //$NON-NLS-1$
+
+ public static String CollaborationRoleSelectionDialog_Title;
+
+ public static String CollaborationRoleSelectionDialog_Message;
+
+ public static String ConnectorCreateCommand_INVALID_ARGS_MSG;
+
+ public static String ConnectorCreateCommand_INVALID_SOURCE_MSG;
+
+ public static String ConnectorCreateCommand_INVALID_TARGET_MSG;
+
+ public static String RoleBindingCreateCommand_INVALID_ARGS_MSG;
+
+ public static String RoleBindingRoleSelectionDialog_Title;
+
+ public static String RoleBindingRoleSelectionDialog_Message;
+
+ public static String InformationFlowSelectionDialog_Title;
+
+ public static String InformationFlowSelectionDialog_Message;
+
+ public static String InformationItemGetNameDialog_Error_Message;
+
+ public static String SelectionValidated;
+
+ public static String ShowHideRelatedContentsAction_Message;
+
+ public static String ShowHideRelatedContentsAction_Title;
+
+ public static String InformationFlowSelectInformationItem_ERROR;
+
+ public static String NoSelectionFound;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/messages.properties
index 191a29a..021283b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/messages/messages.properties
@@ -1,29 +1,18 @@
-CollaborationRoleSelectionDialog_Title=Collaboration role creation
-CollaborationRoleSelectionDialog_Message=Select the ConnectableElement (ex: Property) to reference as a role:
-ConnectorCreateCommand_INVALID_ARGS_MSG=Invalid arguments in create link command
-ConnectorCreateCommand_INVALID_SOURCE_MSG=Invalid source in create Connector command
-ConnectorCreateCommand_INVALID_TARGET_MSG=Invalid target in create Connector command
-CreateUmlElementDialog_New_Element_Name=New Element Name
-RoleBindingCreateCommand_INVALID_ARGS_MSG=Invalid arguments in create link command
-RoleBindingRoleSelectionDialog_Title=Collaboration role binding
-RoleBindingRoleSelectionDialog_Message=Select the role to bind:
-InformationFlowSelectionDialog_Title=InformationFlow creation
-InformationFlowSelectionDialog_Message=Select the InformationItems or the Classifiers to convey
-InformationItemGetNameDialog_Error_Message=Enter a name for the new InformationItem
-SelectionValidated=Selection validated.
-ShowHideRelatedContentsAction_Message=Choose the elements to show
-ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
-ShowHideRelatedContentsAction_Message=Choose the elements to show
-ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
-InformationFlowSelectInformationItem_ERROR=Selection has to be a Classifier or an Information Item.
-InterfaceManagerDialog_CreateANewInterface=Create a new Interface
-InterfaceManagerDialog_CreateNewInterface=Create new Interface
-InterfaceManagerDialog_SelectedTheProvidedInterfaces=Select the provided Interfaces
-InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier=Selection has to be a Package or a Classifier
-InterfaceManagerDialog_SelectTheParentOfThisNewInterface=Select the parent of this new Interface
-InterfaceManagerDialog_SelectTheRequiredInterfaces=Select the required Interfaces
-InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage=\nThe managed port is typed with an Interface, so this interface is not available as a provided Interface.\n
-InterfaceManagerDialog_Title=Select the provided and the required Interfaces
-ManageProvidedInterfacesHandler_OK=OK
-ManageProvidedInterfacesHandler_TheTypeOfThePortIsNotDefined=The type of the Port is not defined. You need to define it before managing its Interfaces.
+CollaborationRoleSelectionDialog_Title=Collaboration role creation
+CollaborationRoleSelectionDialog_Message=Select the ConnectableElement (ex: Property) to reference as a role:
+ConnectorCreateCommand_INVALID_ARGS_MSG=Invalid arguments in create link command
+ConnectorCreateCommand_INVALID_SOURCE_MSG=Invalid source in create Connector command
+ConnectorCreateCommand_INVALID_TARGET_MSG=Invalid target in create Connector command
+RoleBindingCreateCommand_INVALID_ARGS_MSG=Invalid arguments in create link command
+RoleBindingRoleSelectionDialog_Title=Collaboration role binding
+RoleBindingRoleSelectionDialog_Message=Select the role to bind:
+InformationFlowSelectionDialog_Title=InformationFlow creation
+InformationFlowSelectionDialog_Message=Select the InformationItems or the Classifiers to convey
+InformationItemGetNameDialog_Error_Message=Enter a name for the new InformationItem
+SelectionValidated=Selection validated.
+ShowHideRelatedContentsAction_Message=Choose the elements to show
+ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
+ShowHideRelatedContentsAction_Message=Choose the elements to show
+ShowHideRelatedContentsAction_Title=Show/Hide Related Contents
+InformationFlowSelectInformationItem_ERROR=Selection has to be a Classifier or an Information Item.
NoSelectionFound=No selection found. \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java
deleted file mode 100644
index a1eb05a..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/CreateUmlElementDialog.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 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:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.composite.custom.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.composite.custom.messages.Messages;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This dialog allows to create easily a new element in a UML Model.
- */
-public class CreateUmlElementDialog extends ElementTreeSelectionDialog {
- /** the hinted type of the element to create. */
- private IHintedType hintedType;
- /** the parent container of the element to create. */
- private Object parentContainer;
- /** the type of the element to create. */
- private String type;
- /** the root of the model. */
- private Package pack;
- /** the text field used to display the choose the name of the future element. */
- private Text text;
- /** the editing domain. */
- private TransactionalEditingDomain domain;
- /** The element to create is represented by this field. */
- private NewElementRepresentation elementToCreate;
- /** this Set contains names to exclude from the proposed name. */
- private List<String> forbiddenNames;
-
- /**
- * Constructor.
- *
- * @param parent
- * the parent
- * @param domain
- * the domain
- * @param labelProvider
- * the label provider
- * @param contentProvider
- * the content provider
- * @param pack
- * the pack
- * @param hintedType
- * the hinted type
- */
- public CreateUmlElementDialog(Shell parent, TransactionalEditingDomain domain, ILabelProvider labelProvider, ITreeContentProvider contentProvider, Package pack, IHintedType hintedType) {
- super(parent, labelProvider, contentProvider);
- Assert.isNotNull(pack);
- Assert.isNotNull(hintedType);
- this.pack = pack;
- this.hintedType = hintedType;
- this.domain = domain;
- init();
- }
-
- /**
- * Initializes the field {@link #type};.
- */
- protected void init() {
- EClass eClass = hintedType.getEClass();
- this.type = eClass.getName();
- this.parentContainer = null;
- this.forbiddenNames = null;
- }
-
- /**
- * Sets the forbidden names.
- *
- * @param forbiddenNames
- * the new forbidden names
- */
- public void setForbiddenNames(List<String> forbiddenNames) {
- this.forbiddenNames = forbiddenNames;
- }
-
- /**
- * Creates the dialog area.
- *
- * @param parent
- * the parent
- * @return the control
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- GridData data = (GridData) parent.getLayoutData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 1;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- Composite composite = (Composite) super.createDialogArea(parent);
- composite.setLayout(new GridLayout());
- GridData dat = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(dat);
- createNameSection(parent);
- return composite;
- }
-
- /**
- * Creates the name section and put it at the top of the composite.
- *
- * @param parent
- * the composite parent
- */
- protected void createNameSection(Composite parent) {
- Composite nameSection = new Composite(parent, SWT.NONE);
- // the label
- Label label = new Label(nameSection, SWT.NONE);
- label.setText(Messages.CreateUmlElementDialog_New_Element_Name);
- // the text field
- text = new Text(nameSection, SWT.BORDER);
- text.setText(getDefaultName());
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(textData);
- // layout for the nameSection
- GridLayout layout = new GridLayout(2, false);
- GridData data = new GridData(GridData.FILL_BOTH);
- nameSection.setLayout(layout);
- nameSection.setLayoutData(data);
- // we set the name section in first!
- nameSection.moveAbove(null);
- }
-
- /**
- * Returns the default name for the new Element.
- *
- * @return the default name
- * the default name for the new Element
- */
- protected String getDefaultName() {
- boolean existsInterface = false;
- String defaultName;
- int max = 0;
- do {
- List<Interface> allInterface = ElementUtil.getInstancesFilteredByType(pack, Interface.class, null);
- for (Object object : allInterface) {
- String name = NamedElementUtil.getName((NamedElement) object);
- if (name != null && name.startsWith(type)) {
- name = name.substring(type.length());
- Integer val = null;
- try {
- val = Integer.parseInt(name);
- } catch (NumberFormatException e) {
- // Nothing to do
- }
- if (val != null) {
- max = Math.max(Integer.valueOf(val), max);
- existsInterface = true;
- }
- }
- }
- if (existsInterface) {
- defaultName = type + new Integer(max + 1).toString();
- } else {
- defaultName = type + new Integer(max).toString();
- }
- max++;
- } while (!isCorrectName(defaultName));
- return defaultName;
- }
-
- /**
- * Tests if the proposed name is not forbidden
- *
- * @param name
- * a name
- * @return
- * <code>true</code> if the proposed name is not forbidden
- */
- protected boolean isCorrectName(String name) {
- if (forbiddenNames == null) {
- return true;
- }
- return !forbiddenNames.contains(name);
- }
-
- /**
- * Returns the command to create the new element which the chosen name.
- *
- * @return the command
- * the command to create the new element which the chosen name
- */
- public Command getCommand() {
- CompositeCommand cmd = new CompositeCommand("Create new element command"); //$NON-NLS-1$
- // request to create the new Interface
- if (elementToCreate.getCreateElementRequest() != null) {
- ICommand command = getCommand(elementToCreate.getCreateElementRequest());
- if (command.canExecute()) {
- cmd.add(command);
- SetNameCommand nameCommand = new SetNameCommand(domain, "Set Name Command", null, null, elementToCreate); //$NON-NLS-1$
- if (nameCommand.canExecute()) {
- cmd.add(nameCommand);
- }
- }
- return new ICommandProxy(cmd);
- } else {
- return new ICommandProxy(new CustomCreateElementCommand(domain, "CustomCreateElementCommand", null, elementToCreate)); //$NON-NLS-1$
- }
- }
-
- /**
- * Compute result.
- *
- * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- java.util.List<Object> result = new ArrayList<Object>();
- result.add(elementToCreate);
- setResult(result);
- }
-
- /**
- * Set the value to {@link #name} and {@link #parentContainer}.
- *
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
- */
- @Override
- protected void okPressed() {
- ISelection selection = getTreeViewer().getSelection();
- parentContainer = ((IStructuredSelection) selection).getFirstElement();
- CreateElementRequest request = null;
- if (parentContainer instanceof EObject) {
- request = new CreateElementRequest(domain, (EObject) parentContainer, this.hintedType);
- }
- elementToCreate = new NewElementRepresentation(this.text.getText(), parentContainer, hintedType, request);
- super.okPressed();
- }
-
- /**
- * Returns a command corresponding to this request.
- *
- * @param request
- * a request
- * @return the command
- * The command corresponding to this request or an {@link UnexecutableCommand} when the command can not be build
- */
- private ICommand getCommand(IEditCommandRequest request) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(UMLPackage.eINSTANCE.getNamedElement());
- {
- if (provider != null) {
- ICommand cmd = provider.getEditCommand(request);
- if (cmd != null && cmd.canExecute()) {
- return cmd;
- }
- }
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This command is used to set the chosen name to the new element.
- */
- public class SetNameCommand extends AbstractTransactionalCommand {
- /** the representation that will own the new element when it will be created. */
- private NewElementRepresentation representation;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param previousRequest
- * the previous request
- * @param representation
- * the representation
- */
- public SetNameCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, CreateElementRequest previousRequest, NewElementRepresentation representation) {
- super(domain, label, affectedFiles);
- this.representation = representation;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if (representation.getEObject() instanceof NamedElement) {
- NamedElement el = (NamedElement) representation.getEObject();
- el.setName(representation.getName());
- }
- return CommandResult.newOKCommandResult(representation);
- }
- }
-
- /**
- * This command allows to create a new element when its parent is not yet created when the command is build
- *
- * We need a such command, because {@link CreateRelationshipCommand#getCommandResult()} return <code>null</code> when the command has not been
- * executed.
- */
- public class CustomCreateElementCommand extends AbstractTransactionalCommand {
- /** the representation of the element to create. */
- private NewElementRepresentation elementToCreate;
-
- /**
- * Constructor.
- *
- * @param domain
- * the domain
- * @param label
- * the label
- * @param affectedFiles
- * the affected files
- * @param elementToCreate
- * the element to create
- */
- public CustomCreateElementCommand(TransactionalEditingDomain domain, String label, List<?> affectedFiles, NewElementRepresentation elementToCreate) {
- super(domain, label, affectedFiles);
- this.elementToCreate = elementToCreate;
- }
-
- /**
- * Do execute with result.
- *
- * @param monitor
- * the monitor
- * @param info
- * the info
- * @return the command result
- * @throws ExecutionException
- * the execution exception
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- EObject container = elementToCreate.getEObjectParent();
- CreateElementRequest request = new CreateElementRequest(domain, container, hintedType);
- ICommand command = getCommand(request);
- command.execute(new NullProgressMonitor(), null);
- EObject newEl = request.getNewElement();
- if (newEl instanceof NamedElement) {
- ((NamedElement) newEl).setName(elementToCreate.getName());
- }
- elementToCreate.setCreateElement(request.getNewElement());
- return CommandResult.newOKCommandResult(elementToCreate);
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java
deleted file mode 100644
index b8f92c6..0000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/ui/InterfaceManagerDialog.java
+++ /dev/null
@@ -1,1008 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.composite.custom.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.infra.widgets.editors.IElementSelector;
-import org.eclipse.papyrus.infra.widgets.editors.SelectionEditor;
-import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
-import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.papyrus.uml.diagram.common.util.Visitor;
-import org.eclipse.papyrus.uml.diagram.composite.custom.messages.Messages;
-import org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Dependency;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interface;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Realization;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.Usage;
-
-/**
- *
- * This class provides a Dialog to manage easily the provided and the required Interfaces for a {@link Port}
- *
- *
- */
-public class InterfaceManagerDialog extends SelectionDialog {
-
- /** the selected port */
- private Port port;
-
- /** the list of the provided interfaces */
- private List<Object> providedInterfaces;
-
- /** the list of the required interfaces */
- private List<Object> requiredInterfaces;
-
- /** the {@link ReferenceSelector} for the provided interfaces */
- private ReferenceSelector providedSelector;
-
- /** the {@link ReferenceSelector} for the required interfaces */
- private ReferenceSelector requiredSelector;
-
- /** the Editor for the provided interfaces */
- private SelectionEditor providedEditor;
-
- /** the Editor for the required interfaces */
- private SelectionEditor requiredEditor;
-
- /**
- * In this map, we link the {@link Interface} with their {@link Usage} This map is used when we want remove an Interface from a Usage
- */
- private Map<Interface, List<Usage>> requiredInterfacesMappedWithUsage = new HashMap<Interface, List<Usage>>();
-
- /**
- * In this map, we link the {@link Interface} with their {@link Realization} This map is used when we want remove an Interface from a Realization
- */
- private Map<Interface, List<Realization>> providedInterfacesMappedWithRealization = new HashMap<Interface, List<Realization>>();
-
- /** the label provider for selector */
- private final ILabelProvider selectorLabelProvider = new SelectorLabelProvider();
-
- /** the label provider for the create new element dialog */
- private final ILabelProvider newElementLabelProvider = new CreateElementLabelProvider();
-
- /** the domain used for the commands */
- private TransactionalEditingDomain domain;
-
- /** the model */
- private Package model = null;
-
- /** this command contains the list of the command to create the new Interfaces */
- private CompoundCommand interfaceCreationCommand = new CompoundCommand("Create Interfaces Commands"); //$NON-NLS-1$
-
- /** This list contains representation of the Interface before their creation */
- private List<NewElementRepresentation> interfaceRepresentations;
-
- /** boolean used to know if the {@link Port} is typed with an {@link Interface} */
- private boolean typedWithInterface;
-
- /** path for the warning icons */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
-
- /**
- * This list contains the names used for the new elements.
- * We need to remember these names are used in order don't suggest them when we create other new elements
- */
- private List<String> forbiddenNames;
-
- /**
- *
- * Constructor.
- *
- * @param parentShell
- * the parent {@link Shell}
- * @param port
- * the {@link Port} for which we want manage the Interfaces
- */
- public InterfaceManagerDialog(Shell parentShell, Port port) {
- super(parentShell);
- this.setTitle(Messages.InterfaceManagerDialog_Title);
- this.port = port;
- Assert.isTrue(this.port.getType() instanceof Classifier);
- this.typedWithInterface = (this.port.getType() instanceof Interface);
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#create()
- *
- */
- @Override
- public void create() {
- super.create();
- init();
- }
-
- /**
- * This method initialize some fields of the class
- */
- protected void init() {
-
- this.forbiddenNames = new ArrayList<String>();
- this.interfaceRepresentations = new ArrayList<NewElementRepresentation>();
- EList<Namespace> namespaces = port.allNamespaces();
- Element el = namespaces.get(namespaces.size() - 1);
- if (el instanceof Package) {
- model = (Package) el;
- } else {
- model = el.getNearestPackage();
- }
-
- // fill the hashmap to link Interfaces with Usage and InterfaceRealization
- buildProvidedInterfaces();
- buildRequiredInterfaces();
-
- // we build the list of the provided interfaces
- this.providedInterfaces = new ArrayList<Object>();
- for (Interface current : this.port.getProvideds()) {
- this.providedInterfaces.add(current);
- }
- // when the port is typed by an Interface, we don't propose this interface in the possible Provided Interfaces list.
- if (typedWithInterface) {
- this.providedInterfaces.remove(this.port.getType());
- }
-
- // we build the list of the required interfaces
- this.requiredInterfaces = new ArrayList<Object>();
- for (Interface current : this.port.getRequireds()) {
- this.requiredInterfaces.add(current);
- }
-
- // initialize the transactional editing domain
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = activePage.getActiveEditor();
- if (editor instanceof IMultiDiagramEditor) {
- try {
- this.domain = ServiceUtils.getInstance().getTransactionalEditingDomain(((IMultiDiagramEditor) editor).getServicesRegistry());
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
-
- // selectors creation
- createSelectors();
- // editors creation
- createEditors();
-
- }
-
- /**
- * This method fills the map {@link #requiredInterfacesMappedWithUsage}
- */
- protected void buildRequiredInterfaces() {
- List<Usage> allUsage = ElementUtil.getInstancesFilteredByType(this.model, Usage.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier) this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier) this.port.getType()));
-
- for (Object current : allUsage) {
- Usage usage = (Usage) current;
- for (Classifier classifier : classifiers) {// we test if the current Usage is linked with the type of the Port
- if (usage.getClients().contains(classifier)) {// this Usage concerns the current port
- for (EObject target : usage.getSuppliers()) {
- if (this.port.getRequireds().contains(target)) {
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(target);
- if (usages != null) {
- usages.add(usage);
- } else {
- usages = new ArrayList<Usage>();
- usages.add(usage);
- this.requiredInterfacesMappedWithUsage.put((Interface) target, usages);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method fills the map {@link #providedInterfacesMappedWithRealization}
- */
- protected void buildProvidedInterfaces() {
- List<Realization> allRealization = ElementUtil.getInstancesFilteredByType(this.model, Realization.class, null);
- List<Classifier> classifiers = new ArrayList<Classifier>();
- classifiers.add((Classifier) this.port.getType());
-
- classifiers.addAll(Util.getAllSuperClasses(null, (Classifier) this.port.getType()));
-
- for (Object current : allRealization) {
- Realization realization = (Realization) current;
- for (Classifier classifier : classifiers) {// we test if the current Realization is linked with the type of the Port
- if (realization.getClients().contains(classifier)) {// this Realization concerns the current port
- for (EObject target : realization.getSuppliers()) {
- if (this.port.getProvideds().contains(target)) {
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(target);
- if (realizations != null) {
- realizations.add(realization);
- } else {
- realizations = new ArrayList<Realization>();
- realizations.add(realization);
- this.providedInterfacesMappedWithRealization.put((Interface) target, realizations);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- /**
- * This method creates the selectors {@link #providedSelector} and {@link #requiredSelector}
- */
- protected void createSelectors() {
- // the provided selector
- this.providedSelector = new ReferenceSelector(true);
- this.providedSelector.setLabelProvider(selectorLabelProvider);
- this.providedSelector.setContentProvider(new AbstractStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- @Override
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
- if (typedWithInterface) {
- tmp.remove(port.getType());
- }
- // we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- // the required selector
- this.requiredSelector = new ReferenceSelector(true);
- this.requiredSelector.setLabelProvider(selectorLabelProvider);
- this.requiredSelector.setContentProvider(new AbstractStaticContentProvider() {
-
- /**
- *
- * @see org.eclipse.papyrus.editors.providers.IStaticContentProvider#getElements()
- *
- * @return
- */
- @Override
- public Object[] getElements() {
- List<Object> tmp = new ArrayList<Object>();
- tmp.addAll(getAllAvailableInterfaces(model));
-
- // we add the new interfaces which are not yet created
- tmp.addAll(interfaceRepresentations);
- return tmp.toArray();
- }
- });
- }
-
- /**
- * This method create the 2 Editors {@link #providedEditor} and {@link #requiredEditor} and provides the listener for the button of these editors
- */
- protected void createEditors() {
- Composite parent = (Composite) getDialogArea();
- CreateButtonListener listener = new CreateButtonListener();
- // we set a specific message if the port is typed with an Interface
- if (typedWithInterface) {
- Composite messageSection = new Composite(parent, SWT.BORDER);
- CLabel label = new CLabel(messageSection, SWT.NONE);
-
- label.setText(Messages.InterfaceManagerDialog_ThePortIsTypedWithAnInterfaceWarningMessage);
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- label.setImage(errorImage);
- GridLayout layout = new GridLayout(1, true);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- messageSection.setLayout(layout);
- messageSection.setLayoutData(data);
- messageSection.setEnabled(false);
- }
- this.providedEditor = createEditor(parent, providedSelector, Messages.InterfaceManagerDialog_SelectedTheProvidedInterfaces, false, listener, this.providedInterfaces);
- this.requiredEditor = createEditor(parent, requiredSelector, Messages.InterfaceManagerDialog_SelectTheRequiredInterfaces, true, listener, this.requiredInterfaces);
-
- this.providedEditor.create();
- this.requiredEditor.create();
-
- GridLayout layout = (GridLayout) parent.getLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- this.providedEditor.setLayoutData(data);
- this.requiredEditor.setLayoutData(data);
- getShell().setSize(950, 700);
- getShell().layout();
- }
-
- /**
- * Creates a {@link SelectionEditor} and returns it
- *
- * @param parent
- * the composite parent
- * @param selector
- * the selector used by the created editor
- * @param message
- * the message to display in the created editor
- * @param withCreateButton
- * indicates if the editor provides an additional button for a specific action
- * @param listener
- * the listener for the button
- * @param initialSelection
- * the initial selection for this editor
- * @return
- * the created {@link SelectionEditor}
- */
- protected SelectionEditor createEditor(Composite parent, IElementSelector selector, String message, boolean withCreateButton, SelectionListener listener, List<Object> initialSelection) {
- SelectionEditor editor = new SelectionEditor(parent, selector, selectorLabelProvider, initialSelection);
- editor.setMessage(message);
- editor.setAdditionalButton(withCreateButton, Messages.InterfaceManagerDialog_CreateNewInterface, listener);
- return editor;
- }
-
- /**
- * Returns all the available Interfaces
- *
- * @return
- * all the available Interfaces
- * //TODO add the interfaces of the package import!
- */
- protected List<Interface> getAllAvailableInterfaces(Package pack) {
- List<Interface> otherInterfaces = new ArrayList<Interface>();
- List<Element> interfaces = Visitor.getOwnedAndImportedElement(pack, Interface.class);
- for (Namespace namespace : Visitor.getOwnedAndImportedNamespaces(pack)) {
- interfaces.addAll(Visitor.getOwnedAndImportedElement(namespace, Interface.class));
-
- }
-
- for (Element element : interfaces) {
- otherInterfaces.add((Interface) element);
- }
-
- return otherInterfaces;
- }
-
- /**
- * Returns the commands to apply the changes
- *
- * @return
- * the commands to apply the changes
- */
- public Command getCommand() {
- CompoundCommand command = new CompoundCommand("Command to manage interfaces on Port"); //$NON-NLS-1$
- if (!interfaceCreationCommand.isEmpty()) {
- command.add(interfaceCreationCommand);
- }
- Command cmd = getCommandsToCreateElements();
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- cmd = getCommandToRemoveReferencedInterfaces();
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- return command;
- }
-
- /**
- * Returns the command to remove referenced Interfaces in Usage and InterfaceRealization
- *
- * @return
- * The command to remove referenced Interfaces the Usage and InterfaceRealization.
- * Moreover, we add a command to destroy Usage and InterfaceRealization when they have any Suppliers after this action
- */
- protected Command getCommandToRemoveReferencedInterfaces() {
- CompoundCommand command = new CompoundCommand("Command to destroy Usage and InterfaceRealization"); //$NON-NLS-1$
-
- Set<Dependency> relationshipToDestroy = new HashSet<Dependency>();
- // commands to destroy Usage
- for (Object current : this.requiredEditor.getElementToRemove()) {
- // we get all usage associated with this interface
- List<Usage> usages = requiredInterfacesMappedWithUsage.get(current);
- for (Usage currentUsage : usages) {
- // we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentUsage, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject) current, false);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentUsage);
- }
- }
- }
-
- // commands to destroy InterfaceRealization
- for (Object current : this.providedEditor.getElementToRemove()) {
- // we get all usage associated with this interface
- List<Realization> realizations = providedInterfacesMappedWithRealization.get(current);
- for (Realization currentRealization : realizations) {
- // we remove the reference to the Interface in the Usage
- DestroyReferenceRequest request = new DestroyReferenceRequest(domain, currentRealization, UMLPackage.eINSTANCE.getDependency_Supplier(), (EObject) current, false);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- relationshipToDestroy.add(currentRealization);
- }
- }
- }
- if (!relationshipToDestroy.isEmpty()) {
- command.add(new ICommandProxy(new DestroyDependencyWithoutSupplierCommand(this.domain, null, relationshipToDestroy)));
- return command;
- }
-
- // nothing to do
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Returns the command to create new Usage and new InterfaceRealization
- *
- * @return
- * the command to create new Usage and new InterfaceRealization
- */
- protected Command getCommandsToCreateElements() {
- CompoundCommand command = new CompoundCommand("Command to create Usage and InterfaceRealization"); //$NON-NLS-1$
- // commands for Usage Creation
- for (Object current : this.requiredEditor.getElementToAdd()) {
- if (current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType().eContainer(), this.port.getType(), (EObject) current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- } else {// its an NewElementRepresentation
-
- CreateUsageCommand cmd = new CreateUsageCommand(this.domain, this.port.getType().eContainer(), this.port.getType(), (NewElementRepresentation) current, null);
- if (cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
-
- // commands for InterfaceRealization Creation
- for (Object current : providedEditor.getElementToAdd()) {
- if (current instanceof EObject) {
- CreateRelationshipRequest request = new CreateRelationshipRequest(this.port.getType(), this.port.getType(), (EObject) current, org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- } else {// its an NewElementRepresentation
- CreateInterfaceRealizationCommand cmd = new CreateInterfaceRealizationCommand(this.domain, this.port.getType(), this.port.getType(), (NewElementRepresentation) current, null);
- if (cmd.canExecute()) {
- command.add(new ICommandProxy(cmd));
- }
- }
- }
- if (!command.isEmpty()) {
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Return the command corresponding to the request
- *
- * @param req
- * a request
- * @return
- * the command corresponding to the request
- */
- protected Command getCommand(AbstractEditCommandRequest req) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(model);
- if (provider != null) {
- ICommand setCommand = provider.getEditCommand(req);
- if (setCommand != null) {
- return new ICommandProxy(setCommand.reduce());
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * This listener is used to know when the user clicks on the Button to create a new {@link Interface}
- *
- *
- *
- */
- public class CreateButtonListener implements SelectionListener {
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- CreateUmlElementDialog dialog = new CreateUmlElementDialog(getShell(), domain, newElementLabelProvider, new CustomContentProvider(), model, UMLElementTypes.INTERFACE);
- dialog.setTitle(Messages.InterfaceManagerDialog_CreateANewInterface);
- dialog.setMessage(Messages.InterfaceManagerDialog_SelectTheParentOfThisNewInterface);
- dialog.setHelpAvailable(false);
- dialog.setForbiddenNames(forbiddenNames);
- List<Object> input = new ArrayList<Object>();
- input.add(model);
- dialog.setInput(input);
- dialog.setValidator(new ParentInterfaceValidator());
- if (dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
- interfaceCreationCommand.add(dialog.getCommand());
- Object[] res = dialog.getResult();
- for (Object current : res) {
- if (current instanceof NewElementRepresentation) {
- interfaceRepresentations.add((NewElementRepresentation) current);
- forbiddenNames.add(((NewElementRepresentation) current).getName());
- }
- }
- providedSelector.refresh();
- requiredSelector.refresh();
- }
- }
-
- /**
- *
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- *
- * @param e
- */
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
- }
-
- /**
- *
- * This class provides a validator for the selection of the parent of the new Interface
- *
- *
- */
- public class ParentInterfaceValidator implements ISelectionStatusValidator {
-
- /**
- * Selection has to be a Classifier or an Interface to allow creation
- *
- * @see org.eclipse.ui.dialogs.ISelectionStatusValidator#validate(java.lang.Object[])
- *
- * @param selection
- * @return
- */
- @Override
- public IStatus validate(Object[] selection) {
-
- IStatus status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.NoSelectionFound);
- if (selection.length >= 1) {
- for (int i = 0; i < selection.length; i++) {
- if (selection[i] instanceof Package || selection[i] instanceof Classifier || selection[i] instanceof NewElementRepresentation) {
- status = new Status(IStatus.OK, UMLDiagramEditorPlugin.ID, Messages.SelectionValidated);
- } else {
- status = new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, Messages.InterfaceManagerDialog_SelectionHasToBeAPackageOrAClassifier);
- break;
- }
- }
- }
- return status;
- }
- }
-
- /**
- *
- * This class provides a CustomLabelProvider for this dialog.
- * This class manages the {@link NewElementRepresentation} and consider them like Interfaces
- *
- *
- */
- public class SelectorLabelProvider extends CreateElementLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if (element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation) element).getQualifiedName();
- } else if (element instanceof NamedElement) {
- return ((NamedElement) element).getQualifiedName();
- }
- return super.getText(element);
- }
-
- }
-
- public class CreateElementLabelProvider extends UMLLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Image getImage(Object element) {
- if (element instanceof NewElementRepresentation) {
- return org.eclipse.papyrus.uml.tools.Activator.getDefault().getImageForUMLMetaclass(UMLPackage.eINSTANCE.getInterface());
- }
- return super.getImage(element);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.EditorLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(Object element) {
- if (element instanceof NewElementRepresentation) {
- return ((NewElementRepresentation) element).getName();
- }
- return super.getText(element);
- }
-
- }
-
- /**
- *
- * This content provider is used in this dialog. It returns the available element in the model + the future element which are {@link NewElementRepresentation}
- *
- *
- */
- public class CustomContentProvider implements ITreeContentProvider {
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- *
- */
- @Override
- public void dispose() {
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- *
- * @param viewer
- * @param oldInput
- * @param newInput
- */
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- *
- * @param inputElement
- * @return
- */
- @Override
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof List<?>) {
- return ((List<?>) inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- *
- * @param parentElement
- * @return
- */
- @Override
- public Object[] getChildren(Object parentElement) {
- List<Object> children = new ArrayList<Object>();
- List<?> tmp = null;
- if (parentElement instanceof Package) {
- tmp = ((Package) parentElement).getOwnedMembers();
- } else if (parentElement instanceof Classifier) {
- tmp = ((Classifier) parentElement).getOwnedMembers();
- }
- if (tmp != null) {
- for (Object current : tmp) {
- if (current instanceof Classifier || current instanceof Package) {
- children.add(current);
- }
- }
- }
- // we add the future Interfaces to this selection
- for (NewElementRepresentation current : interfaceRepresentations) {
- if (current.getParent() == parentElement) {
- children.add(current);
- }
- }
- return children.toArray();
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Object getParent(Object element) {
- if (element == model) {
- return model;
- } else if (element instanceof NamedElement) {
- return ((NamedElement) element).eContainer();
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public boolean hasChildren(Object element) {
- return getChildren(element).length != 0;
- }
-
- }
-
- /**
- *
- * This command is used to create a New Usage, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateUsageCommand extends AbstractTransactionalCommand {
-
- /** The container for the new Usage */
- private EObject container;
-
- /** the source of this Usage */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the Usage
- * @param source
- * the source for the Usage
- * @param target
- * the target for the Usage
- * @param affectedFiles
- * the affected files
- */
- public CreateUsageCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create Usage Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.USAGE);
- Command command = getCommand(request);
- if (command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to create a New InterfaceRealition, when its target (an Interface) doesn't exist when the command is created
- * (but this Interface will exist when the command will be executed)
- *
- *
- */
- public class CreateInterfaceRealizationCommand extends AbstractTransactionalCommand {
-
- /** The container for the new InterfaceRealization */
- private EObject container;
-
- /** The source for the new InterfaceRealization */
- private EObject source;
-
- /** the target : the representation of the new interface */
- private NewElementRepresentation target;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param container
- * the container for the InterfaceRealization
- * @param source
- * the source for the InterfaceRealization
- * @param target
- * the target for the InterfaceRealization
- * @param affectedFiles
- * the affected files
- */
- public CreateInterfaceRealizationCommand(TransactionalEditingDomain domain, EObject container, EObject source, NewElementRepresentation target, List<?> affectedFiles) {
- super(domain, "Create InterfaceRealization Command", affectedFiles); //$NON-NLS-1$
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, source, target.getEObject(), org.eclipse.papyrus.uml.service.types.element.UMLElementTypes.INTERFACE_REALIZATION);
- Command command = getCommand(request);
- if (command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult(request.getNewElement());
- }
-
- }
-
- /**
- *
- * This command is used to destroy Dependencies which have any supplier before the deletion of the Interface
- *
- *
- */
- public class DestroyDependencyWithoutSupplierCommand extends AbstractTransactionalCommand {
-
- /**
- * the dependencies to test
- */
- private Set<Dependency> dependencies;
-
- /**
- *
- * Constructor.
- *
- * @param domain
- * the domain
- * @param affectedFiles
- * the affected files
- * @param dependencies
- * the dependencies to test
- */
- public DestroyDependencyWithoutSupplierCommand(TransactionalEditingDomain domain, List<?> affectedFiles, Set<Dependency> dependencies) {
- super(domain, "Destroy the empty elements", affectedFiles); //$NON-NLS-1$
- this.dependencies = dependencies;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- *
- * @param monitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- CompoundCommand command = new CompoundCommand("Destroy relationship without suppliers"); //$NON-NLS-1$
- for (Dependency current : dependencies) {
- if (current.getSuppliers().isEmpty()) {
- DestroyElementRequest request = new DestroyElementRequest(domain, current, false);
- Command cmd = getCommand(request);
- if (cmd.canExecute()) {
- command.add(cmd);
- }
- }
- }
-
- if (!command.isEmpty() && command.canExecute()) {
- command.execute();
- }
- return CommandResult.newOKCommandResult();
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/plugin.xml
index 9caedc2..1bc51bf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/plugin.xml
@@ -15,22 +15,22 @@
-->
<plugin>
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- <?gmfgen generated="true"?>
- <context
- description="%context.description"
- id="org.eclipse.papyrus.uml.diagram.composite.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- </extension>
+ <extension point="org.eclipse.ui.contexts" id="ui-context">
+ <?gmfgen generated="true"?>
+ <context
+ description="%context.description"
+ id="org.eclipse.papyrus.uml.diagram.composite.ui.diagramContext"
+ name="%context.name"
+ parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
+ </context>
+ </extension>
- <extension point="org.eclipse.core.runtime.preferences" id="prefs">
- <?gmfgen generated="true"?>
- <initializer class="org.eclipse.papyrus.uml.diagram.composite.preferences.DiagramPreferenceInitializer"/>
- </extension>
+ <extension point="org.eclipse.core.runtime.preferences" id="prefs">
+ <?gmfgen generated="true"?>
+ <initializer class="org.eclipse.papyrus.uml.diagram.composite.preferences.DiagramPreferenceInitializer"/>
+ </extension>
<extension point="org.eclipse.ui.preferencePages" id="prefpages">
<?gmfgen generated="false"?>
@@ -57,77 +57,77 @@
</extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
- <?gmfgen generated="true"?>
- <propertyContributor
- contributorId="org.eclipse.papyrus.uml.diagram.composite"
- labelProvider="org.eclipse.papyrus.uml.diagram.composite.sheet.UMLSheetLabelProvider">
- <propertyCategory category="domain"/>
- <propertyCategory category="visual"/>
- <propertyCategory category="extra"/>
- </propertyContributor>
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
- <?gmfgen generated="true"?>
- <propertyTabs contributorId="org.eclipse.papyrus.uml.diagram.composite">
- <propertyTab
- category="visual"
- id="property.tab.AppearancePropertySection"
- label="%tab.appearance"/>
- <propertyTab
- category="visual"
- id="property.tab.DiagramPropertySection"
- label="%tab.diagram"/>
- <propertyTab
- category="domain"
- id="property.tab.domain"
- label="%tab.domain"/>
- </propertyTabs>
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
- <?gmfgen generated="true"?>
- <propertySections contributorId="org.eclipse.papyrus.uml.diagram.composite">
- <propertySection id="property.section.ConnectorAppearancePropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.ShapeColorAndFontPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.RulerGridPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
- tab="property.tab.DiagramPropertySection">
- </propertySection>
- <propertySection
- id="property.section.domain"
- tab="property.tab.domain"
- class="org.eclipse.papyrus.uml.diagram.composite.sheet.UMLPropertySection">
- <input type="org.eclipse.gmf.runtime.notation.View"/>
- <input type="org.eclipse.gef.EditPart"/>
- </propertySection>
- </propertySections>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.papyrus.uml.diagram.composite.providers.UMLViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="CompositeStructure"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2060,2061,2062,2063,2064,2065,2069,2070,2071,2072,2073,2075,2076,2066,2067,2068,2077,2078,2079,2080,2081,2082,2083,2084,2085,2088,2089,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,3121,3069,3088,3070,3115,3071,3072,3073,3074,3075,3076,3077,3081,3082,3083,3084,3085,3086,3087,3078,3079,3080,3091,3092,3093,3094,3095,3096,3097,3116,3117,3118,3119,3120,3101,3102,3066"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4022,4001,4002,4003,4004,4005,4011,4006,4012,4007,4008,4009,4017,4010,4013,4015,4018,4019,4020,4021"/>
- </viewProvider>
- </extension>
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
+ <?gmfgen generated="true"?>
+ <propertyContributor
+ contributorId="org.eclipse.papyrus.uml.diagram.composite"
+ labelProvider="org.eclipse.papyrus.uml.diagram.composite.sheet.UMLSheetLabelProvider">
+ <propertyCategory category="domain"/>
+ <propertyCategory category="visual"/>
+ <propertyCategory category="extra"/>
+ </propertyContributor>
+ </extension>
+
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
+ <?gmfgen generated="true"?>
+ <propertyTabs contributorId="org.eclipse.papyrus.uml.diagram.composite">
+ <propertyTab
+ category="visual"
+ id="property.tab.AppearancePropertySection"
+ label="%tab.appearance"/>
+ <propertyTab
+ category="visual"
+ id="property.tab.DiagramPropertySection"
+ label="%tab.diagram"/>
+ <propertyTab
+ category="domain"
+ id="property.tab.domain"
+ label="%tab.domain"/>
+ </propertyTabs>
+ </extension>
+
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
+ <?gmfgen generated="true"?>
+ <propertySections contributorId="org.eclipse.papyrus.uml.diagram.composite">
+ <propertySection id="property.section.ConnectorAppearancePropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
+ tab="property.tab.AppearancePropertySection">
+ </propertySection>
+ <propertySection id="property.section.ShapeColorAndFontPropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
+ tab="property.tab.AppearancePropertySection">
+ </propertySection>
+ <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
+ tab="property.tab.AppearancePropertySection">
+ </propertySection>
+ <propertySection id="property.section.RulerGridPropertySection"
+ filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
+ class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
+ tab="property.tab.DiagramPropertySection">
+ </propertySection>
+ <propertySection
+ id="property.section.domain"
+ tab="property.tab.domain"
+ class="org.eclipse.papyrus.uml.diagram.composite.sheet.UMLPropertySection">
+ <input type="org.eclipse.gmf.runtime.notation.View"/>
+ <input type="org.eclipse.gef.EditPart"/>
+ </propertySection>
+ </propertySections>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
+ <?gmfgen generated="true"?>
+ <viewProvider class="org.eclipse.papyrus.uml.diagram.composite.providers.UMLViewProvider">
+ <Priority name="Lowest"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="CompositeStructure"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2060,2061,2062,2063,2064,2065,2069,2070,2071,2072,2073,2075,2076,2066,2067,2068,2077,2078,2079,2080,2081,2082,2083,2084,2085,2088,2089,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,3121,3069,3088,3070,3115,3071,3072,3073,3074,3075,3076,3077,3081,3082,3083,3084,3085,3086,3087,3078,3079,3080,3091,3092,3093,3094,3095,3096,3097,3116,3117,3118,3119,3120,3101,3102,3066"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4022,4001,4002,4003,4004,4005,4011,4006,4012,4007,4008,4009,4017,4010,4013,4015,4018,4019,4020,4021"/>
+ </viewProvider>
+ </extension>
<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
<?gmfgen generated="false"?>
@@ -153,1175 +153,1175 @@
</extension>
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.papyrus.uml.diagram.composite.providers.UMLIconProvider">
- <Priority name="Low"/>
- </IconProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- <?gmfgen generated="true"?>
- <ParserProvider class="org.eclipse.papyrus.uml.diagram.composite.providers.UMLParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- <?gmfgen generated="true"?>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Package_1000"
- name="%metatype.name.Package_1000"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Package"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.PackageEditHelper">
- <param name="semanticHint" value="1000"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Activity_2060"
- name="%metatype.name.Activity_2060"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Activity"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ActivityEditHelper">
- <param name="semanticHint" value="2060"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Interaction_2061"
- name="%metatype.name.Interaction_2061"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interaction"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.InteractionEditHelper">
- <param name="semanticHint" value="2061"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.ProtocolStateMachine_2062"
- name="%metatype.name.ProtocolStateMachine_2062"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ProtocolStateMachine"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ProtocolStateMachineEditHelper">
- <param name="semanticHint" value="2062"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.StateMachine_2063"
- name="%metatype.name.StateMachine_2063"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="StateMachine"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.StateMachineEditHelper">
- <param name="semanticHint" value="2063"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.FunctionBehavior_2064"
- name="%metatype.name.FunctionBehavior_2064"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="FunctionBehavior"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.FunctionBehaviorEditHelper">
- <param name="semanticHint" value="2064"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.OpaqueBehavior_2065"
- name="%metatype.name.OpaqueBehavior_2065"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="OpaqueBehavior"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.OpaqueBehaviorEditHelper">
- <param name="semanticHint" value="2065"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Component_2069"
- name="%metatype.name.Component_2069"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Component"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ComponentEditHelper">
- <param name="semanticHint" value="2069"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Device_2070"
- name="%metatype.name.Device_2070"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Device"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DeviceEditHelper">
- <param name="semanticHint" value="2070"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.ExecutionEnvironment_2071"
- name="%metatype.name.ExecutionEnvironment_2071"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ExecutionEnvironment"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ExecutionEnvironmentEditHelper">
- <param name="semanticHint" value="2071"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Node_2072"
- name="%metatype.name.Node_2072"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Node"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.NodeEditHelper">
- <param name="semanticHint" value="2072"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Class_2073"
- name="%metatype.name.Class_2073"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Class"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ClassEditHelper">
- <param name="semanticHint" value="2073"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Collaboration_2075"
- name="%metatype.name.Collaboration_2075"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Collaboration_3086"/>
- <param name="semanticHint" value="2075"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Interface_2076"
- name="%metatype.name.Interface_2076"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Interface_3087"/>
- <param name="semanticHint" value="2076"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.PrimitiveType_2066"
- name="%metatype.name.PrimitiveType_2066"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="PrimitiveType"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.PrimitiveTypeEditHelper">
- <param name="semanticHint" value="2066"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Enumeration_2067"
- name="%metatype.name.Enumeration_2067"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Enumeration"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.EnumerationEditHelper">
- <param name="semanticHint" value="2067"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.DataType_2068"
- name="%metatype.name.DataType_2068"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="DataType"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DataTypeEditHelper">
- <param name="semanticHint" value="2068"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Actor_2077"
- name="%metatype.name.Actor_2077"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Actor_3091"/>
- <param name="semanticHint" value="2077"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.DeploymentSpecification_2078"
- name="%metatype.name.DeploymentSpecification_2078"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.DeploymentSpecification_3092"/>
- <param name="semanticHint" value="2078"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Artifact_2079"
- name="%metatype.name.Artifact_2079"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Artifact_3093"/>
- <param name="semanticHint" value="2079"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.InformationItem_2080"
- name="%metatype.name.InformationItem_2080"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.InformationItem_3094"/>
- <param name="semanticHint" value="2080"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Signal_2081"
- name="%metatype.name.Signal_2081"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Signal_3095"/>
- <param name="semanticHint" value="2081"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.UseCase_2082"
- name="%metatype.name.UseCase_2082"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.UseCase_3096"/>
- <param name="semanticHint" value="2082"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.SignalEvent_2083"
- name="%metatype.name.SignalEvent_2083"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="SignalEvent"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.SignalEventEditHelper">
- <param name="semanticHint" value="2083"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.CallEvent_2084"
- name="%metatype.name.CallEvent_2084"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="CallEvent"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.CallEventEditHelper">
- <param name="semanticHint" value="2084"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.AnyReceiveEvent_2085"
- name="%metatype.name.AnyReceiveEvent_2085"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="AnyReceiveEvent"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.AnyReceiveEventEditHelper">
- <param name="semanticHint" value="2085"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.ChangeEvent_2088"
- name="%metatype.name.ChangeEvent_2088"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ChangeEvent"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ChangeEventEditHelper">
- <param name="semanticHint" value="2088"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.TimeEvent_2089"
- name="%metatype.name.TimeEvent_2089"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="TimeEvent"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.TimeEventEditHelper">
- <param name="semanticHint" value="2089"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.DurationObservation_2093"
- name="%metatype.name.DurationObservation_2093"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="DurationObservation"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DurationObservationEditHelper">
- <param name="semanticHint" value="2093"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.TimeObservation_2094"
- name="%metatype.name.TimeObservation_2094"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="TimeObservation"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.TimeObservationEditHelper">
- <param name="semanticHint" value="2094"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.LiteralBoolean_2095"
- name="%metatype.name.LiteralBoolean_2095"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="LiteralBoolean"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.LiteralBooleanEditHelper">
- <param name="semanticHint" value="2095"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.LiteralInteger_2096"
- name="%metatype.name.LiteralInteger_2096"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="LiteralInteger"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.LiteralIntegerEditHelper">
- <param name="semanticHint" value="2096"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.LiteralNull_2097"
- name="%metatype.name.LiteralNull_2097"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="LiteralNull"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.LiteralNullEditHelper">
- <param name="semanticHint" value="2097"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.LiteralString_2098"
- name="%metatype.name.LiteralString_2098"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="LiteralString"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.LiteralStringEditHelper">
- <param name="semanticHint" value="2098"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.LiteralUnlimitedNatural_2099"
- name="%metatype.name.LiteralUnlimitedNatural_2099"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="LiteralUnlimitedNatural"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.LiteralUnlimitedNaturalEditHelper">
- <param name="semanticHint" value="2099"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.StringExpression_2100"
- name="%metatype.name.StringExpression_2100"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="StringExpression"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.StringExpressionEditHelper">
- <param name="semanticHint" value="2100"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.OpaqueExpression_2101"
- name="%metatype.name.OpaqueExpression_2101"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="OpaqueExpression"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.OpaqueExpressionEditHelper">
- <param name="semanticHint" value="2101"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.TimeExpression_2102"
- name="%metatype.name.TimeExpression_2102"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="TimeExpression"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.TimeExpressionEditHelper">
- <param name="semanticHint" value="2102"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Expression_2103"
- name="%metatype.name.Expression_2103"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Expression"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ExpressionEditHelper">
- <param name="semanticHint" value="2103"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Duration_2104"
- name="%metatype.name.Duration_2104"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Duration"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DurationEditHelper">
- <param name="semanticHint" value="2104"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.TimeInterval_2105"
- name="%metatype.name.TimeInterval_2105"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="TimeInterval"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.TimeIntervalEditHelper">
- <param name="semanticHint" value="2105"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.DurationInterval_2106"
- name="%metatype.name.DurationInterval_2106"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="DurationInterval"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DurationIntervalEditHelper">
- <param name="semanticHint" value="2106"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Interval_2107"
- name="%metatype.name.Interval_2107"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interval"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.IntervalEditHelper">
- <param name="semanticHint" value="2107"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.InstanceValue_2108"
- name="%metatype.name.InstanceValue_2108"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="InstanceValue"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.InstanceValueEditHelper">
- <param name="semanticHint" value="2108"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Comment_2109"
- name="%metatype.name.Comment_2109"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Comment_3097"/>
- <param name="semanticHint" value="2109"/>
- </specializationType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.DurationConstraint_2110"
- name="%metatype.name.DurationConstraint_2110"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="2110"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.TimeConstraint_2111"
- name="%metatype.name.TimeConstraint_2111"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="TimeConstraint"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.TimeConstraintEditHelper">
- <param name="semanticHint" value="2111"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.IntervalConstraint_2112"
- name="%metatype.name.IntervalConstraint_2112"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="IntervalConstraint"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.IntervalConstraintEditHelper">
- <param name="semanticHint" value="2112"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.InteractionConstraint_2113"
- name="%metatype.name.InteractionConstraint_2113"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="InteractionConstraint"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.InteractionConstraintEditHelper">
- <param name="semanticHint" value="2113"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Constraint_2114"
- name="%metatype.name.Constraint_2114"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Constraint"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ConstraintEditHelper">
- <param name="semanticHint" value="2114"/>
- </metamodelType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Node_3121"
- name="%metatype.name.Node_3121"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3121"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Port_3069"
- name="%metatype.name.Port_3069"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Port"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.PortEditHelper">
- <param name="semanticHint" value="3069"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Parameter_3088"
- name="%metatype.name.Parameter_3088"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Parameter"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ParameterEditHelper">
- <param name="semanticHint" value="3088"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Property_3070"
- name="%metatype.name.Property_3070"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Property"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.PropertyEditHelper">
- <param name="semanticHint" value="3070"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.prototype.CollaborationRole_3115"
- name="%metatype.name.ConnectableElement_3115"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ConnectableElement"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.CollaborationRoleEditHelper">
- <param name="semanticHint" value="3115"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.CollaborationUse_3071"
- name="%metatype.name.CollaborationUse_3071"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="CollaborationUse"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.CollaborationUseEditHelper">
- <param name="semanticHint" value="3071"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Activity_3072"
- name="%metatype.name.Activity_3072"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Activity_2060"/>
- <param name="semanticHint" value="3072"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Interaction_3073"
- name="%metatype.name.Interaction_3073"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Interaction_2061"/>
- <param name="semanticHint" value="3073"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.ProtocolStateMachine_3074"
- name="%metatype.name.ProtocolStateMachine_3074"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.ProtocolStateMachine_2062"/>
- <param name="semanticHint" value="3074"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.StateMachine_3075"
- name="%metatype.name.StateMachine_3075"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.StateMachine_2063"/>
- <param name="semanticHint" value="3075"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.FunctionBehavior_3076"
- name="%metatype.name.FunctionBehavior_3076"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.FunctionBehavior_2064"/>
- <param name="semanticHint" value="3076"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.OpaqueBehavior_3077"
- name="%metatype.name.OpaqueBehavior_3077"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.OpaqueBehavior_2065"/>
- <param name="semanticHint" value="3077"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Component_3081"
- name="%metatype.name.Component_3081"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Component_2069"/>
- <param name="semanticHint" value="3081"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Device_3082"
- name="%metatype.name.Device_3082"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Device_2070"/>
- <param name="semanticHint" value="3082"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.ExecutionEnvironment_3083"
- name="%metatype.name.ExecutionEnvironment_3083"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.ExecutionEnvironment_2071"/>
- <param name="semanticHint" value="3083"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Node_3084"
- name="%metatype.name.Node_3084"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Node_2072"/>
- <param name="semanticHint" value="3084"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Class_3085"
- name="%metatype.name.Class_3085"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Class_2073"/>
- <param name="semanticHint" value="3085"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Collaboration_3086"
- name="%metatype.name.Collaboration_3086"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Collaboration"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.CollaborationEditHelper">
- <param name="semanticHint" value="3086"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Interface_3087"
- name="%metatype.name.Interface_3087"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Interface"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.InterfaceEditHelper">
- <param name="semanticHint" value="3087"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.PrimitiveType_3078"
- name="%metatype.name.PrimitiveType_3078"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.PrimitiveType_2066"/>
- <param name="semanticHint" value="3078"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Enumeration_3079"
- name="%metatype.name.Enumeration_3079"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.Enumeration_2067"/>
- <param name="semanticHint" value="3079"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.DataType_3080"
- name="%metatype.name.DataType_3080"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.uml.diagram.composite.DataType_2068"/>
- <param name="semanticHint" value="3080"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Actor_3091"
- name="%metatype.name.Actor_3091"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Actor"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ActorEditHelper">
- <param name="semanticHint" value="3091"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.DeploymentSpecification_3092"
- name="%metatype.name.DeploymentSpecification_3092"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="DeploymentSpecification"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DeploymentSpecificationEditHelper">
- <param name="semanticHint" value="3092"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Artifact_3093"
- name="%metatype.name.Artifact_3093"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Artifact"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ArtifactEditHelper">
- <param name="semanticHint" value="3093"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.InformationItem_3094"
- name="%metatype.name.InformationItem_3094"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="InformationItem"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.InformationItemEditHelper">
- <param name="semanticHint" value="3094"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Signal_3095"
- name="%metatype.name.Signal_3095"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Signal"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.SignalEditHelper">
- <param name="semanticHint" value="3095"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.UseCase_3096"
- name="%metatype.name.UseCase_3096"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="UseCase"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.UseCaseEditHelper">
- <param name="semanticHint" value="3096"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Comment_3097"
- name="%metatype.name.Comment_3097"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Comment"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.CommentEditHelper">
- <param name="semanticHint" value="3097"/>
- </metamodelType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.DurationConstraint_3116"
- name="%metatype.name.DurationConstraint_3116"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3116"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.TimeConstraint_3117"
- name="%metatype.name.TimeConstraint_3117"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3117"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.IntervalConstraint_3118"
- name="%metatype.name.IntervalConstraint_3118"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3118"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.InteractionConstraint_3119"
- name="%metatype.name.InteractionConstraint_3119"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3119"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Constraint_3120"
- name="%metatype.name.Constraint_3120"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3120"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Property_3101"
- name="%metatype.name.Property_3101"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3101"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Operation_3102"
- name="%metatype.name.Operation_3102"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="3102"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.EnumerationLiteral_3066"
- name="%metatype.name.EnumerationLiteral_3066"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="EnumerationLiteral"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.EnumerationLiteralEditHelper">
- <param name="semanticHint" value="3066"/>
- </metamodelType>
- </metamodel>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Link_4022"
- name="%metatype.name.Link_4022"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4022"/>
- </specializationType>
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.Link_4001"
- name="%metatype.name.Link_4001"
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4001"/>
- </specializationType>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.CommentAnnotatedElement_4002"
- name="%metatype.name.CommentAnnotatedElement_4002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4002"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.uml.diagram.composite.ConstraintConstrainedElement_4003"
- name="%metatype.name.ConstraintConstrainedElement_4003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4003"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.ComponentRealization_4004"
- name="%metatype.name.ComponentRealization_4004"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ComponentRealization"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ComponentRealizationEditHelper">
- <param name="semanticHint" value="4004"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.InterfaceRealization_4005"
- name="%metatype.name.InterfaceRealization_4005"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="InterfaceRealization"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.InterfaceRealizationEditHelper">
- <param name="semanticHint" value="4005"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Substitution_4011"
- name="%metatype.name.Substitution_4011"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Substitution"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.SubstitutionEditHelper">
- <param name="semanticHint" value="4011"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Realization_4006"
- name="%metatype.name.Realization_4006"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Realization"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.RealizationEditHelper">
- <param name="semanticHint" value="4006"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Manifestation_4012"
- name="%metatype.name.Manifestation_4012"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Manifestation"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ManifestationEditHelper">
- <param name="semanticHint" value="4012"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Abstraction_4007"
- name="%metatype.name.Abstraction_4007"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Abstraction"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.AbstractionEditHelper">
- <param name="semanticHint" value="4007"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Usage_4008"
- name="%metatype.name.Usage_4008"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Usage"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.UsageEditHelper">
- <param name="semanticHint" value="4008"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Deployment_4009"
- name="%metatype.name.Deployment_4009"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Deployment"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DeploymentEditHelper">
- <param name="semanticHint" value="4009"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.RoleBinding_4017"
- name="%metatype.name.Dependency_4017"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Dependency"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.RoleBindingEditHelper">
- <param name="semanticHint" value="4017"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Dependency_4010"
- name="%metatype.name.Dependency_4010"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Dependency"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.DependencyEditHelper">
- <param name="semanticHint" value="4010"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Connector_4013"
- name="%metatype.name.Connector_4013"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Connector"
- edithelper="org.eclipse.papyrus.uml.diagram.composite.edit.helpers.ConnectorEditHelper">
- <param name="semanticHint" value="4013"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.uml.diagram.composite.Generalization_4015"
- name="%metatype.name.Generalization