Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauricio Alferez2016-06-28 07:25:27 -0400
committerGerrit Code Review @ Eclipse.org2016-06-28 09:19:46 -0400
commit22b763be4cb214b1876c95196c807b500cb9e054 (patch)
tree541dff0307e154c684d79209dea831a8ffdbc3b4
parent4236704f117d23fac45d85ff1a0cd98699e1a41b (diff)
downloadorg.eclipse.papyrus-22b763be4cb214b1876c95196c807b500cb9e054.tar.gz
org.eclipse.papyrus-22b763be4cb214b1876c95196c807b500cb9e054.tar.xz
org.eclipse.papyrus-22b763be4cb214b1876c95196c807b500cb9e054.zip
Bug 496654 - [Extra][Requirements] Id-Name creation strategies should be
integrated Change-Id: I35759dc9cf72d23c15b34d1a700f10c1c57701c0 Signed-off-by: Mauricio Alferez <mauricio.alferez@cea.fr>
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.common/META-INF/MANIFEST.MF6
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.common/src/org/eclipse/papyrus/requirements/common/Utils.java72
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java82
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/PapyrusReqSysMLRequirementCreateCommand.java77
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/InitDerivedReqCommand.java3
8 files changed, 105 insertions, 142 deletions
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.common/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.common/META-INF/MANIFEST.MF
index c8c3c27f9b1..7cf1727d018 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.common/META-INF/MANIFEST.MF
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.common/META-INF/MANIFEST.MF
@@ -16,8 +16,12 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.8.0",
org.eclipse.core.resources;bundle-version="3.11.0",
- org.eclipse.papyrus.infra.ui;bundle-version="1.2.0"
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
+ org.eclipse.jface,
+ org.eclipse.papyrus.requirements.sysml.common;bundle-version="0.7.0",
+ org.eclipse.papyrus.requirements.preferences;bundle-version="0.7.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.requirements.common
Bundle-Localization: bundle
+Import-Package: org.eclipse.papyrus.sysml.requirements
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
index 9bc079b8fd4..5700a7d149f 100644
--- 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
@@ -14,13 +14,22 @@
*****************************************************************************/
package org.eclipse.papyrus.requirements.common;
+import java.text.DecimalFormat;
import java.util.ArrayList;
+import java.util.Iterator;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.requirements.preferences.PreferenceConstants;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.sysml.requirements.Requirement;
import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.Class;
public class Utils {
@@ -75,4 +84,67 @@ public class Utils {
}
}
+ /**
+ * Get a new id and name for a Papyrus SysML requirement based on the Papyrus for Requirements preferences page.
+ * Also, if the parent is a requirement, the name and id will depend on the parent requirement's id and name.
+ *
+ * @param parent
+ * the parent requirement
+ * @return the name for a potential requirement
+ */
+ public static String getNewRequirementID(Element parent) {
+ IPreferenceStore store = org.eclipse.papyrus.requirements.preferences.Activator.getDefault().getPreferenceStore();
+
+ String prefix = store.getString(PreferenceConstants.REQUIREMENT_ID_PREFIX);// by
+ // default
+ // "R-"
+ String separator = store.getString(PreferenceConstants.CHILD_REQUIREMENTS_SEPARATOR); // by
+ // default
+ // "-"
+ boolean idUniqueInModel = store.getBoolean(PreferenceConstants.REQUIREMENT_ID_UNIQUE_IN_ENTIRE_MODEL); // by default true
+ String parentRequirementId = "";
+ String parentRequirementIdSuffix = "";
+ if (parent instanceof Class) {
+ if (null != UMLUtil.getStereotypeApplication((Class) parent, Requirement.class)) {
+ // Parent is a requirement
+ parentRequirementId = (String) UMLUtil.getTaggedValue((Class) parent, I_SysMLStereotype.REQUIREMENT_STEREOTYPE, I_SysMLStereotype.REQUIREMENT_ID_ATT);
+ parentRequirementIdSuffix = parentRequirementId.replaceAll(prefix, "");
+ }
+ } else
+ separator = "";// we are not dealing with a child requirement, so the separator must be empty.
+
+
+ int digit = store.getInt(PreferenceConstants.REQUIREMENT_ID_DIGIT);// by
+ // default 2
+ int i = 0;
+ DecimalFormat df = new DecimalFormat();
+ df.setMinimumIntegerDigits(digit);
+ String value = (df.format(i));
+ boolean IDexist = true;
+ while (IDexist) {
+ IDexist = false;
+ i++;
+ value = (df.format(i));
+ EList<Element> elements = null;
+ if (idUniqueInModel) {
+ elements = parent.getModel().allOwnedElements();
+ } else {
+ elements = parent.allOwnedElements();
+ }
+ for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext() && (!IDexist);) {
+ Element element = (Element) iterator.next();
+ Object reqIdObject = UMLUtil.getTaggedValue(element, I_SysMLStereotype.REQUIREMENT_STEREOTYPE, I_SysMLStereotype.REQUIREMENT_ID_ATT);
+ if (reqIdObject != null) {
+ String existedID = (String) reqIdObject;
+ String newID = prefix + parentRequirementIdSuffix + separator + value;
+ // id already exists so increment suffix
+ if (newID.equals(existedID)) {
+ IDexist = true;
+ }
+ }
+ }
+ }
+ return prefix + parentRequirementIdSuffix + separator + value;
+ }
+
}
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 3329dd33ba0..5b4e0d25fa1 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
@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.papyrus.requirements.preferences;bundle-version="0.7
org.eclipse.gmf.runtime.diagram.ui,
org.eclipse.papyrus.requirements.sysml.common,
org.eclipse.papyrus.uml.tools,
- org.eclipse.papyrus.requirements.preferences
+ org.eclipse.papyrus.requirements.preferences,
+ org.eclipse.papyrus.requirements.common
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.requirements.sysml.assistant.commands
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java
index a7bd4ecedb5..2add25230e8 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java
@@ -42,7 +42,7 @@ public class CommentReqCommand extends RecordingCommand {
protected void doExecute() {
for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
Element currentElement = (Element) iterator.next();
- createAnnotatedComment(currentElement, "COMMENTS:\n");
+ createAnnotatedComment(currentElement, "Comments:\n");
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java
index 7f5329a295f..5a3a70869c5 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java
@@ -9,6 +9,8 @@
*
* Contributors:
* CEA LIST. - initial API and implementation
+* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Modifications and improvements
+*
*******************************************************************************/
package org.eclipse.papyrus.requirements.sysml.assistant.commands;
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 479f0f466a7..39976e2a59d 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
@@ -14,19 +14,14 @@
*****************************************************************************/
package org.eclipse.papyrus.requirements.sysml.assistant.commands;
-import java.text.DecimalFormat;
-import java.util.Iterator;
-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.PreferenceConstants;
+import org.eclipse.papyrus.requirements.common.Utils;
import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
+import org.eclipse.uml2.uml.Package;
/**
* Creates a requirement and adds a decomposition link from the selected
* requirement to the new requirement. The names are based on the Papyrus for Requirements
@@ -45,76 +40,19 @@ public class InitDecomposeReqCommand extends RecordingCommand {
@Override
protected void doExecute() {
- String concatenedString = "";
- org.eclipse.uml2.uml.Package owner = null;
+ Package owner = null;
if (selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
- Stereotype stereotype = selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
- concatenedString = concatenedString + selectedElement.getValue(stereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT);
owner = selectedElement.getNearestPackage();
- String id = getNewIDReq((Class) selectedElement, stereotype);
- 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);
- DecomposeReqCommand decompositionReqCreateCommand = new DecomposeReqCommand(domain, req,
+ String id = Utils.getNewRequirementID((Class) selectedElement);
+ Class requirement = owner.createOwnedClass(id, false);
+ Stereotype reqStereotype = requirement.getApplicableStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ requirement.applyStereotype(reqStereotype);
+ requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT, "");
+ requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT, id);
+ DecomposeReqCommand decompositionReqCreateCommand = new DecomposeReqCommand(domain, requirement,
(Class) selectedElement);
decompositionReqCreateCommand.execute();
}
}
- /**
- * get a new name of a Papyrus SysML child requirement based on the Papyrus
- * req preferences and the Id of the parent Requirement
- *
- * @param parent
- * the parent requirement
- * @return the name for a potential requirement
- */
- public static String getNewIDReq(org.eclipse.uml2.uml.Class parent, Stereotype stereotype) {
- IPreferenceStore store = org.eclipse.papyrus.requirements.preferences.Activator.getDefault().getPreferenceStore();
-
- String prefix = store.getString(PreferenceConstants.REQUIREMENT_ID_PREFIX);// by
- // default
- // "R-"
- String separator = store.getString(PreferenceConstants.CHILD_REQUIREMENTS_SEPARATOR); // by
- // default
- // "-"
- boolean idUniqueInModel = store.getBoolean(PreferenceConstants.REQUIREMENT_ID_UNIQUE_IN_ENTIRE_MODEL); // by default true
-
- String parentRequirementId = (String) parent.getValue(stereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT);
-
- String parentRequirementIdSuffix = parentRequirementId.replaceAll(prefix, "");
- int digit = store.getInt(PreferenceConstants.REQUIREMENT_ID_DIGIT);// by
- // default 2
- int i = 0;
- DecimalFormat df = new DecimalFormat();
- df.setMinimumIntegerDigits(digit);
- String value = (df.format(i));
- boolean IDexist = true;
- while (IDexist) {
- IDexist = false;
- i++;
- value = (df.format(i));
- EList<Element> elements = null;
- if (idUniqueInModel) {
- elements = parent.getModel().allOwnedElements();
- } else {
- elements = parent.allOwnedElements();
- }
- for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext() && (!IDexist);) {
- Element element = (Element) iterator.next();
- Object reqIdObject = UMLUtil.getTaggedValue(element, I_SysMLStereotype.REQUIREMENT_STEREOTYPE, I_SysMLStereotype.REQUIREMENT_ID_ATT);
- if (reqIdObject != null) {
- String existedID = (String) reqIdObject;
- String newID = prefix + parentRequirementIdSuffix + separator + value;
- // id already exists so increment suffix
- if (newID.equals(existedID)) {
- IDexist = true;
- }
- }
- }
- }
- return prefix + parentRequirementIdSuffix + separator + value;
- }
} \ 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/PapyrusReqSysMLRequirementCreateCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/PapyrusReqSysMLRequirementCreateCommand.java
index e2eca8d4135..f87af1412df 100644
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/PapyrusReqSysMLRequirementCreateCommand.java
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/PapyrusReqSysMLRequirementCreateCommand.java
@@ -9,26 +9,22 @@
*
* Contributors:
* CEA LIST. - initial API and implementation
+* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Modifications and improvements
+*
*******************************************************************************/
package org.eclipse.papyrus.requirements.sysml.assistant.commands;
-import java.text.DecimalFormat;
-import java.util.Iterator;
-
-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.papyrus.requirements.common.Utils;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Class;
/**
- * Creates a new SysML requirement based on the options chosen in the Papyrus Req preferences page.
+ * Creates a new SysML requirement based on the options chosen in the Papyrus for Requirements preferences page.
*
*/
public class PapyrusReqSysMLRequirementCreateCommand extends RecordingCommand {
@@ -39,69 +35,20 @@ public class PapyrusReqSysMLRequirementCreateCommand extends RecordingCommand {
this.selectedElement = selectedElements;
}
- protected void createRequirement(org.eclipse.uml2.uml.Package owner, String text) {
- org.eclipse.uml2.uml.Class requirement = owner.createOwnedClass("tmpName", false);
+ protected void createRequirement(Package owner, String id, String text) {
+ Class requirement = owner.createOwnedClass(id, false);
Stereotype reqStereotype = requirement.getApplicableStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
requirement.applyStereotype(reqStereotype);
- String id = getNewIDReq(owner);
- requirement.setName(id);
+ requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT, text);
requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT, id);
}
- /**
- * get new name of Papyrus SysML requirement
- *
- * @param owner
- * the package that will contain requirement
- * @return the name for a potential requirement
- */
- public static String getNewIDReq(org.eclipse.uml2.uml.Package owner) {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- String prefix = store.getString(PreferenceConstants.REQUIREMENT_ID_PREFIX);
- int digit = store.getInt(PreferenceConstants.REQUIREMENT_ID_DIGIT);
- int i = 0;
-
- DecimalFormat df = new DecimalFormat();
- // create suffix
- df.setMinimumIntegerDigits(digit);
- String value = (df.format(i));
- // got through all elements
- boolean IDexist = true;
- while (IDexist) {
- IDexist = false;
- i++;
- value = (df.format(i));
- EList<PackageableElement> packelements = owner.getPackagedElements();
- for (Iterator<PackageableElement> iterator = packelements.iterator(); iterator.hasNext() && (!IDexist);) {
- PackageableElement packageableElement = (PackageableElement) iterator.next();
- // current element is a Req?
- Stereotype reqStereotype = packageableElement
- .getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
-
- if (reqStereotype != null) {
- if (packageableElement.getValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT) != null) {
- String existedID = (String) packageableElement.getValue(reqStereotype,
- I_SysMLStereotype.REQUIREMENT_ID_ATT);
- String newID = prefix + value;
- // id already exist so increment suffix
- if (newID.equals(existedID)) {
- IDexist = true;
- }
- }
- }
- }
-
- }
- return prefix + value;
-
- }
-
@Override
protected void doExecute() {
- if (selectedElement instanceof Package) {
- createRequirement((Package) selectedElement, "");
+ if (selectedElement.getNearestPackage() != null) {
+ Package owner = selectedElement.getNearestPackage();
+ String id = Utils.getNewRequirementID(owner);
+ createRequirement(owner, id, "");
}
-
}
-
} \ 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/InitDerivedReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands/src/org/eclipse/papyrus/requirements/sysml/traceability/commands/InitDerivedReqCommand.java
index 1e5090376f1..b15c7a9a066 100644
--- 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
@@ -22,7 +22,6 @@ 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.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;
@@ -89,7 +88,7 @@ public class InitDerivedReqCommand extends RecordingCommand {
Utils.applyMissingProfiles(owner, missingProfiles);
}
- String ID = PapyrusReqSysMLRequirementCreateCommand.getNewIDReq(owner);
+ String ID = Utils.getNewRequirementID(owner);
Class req = owner.createOwnedClass(ID, false);
final Stereotype reqStereotype = req.getApplicableStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
req.applyStereotype(reqStereotype);

Back to the top