Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Le Menez2017-03-06 13:20:10 +0000
committerGerrit Code Review @ Eclipse.org2017-03-08 12:39:53 +0000
commit0dcb98d80b61d3cc4b7c348c85c6b5daab6d2dbb (patch)
treebd74d42afe1d81d78174bc7fcdbc85a0e5255af8 /extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml
parent6acf0b06043676ffc727e8c3b8f025c596f94c24 (diff)
downloadorg.eclipse.papyrus-0dcb98d80b61d3cc4b7c348c85c6b5daab6d2dbb.tar.gz
org.eclipse.papyrus-0dcb98d80b61d3cc4b7c348c85c6b5daab6d2dbb.tar.xz
org.eclipse.papyrus-0dcb98d80b61d3cc4b7c348c85c6b5daab6d2dbb.zip
Bug 512022 - [Papyrus] [oxygen] Creation of a new Git/Gerrit repository org.eclipse.papyrus-requirements.git
- Archived the plugins moved to the new repository - Corrected the merge conflict Change-Id: I8dfffd72c0d8127348821c518307955d19e3b245 Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml')
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/Activator.java62
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java51
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DecomposeReqCommand.java51
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java88
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java58
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/PapyrusReqSysMLRequirementCreateCommand.java54
6 files changed, 0 insertions, 364 deletions
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/Activator.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/Activator.java
deleted file mode 100644
index 3c658e9b1ab..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/Activator.java
+++ /dev/null
@@ -1,62 +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 org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.requirements.sysml.assistant.commands"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
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
deleted file mode 100644
index 2add25230e8..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/CommentReqCommand.java
+++ /dev/null
@@ -1,51 +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.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-/**
- *
- * Parses the text of the requirement and move some parts as comment
- *
- */
-public class CommentReqCommand extends RecordingCommand {
- protected ArrayList<Element> selectedElements;
- public CommentReqCommand(TransactionalEditingDomain domain, ArrayList<Element> selectedElements) {
- super(domain,"CommentReqCommand" );
- this.selectedElements=selectedElements;
- }
-
- protected void createAnnotatedComment(Element owner,String text){
- Comment comment=owner.createOwnedComment();
- comment.getAnnotatedElements().add(owner);
- comment.setBody(text);
- }
-
-
- @Override
- protected void doExecute() {
- for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
- Element currentElement = (Element) iterator.next();
- createAnnotatedComment(currentElement, "Comments:\n");
-
- }
-
- }
-
-}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DecomposeReqCommand.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DecomposeReqCommand.java
deleted file mode 100644
index a5a789f0bcd..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/DecomposeReqCommand.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*****************************************************************************
- * 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.assistant.commands;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- * This class creates a "Decompose" link between requirements
- *
- */
-public class DecomposeReqCommand extends RecordingCommand {
- private org.eclipse.uml2.uml.Class parent;
- private org.eclipse.uml2.uml.Class child;
-
- /**
- * Makes a decomposition
- *
- * @param domain
- * the domain to execute a transaction
- * @param child
- * element that will be nested by the parent
- * @param parent
- * element that will nest the child
- *
- */
- public DecomposeReqCommand(TransactionalEditingDomain domain, org.eclipse.uml2.uml.Class child,
- org.eclipse.uml2.uml.Class parent) {
- super(domain, "Create a Decompositon");
- this.parent = parent;
- this.child = child;
- }
-
- @Override
- protected void doExecute() {
- parent.getNestedClassifiers().add(child);
- }
-
-}
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
deleted file mode 100644
index 5a3a70869c5..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/ExtractCommentCommand.java
+++ /dev/null
@@ -1,88 +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
-* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Modifications and improvements
-*
-*******************************************************************************/
-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.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
-import org.eclipse.papyrus.requirements.preferences.PreferenceConstants;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- *
- * Parses the text of the requirement and move some parts as comments
- *
- */
-public class ExtractCommentCommand extends RecordingCommand {
- protected ArrayList<Element> selectedElements;
-
- public ExtractCommentCommand(TransactionalEditingDomain domain, ArrayList<Element> selectedElements) {
- super(domain, "ExtractCommentCommand");
- this.selectedElements = selectedElements;
- }
-
- protected void createAnnotatedComment(Element owner, String text) {
- Comment comment = owner.createOwnedComment();
- comment.getAnnotatedElements().add(owner);
- comment.setBody(text);
- }
-
- /**
- *
- * Example: "[stakeHolder1, stakeHolder2] some text" in the text attribute of a requirement,
- * becomes the text "Stakeholders:[stakeHolder1, stakeHolder2]" in the body of a new comment
- * of the requirement received as input.
- *
- * @param requirement
- */
- protected void parseAndExecute(Class requirement) {
- IPreferenceStore store = org.eclipse.papyrus.requirements.preferences.Activator.getDefault().getPreferenceStore();
- String initialChar = store.getString(PreferenceConstants.INITIAL_CHAR);
- String finalChar = store.getString(PreferenceConstants.FINAL_CHAR);
- String meaningOfTextBetweenChars = store.getString(PreferenceConstants.MEANING_OF_TEXT_BETWEEN_CHARS);
-
- Stereotype reqStereotype = requirement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
- String text = (String) requirement.getValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT);
- if (text == null)
- return;
- text = text.trim();
- if (text.startsWith(initialChar)) {
- int index = text.indexOf(finalChar);
- String extractedText = text.substring(0, index + 1);
- text = text.substring(index + 1);
- text = text.trim();
- createAnnotatedComment(requirement, meaningOfTextBetweenChars + extractedText);
- requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT, text);
- }
- }
-
- @Override
- protected void doExecute() {
- for (Iterator<Element> iterator = selectedElements.iterator(); iterator.hasNext();) {
- Element currentElement = (Element) iterator.next();
- if (currentElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
- parseAndExecute((Class) currentElement);
- }
- }
- }
-
-}
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
deleted file mode 100644
index 39976e2a59d..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/InitDecomposeReqCommand.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*****************************************************************************
- * 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.assistant.commands;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-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.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
- * preferences.
- *
- */
-public class InitDecomposeReqCommand extends RecordingCommand {
- protected Element selectedElement;
- TransactionalEditingDomain domain;
-
- public InitDecomposeReqCommand(TransactionalEditingDomain domain, Element selectedElement) {
- super(domain, "DecomposeReqCommand");
- this.selectedElement = selectedElement;
- this.domain = domain;
- }
-
- @Override
- protected void doExecute() {
- Package owner = null;
- if (selectedElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE) != null) {
- owner = selectedElement.getNearestPackage();
- 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();
- }
- }
-
-} \ 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
deleted file mode 100644
index f87af1412df..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.assistant.commands/src/org/eclipse/papyrus/requirements/sysml/assistant/commands/PapyrusReqSysMLRequirementCreateCommand.java
+++ /dev/null
@@ -1,54 +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
-* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Modifications and improvements
-*
-*******************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.assistant.commands;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-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.Stereotype;
-import org.eclipse.uml2.uml.Class;
-
-/**
- * Creates a new SysML requirement based on the options chosen in the Papyrus for Requirements preferences page.
- *
- */
-public class PapyrusReqSysMLRequirementCreateCommand extends RecordingCommand {
- protected Element selectedElement;
-
- public PapyrusReqSysMLRequirementCreateCommand(TransactionalEditingDomain domain, Element selectedElements) {
- super(domain, "PapyrusReqSysMLRequirementCreateCommand");
- this.selectedElement = selectedElements;
- }
-
- 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);
- requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT, text);
- requirement.setValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_ID_ATT, id);
- }
-
- @Override
- protected void doExecute() {
- if (selectedElement.getNearestPackage() != null) {
- Package owner = selectedElement.getNearestPackage();
- String id = Utils.getNewRequirementID(owner);
- createRequirement(owner, id, "");
- }
- }
-} \ No newline at end of file

Back to the top