Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauricio Alferez2016-02-17 18:21:24 +0000
committerGerrit Code Review @ Eclipse.org2016-02-19 15:12:31 +0000
commitd1e9f55d64b16bf78c3a52088ea4fd50091de769 (patch)
tree766de3fede1c29164f3cd0d1e1f5a5c5e90c3456 /extraplugins
parenta1c2c13a0a2e6334ca3330323ea3e99369486b86 (diff)
downloadorg.eclipse.papyrus-d1e9f55d64b16bf78c3a52088ea4fd50091de769.tar.gz
org.eclipse.papyrus-d1e9f55d64b16bf78c3a52088ea4fd50091de769.tar.xz
org.eclipse.papyrus-d1e9f55d64b16bf78c3a52088ea4fd50091de769.zip
[Extra][Requirements] New commands, key bindings and refactorings
Change-Id: I0fda87382a5dc62efbbd7049ca6399f2a89de000 Signed-off-by: Mauricio Alferez <mauricio.alferez@cea.fr>
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.common.ui/src/org/eclipse/papyrus/requirements/common/ui/Activator.java6
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Activator.java14
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Utils.java53
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.languagecreationtools.domainModel2Profile/src/org/eclipse/papyrus/requirements/languagecreationtools/domainModel2Profile/utils/Utils.java2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/META-INF/MANIFEST.MF6
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.properties14
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.xml21
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DerivationReqCreateCommand.java57
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java1
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDerivedReqCommand.java97
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/plugin.xml22
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/DecomposeReqHandler.java2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.properties16
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.xml100
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/src/org/eclipse/papyrus/requirements/sysml/assistant/ui/Activator.java6
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/src/org/eclipse/papyrus/requirements/sysml/testers/SysMLRequirementsProfileTester.java2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/.classpath2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/META-INF/MANIFEST.MF10
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.properties13
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.xml54
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivedLinkReqCommand.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddDerivedLinkReqCommand.java)47
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivesLinkReqCommand.java74
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinedByCommand.java75
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinesCommand.java75
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiedByLinkCommand.java68
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiesLinkCommand.java69
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddVerifiedByLinkCommand.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddVerifyLinkCommand.java)23
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddVerifiesLinkCommand.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddSatisfyLinkCommand.java)29
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/DerivationReqCreateCommand.java48
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/InitDerivedReqCommand.java115
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/RefinementCreateCommand.java22
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/SatisfyCreateCommand.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/SatisfyCreateCommand.java)8
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/VerifyCreateCommand.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/VerifyCreateCommand.java)8
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/META-INF/MANIFEST.MF5
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.properties37
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.xml43
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivedByLinkHandler.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddDerivedLinkReqHandler.java)16
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivesLinkHandler.java67
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinedByLinkHandler.java67
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinesLinkHandler.java67
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiedByLinkHandler.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddSatisfyLinkHandler.java)15
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiesLinkHandler.java67
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiedByLinkHandler.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddVerifyLinkHandler.java)15
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiesLinkHandler.java67
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/ApplyTracabilityHandler.java54
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/InitDerivedReqHandler.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/InitDerivedReqHandler.java)4
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/META-INF/MANIFEST.MF6
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.properties44
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.xml239
51 files changed, 1454 insertions, 524 deletions
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.common.ui/src/org/eclipse/papyrus/requirements/common/ui/Activator.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.common.ui/src/org/eclipse/papyrus/requirements/common/ui/Activator.java
index 324858ded59..d58511bd971 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.common.ui/src/org/eclipse/papyrus/requirements/common/ui/Activator.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.common.ui/src/org/eclipse/papyrus/requirements/common/ui/Activator.java
@@ -8,8 +8,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
-* CEA LIST. - initial API and implementation
-*******************************************************************************/
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.requirements.common.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Activator.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Activator.java
index 19d2f9c05ea..ebd6f56df14 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Activator.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Activator.java
@@ -1,3 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.requirements.common;
import org.osgi.framework.BundleActivator;
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Utils.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Utils.java
new file mode 100644
index 00000000000..df98b28d5d9
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Utils.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.common;
+
+import java.util.ArrayList;
+
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+public class Utils {
+ /**
+ * @param elem UML model element
+ * @return the highest level Package of the element
+ */
+ public static Package getToPackage(Element elememt) {
+ Package tmp = elememt.getNearestPackage();
+ while (tmp.getOwner() != null && (tmp.getOwner() instanceof Package)) {
+ tmp = (Package) tmp.getOwner();
+ }
+ return tmp;
+ }
+ /**
+ * Verifies if an element applies a list of profiles
+ *
+ * @param element
+ * the model element that can apply profiles
+ * @param requiredProfiles
+ * the profiles that will be verified
+ * @return the list of missing profiles
+ */
+ public static ArrayList<String> getMissingRequiredProfileApplications(org.eclipse.uml2.uml.Package element,
+ ArrayList<String> requiredProfiles) {
+ ArrayList<String> missingProfiles = new ArrayList<String>();
+ for (String profileQN : requiredProfiles) {
+ if (element.getAppliedProfile(profileQN) == null) {
+ missingProfiles.add(profileQN);
+ }
+ }
+ return missingProfiles;
+ }
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.languagecreationtools.domainModel2Profile/src/org/eclipse/papyrus/requirements/languagecreationtools/domainModel2Profile/utils/Utils.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.languagecreationtools.domainModel2Profile/src/org/eclipse/papyrus/requirements/languagecreationtools/domainModel2Profile/utils/Utils.java
index 96d8160ba6b..dff0b593125 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.languagecreationtools.domainModel2Profile/src/org/eclipse/papyrus/requirements/languagecreationtools/domainModel2Profile/utils/Utils.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.languagecreationtools.domainModel2Profile/src/org/eclipse/papyrus/requirements/languagecreationtools/domainModel2Profile/utils/Utils.java
@@ -179,7 +179,7 @@ public class Utils {
* Creates a UML profile with a specific name and nsURI
*
* @param name
- * The new of the new profile
+ * The new profile
* @param nsURI
* The nsURI of the new package
* @return the new UML profile
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/META-INF/MANIFEST.MF
index 79f3cbfb58b..34e39b92c1b 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/META-INF/MANIFEST.MF
@@ -13,10 +13,6 @@ Require-Bundle: org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.papyrus.requirements.sysml.assistant.commands;
- uses:="org.osgi.framework,
- org.eclipse.uml2.uml,
- org.eclipse.ui.plugin,
- org.eclipse.emf.transaction"
+Export-Package: org.eclipse.papyrus.requirements.sysml.assistant.commands
Bundle-Localization: plugin
Import-Package: org.eclipse.papyrus.requirements.sysml.common
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.properties
index 55175c56150..49ca7fbc6f9 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.properties
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.properties
@@ -1,12 +1,12 @@
#Properties file for org.eclipse.papyrus.requirements.sysml.assistant.commands
+
+#Commands to be executed from a Package or Model
createNewRequirement.command.name = Create new requirement
-decomposeRequirement.command.name = Decompose requirement
-deriveNewRequirement.command.name = Derive new requirement
-addDerivedLink.command.name = Add derived link
-addSatisfyLink.command.name = Add satisfy Link
-addVerifyLink.command.name = Add verify Link
-createComments.command.name = Create comments
-extractComments.command.name = Extract comments
+
+#Commands to be executed from requirements
+decomposeRequirement.command.name = Decompose Requirement
+createComments.command.name = Create Comments
+extractComments.command.name = Extract Comments
Bundle-Vendor = Eclipse Modeling Project
Bundle-Name = Papyrus Req SysML Assistant (Incubation) \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.xml
index 6fe30bd9172..8737058c022 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.xml
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/plugin.xml
@@ -15,26 +15,6 @@
</command>
<command
categoryId="org.eclipse.papyrus.editor.category"
- id="org.eclipse.papyrus.requirements.sysml.assistant.handlers.InitDerivedReqHandler"
- name="%deriveNewRequirement.command.name">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- id="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddDerivedLinkReqHandler"
- name="%addDerivedLink.command.name">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- id="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddSatisfyLinkHandler"
- name="%addSatisfyLink.command.name">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- id="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddVerifyLinkHandler"
- name="%addVerifyLink.command.name">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
id="org.eclipse.papyrus.requirements.sysml.assistant.handlers.CommentReqHandler"
name="%createComments.command.name">
</command>
@@ -44,5 +24,4 @@
name="%extractComments.command.name">
</command>
</extension>
-
</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DerivationReqCreateCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DerivationReqCreateCommand.java
deleted file mode 100644
index e1f339e24fe..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DerivationReqCreateCommand.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Patrick Tessier (patrick.tessier@cea.fr) CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.uml2.uml.Abstraction;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * Creates a "DerivedReq" link between requirements
- *
- */
-public class DerivationReqCreateCommand extends RecordingCommand {
- private NamedElement source;
- private NamedElement target;
- /** Qualified name of the stereotype DeriveReqt */
- public static final String DERIVEREQT_STEREOTYPE = "SysML::Requirements::DeriveReqt";
- /**
- * use to make an abstraction
- * @param domain the domain to execute a transaction
- * @param source the source of the abstraction (the more concrete element)
- * @param target the target of the abstraction (the more abstract element)
-
- */
- public DerivationReqCreateCommand(TransactionalEditingDomain domain, NamedElement source, NamedElement target){
- super(domain,"Create an Abstraction");
- this.source=source;
- this.target=target;
- }
-
- @Override
- protected void doExecute() {
- Abstraction theAbstraction= UMLFactory.eINSTANCE.createAbstraction();
- source.getNearestPackage().getPackagedElements().add(theAbstraction);
- theAbstraction.getSuppliers().add(target);
- theAbstraction.getClients().add(source);
- theAbstraction.setName("DeriveFrom_"+this.target.getName());
- Stereotype satisfyStereotype= theAbstraction.getApplicableStereotype(DERIVEREQT_STEREOTYPE);
- theAbstraction.applyStereotype(satisfyStereotype);
- }
-
-}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java
index 2c7ee4e3109..28caec8cbf8 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java
@@ -21,7 +21,6 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.requirements.preferences.Activator;
import org.eclipse.papyrus.requirements.preferences.PreferenceConstants;
import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
import org.eclipse.uml2.uml.Class;
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDerivedReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDerivedReqCommand.java
deleted file mode 100644
index e9436fcf256..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDerivedReqCommand.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
-* CEA LIST. - initial API and implementation
-*******************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
-import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
-import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.UMLPackage;
-/**
- *
- * Creates a derived requirement from a set of requirements with concatened text
- *
- */
-public class InitDerivedReqCommand extends RecordingCommand {
- protected ArrayList<Element> selectedElements;
- TransactionalEditingDomain domain;
-
- public InitDerivedReqCommand(TransactionalEditingDomain domain, ArrayList<Element> selectedElements) {
- super(domain,"InitDerivedReqCommand" );
- this.selectedElements=selectedElements;
- this.domain=domain;
- }
-
- private Package getToPackage(Element elem){
- Package tmp= elem.getNearestPackage();
- while(tmp.getOwner()!=null && (tmp.getOwner()instanceof Package)){
- tmp= (Package)tmp.getOwner();
- }
- return tmp;
- }
- @Override
- protected void doExecute() {
- String concatenedString="";
- org.eclipse.uml2.uml.Package owner=null;
- for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
- Element currentElement = (Element) iterator.next();
- if( currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE)!=null){
- Stereotype stereotype= currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
- concatenedString=concatenedString+ "\n"+currentElement.getValue(stereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT);
- owner=currentElement.getNearestPackage();
- }
-
- }
- //open Tree selection dialog in order to choose the owner of the new requirement
- TreeSelectorDialog dialog = new TreeSelectorDialog(Display.getDefault().getActiveShell());
- dialog.setContentProvider(new UMLContentProvider(getToPackage(owner), UMLPackage.eINSTANCE.getPackage_NestedPackage()));
- dialog.setLabelProvider(new UMLLabelProvider());
- dialog.setMessage("Choose the owner for the new requirement");
- dialog.setTitle("Choose the owner for the new requirement");
- dialog.create();
- dialog.setDescription("Choose the owner for the new requirement");
- if(dialog.open() == org.eclipse.jface.window.Window.OK) {
- Object[] result = dialog.getResult();
- owner= ((org.eclipse.uml2.uml.Package)result[0]);
- }
- else return;
- String ID= PapyrusReqSysMLRequirementCreateCommand.getNewIDReq(owner);
- Class req=owner.createOwnedClass(ID, false);
- Stereotype reqStereotype=req.getApplicableStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
- req.applyStereotype(reqStereotype);
- req.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT, concatenedString);
- req.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT, ID);
-
-
- for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
- Element currentElement = (Element) iterator.next();
- if( currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE)!=null){
- DerivationReqCreateCommand derivationReqCreateCommand= new DerivationReqCreateCommand(domain, req,(NamedElement) currentElement);
- derivationReqCreateCommand.execute();
- }
-
- }
- }
-
-}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/plugin.xml
index fd523858c5a..a14e73cd1bd 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/plugin.xml
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/plugin.xml
@@ -8,33 +8,17 @@
commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.PapyrusReqSysMLRequirementHandler">
</handler>
<handler
- class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.ExtractCommentsHandler"
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.ExtractCommentsHandler">
- </handler>
- <handler
- class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.InitDerivedReqHandler"
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.InitDerivedReqHandler">
- </handler>
- <handler
- class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddVerifyLinkHandler"
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddVerifyLinkHandler">
- </handler>
- <handler
- class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddSatisfyLinkHandler"
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddSatisfyLinkHandler">
- </handler>
- <handler
class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.DecomposeReqHandler"
commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.DecomposeReqHandler">
</handler>
<handler
- class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddDerivedLinkReqHandler"
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddDerivedLinkReqHandler">
+ class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.ExtractCommentsHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.ExtractCommentsHandler">
</handler>
+
<handler
class="org.eclipse.papyrus.requirements.sysml.assistant.handlers.CommentReqHandler"
commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.CommentReqHandler">
</handler>
</extension>
-
</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/DecomposeReqHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/DecomposeReqHandler.java
index e11850be09d..82b4bab6dfd 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/DecomposeReqHandler.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/DecomposeReqHandler.java
@@ -16,8 +16,8 @@ package org.eclipse.papyrus.requirements.sysml.assistant.handlers;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.InitDecomposeReqCommand;
import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.assistant.commands.InitDecomposeReqCommand;
import org.eclipse.uml2.uml.Element;
/**
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/META-INF/MANIFEST.MF
index 3e946ee81e4..866ac0f6b5f 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/META-INF/MANIFEST.MF
@@ -6,7 +6,8 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Activator: org.eclipse.papyrus.requirements.sysml.assistant.ui.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
- org.eclipse.papyrus.requirements.common.ui;bundle-version="0.7.0"
+ org.eclipse.papyrus.requirements.common.ui;bundle-version="0.7.0",
+ org.eclipse.papyrus.requirements.sysml.testers;bundle-version="0.7.0"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.properties
index 669b5c11e89..7b44aa828a0 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.properties
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.properties
@@ -1,30 +1,22 @@
#Properties file for org.eclipse.papyrus.requirements.sysml.assistant.ui
+
papyrus.requirements.sysml.assistant.menu.label = Papyrus Req - Editing Tools
papyrus.requirements.sysml.assistant.menu.tooltip = Assistants to edit SysML requirements models
+#Commands to be executed from package or model
createNewRequirement.command.label = Create new requirement
createNewRequirement.command.tooltip = Create new requirement in the selected package
+#Commands to be executed from requirements
decomposeRequirement.command.label = Decompose requirement
decomposeRequirement.command.tooltip = Create new requirement that decomposes the selected requirement
-deriveNewRequirement.command.label = Derive new requirement
-deriveNewRequirement.command.tooltip = Create new derived requirement from the set of selected requirements
-
-addDerivedLink.command.label = Add derived links
-addDerivedLink.command.tooltip = Add derivedReqt links
-
-addSatisfyLink.command.label = Add satisfy links
-addSatisfyLink.command.tooltip = Add satisfy links
-
-addVerifyLink.command.label = Add verify links
-addVerifyLink.command.tooltip = Add verify links
createComments.command.label = Create comments
createComments.command.tooltip = Create Comments
extractComments.command.label = Extract annotations as comments
-extractComments.command.tooltip = Extract stakeholders names written as annotations between "[" and "]" to a new comment.
+extractComments.command.tooltip = Extract stakeholders names written as annotations between "[" and "]" to a new comment
Bundle-Vendor = Eclipse Modeling Project
Bundle-Name = Papyrus Req SysML Editing Assistant (Incubation) \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.xml
index eb0f8274d54..a5468fd3d09 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.xml
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/plugin.xml
@@ -71,78 +71,6 @@
</visibleWhen>
</command>
<command
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.InitDerivedReqHandler"
- icon="images/DeriveReqt.gif"
- label="%deriveNewRequirement.command.label"
- style="push"
- tooltip="%deriveNewRequirement.command.tooltip">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
- value="true">
- </test>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddDerivedLinkReqHandler"
- icon="images/DeriveReqt.gif"
- label="%addDerivedLink.command.label"
- style="push"
- tooltip="%addDerivedLink.command.tooltip">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
- value="true">
- </test>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddSatisfyLinkHandler"
- icon="images/Satisfy.gif"
- label="%addSatisfyLink.command.label"
- style="push"
- tooltip="%addSatisfyLink.command.tooltip">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
- value="true">
- </test>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddVerifyLinkHandler"
- icon="images/Verify.gif"
- label="%addVerifyLink.command.label"
- style="push"
- tooltip="%addVerifyLink.command.tooltip">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
- value="true">
- </test>
- </with>
- </visibleWhen>
- </command>
- <command
commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.CommentReqHandler"
icon="images/Comment.gif"
label="%createComments.command.label"
@@ -195,40 +123,16 @@
sequence="M1+2">
</key>
<key
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.InitDerivedReqHandler"
- contextId="org.eclipse.ui.contexts.window"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M1+9">
- </key>
- <key
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddDerivedLinkReqHandler"
- contextId="org.eclipse.ui.contexts.window"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M1+4">
- </key>
- <key
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddSatisfyLinkHandler"
- contextId="org.eclipse.ui.contexts.window"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M1+5">
- </key>
- <key
- commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.AddVerifyLinkHandler"
- contextId="org.eclipse.ui.contexts.window"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M1+6">
- </key>
- <key
commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.CommentReqHandler"
contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M1+7">
+ sequence="M1+4">
</key>
<key
commandId="org.eclipse.papyrus.requirements.sysml.assistant.handlers.ExtractCommentsHandler"
contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M1+8">
+ sequence="M1+5">
</key>
</extension>
</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/src/org/eclipse/papyrus/requirements/sysml/assistant/ui/Activator.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/src/org/eclipse/papyrus/requirements/sysml/assistant/ui/Activator.java
index c705d1ae702..856b3a540ee 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/src/org/eclipse/papyrus/requirements/sysml/assistant/ui/Activator.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.ui/src/org/eclipse/papyrus/requirements/sysml/assistant/ui/Activator.java
@@ -8,8 +8,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
-* CEA LIST. - initial API and implementation
-*******************************************************************************/
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.requirements.sysml.assistant.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/META-INF/MANIFEST.MF
index 9ffea7e49d8..1e5ff97f835 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/META-INF/MANIFEST.MF
@@ -8,7 +8,8 @@ Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.5.0",
org.eclipse.uml2.uml;bundle-version="5.1.100",
org.eclipse.papyrus.requirements.sysml.common;bundle-version="0.7.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.8.0"
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.8.0",
+ org.eclipse.uml2.uml.profile.standard
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.requirements.sysml.testers;uses:="org.osgi.framework,org.eclipse.core.expressions,org.eclipse.ui.plugin"
Bundle-Localization: plugin
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/src/org/eclipse/papyrus/requirements/sysml/testers/SysMLRequirementsProfileTester.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/src/org/eclipse/papyrus/requirements/sysml/testers/SysMLRequirementsProfileTester.java
index c9431436789..7c30b313fe5 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/src/org/eclipse/papyrus/requirements/sysml/testers/SysMLRequirementsProfileTester.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.testers/src/org/eclipse/papyrus/requirements/sysml/testers/SysMLRequirementsProfileTester.java
@@ -23,7 +23,7 @@ import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.util.UMLUtil;
/**
- * This class helps to test if the selected element is a UML Package or not
+ * This class helps to test if the selected element applies the SysMLRequirements Profile or not
*/
public class SysMLRequirementsProfileTester extends PropertyTester {
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/.classpath b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/.classpath
index b862a296d38..0f14fdbe865 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/.classpath
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/META-INF/MANIFEST.MF
index 91eb3595d00..530cb729ac1 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/META-INF/MANIFEST.MF
@@ -7,7 +7,15 @@ Bundle-Activator: org.eclipse.papyrus.requirements.sysml.traceability.commands.A
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
org.eclipse.papyrus.uml.tools;bundle-version="0.9.1";resolution:=optional,
- org.eclipse.papyrus.requirements.sysml.common;bundle-version="0.7.0"
+ org.eclipse.papyrus.requirements.sysml.common;bundle-version="0.7.0",
+ org.eclipse.papyrus.infra.widgets,
+ org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0",
+ org.eclipse.papyrus.requirements.preferences,
+ org.eclipse.papyrus.requirements.sysml.assistant.commands,
+ org.eclipse.jface,
+ org.eclipse.papyrus.sysml,
+ org.eclipse.uml2.uml,
+ org.eclipse.papyrus.requirements.common
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.requirements.sysml.traceability.commands;
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.properties
index 4ba65efdf31..e63b61065e4 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.properties
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.properties
@@ -1,6 +1,19 @@
#Properties file for org.eclipse.papyrus.requirements.sysml.traceability.commands
+#Commands to be executed from a Model
applyTraceabilityAssistant.command.name = Apply Traceability Assistant
+#Commands to be executed from requirements
+deriveNewRequirement.command.name = Derive New Requirement
+addDerivesLink.command.name = Add Derives Link
+addDerivedByLink.command.name = Add Derived By Link
+addSatisfiedByLink.command.name = Add Satisfied By Link
+addVerifiedByLink.command.name = Add Verified By Link
+
+#Commands to be executed from model elements
+
+addVerifiesLink.command.name = Add Verifies Link
+addSatisfiesLink.command.name = Add Satisfies Links
+
Bundle-Vendor = Eclipse Modeling Project
Bundle-Name = Papyrus Traceability Assistant Commands (Incubation) \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.xml
index 450786151d4..8bab0e734b0 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.xml
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/plugin.xml
@@ -9,5 +9,57 @@
name="%applyTraceabilityAssistant.command.name">
</command>
</extension>
-
+ <extension
+ point="org.eclipse.ui.commands">
+
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.InitDerivedReqHandler"
+ name="%deriveNewRequirement.command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivedByLinkHandler"
+ name="%addDerivedByLink.command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinedByLinkHandler"
+ name="%addRefinedByLink.command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiedByLinkHandler"
+ name="%addSatisfiedByLink.command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiedByLinkHandler"
+ name="%addVerifiedByLink.command.name">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiesLinkHandler"
+ name="%addVerifiesLink.command.name">
+ </command>
+
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinesLinkHandler"
+ name="%addRefinesLink.command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiesLinkHandler"
+ name="%addSatisfiesLink.command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ id="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivesLinkHandler"
+ name="%addDerivesLink.command.name">
+ </command>
+ </extension>
</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddDerivedLinkReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivedLinkReqCommand.java
index 63ebc7b34a1..a004aab7fea 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddDerivedLinkReqCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivedLinkReqCommand.java
@@ -10,65 +10,62 @@
* Contributors:
* CEA LIST. - initial API and implementation
*******************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.UMLPackage;
+
/**
*
- * Creates a set of DerivedReq links
+ * Creates a set of DerivedReq links based on a derived requirement
*/
public class AddDerivedLinkReqCommand extends RecordingCommand {
protected Element selectedElement;
TransactionalEditingDomain domain;
-
+
public AddDerivedLinkReqCommand(TransactionalEditingDomain domain, Element selectedElement) {
- super(domain,"AddDerivedReqCommand" );
- this.selectedElement=selectedElement;
- this.domain=domain;
+ super(domain, "AddDerivedLinkReqCommand");
+ this.selectedElement = selectedElement;
+ this.domain = domain;
}
- private Package getToPackage(Element elem){
- Package tmp= elem.getNearestPackage();
- while(tmp.getOwner()!=null && (tmp.getOwner()instanceof Package)){
- tmp= (Package)tmp.getOwner();
- }
- return tmp;
- }
@Override
protected void doExecute() {
- if( selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE)!=null){
- Stereotype reqStereotype=selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
- //open Tree selection dialog in order to choose the owner of the new requirement
- final IStaticContentProvider provider =new UMLContentProvider(getToPackage(selectedElement), UMLPackage.eINSTANCE.getPackage_PackagedElement(),reqStereotype);
+ if (selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ Stereotype reqStereotype = selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ final IStaticContentProvider provider = new UMLContentProvider(Utils.getToPackage(selectedElement),
+ UMLPackage.eINSTANCE.getPackage_PackagedElement(), reqStereotype);
+
ReferenceSelector selector = new ReferenceSelector();
selector.setLabelProvider(new UMLLabelProvider());
selector.setContentProvider(provider);
- MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),selector,"Choose requirements to add DeriveReqt link");
-
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(
+ Display.getDefault().getActiveShell(), selector,
+ "Choose the requirements from which this requirement was derived");
+
dialog.setLabelProvider(new UMLLabelProvider());
- //dialog.setMessage("Choose Requirements to add Derived Link");
- //dialog.setTitle("Choose Requirements to add Derived Link");
+
dialog.create();
- if(dialog.open() == org.eclipse.jface.window.Window.OK) {
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
Object[] result = dialog.getResult();
for (int i = 0; i < result.length; i++) {
Element currentElement = (Element) result[i];
- if( currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE)!=null){
- DerivationReqCreateCommand derivationReqCreateCommand= new DerivationReqCreateCommand(domain,(NamedElement) selectedElement,(NamedElement) currentElement);
+ if (currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ DerivationReqCreateCommand derivationReqCreateCommand = new DerivationReqCreateCommand(domain,
+ (NamedElement) selectedElement, (NamedElement) currentElement);
derivationReqCreateCommand.execute();
}
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivesLinkReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivesLinkReqCommand.java
new file mode 100644
index 00000000000..4394c2b58fb
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddDerivesLinkReqCommand.java
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+* CEA LIST. - initial API and implementation
+*******************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * Creates a set of DerivedReq links based on the requirements that derives
+ * others
+ */
+public class AddDerivesLinkReqCommand extends RecordingCommand {
+ protected Element selectedElement;
+ TransactionalEditingDomain domain;
+
+ public AddDerivesLinkReqCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain, "AddDerivesLinkReqCommand");
+ this.selectedElement = selectedElement;
+ this.domain = domain;
+ }
+
+ @Override
+ protected void doExecute() {
+ if (selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ Stereotype reqStereotype = selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ final IStaticContentProvider provider = new UMLContentProvider(Utils.getToPackage(selectedElement),
+ UMLPackage.eINSTANCE.getPackage_PackagedElement(), reqStereotype);
+ ReferenceSelector selector = new ReferenceSelector();
+ selector.setLabelProvider(new UMLLabelProvider());
+ selector.setContentProvider(provider);
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(
+ Display.getDefault().getActiveShell(), selector, "Choose the derived requirements");
+
+ dialog.setLabelProvider(new UMLLabelProvider());
+
+ dialog.create();
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
+ Object[] result = dialog.getResult();
+
+ for (int i = 0; i < result.length; i++) {
+ Element currentElement = (Element) result[i];
+ if (currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ DerivationReqCreateCommand derivationReqCreateCommand = new DerivationReqCreateCommand(domain,
+ (NamedElement) currentElement, (NamedElement) selectedElement);
+ derivationReqCreateCommand.execute();
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinedByCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinedByCommand.java
new file mode 100644
index 00000000000..5da512430ee
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinedByCommand.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.UseCase;
+
+/**
+ *
+ * Creates a set of Refine links based on a requirement
+ *
+ */
+public class AddRefinedByCommand extends RecordingCommand {
+ protected Element selectedElement;
+ TransactionalEditingDomain domain;
+
+ public AddRefinedByCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain, "AddRefinedByCommand");
+ this.selectedElement = selectedElement;
+ this.domain = domain;
+ }
+
+ @Override
+ protected void doExecute() {
+ if (selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ final IStaticContentProvider provider = new UMLContentProvider(Utils.getToPackage(selectedElement),
+ UMLPackage.eINSTANCE.getPackage_PackagedElement());
+ ReferenceSelector selector = new ReferenceSelector();
+ selector.setLabelProvider(new UMLLabelProvider());
+ selector.setContentProvider(provider);
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(
+ Display.getDefault().getActiveShell(), selector, "Choose the Use Cases that refine the requirement");
+
+ dialog.setLabelProvider(new UMLLabelProvider());
+
+ dialog.create();
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
+ Object[] result = dialog.getResult();
+
+ for (int i = 0; i < result.length; i++) {
+ Element currentElement = (Element) result[i];
+ if (currentElement instanceof UseCase) {
+ RefinementCreateCommand refinementCreateCommand = new RefinementCreateCommand(domain,
+ (UseCase) currentElement, (NamedElement) selectedElement);
+ refinementCreateCommand.execute();
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinesCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinesCommand.java
new file mode 100644
index 00000000000..5b2da0f49d3
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddRefinesCommand.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.UseCase;
+
+/**
+ *
+ * Creates a set of Refine links based on the model elements that refine the selected requirement
+ *
+ */
+public class AddRefinesCommand extends RecordingCommand {
+ protected Element selectedElement;
+ TransactionalEditingDomain domain;
+
+ public AddRefinesCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain, "AddRefinesCommand");
+ this.selectedElement = selectedElement;
+ this.domain = domain;
+ }
+
+ @Override
+ protected void doExecute() {
+ if (selectedElement instanceof UseCase) {
+ final IStaticContentProvider provider = new UMLContentProvider(Utils.getToPackage(selectedElement),
+ UMLPackage.eINSTANCE.getPackage_PackagedElement());
+ ReferenceSelector selector = new ReferenceSelector();
+ selector.setLabelProvider(new UMLLabelProvider());
+ selector.setContentProvider(provider);
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(
+ Display.getDefault().getActiveShell(), selector, "Choose the requirements refined by the Use Case");
+
+ dialog.setLabelProvider(new UMLLabelProvider());
+
+ dialog.create();
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
+ Object[] result = dialog.getResult();
+
+ for (int i = 0; i < result.length; i++) {
+ Element currentElement = (Element) result[i];
+ if (currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ RefinementCreateCommand refinementCreateCommand = new RefinementCreateCommand(domain,
+ (UseCase) selectedElement, (NamedElement) currentElement);
+ refinementCreateCommand.execute();
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiedByLinkCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiedByLinkCommand.java
new file mode 100644
index 00000000000..7379d98d44c
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiedByLinkCommand.java
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
+import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * Creates a set of Satisfy links based on a selected requirement
+ */
+public class AddSatisfiedByLinkCommand extends RecordingCommand {
+ protected Element selectedElement;
+ TransactionalEditingDomain domain;
+
+ public AddSatisfiedByLinkCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain, "Add Satisfied By Link Command");
+ this.selectedElement = selectedElement;
+ this.domain = domain;
+ }
+
+ @Override
+ protected void doExecute() {
+ // open Tree selection dialog
+ final IStaticContentProvider provider = new UMLContentProvider(Utils.getToPackage(selectedElement),
+ UMLPackage.eINSTANCE.getPackage_PackagedElement());
+ ReferenceSelector selector = new ReferenceSelector();
+ selector.setLabelProvider(new UMLLabelProvider());
+ selector.setContentProvider(provider);
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),
+ selector, "Choose the model elements that satisfy the requirement");
+
+ dialog.setLabelProvider(new UMLLabelProvider());
+ dialog.create();
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
+ Object[] result = dialog.getResult();
+
+ for (int i = 0; i < result.length; i++) {
+ Element currentElement = (Element) result[i];
+ SatisfyCreateCommand satisfyCreateCommand = new SatisfyCreateCommand(domain,
+ (NamedElement) currentElement, (NamedElement) selectedElement);
+ satisfyCreateCommand.execute();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiesLinkCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiesLinkCommand.java
new file mode 100644
index 00000000000..f94c0367ff4
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddSatisfiesLinkCommand.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
+import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * Creates a set of Satisfy links based on a selected model element
+ */
+public class AddSatisfiesLinkCommand extends RecordingCommand {
+ protected Element selectedElement;
+ TransactionalEditingDomain domain;
+
+ public AddSatisfiesLinkCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain, "Add Satisfies Link Command");
+ this.selectedElement = selectedElement;
+ this.domain = domain;
+ }
+
+
+ @Override
+ protected void doExecute() {
+ // open Tree selection dialog
+ final IStaticContentProvider provider = new UMLContentProvider(Utils.getToPackage(selectedElement),
+ UMLPackage.eINSTANCE.getPackage_PackagedElement());
+ ReferenceSelector selector = new ReferenceSelector();
+ selector.setLabelProvider(new UMLLabelProvider());
+ selector.setContentProvider(provider);
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),
+ selector, "Choose the requirements satisfied by the model element");
+
+ dialog.setLabelProvider(new UMLLabelProvider());
+ dialog.create();
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
+ Object[] result = dialog.getResult();
+
+ for (int i = 0; i < result.length; i++) {
+ Element currentElement = (Element) result[i];
+ SatisfyCreateCommand satisfyCreateCommand = new SatisfyCreateCommand(domain,
+ (NamedElement) selectedElement, (NamedElement) currentElement);
+ satisfyCreateCommand.execute();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddVerifyLinkCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddVerifiedByLinkCommand.java
index 31baaa8996c..8a596890ebe 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddVerifyLinkCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddVerifiedByLinkCommand.java
@@ -12,53 +12,44 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.UMLPackage;
/**
*
- * Creates a set of Verify links
+ * Creates a set of Verify links based on a selected requirement
*/
-public class AddVerifyLinkCommand extends RecordingCommand {
+public class AddVerifiedByLinkCommand extends RecordingCommand {
protected Element selectedElement;
TransactionalEditingDomain domain;
- public AddVerifyLinkCommand(TransactionalEditingDomain domain, Element selectedElement) {
- super(domain,"Add Verify Link Command" );
+ public AddVerifiedByLinkCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain,"Add Verified By Link Command" );
this.selectedElement=selectedElement;
this.domain=domain;
}
- private Package getToPackage(Element elem){
- Package tmp= elem.getNearestPackage();
- while(tmp.getOwner()!=null && (tmp.getOwner()instanceof Package)){
- tmp= (Package)tmp.getOwner();
- }
- return tmp;
- }
@Override
protected void doExecute() {
//open Tree selection dialog
- final IStaticContentProvider provider =new UMLContentProvider(getToPackage(selectedElement), UMLPackage.eINSTANCE.getPackage_PackagedElement());
+ final IStaticContentProvider provider =new UMLContentProvider(Utils.getToPackage(selectedElement), UMLPackage.eINSTANCE.getPackage_PackagedElement());
ReferenceSelector selector = new ReferenceSelector();
selector.setLabelProvider(new UMLLabelProvider());
selector.setContentProvider(provider);
MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),selector,"Choose the model elements that verify the requirement");
dialog.setLabelProvider(new UMLLabelProvider());
- //dialog.setMessage("Choose the model elements that verify the requirement");
- //dialog.setTitle("Choose the model elements that verify the requirement");
dialog.create();
if(dialog.open() == org.eclipse.jface.window.Window.OK) {
Object[] result = dialog.getResult();
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddSatisfyLinkCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddVerifiesLinkCommand.java
index 31bbfb77367..a7c1befa313 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/AddSatisfyLinkCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/AddVerifiesLinkCommand.java
@@ -12,61 +12,52 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.requirements.common.Utils;
import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.UMLPackage;
/**
*
- * Creates a set of Satisfy links
+ * Creates a set of Verify links base on a selected model element
*/
-public class AddSatisfyLinkCommand extends RecordingCommand {
+public class AddVerifiesLinkCommand extends RecordingCommand {
protected Element selectedElement;
TransactionalEditingDomain domain;
- public AddSatisfyLinkCommand(TransactionalEditingDomain domain, Element selectedElement) {
- super(domain,"Add Satisfy Link Command" );
+ public AddVerifiesLinkCommand(TransactionalEditingDomain domain, Element selectedElement) {
+ super(domain,"Add Verifies Link Command" );
this.selectedElement=selectedElement;
this.domain=domain;
}
- private Package getToPackage(Element elem){
- Package tmp= elem.getNearestPackage();
- while(tmp.getOwner()!=null && (tmp.getOwner()instanceof Package)){
- tmp= (Package)tmp.getOwner();
- }
- return tmp;
- }
@Override
protected void doExecute() {
//open Tree selection dialog
- final IStaticContentProvider provider =new UMLContentProvider(getToPackage(selectedElement), UMLPackage.eINSTANCE.getPackage_PackagedElement());
+ final IStaticContentProvider provider =new UMLContentProvider(Utils.getToPackage(selectedElement), UMLPackage.eINSTANCE.getPackage_PackagedElement());
ReferenceSelector selector = new ReferenceSelector();
selector.setLabelProvider(new UMLLabelProvider());
selector.setContentProvider(provider);
- MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),selector,"Choose the model elements that satisfy the requirement");
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),selector,"Choose the requirements that this model element verifies");
dialog.setLabelProvider(new UMLLabelProvider());
- //dialog.setMessage("Choose the model elements that satisfy the requirement");
- //dialog.setTitle("Choose the model elements that satisfy the requirement");
dialog.create();
if(dialog.open() == org.eclipse.jface.window.Window.OK) {
Object[] result = dialog.getResult();
for (int i = 0; i < result.length; i++) {
Element currentElement = (Element) result[i];
- SatisfyCreateCommand satisfyCreateCommand= new SatisfyCreateCommand(domain,(NamedElement) currentElement,(NamedElement) selectedElement);
- satisfyCreateCommand.execute();
+ VerifyCreateCommand verifyCreateCommand= new VerifyCreateCommand(domain,(NamedElement) selectedElement,(NamedElement) currentElement);
+ verifyCreateCommand.execute();
}
}
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/DerivationReqCreateCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/DerivationReqCreateCommand.java
index 5252a9020ec..853c444d9ac 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/DerivationReqCreateCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/DerivationReqCreateCommand.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015 CEA LIST.
+ * Copyright (c) 2016 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,7 +9,7 @@
*
* Contributors:
*
- * Patrick Tessier (patrick.tessier@cea.fr) CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.requirements.sysml.traceability.commands;
@@ -22,36 +22,42 @@ import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.UMLFactory;
-
/**
- * this command is used to create a link "satisfyBy" between requirement and namedElement
+ * Creates a "DerivedReq" link between requirements
*
*/
public class DerivationReqCreateCommand extends RecordingCommand {
private NamedElement source;
private NamedElement target;
- /**
- * use to make an abstraction
- * @param domain the domain to execute a transaction
- * @param source the source of the abstraction (the more concrete element)
- * @param target the target of the abstraction (the more abstract element)
+ /**
+ * use to make an abstraction
+ *
+ * @param domain
+ * the domain to execute a transaction
+ * @param source
+ * the source of the abstraction (the more concrete element) -
+ * client
+ * @param target
+ * the target of the abstraction (the more abstract element) -
+ * supplier
+ *
*/
- public DerivationReqCreateCommand(TransactionalEditingDomain domain, NamedElement source, NamedElement target){
- super(domain,"Create an Abstraction");
- this.source=source;
- this.target=target;
+ public DerivationReqCreateCommand(TransactionalEditingDomain domain, NamedElement source, NamedElement target) {
+ super(domain, "Create an Abstraction");
+ this.source = source;
+ this.target = target;
}
@Override
protected void doExecute() {
- Abstraction theAbstraction= UMLFactory.eINSTANCE.createAbstraction();
- target.getNearestPackage().getPackagedElements().add(theAbstraction);
- theAbstraction.getSuppliers().add(source);
- theAbstraction.getClients().add(target);
- theAbstraction.setName("DeriveFrom_"+this.source.getName());
- Stereotype satisfyStereotype= theAbstraction.getApplicableStereotype(I_SysMLStereotype.DERIVEREQT_STEREOTYPE);
- theAbstraction.applyStereotype(satisfyStereotype);
+ Abstraction theAbstraction = UMLFactory.eINSTANCE.createAbstraction();
+ source.getNearestPackage().getPackagedElements().add(theAbstraction);
+ theAbstraction.getSuppliers().add(target);
+ theAbstraction.getClients().add(source);
+ theAbstraction.setName("Derived_from" + this.target.getName());
+ Stereotype derivedReqtStereotype = theAbstraction
+ .getApplicableStereotype((I_SysMLStereotype.DERIVEREQT_STEREOTYPE));
+ theAbstraction.applyStereotype(derivedReqtStereotype);
}
-
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/InitDerivedReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/InitDerivedReqCommand.java
new file mode 100644
index 00000000000..5ac3ce08d6f
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/InitDerivedReqCommand.java
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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 (patrick.tessier@cea.fr) CEA LIST - Initial API and implementation
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Improvements
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
+import org.eclipse.papyrus.requirements.common.Utils;
+import org.eclipse.papyrus.requirements.sysml.assistant.commands.PapyrusReqSysMLRequirementCreateCommand;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
+import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ *
+ * Creates a derived requirement from a set of requirements with a concatened
+ * text
+ *
+ */
+public class InitDerivedReqCommand extends RecordingCommand {
+ protected ArrayList<Element> selectedElements;
+ TransactionalEditingDomain domain;
+
+ public InitDerivedReqCommand(TransactionalEditingDomain domain, ArrayList<Element> selectedElements) {
+ super(domain, "InitDerivedReqCommand");
+ this.selectedElements = selectedElements;
+ this.domain = domain;
+ }
+
+ @Override
+ protected void doExecute() {
+ String concatenedString = "";
+ org.eclipse.uml2.uml.Package owner = null;
+ for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
+ Element currentElement = (Element) iterator.next();
+ if (currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ Stereotype stereotype = currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ concatenedString = concatenedString + "\n"
+ + currentElement.getValue(stereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT);
+ owner = currentElement.getNearestPackage();
+ }
+ }
+ // open Tree selection dialog in order to choose the owner of the new
+ // requirement
+ TreeSelectorDialog dialog = new TreeSelectorDialog(Display.getDefault().getActiveShell());
+ dialog.setContentProvider(
+ new UMLContentProvider(Utils.getToPackage(owner), UMLPackage.eINSTANCE.getPackage_NestedPackage()));
+ dialog.setLabelProvider(new UMLLabelProvider());
+ dialog.setMessage("Choose the owner of the new derived requirement");
+ dialog.setTitle("Choose the owner of the new derived requirement");
+ dialog.create();
+ dialog.setDescription("Choose the owner of the new derived requirement");
+ if (dialog.open() == org.eclipse.jface.window.Window.OK) {
+ Object[] result = dialog.getResult();
+ owner = ((org.eclipse.uml2.uml.Package) result[0]);
+ } else
+ return;
+
+
+ final String sysmlReqProfileQN = UMLUtil.getProfile(RequirementsPackage.eINSTANCE, owner).getQualifiedName();
+ ArrayList<String> requiredProfiles = new ArrayList<String>();
+
+ requiredProfiles.add(sysmlReqProfileQN);// e.g. "SysML::Requirements"
+
+ if (Utils.getMissingRequiredProfileApplications(owner, requiredProfiles).size() > 0) {
+ for (String missingProfileQN : Utils.getMissingRequiredProfileApplications(owner, requiredProfiles)) {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Missing profile application",
+ "Please apply the profile " + missingProfileQN + " to " + owner.getName());
+ }
+ return;
+ }
+
+ String ID = PapyrusReqSysMLRequirementCreateCommand.getNewIDReq(owner);
+ Class req = owner.createOwnedClass(ID, false);
+ Stereotype reqStereotype = req.getApplicableStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ req.applyStereotype(reqStereotype);
+ req.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT, concatenedString);
+ req.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT, ID);
+
+ for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
+ Element currentElement = (Element) iterator.next();
+ if (currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
+ DerivationReqCreateCommand derivationReqCreateCommand = new DerivationReqCreateCommand(domain, req,
+ (NamedElement) currentElement);
+ derivationReqCreateCommand.execute();
+ }
+ }
+ }
+
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/RefinementCreateCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/RefinementCreateCommand.java
index 1cb2e171be3..fe6e5d3fec6 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/RefinementCreateCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/RefinementCreateCommand.java
@@ -10,6 +10,7 @@
* Contributors:
*
* Patrick Tessier (patrick.tessier@cea.fr) CEA LIST - Initial API and implementation
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Improvements
*
*****************************************************************************/
package org.eclipse.papyrus.requirements.sysml.traceability.commands;
@@ -24,7 +25,7 @@ import org.eclipse.uml2.uml.UseCase;
/**
- * this command is used to create a link "Refine" between requirement and UseCase
+ * Used to create a link "Refine" between requirement and UseCase
*
*/
public class RefinementCreateCommand extends RecordingCommand {
@@ -33,9 +34,8 @@ public class RefinementCreateCommand extends RecordingCommand {
/**
* use to make an abstraction
* @param domain the domain to execute a transaction
- * @param source the source of the abstraction (the more concrete element)
- * @param target the target of the abstraction (the more abstract element)
-
+ * @param source the source of the abstraction (the more concrete element) - client
+ * @param target the target of the abstraction (the more abstract element) - supplier
*/
public RefinementCreateCommand(TransactionalEditingDomain domain, UseCase source, NamedElement target){
super(domain,"Create an Abstraction");
@@ -46,12 +46,14 @@ public class RefinementCreateCommand extends RecordingCommand {
@Override
protected void doExecute() {
Abstraction theAbstraction= UMLFactory.eINSTANCE.createAbstraction();
- target.getNearestPackage().getPackagedElements().add(theAbstraction);
- theAbstraction.getSuppliers().add(source);
- theAbstraction.getClients().add(target);
- theAbstraction.setName("SatisfactionOf_"+this.source.getName());
- Stereotype satisfyStereotype= theAbstraction.getApplicableStereotype("StandardProfileL2::Refine");
- theAbstraction.applyStereotype(satisfyStereotype);
+ source.getNearestPackage().getPackagedElements().add(theAbstraction);
+ theAbstraction.getSuppliers().add(target);
+ theAbstraction.getClients().add(source);
+ theAbstraction.setName("Refines_"+this.target.getName());
+// final String packageQN = UMLUtil.getProfile(StandardPackage.eINSTANCE, source.getNearestPackage()).getQualifiedName();
+// Stereotype refineStereotype= theAbstraction.getApplicableStereotype(packageQN+"::Refine");// now it is "StandardProfile::Refine" before it was "StandardProfileL2::Refine"
+ Stereotype refineStereotype= theAbstraction.getApplicableStereotype("StandardProfile::Refine");
+ theAbstraction.applyStereotype(refineStereotype);
}
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/SatisfyCreateCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/SatisfyCreateCommand.java
index f411fe59b14..bfa7bd13827 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/SatisfyCreateCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/SatisfyCreateCommand.java
@@ -12,7 +12,7 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -36,9 +36,11 @@ public class SatisfyCreateCommand extends RecordingCommand {
* @param domain
* the domain to execute a transaction
* @param source
- * the source of the abstraction (the more concrete element)
+ * the source of the abstraction (the more concrete element) -
+ * client
* @param target
- * the target of the abstraction (the more abstract element)
+ * the target of the abstraction (the more abstract element) -
+ * supplier
*
*/
public SatisfyCreateCommand(TransactionalEditingDomain domain, NamedElement source, NamedElement target) {
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/VerifyCreateCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/VerifyCreateCommand.java
index 29c481c95e4..4170e3a5beb 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/VerifyCreateCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/VerifyCreateCommand.java
@@ -12,7 +12,7 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
+package org.eclipse.papyrus.requirements.sysml.traceability.commands;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -36,9 +36,11 @@ public class VerifyCreateCommand extends RecordingCommand {
* @param domain
* the domain to execute a transaction
* @param source
- * the source of the abstraction (the more concrete element)
+ * the source of the abstraction (the more concrete element) -
+ * client
* @param target
- * the target of the abstraction (the more abstract element)
+ * the target of the abstraction (the more abstract element) -
+ * supplier
*
*/
public VerifyCreateCommand(TransactionalEditingDomain domain, NamedElement source, NamedElement target) {
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/META-INF/MANIFEST.MF
index 1e58de51698..86af066453d 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/META-INF/MANIFEST.MF
@@ -11,7 +11,10 @@ Require-Bundle: org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
org.eclipse.papyrus.requirements.sysml.traceability.assistant;bundle-version="0.7.0",
org.eclipse.papyrus.uml.extensionpoints;bundle-version="1.2.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
+ org.eclipse.papyrus.requirements.common,
+ org.eclipse.papyrus.requirements.sysml.traceability.commands,
+ org.eclipse.uml2.uml
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.requirements.sysml.traceability.handlers
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.properties
index f9459933320..9c144b10c42 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.properties
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.properties
@@ -1,40 +1,3 @@
#Properties file for org.eclipse.papyrus.requirements.sysml.assistant
-menu.label = Papyrus Req
-menu.tooltip = Assistants to manage SysML requirements
-menu.label.0 = Tools to Define Requirements Profile
-menu.tooltip.0 = Tools to Define Requirements Language
-
-command.label = Create New Requirement
-command.tooltip = Create New Requirement
-command.label.0 = Add Derived Link
-command.tooltip.0 = Add Derived Link
-command.label.1 = Derive New Requirement
-command.tooltip.1 = Derive New Requirement
-command.label.2 = Create Comments for Elements
-command.tooltip.2 = Create Comments for Elements
-command.label.3 = Extract Comments
-command.tooltip.3 = Extract Comments
-command.label.4 = Decompose Requirement
-command.tooltip.4 = Decompose Requirement
-command.label.5 = Add Satisfy Link
-command.tooltip.5 = Add Satisfy Link
-command.label.6 = Add Verify Link
-command.tooltip.6 = Add Verify Link
-command.label.7 = Define or Update Stereotype and Profile on Demand
-command.tooltip.7 = Define or Update Stereotype and Profile on Demand
-command.label.8 = Generate Profile from Domain Model
-command.tooltip.8 = Generates an initial profile from a domain model according to user-defined Papyrus Req preferences
-
-command.name = Extract Comments Assistant
-command.name.0 = InitDerivedRequirement Assistant
-command.name.1 = Create Comments
-command.name.2 = Create New Papyrus SysML Requirement
-command.name.3 = Add Derived Link
-command.name.4 = Decompose Requirement
-command.name.5 = Add Satisfy Link
-command.name.6 = Add Verify Link
-command.name.7 = Generate Profile from a Domain Model
-command.name.8 = Define or Update Stereotypes
-
Bundle-Vendor = Eclipse Modeling Project
Bundle-Name = Papyrus Req SysML Assistant (Incubation) \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.xml
index 8ed36d174c7..6b2602894d8 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.xml
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/plugin.xml
@@ -8,5 +8,46 @@
commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.ApplyTracabilityHandler">
</handler>
</extension>
-
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.InitDerivedReqHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.InitDerivedReqHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivesLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivesLinkHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivedByLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivedByLinkHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinedByLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinedByLinkHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiedByLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiedByLinkHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiedByLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiedByLinkHandler">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiesLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiesLinkHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiesLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiesLinkHandler">
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinesLinkHandler"
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinesLinkHandler">
+ </handler>
+ </extension>
</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddDerivedLinkReqHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivedByLinkHandler.java
index a39495d168f..965b91f2346 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddDerivedLinkReqHandler.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivedByLinkHandler.java
@@ -8,33 +8,33 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Patrick Tessier (patrick.tessier@cea.fr) CEA LIST. - initial API and implementation
+ * CEA LIST. - initial API and implementation
*******************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.handlers;
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
import java.util.ArrayList;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.AddDerivedLinkReqCommand;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.DerivationReqCreateCommand;
import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddDerivedLinkReqCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.DerivationReqCreateCommand;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
/**
- * Executes the addition of DerivedReqt links
+ * Executes the addition of DerivedReqt links based on a selected requirement
*
*/
-public class AddDerivedLinkReqHandler extends PapyrusAbstractHandler {
+public class AddDerivedByLinkHandler extends PapyrusAbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
super.execute(event);
ArrayList<Element> selectedElements = getSelectionSet();
if (selectedElements.size() == 2) {
DerivationReqCreateCommand addDerivedLinkReqCommand = new DerivationReqCreateCommand(
- transactionalEditingDomain, (NamedElement) selectedElements.get(1),
- (NamedElement) selectedElements.get(0));
+ transactionalEditingDomain, (NamedElement) selectedElements.get(0),
+ (NamedElement) selectedElements.get(1));
transactionalEditingDomain.getCommandStack().execute(addDerivedLinkReqCommand);
} else {
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivesLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivesLinkHandler.java
new file mode 100644
index 00000000000..bcb3fb83984
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddDerivesLinkHandler.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddDerivesLinkReqCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.DerivationReqCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * Executes the addition of DerivedReqt links based on a selected requirement
+ *
+ */
+public class AddDerivesLinkHandler extends PapyrusAbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElements = getSelectionSet();
+ if (selectedElements.size() == 2) {
+ DerivationReqCreateCommand addDerivedLinkReqCommand = new DerivationReqCreateCommand(
+ transactionalEditingDomain, (NamedElement) selectedElements.get(1),
+ (NamedElement) selectedElements.get(0));
+ transactionalEditingDomain.getCommandStack().execute(addDerivedLinkReqCommand);
+ } else {
+
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ AddDerivesLinkReqCommand addDerivesLinkReqCommand = new AddDerivesLinkReqCommand(
+ transactionalEditingDomain, selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(addDerivesLinkReqCommand);
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinedByLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinedByLinkHandler.java
new file mode 100644
index 00000000000..e6855743213
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinedByLinkHandler.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddRefinedByCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.RefinementCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UseCase;
+
+/**
+ * Executes the addition of Refine links based on a selected requirement
+ *
+ */
+public class AddRefinedByLinkHandler extends PapyrusAbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElements = getSelectionSet();
+ if (selectedElements.size() == 2) {
+ RefinementCreateCommand refinementCreateCommand = new RefinementCreateCommand(
+ transactionalEditingDomain, (UseCase) selectedElements.get(0),
+ (NamedElement) selectedElements.get(1));
+ transactionalEditingDomain.getCommandStack().execute(refinementCreateCommand);
+ } else {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ AddRefinedByCommand addRefinedByCommand = new AddRefinedByCommand(
+ transactionalEditingDomain, selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(addRefinedByCommand);
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinesLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinesLinkHandler.java
new file mode 100644
index 00000000000..5f3e9501c61
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddRefinesLinkHandler.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddRefinesCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.RefinementCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UseCase;
+
+/**
+ * Executes the addition of Refine links based on a selected model element (e.g. an Use Case)
+ *
+ */
+public class AddRefinesLinkHandler extends PapyrusAbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElements = getSelectionSet();
+ if (selectedElements.size() == 2) {
+ RefinementCreateCommand refinementCreateCommand = new RefinementCreateCommand(
+ transactionalEditingDomain, (UseCase) selectedElements.get(1),
+ (NamedElement) selectedElements.get(0));
+ transactionalEditingDomain.getCommandStack().execute(refinementCreateCommand);
+ } else {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ AddRefinesCommand addRefinesCommand = new AddRefinesCommand(
+ transactionalEditingDomain, selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(addRefinesCommand);
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddSatisfyLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiedByLinkHandler.java
index 2939f46de75..9a6f6cdb403 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddSatisfyLinkHandler.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiedByLinkHandler.java
@@ -12,23 +12,23 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.handlers;
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
import java.util.ArrayList;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.AddSatisfyLinkCommand;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.SatisfyCreateCommand;
import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddSatisfiedByLinkCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.SatisfyCreateCommand;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
/**
- * Executes the addition of Satisfy links
+ * Executes the addition of Satisfy links based on a selected requirement
*
*/
-public class AddSatisfyLinkHandler extends PapyrusAbstractHandler {
+public class AddSatisfiedByLinkHandler extends PapyrusAbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
super.execute(event);
@@ -38,11 +38,10 @@ public class AddSatisfyLinkHandler extends PapyrusAbstractHandler {
(NamedElement) selectedElements.get(1), (NamedElement) selectedElements.get(0));
transactionalEditingDomain.getCommandStack().execute(addSatisfyCreateCommand);
} else {
-
Element selectedElement = getSelection();
if (selectedElement != null) {
- AddSatisfyLinkCommand addAddSatisfyLinkCommand = new AddSatisfyLinkCommand(transactionalEditingDomain,
- selectedElement);
+ AddSatisfiedByLinkCommand addAddSatisfyLinkCommand = new AddSatisfiedByLinkCommand(
+ transactionalEditingDomain, selectedElement);
transactionalEditingDomain.getCommandStack().execute(addAddSatisfyLinkCommand);
}
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiesLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiesLinkHandler.java
new file mode 100644
index 00000000000..14e0155688c
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddSatisfiesLinkHandler.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddSatisfiesLinkCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.SatisfyCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * Executes the addition of Satisfy links based on a selected model element
+ *
+ */
+public class AddSatisfiesLinkHandler extends PapyrusAbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElements = getSelectionSet();
+ if (selectedElements.size() == 2) {
+ SatisfyCreateCommand addSatisfyCreateCommand = new SatisfyCreateCommand(transactionalEditingDomain,
+ (NamedElement) selectedElements.get(0), (NamedElement) selectedElements.get(1));
+ transactionalEditingDomain.getCommandStack().execute(addSatisfyCreateCommand);
+ } else {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ AddSatisfiesLinkCommand addSatisfiesLinkCommand = new AddSatisfiesLinkCommand(
+ transactionalEditingDomain, selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(addSatisfiesLinkCommand);
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddVerifyLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiedByLinkHandler.java
index ea24f1c19f5..3628a529d24 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/AddVerifyLinkHandler.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiedByLinkHandler.java
@@ -12,23 +12,23 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.handlers;
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
import java.util.ArrayList;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.AddVerifyLinkCommand;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.VerifyCreateCommand;
import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddVerifiedByLinkCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.VerifyCreateCommand;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
/**
- * Executes the addition of Verify links
+ * Executes the addition of Verify links based on a selected requirement
*
*/
-public class AddVerifyLinkHandler extends PapyrusAbstractHandler {
+public class AddVerifiedByLinkHandler extends PapyrusAbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
super.execute(event);
@@ -38,12 +38,11 @@ public class AddVerifyLinkHandler extends PapyrusAbstractHandler {
(NamedElement) selectedElements.get(1), (NamedElement) selectedElements.get(0));
transactionalEditingDomain.getCommandStack().execute(addVerifyCreateCommand);
} else {
-
Element selectedElement = getSelection();
if (selectedElement != null) {
- AddVerifyLinkCommand addAddVerifyLinkCommand = new AddVerifyLinkCommand(transactionalEditingDomain,
+ AddVerifiedByLinkCommand addVerifiedByLinkCommand = new AddVerifiedByLinkCommand(transactionalEditingDomain,
selectedElement);
- transactionalEditingDomain.getCommandStack().execute(addAddVerifyLinkCommand);
+ transactionalEditingDomain.getCommandStack().execute(addVerifiedByLinkCommand);
}
}
return null;
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiesLinkHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiesLinkHandler.java
new file mode 100644
index 00000000000..4445232a8e0
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/AddVerifiesLinkHandler.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.AddVerifiesLinkCommand;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.VerifyCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * Executes the addition of Verify links based on a selected model element
+ *
+ */
+public class AddVerifiesLinkHandler extends PapyrusAbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElements = getSelectionSet();
+ if (selectedElements.size() == 2) {
+ VerifyCreateCommand addVerifyCreateCommand = new VerifyCreateCommand(transactionalEditingDomain,
+ (NamedElement) selectedElements.get(0), (NamedElement) selectedElements.get(1));
+ transactionalEditingDomain.getCommandStack().execute(addVerifyCreateCommand);
+ } else {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ AddVerifiesLinkCommand addVerifiesLinkCommand = new AddVerifiesLinkCommand(transactionalEditingDomain,
+ selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(addVerifiesLinkCommand);
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ Element selectedElement = getSelection();
+ if (selectedElement != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/ApplyTracabilityHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/ApplyTracabilityHandler.java
index 91434299a22..d9775b533da 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/ApplyTracabilityHandler.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/ApplyTracabilityHandler.java
@@ -10,7 +10,8 @@
* Contributors:
*
* Patrick Tessier (patrick.tessier@cea.fr) CEA LIST - Initial API and implementation
- *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Improvements
+ *
*****************************************************************************/
package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
@@ -28,12 +29,12 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.ui.util.EditorUtils;
import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForHandlers;
+import org.eclipse.papyrus.requirements.common.Utils;
import org.eclipse.papyrus.requirements.sysml.traceability.assistant.analysis.TracabilityAnalyzer;
import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile;
import org.eclipse.papyrus.uml.extensionpoints.utils.Util;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
@@ -42,35 +43,33 @@ import org.eclipse.uml2.uml.Profile;
* this class launch the application of the SysML profile
*/
-public class ApplyTracabilityHandler extends AbstractHandler {
+public class ApplyTracabilityHandler extends AbstractHandler {
- protected TransactionalEditingDomain transactionalEditingDomain=null;
- protected org.eclipse.uml2.uml.Package selectedElement=null;
+ protected TransactionalEditingDomain transactionalEditingDomain = null;
+ protected org.eclipse.uml2.uml.Package selectedElement = null;
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
try {
- transactionalEditingDomain =ServiceUtilsForHandlers.getInstance().getService(TransactionalEditingDomain.class, event);
+ transactionalEditingDomain = ServiceUtilsForHandlers.getInstance()
+ .getService(TransactionalEditingDomain.class, event);
} catch (Exception e) {
- System.err.println("impossible to get the Transactional Editing Domain "+e);
+ System.err.println("impossible to get the Transactional Editing Domain " + e);
}
-
-
- if(selection instanceof IStructuredSelection) {
- Object selectedobject = ((IStructuredSelection)selection).getFirstElement();
- EObject selectedEObject = (EObject)EMFHelper.getEObject(selectedobject);
- if (selectedEObject instanceof Model){
- selectedElement=(Package)selectedEObject;
+ if (selection instanceof IStructuredSelection) {
+ Object selectedobject = ((IStructuredSelection) selection).getFirstElement();
+ EObject selectedEObject = (EObject) EMFHelper.getEObject(selectedobject);
+ if (selectedEObject instanceof Model) {
+ selectedElement = (Package) selectedEObject;
}
-
- if(selectedElement!=null){
+ if (selectedElement != null) {
@SuppressWarnings("deprecation")
TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
- if (editingDomain != null && selectedElement!=null) {
+ if (editingDomain != null && selectedElement != null) {
Command command = new RecordingCommand(editingDomain) {
@Override
@@ -80,8 +79,8 @@ public class ApplyTracabilityHandler extends AbstractHandler {
}
};
editingDomain.getCommandStack().execute(command);
- TracabilityAnalyzer analyzer= new TracabilityAnalyzer();
- analyzer.runAnalysis(getToPackage(selectedElement), editingDomain);
+ TracabilityAnalyzer analyzer = new TracabilityAnalyzer();
+ analyzer.runAnalysis(Utils.getToPackage(selectedElement), editingDomain);
}
}
@@ -89,13 +88,6 @@ public class ApplyTracabilityHandler extends AbstractHandler {
return null;
}
- private Package getToPackage(Element elem){
- Package tmp= elem.getNearestPackage();
- while(tmp.getOwner()!=null && (tmp.getOwner()instanceof Package)){
- tmp= (Package)tmp.getOwner();
- }
- return tmp;
- }
/**
*
* @see org.eclipse.core.commands.AbstractHandler#isEnabled()
@@ -108,19 +100,19 @@ public class ApplyTracabilityHandler extends AbstractHandler {
}
protected void changeStructure(Package currentPackage) {
- Package topPackage= getToPackage(currentPackage);
- //apply SysML profile
- RegisteredProfile SysMLregisteredProfile=(RegisteredProfile)RegisteredProfile.getRegisteredProfile("SysML");
+ Package topPackage = Utils.getToPackage(currentPackage);
+ // apply SysML profile
+ RegisteredProfile SysMLregisteredProfile = (RegisteredProfile) RegisteredProfile.getRegisteredProfile("SysML");
URI SysMLmodelUri = SysMLregisteredProfile.uri;
@SuppressWarnings("deprecation")
final Resource SysMLResource = Util.getResourceSet(topPackage).getResource(SysMLmodelUri, true);
- Profile sysMLprofile=(Profile) SysMLResource.getContents().get(0);
+ Profile sysMLprofile = (Profile) SysMLResource.getContents().get(0);
topPackage.applyProfile(sysMLprofile);
URI standardL2URI = URI.createURI("pathmap://UML_PROFILES/StandardL2.profile.uml");
@SuppressWarnings("deprecation")
final Resource standardL2Resource = Util.getResourceSet(topPackage).getResource(standardL2URI, true);
- Profile standardL2Profile=(Profile) standardL2Resource.getContents().get(0);
+ Profile standardL2Profile = (Profile) standardL2Resource.getContents().get(0);
topPackage.applyProfile(standardL2Profile);
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/InitDerivedReqHandler.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/InitDerivedReqHandler.java
index f34febc0cc4..e7b22952265 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.handlers/src/org/eclipse/papyrus/requirements/sysml/assistant/handlers/InitDerivedReqHandler.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers/src/org/eclipse/papyrus/requirements/sysml/traceability/handlers/InitDerivedReqHandler.java
@@ -10,14 +10,14 @@
* Contributors:
* Patrick Tessier (patrick.tessier@cea.fr) CEA LIST. - initial API and implementation
*******************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.handlers;
+package org.eclipse.papyrus.requirements.sysml.traceability.handlers;
import java.util.ArrayList;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.requirements.sysml.assistant.commands.InitDerivedReqCommand;
import org.eclipse.papyrus.requirements.common.PapyrusAbstractHandler;
+import org.eclipse.papyrus.requirements.sysml.traceability.commands.InitDerivedReqCommand;
import org.eclipse.uml2.uml.Element;
/**
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/META-INF/MANIFEST.MF
index 67ffd799305..e2b290296b5 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/META-INF/MANIFEST.MF
@@ -9,10 +9,12 @@ Require-Bundle: org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
org.eclipse.papyrus.infra.emf;bundle-version="0.10.0";resolution:=optional,
org.eclipse.papyrus.infra.widgets;bundle-version="0.9.1";resolution:=optional,
org.eclipse.papyrus.infra.core;bundle-version="0.9.0";resolution:=optional,
- org.eclipse.core.expressions;bundle-version="3.5.0",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0",
- org.eclipse.papyrus.requirements.common.ui;bundle-version="0.7.0"
+ org.eclipse.papyrus.requirements.common.ui;bundle-version="0.7.0",
+ org.eclipse.papyrus.requirements.sysml.testers;bundle-version="0.7.0",
+ org.eclipse.core.expressions;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: org.eclipse.papyrus.requirements.sysml.traceability.ui
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.properties
index 646c08b1625..27d3c6962c1 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.properties
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.properties
@@ -1,9 +1,53 @@
#Properties file for org.eclipse.papyrus.requirements.sysml.traceability.ui
+# Contributors:
+# Mauricio Alferez (mauricio.alferez@cea.fr)
+
papyrus.requirements.sysml.traceability.menu.label = Papyrus Req - Traceability Tools
papyrus.requirements.sysml.traceability.menu.tooltip = Traceability assistants and tables for SysML requirements models
+#--------------------------------------------------------------------------
+#Commands to be executed from a Model
applyTraceabilityAssistant.command.label = Apply Traceability Assistant
applyTraceabilityAssistant.command.tooltip = Apply Traceability Assistant
+#--------------------------------------------------------------------------
+#Commands to be executed from requirements
+#--------------------------------------------------------------------------
+ #"A DeriveReqt relationship is a dependency between two requirements in which a client requirement can be derived from the supplier requirement.
+ #As with other dependencies, the arrow direction points from the derived (client) requirement to the (supplier) requirement from which it is derived."
+deriveNewRequirement.command.label = Derive new requirement
+deriveNewRequirement.command.tooltip = Create a derived requirement from the set of selected requirements
+addDerivesLink.command.label = Derives
+addDerivesLink.command.tooltip = Add "DerivedReqt" links from derived requirements to the selected requirement
+addDerivedByLink.command.label = Derived from
+addDerivedByLink.command.tooltip = Add "DerivedReqt" links from the selected requirement to other requirements
+
+ #"Specifies a refinement relationship between model elements at different semantic levels, such as analysis and design.
+ # The mapping specifies the relationship between the two elements or sets of elements. The mapping may or may not be computable, and it may be unidirectional or bidirectional.
+ # Refinement can be used to model transformations from analysis to design and other such changes."
+addRefinedByLink.command.label = Refined by
+addRefinedByLink.command.tooltip = Add "Refine" links from the selected requirement to a model element
+
+ #"A Satisfy relationship is a dependency between a requirement and a model element that fulfills the requirement.
+ #As with other dependencies, the arrow direction points from the satisfying (client) model element to the (supplier) requirement that is satisfied."
+addSatisfiedbyLink.command.label = Satisfied by
+addSatisfiedbyLink.command.tooltip = Add "Satisfy" links from model elements to the selected requirement
+
+addVerifiedByLink.command.label = Verified by
+addVerifiedByLink.command.tooltip = Add "Verify" links from model element to the selected requirement
+
+#--------------------------------------------------------------------------
+#Commands to be executed from model elements
+#--------------------------------------------------------------------------
+addSatisfiesLink.command.label = Satisfies
+addSatisfiesLink.command.tooltip = Add "Satisfy" links from the selected element to requirements
+
+addVerifiesLink.command.label = Verifies
+addVerifiesLink.command.tooltip = Add "Verify" links from the selected element to requirements
+
+addRefinesLink.command.label = Refines
+addRefinesLink.command.tooltip = Add "Refine" links from the selected element to requirements
+
+#--------------------------------------------------------------------------
Bundle-Vendor = Eclipse Modeling Project
Bundle-Name = Papyrus Req SysML Traceability UI (Incubation) \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.xml
index b6ab4c6435e..3bc0ac89fdf 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.xml
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui/plugin.xml
@@ -31,6 +31,185 @@
tooltip="%papyrus.requirements.sysml.traceability.menu.tooltip">
</menu>
</menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:papyrus.requirements.sysml.traceability.menu">
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.InitDerivedReqHandler"
+ icon="images/DeriveReqt.gif"
+ label="%deriveNewRequirement.command.label"
+ style="push"
+ tooltip="%deriveNewRequirement.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivesLinkHandler"
+ icon="images/DeriveReqt.gif"
+ label="%addDerivesLink.command.label"
+ style="push"
+ tooltip="%addDerivesLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="false">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivedByLinkHandler"
+ icon="images/DeriveReqt.gif"
+ label="%addDerivedByLink.command.label"
+ style="push"
+ tooltip="%addDerivedByLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinedByLinkHandler"
+ icon="images/Verify.gif"
+ label="%addRefinedByLink.command.label"
+ style="push"
+ tooltip="%addRefinedByLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiedByLinkHandler"
+ icon="images/Satisfy.gif"
+ label="%addSatisfiedbyLink.command.label"
+ style="push"
+ tooltip="%addSatisfiedbyLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiedByLinkHandler"
+ icon="images/Verify.gif"
+ label="%addVerifiedByLink.command.label"
+ style="push"
+ tooltip="%addVerifiedByLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:papyrus.requirements.sysml.traceability.menu">
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinesLinkHandler"
+ icon="images/Verify.gif"
+ label="%addRefinesLink.command.label"
+ style="push"
+ tooltip="%addRefinesLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="false">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiesLinkHandler"
+ icon="images/Satisfy.gif"
+ label="%addSatisfiesLink.command.label"
+ style="push"
+ tooltip="%addSatisfiesLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="false">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiesLinkHandler"
+ icon="images/Verify.gif"
+ label="%addVerifiesLink.command.label"
+ style="push"
+ tooltip="%addVerifiesLink.command.tooltip">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.requirements.sysml.testers.isRequirementElement"
+ value="false">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:papyrus.requirements.sysml.traceability.menu">
@@ -52,6 +231,66 @@
</visibleWhen>
</command>
</menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.InitDerivedReqHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+6">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivesLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+7">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddDerivedByLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+8">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinedByLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+9">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiedByLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+0">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiedByLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+0">
+ </key>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddRefinesLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+1">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddVerifiesLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+2">
+ </key>
+ <key
+ commandId="org.eclipse.papyrus.requirements.sysml.traceability.handlers.AddSatisfiesLinkHandler"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+3">
+ </key>
</extension>
</plugin>

Back to the top