Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauricio Alferez2015-05-29 12:40:35 +0000
committerPatrick Tessier2015-06-08 11:59:35 +0000
commit9f6298286087824e7828c29302a48b3a64098507 (patch)
tree953e38eb7168fb8640346efee489755b138f4fd6 /extraplugins/req
parentd32077bd908d067349d619b473c2b5059fa4fba8 (diff)
downloadorg.eclipse.papyrus-9f6298286087824e7828c29302a48b3a64098507.tar.gz
org.eclipse.papyrus-9f6298286087824e7828c29302a48b3a64098507.tar.xz
org.eclipse.papyrus-9f6298286087824e7828c29302a48b3a64098507.zip
Papyrus REQ SysML assistant plugin
Change-Id: I485ee65b017db1ed1ba2459d413053ac650db6d9 Signed-off-by: Mauricio Alferez <mauricio.alferez@cea.fr> Reviewed-on: https://git.eclipse.org/r/48838 Tested-by: Hudson CI Reviewed-by: Patrick Tessier <Patrick.Tessier@cea.fr>
Diffstat (limited to 'extraplugins/req')
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.classpath7
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.gitignore1
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.project28
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/META-INF/MANIFEST.MF22
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/about.html28
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/build.properties9
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/bundle.properties22
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.bmpbin0 -> 822 bytes
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.icobin0 -> 1150 bytes
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_32x32.icobin0 -> 4286 bytes
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_48x48.icobin0 -> 9662 bytes
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/plugin.xml119
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/pom.xml14
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/Activator.java62
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/I_SysMLStereotype.java248
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/AddDerivedLinkReqCommand.java78
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/CommentReqCommand.java51
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/DerivationReqCreateCommand.java57
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/ExtractCommentCommand.java75
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/InitDerivedReqCommand.java96
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/PapyrusReqSysMLRequirementCreateCommand.java105
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/AddDerivedLinkReqHandler.java66
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/CommentReqHandler.java56
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/ExtractCommentsHandler.java56
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDerivedReqHandler.java56
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLAbstractHandler.java123
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLRequirementHandler.java56
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.classpath7
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.gitignore1
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.project28
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/META-INF/MANIFEST.MF13
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/about.html28
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/build.properties8
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/bundle.properties4
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/plugin.xml19
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/pom.xml14
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/Activator.java62
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceConstants.java26
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceInitializer.java34
-rw-r--r--extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferencePage.java79
42 files changed, 1772 insertions, 0 deletions
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.classpath b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.classpath
new file mode 100644
index 00000000000..8a8f1668cdc
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.gitignore b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.project b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.project
new file mode 100644
index 00000000000..460b21e5866
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.req.sysml.assistant</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.settings/org.eclipse.jdt.core.prefs b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f287d53cf45
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/META-INF/MANIFEST.MF b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..9c6efc7b69e
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.req.sysml.assistant;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.req.sysml.assistant.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
+ org.eclipse.uml2.uml;bundle-version="4.0.0",
+ org.eclipse.papyrus.req.sysml.preferences;bundle-version="0.1.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0";resolution:=optional,
+ org.eclipse.papyrus.infra.emf;bundle-version="0.10.0";resolution:=optional,
+ org.eclipse.papyrus.uml.tools;bundle-version="0.9.1";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.papyrus.editor;bundle-version="0.9.0";resolution:=optional
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.req.sysml.assistant
+Bundle-Localization: bundle
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/about.html b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/build.properties b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/build.properties
new file mode 100644
index 00000000000..e5807f39587
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ images/,\
+ about.html,\
+ bundle.properties
+src.includes = about.html
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/bundle.properties b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/bundle.properties
new file mode 100644
index 00000000000..45dc4502999
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/bundle.properties
@@ -0,0 +1,22 @@
+#Properties file for org.eclipse.papyrus.req.sysml.assistant
+menu.label = Papyrus Req
+menu.tooltip = Papyrus Req
+menu.label.0 = Papyrus Req
+menu.tooltip.0 = Papyrus Req
+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.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
+Bundle-Vendor = CEA LIST
+Bundle-Name = Papyrus Req SysML Assistant (Incubation) \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.bmp b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.bmp
new file mode 100644
index 00000000000..890248a8e55
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.bmp
Binary files differ
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.ico b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.ico
new file mode 100644
index 00000000000..88015c1c996
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_16x16.ico
Binary files differ
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_32x32.ico b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_32x32.ico
new file mode 100644
index 00000000000..ae20fcd2471
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_32x32.ico
Binary files differ
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_48x48.ico b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_48x48.ico
new file mode 100644
index 00000000000..d1941be56ee
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/images/Papyrus_Req_logo_48x48.ico
Binary files differ
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/plugin.xml b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/plugin.xml
new file mode 100644
index 00000000000..d48f20d380a
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/plugin.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?after=filtersMenu">
+ <menu
+ icon="images/Papyrus_Req_logo_16x16.bmp"
+ id="org.eclipse.papyrus.req.sysml.menu"
+ label="%menu.label"
+ tooltip="%menu.tooltip">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ <menu
+ icon="images/Papyrus_Req_logo_16x16.bmp"
+ id="org.eclipse.papyrus.req.sysml.menu"
+ label="%menu.label.0"
+ tooltip="%menu.tooltip.0">
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.req.sysml.menu">
+ <command
+ commandId="org.eclipse.papyrus.req.sysml.assistant.handler.PapyrusReqSysMLRequirementHandler"
+ label="%command.label"
+ style="push"
+ tooltip="%command.tooltip">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.req.sysml.assistant.handler.AddDerivedLinkReqHandler"
+ label="%command.label.0"
+ style="push"
+ tooltip="%command.tooltip.0">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.req.sysml.assistant.handler.InitDerivedReqHandler"
+ label="%command.label.1"
+ style="push"
+ tooltip="%command.tooltip.1">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.req.sysml.assistant.handler.CommentReqHandler"
+ label="%command.label.2"
+ style="push"
+ tooltip="%command.tooltip.2">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.req.sysml.assistant.handler.ExtractCommentsHandler"
+ label="%command.label.3"
+ style="push"
+ tooltip="%command.tooltip.3">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.req.sysml.assistant.handler.ExtractCommentsHandler"
+ id="org.eclipse.papyrus.req.sysml.assistant.handler.ExtractCommentsHandler"
+ name="%command.name">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.req.sysml.assistant.handler.InitDerivedReqHandler"
+ id="org.eclipse.papyrus.req.sysml.assistant.handler.InitDerivedReqHandler"
+ name="%command.name.0">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.req.sysml.assistant.handler.CommentReqHandler"
+ id="org.eclipse.papyrus.req.sysml.assistant.handler.CommentReqHandler"
+ name="%command.name.1">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.req.sysml.assistant.handler.PapyrusReqSysMLRequirementHandler"
+ id="org.eclipse.papyrus.req.sysml.assistant.handler.PapyrusReqSysMLRequirementHandler"
+ name="%command.name.2">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.req.sysml.assistant.handler.AddDerivedLinkReqHandler"
+ id="org.eclipse.papyrus.req.sysml.assistant.handler.AddDerivedLinkReqHandler"
+ name="%command.name.3">
+ </command>
+ </extension>
+
+</plugin>
+
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/pom.xml b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/pom.xml
new file mode 100644
index 00000000000..72da189fcbb
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../releng/top-pom-extras.xml</relativePath>
+ </parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.req.sysml.assistant</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/Activator.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/Activator.java
new file mode 100644
index 00000000000..87e4f3fdaca
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/Activator.java
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant;
+
+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.req.sysml.assistant"; //$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/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/I_SysMLStereotype.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/I_SysMLStereotype.java
new file mode 100644
index 00000000000..3b04feff829
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/I_SysMLStereotype.java
@@ -0,0 +1,248 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant;
+
+/**
+ * list of constant for SysML
+ *
+ */
+public interface I_SysMLStereotype {
+ /** Qualified name of the stereotype Conform */
+ public static final String CONFORM_STEREOTYPE = "SysML::ModelElements::Conform";
+ /** name of property base_Dependency of the stereotype Conform */
+ public static final String CONFORM_BASE_DEPENDENCY_ATT = "base_Dependency";
+ /** Qualified name of the stereotype View */
+ public static final String VIEW_STEREOTYPE = "SysML::ModelElements::View";
+ /** name of property viewPoint of the stereotype View */
+ public static final String VIEW_VIEWPOINT_ATT = "viewPoint";
+ /** name of property base_Package of the stereotype View */
+ public static final String VIEW_BASE_PACKAGE_ATT = "base_Package";
+ /** Qualified name of the stereotype ViewPoint */
+ public static final String VIEWPOINT_STEREOTYPE = "SysML::ModelElements::ViewPoint";
+ /** name of property base_Class of the stereotype ViewPoint */
+ public static final String VIEWPOINT_BASE_CLASS_ATT = "base_Class";
+ /** name of property stakeHolders of the stereotype ViewPoint */
+ public static final String VIEWPOINT_STAKEHOLDERS_ATT = "stakeHolders";
+ /** name of property purpose of the stereotype ViewPoint */
+ public static final String VIEWPOINT_PURPOSE_ATT = "purpose";
+ /** name of property concerns of the stereotype ViewPoint */
+ public static final String VIEWPOINT_CONCERNS_ATT = "concerns";
+ /** name of property languages of the stereotype ViewPoint */
+ public static final String VIEWPOINT_LANGUAGES_ATT = "languages";
+ /** name of property methods of the stereotype ViewPoint */
+ public static final String VIEWPOINT_METHODS_ATT = "methods";
+ /** Qualified name of the stereotype Rationale */
+ public static final String RATIONALE_STEREOTYPE = "SysML::ModelElements::Rationale";
+ /** name of property base_Comment of the stereotype Rationale */
+ public static final String RATIONALE_BASE_COMMENT_ATT = "base_Comment";
+ /** Qualified name of the stereotype Problem */
+ public static final String PROBLEM_STEREOTYPE = "SysML::ModelElements::Problem";
+ /** name of property base_Comment of the stereotype Problem */
+ public static final String PROBLEM_BASE_COMMENT_ATT = "base_Comment";
+ /** Qualified name of the stereotype Block */
+ public static final String BLOCK_STEREOTYPE = "SysML::Blocks::Block";
+ /** name of property isEncapsulated of the stereotype Block */
+ public static final String BLOCK_ISENCAPSULATED_ATT = "isEncapsulated";
+ /** name of property base_Class of the stereotype Block */
+ public static final String BLOCK_BASE_CLASS_ATT = "base_Class";
+ /** Qualified name of the stereotype DistributedProperty */
+ public static final String DISTRIBUTEDPROPERTY_STEREOTYPE = "SysML::Blocks::DistributedProperty";
+ /** name of property base_Property of the stereotype DistributedProperty */
+ public static final String DISTRIBUTEDPROPERTY_BASE_PROPERTY_ATT = "base_Property";
+ /** Qualified name of the stereotype Dimension */
+ public static final String DIMENSION_STEREOTYPE = "SysML::Blocks::Dimension";
+ /** name of property base_InstanceSpecification of the stereotype Dimension */
+ public static final String DIMENSION_BASE_INSTANCESPECIFICATION_ATT = "base_InstanceSpecification";
+ /** Qualified name of the stereotype Unit */
+ public static final String UNIT_STEREOTYPE = "SysML::Blocks::Unit";
+ /** name of property base_InstanceSpecification of the stereotype Unit */
+ public static final String UNIT_BASE_INSTANCESPECIFICATION_ATT = "base_InstanceSpecification";
+ /** name of property dimension of the stereotype Unit */
+ public static final String UNIT_DIMENSION_ATT = "dimension";
+ /** Qualified name of the stereotype ValueType */
+ public static final String VALUETYPE_STEREOTYPE = "SysML::Blocks::ValueType";
+ /** name of property base_DataType of the stereotype ValueType */
+ public static final String VALUETYPE_BASE_DATATYPE_ATT = "base_DataType";
+ /** name of property unit of the stereotype ValueType */
+ public static final String VALUETYPE_UNIT_ATT = "unit";
+ /** name of property dimension of the stereotype ValueType */
+ public static final String VALUETYPE_DIMENSION_ATT = "dimension";
+ /** Qualified name of the stereotype NestedConnectorEnd */
+ public static final String NESTEDCONNECTOREND_STEREOTYPE = "SysML::Blocks::NestedConnectorEnd";
+ /** name of property propertyPath of the stereotype NestedConnectorEnd */
+ public static final String NESTEDCONNECTOREND_PROPERTYPATH_ATT = "propertyPath";
+ /** name of property base_ConnectorEnd of the stereotype NestedConnectorEnd */
+ public static final String NESTEDCONNECTOREND_BASE_CONNECTOREND_ATT = "base_ConnectorEnd";
+ /** Qualified name of the stereotype ParticipantProperty */
+ public static final String PARTICIPANTPROPERTY_STEREOTYPE = "SysML::Blocks::ParticipantProperty";
+ /** name of property base_Property of the stereotype ParticipantProperty */
+ public static final String PARTICIPANTPROPERTY_BASE_PROPERTY_ATT = "base_Property";
+ /** name of property end of the stereotype ParticipantProperty */
+ public static final String PARTICIPANTPROPERTY_END_ATT = "end";
+ /** Qualified name of the stereotype ConnectorProperty */
+ public static final String CONNECTORPROPERTY_STEREOTYPE = "SysML::Blocks::ConnectorProperty";
+ /** name of property base_Property of the stereotype ConnectorProperty */
+ public static final String CONNECTORPROPERTY_BASE_PROPERTY_ATT = "base_Property";
+ /** name of property connector of the stereotype ConnectorProperty */
+ public static final String CONNECTORPROPERTY_CONNECTOR_ATT = "connector";
+ /** Qualified name of the stereotype BindingConnector */
+ public static final String BINDINGCONNECTOR_STEREOTYPE = "SysML::Blocks::BindingConnector";
+ /** name of property base_Connector of the stereotype BindingConnector */
+ public static final String BINDINGCONNECTOR_BASE_CONNECTOR_ATT = "base_Connector";
+ /** Qualified name of the stereotype PropertySpecificType */
+ public static final String PROPERTYSPECIFICTYPE_STEREOTYPE = "SysML::Blocks::PropertySpecificType";
+ /** name of property base_Classifier of the stereotype PropertySpecificType */
+ public static final String PROPERTYSPECIFICTYPE_BASE_CLASSIFIER_ATT = "base_Classifier";
+ /** Qualified name of the stereotype FlowPort */
+ public static final String FLOWPORT_STEREOTYPE = "SysML::PortAndFlows::FlowPort";
+ /** name of property base_Port of the stereotype FlowPort */
+ public static final String FLOWPORT_BASE_PORT_ATT = "base_Port";
+ /** name of property isAtomic of the stereotype FlowPort */
+ public static final String FLOWPORT_ISATOMIC_ATT = "isAtomic";
+ /** name of property isConjugated of the stereotype FlowPort */
+ public static final String FLOWPORT_ISCONJUGATED_ATT = "isConjugated";
+ /** name of property direction of the stereotype FlowPort */
+ public static final String FLOWPORT_DIRECTION_ATT = "direction";
+ /** Qualified name of the stereotype FlowProperty */
+ public static final String FLOWPROPERTY_STEREOTYPE = "SysML::PortAndFlows::FlowProperty";
+ /** name of property base_Property of the stereotype FlowProperty */
+ public static final String FLOWPROPERTY_BASE_PROPERTY_ATT = "base_Property";
+ /** name of property direction of the stereotype FlowProperty */
+ public static final String FLOWPROPERTY_DIRECTION_ATT = "direction";
+ /** Qualified name of the stereotype FlowSpecification */
+ public static final String FLOWSPECIFICATION_STEREOTYPE = "SysML::PortAndFlows::FlowSpecification";
+ /** name of property base_Interface of the stereotype FlowSpecification */
+ public static final String FLOWSPECIFICATION_BASE_INTERFACE_ATT = "base_Interface";
+ /** name of literal in of the Enumeration FlowDirection */
+ public static final String FLOWDIRECTION_IN_ENUM = "in";
+ /** name of literal out of the Enumeration FlowDirection */
+ public static final String FLOWDIRECTION_OUT_ENUM = "out";
+ /** name of literal inout of the Enumeration FlowDirection */
+ public static final String FLOWDIRECTION_INOUT_ENUM = "inout";
+ /** Qualified name of the stereotype ItemFlow */
+ public static final String ITEMFLOW_STEREOTYPE = "SysML::PortAndFlows::ItemFlow";
+ /** name of property base_InformationFlow of the stereotype ItemFlow */
+ public static final String ITEMFLOW_BASE_INFORMATIONFLOW_ATT = "base_InformationFlow";
+ /** name of property itemProperty of the stereotype ItemFlow */
+ public static final String ITEMFLOW_ITEMPROPERTY_ATT = "itemProperty";
+ /** Qualified name of the stereotype ConstraintBlock */
+ public static final String CONSTRAINTBLOCK_STEREOTYPE = "SysML::Constraints::ConstraintBlock";
+ /** Qualified name of the stereotype ConstraintProperty */
+ public static final String CONSTRAINTPROPERTY_STEREOTYPE = "SysML::Constraints::ConstraintProperty";
+ /** name of property base_Property of the stereotype ConstraintProperty */
+ public static final String CONSTRAINTPROPERTY_BASE_PROPERTY_ATT = "base_Property";
+ /** Qualified name of the stereotype Optional */
+ public static final String OPTIONAL_STEREOTYPE = "SysML::Activities::Optional";
+ /** name of property base_Parameter of the stereotype Optional */
+ public static final String OPTIONAL_BASE_PARAMETER_ATT = "base_Parameter";
+ /** Qualified name of the stereotype Rate */
+ public static final String RATE_STEREOTYPE = "SysML::Activities::Rate";
+ /** name of property base_Parameter of the stereotype Rate */
+ public static final String RATE_BASE_PARAMETER_ATT = "base_Parameter";
+ /** name of property base_ActivityEdge of the stereotype Rate */
+ public static final String RATE_BASE_ACTIVITYEDGE_ATT = "base_ActivityEdge";
+ /** name of property rate of the stereotype Rate */
+ public static final String RATE_RATE_ATT = "rate";
+ /** Qualified name of the stereotype Probability */
+ public static final String PROBABILITY_STEREOTYPE = "SysML::Activities::Probability";
+ /** name of property base_ActivityEdge of the stereotype Probability */
+ public static final String PROBABILITY_BASE_ACTIVITYEDGE_ATT = "base_ActivityEdge";
+ /** name of property base_ParameterSet of the stereotype Probability */
+ public static final String PROBABILITY_BASE_PARAMETERSET_ATT = "base_ParameterSet";
+ /** name of property probability of the stereotype Probability */
+ public static final String PROBABILITY_PROBABILITY_ATT = "probability";
+ /** Qualified name of the stereotype Continuous */
+ public static final String CONTINUOUS_STEREOTYPE = "SysML::Activities::Continuous";
+ /** Qualified name of the stereotype Discrete */
+ public static final String DISCRETE_STEREOTYPE = "SysML::Activities::Discrete";
+ /** Qualified name of the stereotype ControlOperator */
+ public static final String CONTROLOPERATOR_STEREOTYPE = "SysML::Activities::ControlOperator";
+ /** name of property base_Operation of the stereotype ControlOperator */
+ public static final String CONTROLOPERATOR_BASE_OPERATION_ATT = "base_Operation";
+ /** name of property base_Behavior of the stereotype ControlOperator */
+ public static final String CONTROLOPERATOR_BASE_BEHAVIOR_ATT = "base_Behavior";
+ /** Qualified name of the stereotype NoBuffer */
+ public static final String NOBUFFER_STEREOTYPE = "SysML::Activities::NoBuffer";
+ /** name of property base_ObjectNode of the stereotype NoBuffer */
+ public static final String NOBUFFER_BASE_OBJECTNODE_ATT = "base_ObjectNode";
+ /** Qualified name of the stereotype Overwrite */
+ public static final String OVERWRITE_STEREOTYPE = "SysML::Activities::Overwrite";
+ /** name of property base_ObjectNode of the stereotype Overwrite */
+ public static final String OVERWRITE_BASE_OBJECTNODE_ATT = "base_ObjectNode";
+ /** Qualified name of the stereotype Allocate */
+ public static final String ALLOCATE_STEREOTYPE = "SysML::Allocations::Allocate";
+ /** name of property base_Abstraction of the stereotype Allocate */
+ public static final String ALLOCATE_BASE_ABSTRACTION_ATT = "base_Abstraction";
+ /** Qualified name of the stereotype Allocated */
+ public static final String ALLOCATED_STEREOTYPE = "SysML::Allocations::Allocated";
+ /** name of property base_NamedElement of the stereotype Allocated */
+ public static final String ALLOCATED_BASE_NAMEDELEMENT_ATT = "base_NamedElement";
+ /** name of property allocatedFrom of the stereotype Allocated */
+ public static final String ALLOCATED_ALLOCATEDFROM_ATT = "allocatedFrom";
+ /** name of property allocatedTo of the stereotype Allocated */
+ public static final String ALLOCATED_ALLOCATEDTO_ATT = "allocatedTo";
+ /** Qualified name of the stereotype AllocateActivityPartition */
+ public static final String ALLOCATEACTIVITYPARTITION_STEREOTYPE = "SysML::Allocations::AllocateActivityPartition";
+ /** name of property base_ActivityPartition of the stereotype AllocateActivityPartition */
+ public static final String ALLOCATEACTIVITYPARTITION_BASE_ACTIVITYPARTITION_ATT = "base_ActivityPartition";
+ /** Qualified name of the stereotype DeriveReqt */
+ public static final String DERIVEREQT_STEREOTYPE = "SysML::Requirements::DeriveReqt";
+ /** Qualified name of the stereotype Verify */
+ public static final String VERIFY_STEREOTYPE = "SysML::Requirements::Verify";
+ /** Qualified name of the stereotype Copy */
+ public static final String COPY_STEREOTYPE = "SysML::Requirements::Copy";
+ /** Qualified name of the stereotype Satisfy */
+ public static final String SATISFY_STEREOTYPE = "SysML::Requirements::Satisfy";
+ /** Qualified name of the stereotype TestCase */
+ public static final String TESTCASE_STEREOTYPE = "SysML::Requirements::TestCase";
+ /** name of property base_Behavior of the stereotype TestCase */
+ public static final String TESTCASE_BASE_BEHAVIOR_ATT = "base_Behavior";
+ /** name of property base_Operation of the stereotype TestCase */
+ public static final String TESTCASE_BASE_OPERATION_ATT = "base_Operation";
+ /** name of property verifies of the stereotype TestCase */
+ public static final String TESTCASE_VERIFIES_ATT = "verifies";
+ /** Qualified name of the stereotype Requirement */
+ public static final String REQUIREMENT_STEREOTYPE = "SysML::Requirements::Requirement";
+ /** name of property text of the stereotype Requirement */
+ public static final String REQUIREMENT_TEXT_ATT = "text";
+ /** name of property id of the stereotype Requirement */
+ public static final String REQUIREMENT_ID_ATT = "id";
+ /** name of property derived of the stereotype Requirement */
+ public static final String REQUIREMENT_DERIVED_ATT = "derived";
+ /** name of property derivedFrom of the stereotype Requirement */
+ public static final String REQUIREMENT_DERIVEDFROM_ATT = "derivedFrom";
+ /** name of property satisfiedBy of the stereotype Requirement */
+ public static final String REQUIREMENT_SATISFIEDBY_ATT = "satisfiedBy";
+ /** name of property refinedBy of the stereotype Requirement */
+ public static final String REQUIREMENT_REFINEDBY_ATT = "refinedBy";
+ /** name of property tracedTo of the stereotype Requirement */
+ public static final String REQUIREMENT_TRACEDTO_ATT = "tracedTo";
+ /** name of property verifiedBy of the stereotype Requirement */
+ public static final String REQUIREMENT_VERIFIEDBY_ATT = "verifiedBy";
+ /** name of property master of the stereotype Requirement */
+ public static final String REQUIREMENT_MASTER_ATT = "master";
+ /** name of property base_Class of the stereotype Requirement */
+ public static final String REQUIREMENT_BASE_CLASS_ATT = "base_Class";
+ /** Qualified name of the stereotype RequirementRelated */
+ public static final String REQUIREMENTRELATED_STEREOTYPE = "SysML::Requirements::RequirementRelated";
+ /** name of property base_NamedElement of the stereotype RequirementRelated */
+ public static final String REQUIREMENTRELATED_BASE_NAMEDELEMENT_ATT = "base_NamedElement";
+ /** name of property tracedFrom of the stereotype RequirementRelated */
+ public static final String REQUIREMENTRELATED_TRACEDFROM_ATT = "tracedFrom";
+ /** name of property satisfies of the stereotype RequirementRelated */
+ public static final String REQUIREMENTRELATED_SATISFIES_ATT = "satisfies";
+ /** name of property refines of the stereotype RequirementRelated */
+ public static final String REQUIREMENTRELATED_REFINES_ATT = "refines";
+ /** name of property verifies of the stereotype RequirementRelated */
+ public static final String REQUIREMENTRELATED_VERIFIES_ATT = "verifies";
+ }
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/AddDerivedLinkReqCommand.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/AddDerivedLinkReqCommand.java
new file mode 100644
index 00000000000..fd5aa1a5556
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/AddDerivedLinkReqCommand.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.command;
+
+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.req.sysml.assistant.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;
+/**
+ *
+ *create a set of derived Link
+ */
+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;
+ }
+
+ 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);
+ ReferenceSelector selector = new ReferenceSelector();
+ selector.setLabelProvider(new UMLLabelProvider());
+ selector.setContentProvider(provider);
+ MultipleValueSelectionDialog dialog = new MultipleValueSelectionDialog(Display.getDefault().getActiveShell(),selector,"Choose Requirements to add Derived Link");
+
+ 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) {
+ 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);
+ derivationReqCreateCommand.execute();
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/CommentReqCommand.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/CommentReqCommand.java
new file mode 100644
index 00000000000..d55f878eee1
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/CommentReqCommand.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.command;
+
+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;
+/**
+ *
+ * parse 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/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/DerivationReqCreateCommand.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/DerivationReqCreateCommand.java
new file mode 100644
index 00000000000..7d64dafafed
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/DerivationReqCreateCommand.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.command;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.req.sysml.assistant.I_SysMLStereotype;
+import org.eclipse.uml2.uml.Abstraction;
+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
+ *
+ */
+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)
+
+ */
+ 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(I_SysMLStereotype.DERIVEREQT_STEREOTYPE);
+ theAbstraction.applyStereotype(satisfyStereotype);
+ }
+
+}
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/ExtractCommentCommand.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/ExtractCommentCommand.java
new file mode 100644
index 00000000000..0b76df9e9a6
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/ExtractCommentCommand.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.command;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.req.sysml.assistant.I_SysMLStereotype;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+/**
+ *
+ * parse the text of the requirement and move some parts as comment
+ *
+ */
+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]
+ * @param req
+ */
+ protected void parseAndExecute(Class req){
+ Stereotype reqStereotype= req.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ String text= (String)req.getValue(reqStereotype, I_SysMLStereotype.REQUIREMENT_TEXT_ATT);
+ text= text.trim();
+ if(text.startsWith("[")){
+ //stakeholders detected
+ int index= text.indexOf("]");
+ String stakeholders=text.substring(0, index+1);
+ text= text.substring(index+1);
+ text=text.trim();
+ createAnnotatedComment(req, "STAKEHOLDERS:"+stakeholders);
+ req.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/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/InitDerivedReqCommand.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/InitDerivedReqCommand.java
new file mode 100644
index 00000000000..85af00c1ebc
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/InitDerivedReqCommand.java
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.command;
+
+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.req.sysml.assistant.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;
+/**
+ *
+ *create a derived requirement from a set of requirement 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]);
+ }
+ 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/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/PapyrusReqSysMLRequirementCreateCommand.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/PapyrusReqSysMLRequirementCreateCommand.java
new file mode 100644
index 00000000000..b66c2917311
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/command/PapyrusReqSysMLRequirementCreateCommand.java
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.command;
+
+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.req.sysml.assistant.I_SysMLStereotype;
+import org.eclipse.papyrus.req.sysml.preferences.Activator;
+import org.eclipse.papyrus.req.sysml.preferences.PreferenceConstants;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.PackageableElement;
+import org.eclipse.uml2.uml.Stereotype;
+/**
+ *
+ * parse the text of the requirement and move some parts as comment
+ *
+ */
+
+public class PapyrusReqSysMLRequirementCreateCommand extends RecordingCommand {
+ protected Element selectedElement;
+ public PapyrusReqSysMLRequirementCreateCommand(TransactionalEditingDomain domain, Element selectedElements) {
+ super(domain,"PapyrusReqSysMLRequirementCreateCommand" );
+ this.selectedElement=selectedElements;
+ }
+
+ protected void createRequirement(org.eclipse.uml2.uml.Package owner,String text){
+ org.eclipse.uml2.uml.Class requirement=owner.createOwnedClass("tmpName", 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_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, "");
+ }
+
+ }
+
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/AddDerivedLinkReqHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/AddDerivedLinkReqHandler.java
new file mode 100644
index 00000000000..db459ccb923
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/AddDerivedLinkReqHandler.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.handler;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.req.sysml.assistant.command.AddDerivedLinkReqCommand;
+import org.eclipse.papyrus.req.sysml.assistant.command.DerivationReqCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * this class execute a derived link
+ */
+
+public class AddDerivedLinkReqHandler extends PapyrusReqSysMLAbstractHandler {
+
+
+
+ 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){
+ AddDerivedLinkReqCommand addDerivedLinkReqCommand= new AddDerivedLinkReqCommand(transactionalEditingDomain,selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(addDerivedLinkReqCommand);
+ }
+ }
+ 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/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/CommentReqHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/CommentReqHandler.java
new file mode 100644
index 00000000000..563edcbc6e0
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/CommentReqHandler.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.handler;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.req.sysml.assistant.command.CommentReqCommand;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * this class create a comment with the annotated element filled
+ */
+
+public class CommentReqHandler extends PapyrusReqSysMLAbstractHandler {
+
+
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElement=getSelectionSet();
+ if( selectedElement.size()!=0){
+ CommentReqCommand commentReqCommand= new CommentReqCommand(transactionalEditingDomain,selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(commentReqCommand);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ ArrayList<Element> selectedElement=getSelectionSet();
+ if( selectedElement.size()!=0){
+ return true;
+ }
+ else{ return false;}
+ }
+
+
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/ExtractCommentsHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/ExtractCommentsHandler.java
new file mode 100644
index 00000000000..0cadd1d1856
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/ExtractCommentsHandler.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.handler;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.req.sysml.assistant.command.ExtractCommentCommand;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * this class execute parses of comment
+ */
+
+public class ExtractCommentsHandler extends PapyrusReqSysMLAbstractHandler {
+
+
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElement=getSelectionSet();
+ if( selectedElement.size()!=0){
+ ExtractCommentCommand extractCommentCommand= new ExtractCommentCommand(transactionalEditingDomain,selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(extractCommentCommand);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ ArrayList<Element> selectedElement=getSelectionSet();
+ if( selectedElement.size()!=0){
+ return true;
+ }
+ else{ return false;}
+ }
+
+
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDerivedReqHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDerivedReqHandler.java
new file mode 100644
index 00000000000..96c45451d28
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/InitDerivedReqHandler.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.handler;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.req.sysml.assistant.command.InitDerivedReqCommand;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Use to create a derived requirement
+ */
+
+public class InitDerivedReqHandler extends PapyrusReqSysMLAbstractHandler {
+
+
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ ArrayList<Element> selectedElement=getSelectionSet();
+ if( selectedElement.size()!=0){
+ InitDerivedReqCommand initDerivedReqCommand= new InitDerivedReqCommand(transactionalEditingDomain,selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(initDerivedReqCommand);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true if the handler is possible
+ */
+ @Override
+ public boolean isEnabled() {
+ ArrayList<Element> selectedElement=getSelectionSet();
+ if( selectedElement.size()!=0){
+ return true;
+ }
+ else{ return false;}
+ }
+
+
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLAbstractHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLAbstractHandler.java
new file mode 100644
index 00000000000..4a92218fa82
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLAbstractHandler.java
@@ -0,0 +1,123 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.handler;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Abstract handler in order to connect to Papyrus
+ *
+ */
+public abstract class PapyrusReqSysMLAbstractHandler extends AbstractHandler {
+
+ protected TransactionalEditingDomain transactionalEditingDomain=null;
+ protected IMultiDiagramEditor papyrusEditor;
+
+
+ /**
+ * install element of Papyrus in order to execute commands
+ * @param event the context of the execution
+ */
+ protected void setPapyrusEnvironment(ExecutionEvent event){
+ //look for papyrus
+ try {
+ papyrusEditor = ServiceUtilsForHandlers.getInstance().getService(IMultiDiagramEditor.class, event);
+ transactionalEditingDomain= ServiceUtilsForHandlers.getInstance().getService(org.eclipse.emf.transaction.TransactionalEditingDomain.class, event);
+
+ } catch (ServiceException ex) {
+ System.err.println(ex);
+ }
+ }
+ /**
+ * getSelected element in the diagram or in the model explorer
+ * @return Element or null
+ */
+ protected Element getSelection(){
+ org.eclipse.uml2.uml.Element selectedElement =null;
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = selectionService.getSelection();
+ //look for papyrus
+ if(selection instanceof IStructuredSelection) {
+ Object selectedobject = ((IStructuredSelection)selection).getFirstElement();
+ if(selectedobject instanceof GraphicalEditPart) {
+ Object graphicalElement = ((GraphicalEditPart)selectedobject).getModel();
+ if((graphicalElement instanceof View) && ((View)graphicalElement).getElement() instanceof org.eclipse.uml2.uml.Element) {
+ selectedElement = (org.eclipse.uml2.uml.Element)((View)graphicalElement).getElement();
+ }
+ }
+ else if(selectedobject instanceof IAdaptable) {
+ EObject selectedEObject = (EObject)((IAdaptable)selectedobject).getAdapter(EObject.class);
+ if (selectedEObject instanceof org.eclipse.uml2.uml.Element){
+ selectedElement=(Element)selectedEObject;
+ }
+ }
+ }
+ return selectedElement;
+ }
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ setPapyrusEnvironment(event);
+ return null;
+ }
+ /**
+ * getSelected element in the diagram or in hte model explorer
+ * @return Element or null
+ */
+ protected ArrayList<Element> getSelectionSet(){
+ ArrayList<Element> selectedSet =new ArrayList<Element>();
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = selectionService.getSelection();
+
+
+ if(selection instanceof IStructuredSelection) {
+ @SuppressWarnings("rawtypes")
+ Iterator selectedobjectIteractor = ((IStructuredSelection)selection).iterator();
+ while (selectedobjectIteractor.hasNext()) {
+ Object currentSelection = selectedobjectIteractor.next();
+ if(currentSelection instanceof GraphicalEditPart) {
+ Object graphicalElement = ((GraphicalEditPart)currentSelection).getModel();
+ if((graphicalElement instanceof View) && ((View)graphicalElement).getElement() instanceof org.eclipse.uml2.uml.Element) {
+ selectedSet.add( (org.eclipse.uml2.uml.Element)((View)graphicalElement).getElement());
+ }
+ }
+ else if(currentSelection instanceof IAdaptable) {
+ EObject selectedEObject = (EObject)((IAdaptable)currentSelection).getAdapter(EObject.class);
+ if (selectedEObject instanceof org.eclipse.uml2.uml.Element){
+ selectedSet.add((Element)selectedEObject);
+ }
+ }
+ }
+
+
+ }
+ return selectedSet;
+ }
+}
+
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLRequirementHandler.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLRequirementHandler.java
new file mode 100644
index 00000000000..b360f1079c9
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.assistant/src/org/eclipse/papyrus/req/sysml/assistant/handler/PapyrusReqSysMLRequirementHandler.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * 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.req.sysml.assistant.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.req.sysml.assistant.command.PapyrusReqSysMLRequirementCreateCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * this class create a new requirement from the preferences
+ */
+
+public class PapyrusReqSysMLRequirementHandler extends PapyrusReqSysMLAbstractHandler {
+
+
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ Element selectedElement=getSelection();
+ if( selectedElement instanceof Package){
+ PapyrusReqSysMLRequirementCreateCommand darwinRequirementCommand= new PapyrusReqSysMLRequirementCreateCommand(transactionalEditingDomain,selectedElement);
+ transactionalEditingDomain.getCommandStack().execute(darwinRequirementCommand);
+ }
+ 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 instanceof Package){
+ return true;
+ }
+
+ else{ return false;}
+ }
+
+
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.classpath b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.classpath
new file mode 100644
index 00000000000..8a8f1668cdc
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.gitignore b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.project b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.project
new file mode 100644
index 00000000000..a7e3302bf93
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.req.sysml.preferences</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.settings/org.eclipse.jdt.core.prefs b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f287d53cf45
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/META-INF/MANIFEST.MF b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..812b0129573
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.req.sysml.preferences;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.req.sysml.preferences.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.req.sysml.preferences
+Bundle-Localization: bundle
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/about.html b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/build.properties b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/build.properties
new file mode 100644
index 00000000000..34dfd31bf32
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ bundle.properties
+src.includes = about.html
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/bundle.properties b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/bundle.properties
new file mode 100644
index 00000000000..98811832057
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/bundle.properties
@@ -0,0 +1,4 @@
+#Properties file for org.eclipse.papyrus.req.sysml.preferences
+Bundle-Vendor = CEA LIST
+Bundle-Name = Papyrus Req SysML Preferences (Incubation)
+page.name = Papyrus Req \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/plugin.xml b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/plugin.xml
new file mode 100644
index 00000000000..d0a35262744
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/plugin.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
+ class="org.eclipse.papyrus.req.sysml.preferences.PreferencePage"
+ id="org.eclipse.papyrus.req.sysml.preferences.PreferencePage"
+ name="%page.name">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.papyrus.req.sysml.preferences.PreferenceInitializer">
+ </initializer>
+ </extension>
+</plugin>
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/pom.xml b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/pom.xml
new file mode 100644
index 00000000000..9374731a3fd
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../releng/top-pom-extras.xml</relativePath>
+ </parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.req.sysml.preferences</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/Activator.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/Activator.java
new file mode 100644
index 00000000000..597c73ad7db
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/Activator.java
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * 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.req.sysml.preferences;
+
+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.req.sysml.preferences"; //$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/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceConstants.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceConstants.java
new file mode 100644
index 00000000000..ea73e0e0ff4
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceConstants.java
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * 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.req.sysml.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ /**
+ * PREFIX for REQUIREMENT
+ */
+ public static final String REQUIREMENT_ID_PREFIX = "REQUIREMENT_ID_PREFIX";
+ public static final String REQUIREMENT_ID_DIGIT = "REQUIREMENT_ID_DIGIT";
+
+} \ No newline at end of file
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceInitializer.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceInitializer.java
new file mode 100644
index 00000000000..0a6ee45b4d5
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferenceInitializer.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * 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.req.sysml.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+
+/**
+ * Initializes the preferences for the creation of Papyrus REQ SysML requirements
+ *
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ store.setDefault(PreferenceConstants.REQUIREMENT_ID_PREFIX, "REQ_");
+ store.setDefault(PreferenceConstants.REQUIREMENT_ID_DIGIT, 3);
+
+ }
+
+}
diff --git a/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferencePage.java b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferencePage.java
new file mode 100644
index 00000000000..3be2abbd0be
--- /dev/null
+++ b/extraplugins/req/org.eclipse.papyrus.req.sysml.preferences/src/org/eclipse/papyrus/req/sysml/preferences/PreferencePage.java
@@ -0,0 +1,79 @@
+/*****************************************************************************
+ * 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.req.sysml.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * Preference page related to SysML Papyrus REQ
+ *
+ */
+public class PreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ public PreferencePage() {
+ super(GRID);
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription("Papyrus SysML Requirements");
+ }
+
+
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ @Override
+ public void createFieldEditors() {
+
+ Group dmGroup = createGroup("Requirement");
+ addField(new StringFieldEditor(PreferenceConstants.REQUIREMENT_ID_PREFIX,"Prefix for Requirement ID",dmGroup));
+ addField(new IntegerFieldEditor(PreferenceConstants.REQUIREMENT_ID_DIGIT,"Number of digits for Requirement ID",dmGroup));
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+ private Group createGroup(String text) {
+ Group group = new Group(getFieldEditorParent(), SWT.NONE);
+ //group.setLayout(new GridLayout(1, false));
+
+ GridLayout gridLayout = new GridLayout(2, false);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.horizontalSpan = 2;
+
+ group.setLayoutData(gridData);
+ group.setLayout(gridLayout);
+
+ group.setText(text);
+
+ return group;
+ }
+
+}

Back to the top