Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauricio Alferez2016-02-23 10:29:28 +0000
committerGerrit Code Review @ Eclipse.org2016-02-24 15:06:15 +0000
commitb55f2cbe11571743b459d4506d87faafc471c579 (patch)
treefc4d9fafa0580add76305ae038b89dad9754e740
parent15774f3975ee1b16a699665a185638a3a57b374b (diff)
downloadorg.eclipse.papyrus-b55f2cbe11571743b459d4506d87faafc471c579.tar.gz
org.eclipse.papyrus-b55f2cbe11571743b459d4506d87faafc471c579.tar.xz
org.eclipse.papyrus-b55f2cbe11571743b459d4506d87faafc471c579.zip
Requirements x model elements Satisfy Matrix
Change-Id: I33d8ff345d20a5fe2712808824992f7bdaa17afe Signed-off-by: Mauricio Alferez <mauricio.alferez@cea.fr>
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.classpath7
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.gitignore1
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.project28
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.pde.core.prefs2
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/META-INF/MANIFEST.MF35
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/about.html28
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/build.properties9
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.configuration21
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.nattableconfiguration34
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.pngbin0 -> 302 bytes
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/plugin.xml61
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/pom.xml13
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/Activator.java64
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixElementAxisManager.java36
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixRequirementsAxisManager.java25
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/celleditor/SatisfiedByCellEditorConfiguration.java102
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/RowEqualsColumCellManager.java26
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SameStereotypeCellManager.java36
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SatisfyMatrixCellManager.java195
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/tester/RequirementTableTester.java58
21 files changed, 788 insertions, 0 deletions
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.classpath b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.classpath
new file mode 100644
index 00000000000..b862a296d38
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.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.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.gitignore b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.project b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.project
new file mode 100644
index 00000000000..d97636c0880
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config</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/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.jdt.core.prefs b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..295926d9641
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.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.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.pde.core.prefs b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 00000000000..e313d3c3b6b
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+resolve.requirebundle=false
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..d76164dfef4
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SysML Satisfy Matrix
+Bundle-SymbolicName: org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.gmf.runtime.emf.type.core,
+ org.eclipse.papyrus.sysml.service.types;bundle-version="1.2.0",
+ org.eclipse.papyrus.sysml;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0",
+ org.eclipse.papyrus.sysml.nattable;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.nattable.common;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.nattable;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.nattable,
+ org.eclipse.papyrus.infra.nattable.model;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0",
+ org.eclipse.nebula.widgets.nattable.core;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.nattable.stereotype.display;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.emf.nattable;bundle-version="1.2.0",
+ org.eclipse.papyrus.sysml.nattable.requirement.config,
+ org.eclipse.papyrus.infra.viewpoints.policy,
+ ca.odell.glazedlists;bundle-version="1.9.0",
+ org.eclipse.emf.ecore,
+ org.eclipse.uml2.uml,
+ org.eclipse.emf.common,
+ org.eclipse.papyrus.infra.services.edit,
+ org.eclipse.papyrus.infra.gmfdiag.commands,
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.requirements.sysml.common
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/about.html b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/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/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/build.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/build.properties
new file mode 100644
index 00000000000..20df2a8e6c6
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ config/,\
+ icons/,\
+ about.html
+src.includes = about.html
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.configuration b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.configuration
new file mode 100644
index 00000000000..5922c239cbb
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.configuration
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration:PapyrusConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmi:id="_ko07IErbEeSdQKzSRatBjg">
+ <viewpoints xsi:type="configuration:PapyrusViewpoint" xmi:id="_xogdoErbEeSdQKzSRatBjg" name="Default Papyrus Viewpoint">
+ <modelKinds xsi:type="configuration:PapyrusSyncTable" xmi:id="_lTE0gHDwEeWh-MssWmCB_A" name="Satisfy Matrix" icon="platform:/plugin/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.png" implementationID="SatisfyMatrix">
+ <profiles href="http://www.eclipse.org/papyrus/0.7.0/SysML#//requirements"/>
+ <modelRules xmi:id="_lTE0gXDwEeWh-MssWmCB_A">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </modelRules>
+ <modelRules xmi:id="_lTE0gnDwEeWh-MssWmCB_A">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ <stereotypes href="http://www.eclipse.org/papyrus/0.7.0/SysML#//requirements/Requirement"/>
+ </modelRules>
+ <owningRules xmi:id="_lTE0g3DwEeWh-MssWmCB_A">
+ <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </owningRules>
+ <categories href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wNb49xhEeOqHvRyiN87hA"/>
+ </modelKinds>
+ </viewpoints>
+ <defaultStakeholder href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wLmkdxhEeOqHvRyiN87hA"/>
+ <metamodel href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
+</configuration:PapyrusConfiguration>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.nattableconfiguration b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.nattableconfiguration
new file mode 100644
index 00000000000..b5b7f140a5d
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.nattableconfiguration
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattableconfiguration:TableConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:nattablelabelprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattablecontentprovider" xmlns:nattablestyle="http://www.eclipse.org/papyrus/nattable/model/table/nattablestyle" xmlns:nattabletester="http://www.eclipse.org/papyrus/nattable/model/table/nattabletester" description="This table is a matrix that shows if the element satisfies a requirement" name="SatisfyMatrix" type="SatisfyMatrix" iconPath="platform:/plugin/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.png" defaultRowAxisProvider="//@rowAxisProviders.0" defaultColumnAxisProvider="//@columnAxisProviders.0">
+ <styles xsi:type="nattablestyle:TableDisplayStyle" displayStyle="HIERARCHIC_SINGLE_TREE_COLUMN"/>
+ <creationTester xsi:type="nattabletester:JavaTableTester" tester="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.tester.RequirementTableTester.java"/>
+ <rowHeaderAxisConfiguration xsi:type="nattableaxisconfiguration:TableHeaderAxisConfiguration" indexStyle="NUMERIC" displayIndex="false">
+ <ownedLabelConfigurations xsi:type="nattablelabelprovider:ObjectLabelProviderConfiguration"/>
+ <ownedLabelConfigurations xsi:type="nattablelabelprovider:FeatureLabelProviderConfiguration" displayType="false" displayMultiplicity="false"/>
+ <ownedAxisConfigurations xsi:type="nattableaxisconfiguration:TreeFillingConfiguration" labelProvider="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.1" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.treefilling.feature.labelprovider">
+ <axisUsedAsAxisProvider xsi:type="nattableaxis:EStructuralFeatureAxis">
+ <element xsi:type="ecore:EReference" href="http://www.eclipse.org/uml2/5.0.0/UML#//Element/ownedElement"/>
+ </axisUsedAsAxisProvider>
+ </ownedAxisConfigurations>
+ <ownedAxisConfigurations xsi:type="nattableaxisconfiguration:TreeFillingConfiguration" depth="1" labelProvider="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.1" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.treefilling.feature.labelprovider">
+ <axisUsedAsAxisProvider xsi:type="nattableaxis:EStructuralFeatureAxis">
+ <element xsi:type="ecore:EReference" href="http://www.eclipse.org/uml2/5.0.0/UML#//Element/ownedElement"/>
+ </axisUsedAsAxisProvider>
+ </ownedAxisConfigurations>
+ <ownedAxisConfigurations xsi:type="nattableaxisconfiguration:TreeFillingConfiguration" depth="2" labelProvider="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.1" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.treefilling.feature.labelprovider">
+ <axisUsedAsAxisProvider xsi:type="nattableaxis:EStructuralFeatureAxis">
+ <element xsi:type="ecore:EReference" href="http://www.eclipse.org/uml2/5.0.0/UML#//Element/ownedElement"/>
+ </axisUsedAsAxisProvider>
+ </ownedAxisConfigurations>
+ <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.req.matrix.config.axismanager.SatisfyMatrixElementAxisManager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider" headerLabelConfiguration="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.0" specificAxisConfigurations="//@rowHeaderAxisConfiguration/@ownedAxisConfigurations.0 //@rowHeaderAxisConfiguration/@ownedAxisConfigurations.1 //@rowHeaderAxisConfiguration/@ownedAxisConfigurations.2"/>
+ </rowHeaderAxisConfiguration>
+ <columnHeaderAxisConfiguration xsi:type="nattableaxisconfiguration:TableHeaderAxisConfiguration">
+ <ownedLabelConfigurations xsi:type="nattablelabelprovider:ObjectLabelProviderConfiguration"/>
+ <ownedAxisConfigurations xsi:type="nattableaxisconfiguration:EStructuralFeatureValueFillingConfiguration">
+ <listenFeature xsi:type="ecore:EReference" href="http://www.eclipse.org/uml2/5.0.0/UML#//Namespace/ownedMember"/>
+ </ownedAxisConfigurations>
+ <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.req.matrix.config.axismanager.SatisfyMatrixRequirementsAxisManager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider" headerLabelConfiguration="//@columnHeaderAxisConfiguration/@ownedLabelConfigurations.0" specificAxisConfigurations="//@columnHeaderAxisConfiguration/@ownedAxisConfigurations.0"/>
+ </columnHeaderAxisConfiguration>
+ <columnAxisProviders xsi:type="nattableaxisprovider:MasterObjectAxisProvider" name="DefaultColumnProvider"/>
+ <rowAxisProviders xsi:type="nattableaxisprovider:MasterObjectAxisProvider" name="DefaultRowProvider"/>
+</nattableconfiguration:TableConfiguration>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.png b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.png
new file mode 100644
index 00000000000..a3254323439
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.png
Binary files differ
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/plugin.xml
new file mode 100644
index 00000000000..82599d0b4ba
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/plugin.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.tester">
+ <tester
+ class="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.tester.RequirementTableTester"
+ id="org.eclipse.papyrus.req.matrix.config.tester.RequirementTableTester">
+ </tester>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.axismanager">
+ <axisManager
+ id="org.eclipse.papyrus.req.matrix.config.axismanager.SatisfyMatrixRequirementsAxisManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.axismanager.SatisfyMatrixRequirementsAxisManager">
+ </axisManager>
+ <axisManager
+ id="org.eclipse.papyrus.req.matrix.config.axismanager.SatisfyMatrixElementAxisManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.axismanager.SatisfyMatrixElementAxisManager">
+ </axisManager>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.configuration">
+ <configuration
+ file="config/SatisfyMatrix.nattableconfiguration"
+ type="SatisfyMatrix">
+ </configuration>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.cellmanager">
+ <cellManager
+ id="org.eclipse.papyrus.req.sysml.matrix.config.cellmanager.RowEqualsColumCellManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager.RowEqualsColumCellManager"
+ order="1">
+ </cellManager>
+ <cellManager
+ id="org.eclipse.papyrus.req.sysml.matrix.config.cellmanager.SameStereotypeCellManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager.SameStereotypeCellManager"
+ order="2">
+ </cellManager>
+ <cellManager
+ id="org.eclipse.papyrus.req.sysml.matrix.config.cellmanager.SatisfyMatrixCellManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager.SatisfyMatrixCellManager"
+ order="3">
+ </cellManager>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.viewpoints.policy.custom">
+ <contribution
+ file="config/SatisfyMatrix.configuration"
+ original="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration">
+ </contribution>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.celleditor.configuration">
+ <cellAxisConfiguration
+ class="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.celleditor.SatisfiedByCellEditorConfiguration"
+ order="33">
+ </cellAxisConfiguration>
+ </extension>
+</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/pom.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/pom.xml
new file mode 100644
index 00000000000..4e6f2980cb9
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/pom.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.extra.releng</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../../../releng/extra</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/Activator.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/Activator.java
new file mode 100644
index 00000000000..30de4f75d70
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/Activator.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixElementAxisManager.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixElementAxisManager.java
new file mode 100644
index 00000000000..94d2ba4b3b9
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixElementAxisManager.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.axismanager;
+
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.TreeFillingConfiguration;
+import org.eclipse.papyrus.uml.nattable.manager.axis.UMLElementTreeAxisManagerForEventList;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.NamedElement;
+
+public class SatisfyMatrixElementAxisManager extends UMLElementTreeAxisManagerForEventList {
+
+ @Override
+ public boolean isAllowedContents(Object objectToTest, Object semanticParent, TreeFillingConfiguration conf,
+ int depth) {
+ if (objectToTest instanceof NamedElement) {
+ if (!(objectToTest instanceof Dependency)) {
+ return true;
+ }
+ }
+ return false;
+ // return super.isAllowedContents(objectToTest, semanticParent, conf,
+ // depth);//this allows any UML element
+ }
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixRequirementsAxisManager.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixRequirementsAxisManager.java
new file mode 100644
index 00000000000..a40fd749015
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixRequirementsAxisManager.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.axismanager;
+
+import org.eclipse.papyrus.sysml.nattable.manager.axis.RequirementAxisManager;
+
+/**
+ * AxisManager for SysML Requirements
+ *
+ */
+public class SatisfyMatrixRequirementsAxisManager extends RequirementAxisManager {
+
+} \ No newline at end of file
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/celleditor/SatisfiedByCellEditorConfiguration.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/celleditor/SatisfiedByCellEditorConfiguration.java
new file mode 100644
index 00000000000..2545df37133
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/celleditor/SatisfiedByCellEditorConfiguration.java
@@ -0,0 +1,102 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.celleditor;
+
+import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
+import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
+import org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter;
+import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
+import org.eclipse.nebula.widgets.nattable.edit.editor.CheckBoxCellEditor;
+import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
+import org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.painter.CustomCheckBoxPainter;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.sysml.requirements.Requirement;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+public class SatisfiedByCellEditorConfiguration implements ICellAxisConfiguration {
+ /**
+ * the id of this editor
+ */
+ private static final String ID = "org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.celleditor.SatisfyByCellEditorConfiguration.CheckBox";//$NON-NLS-1$
+
+
+ /**
+ * @see org.eclipse.papyrus.infra.nattable.configuration.IPapyrusNatTableConfiguration#getConfigurationId()
+ *
+ * @return
+ */
+ @Override
+ public String getConfigurationId() {
+ return ID;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.nattable.configuration.IPapyrusNatTableConfiguration#getConfigurationDescription()
+ *
+ * @return
+ */
+ @Override
+ public String getConfigurationDescription() {
+ // TODO Auto-generated method stub
+ return "This configuration provides a CheckBox editor for a single Boolean that is not necessarily a EStructuralFeature as in SingleBooleanCellEditorConfiguration";//$NON-NLS-1$
+ }
+
+
+ /**
+ * @see org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration#handles(org.eclipse.papyrus.infra.nattable.model.nattable.Table, java.lang.Object)
+ *
+ * @param table
+ * @param axisElement
+ * @return
+ */
+ @Override
+ public boolean handles(Table table, Object axisElement) {
+ if(table.getTableConfiguration().getType().equals("SatisfyMatrix")){
+ Object repElement = AxisUtils.getRepresentedElement(axisElement);
+ Element colUMLElement = (Element) repElement;
+ if (UMLUtil.getStereotypeApplication(colUMLElement, Requirement.class) != null) {
+ Stereotype reqStereotype = colUMLElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ if(reqStereotype!=null){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration#configureCellEditor(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry, java.lang.Object, java.lang.String)
+ *
+ * @param configRegistry
+ * @param axis
+ * @param configLabel
+ */
+
+ @Override
+ public void configureCellEditor(IConfigRegistry configRegistry, Object axis, String configLabel) {
+ configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new CustomCheckBoxPainter(), DisplayMode.NORMAL, configLabel);
+ configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new CheckBoxCellEditor(), DisplayMode.NORMAL, configLabel);
+ configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultBooleanDisplayConverter(), DisplayMode.EDIT, configLabel);
+ }
+
+
+
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/RowEqualsColumCellManager.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/RowEqualsColumCellManager.java
new file mode 100644
index 00000000000..15759c094b6
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/RowEqualsColumCellManager.java
@@ -0,0 +1,26 @@
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager;
+
+import org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.Activator;
+
+public class RowEqualsColumCellManager extends AbstractCellManager {
+ public static final String CELL_MANAGER_ID = Activator.PLUGIN_ID + ".RowEqualsColumnCellManager";
+
+ @Override
+ public boolean handles(Object columnElement, Object rowElement) {
+ Object column = AxisUtils.getRepresentedElement(columnElement);
+ Object row = AxisUtils.getRepresentedElement(rowElement);
+ if (row.equals(column)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected Object doGetValue(Object columnElement, Object rowElement, INattableModelManager tableManager) {
+ return "same element";
+ }
+
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SameStereotypeCellManager.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SameStereotypeCellManager.java
new file mode 100644
index 00000000000..89a71cf3c61
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SameStereotypeCellManager.java
@@ -0,0 +1,36 @@
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.Activator;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+public class SameStereotypeCellManager extends AbstractCellManager {
+ public static final String CELL_MANAGER_ID = Activator.PLUGIN_ID + ".SameStereotypeCellManager";
+
+ @Override
+ public boolean handles(Object columnElement, Object rowElement) {
+ Object column = AxisUtils.getRepresentedElement(columnElement);
+ Object row = AxisUtils.getRepresentedElement(rowElement);
+ if (column instanceof Element && row instanceof Element) {
+ Element colUMLElement = (Element) column;
+ Element rowUMLElement = (Element) row;
+ EList <Stereotype> stereotypesInRowUMLElement = rowUMLElement.getAppliedStereotypes();
+ for (Stereotype s: colUMLElement.getAppliedStereotypes()){
+ if (stereotypesInRowUMLElement.contains(s)){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected Object doGetValue(Object columnElement, Object rowElement, INattableModelManager tableManager) {
+ return "No relationship";
+ }
+
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SatisfyMatrixCellManager.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SatisfyMatrixCellManager.java
new file mode 100644
index 00000000000..fedb9088eb6
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SatisfyMatrixCellManager.java
@@ -0,0 +1,195 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.ITreeItemAxis;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.TableConfiguration;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.requirements.sysml.common.I_SysMLStereotype;
+import org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.Activator;
+import org.eclipse.papyrus.sysml.requirements.Requirement;
+import org.eclipse.uml2.uml.Abstraction;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+@SuppressWarnings("deprecation")
+public class SatisfyMatrixCellManager extends AbstractCellManager {
+ public static final String SATISFY_MESSAGE = "satisfies";
+ public static final String CELL_MANAGER_ID = Activator.PLUGIN_ID + ".cellmanager";
+
+ @Override
+ public boolean handles(Object columnElement, Object rowElement) {
+ // Supports Requirement x Element
+ Object column = AxisUtils.getRepresentedElement(columnElement);
+ Object row = AxisUtils.getRepresentedElement(rowElement);
+ if (rowElement instanceof ITreeItemAxis) {
+ ITreeItemAxis axis = (ITreeItemAxis) rowElement;
+ AxisManagerRepresentation manager = axis.getManager();
+ TableConfiguration conf = (TableConfiguration) manager.eContainer().eContainer();
+ String type = conf.getType();
+ if (!type.equals("SatisfyMatrix")) {
+ return false;
+ }
+ }
+
+ if (column instanceof Element) {
+ Element colUMLElement = (Element) column;
+ if (UMLUtil.getStereotypeApplication(colUMLElement, Requirement.class) != null) {
+ if (row instanceof Element) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected Object doGetValue(Object columnElement, Object rowElement, INattableModelManager tableManager) {
+ Object column = AxisUtils.getRepresentedElement(columnElement);
+ Object row = AxisUtils.getRepresentedElement(rowElement);
+ EObject eObjectInRow = (EObject) row;
+ if (column instanceof Element) {
+ Element colUMLElement = (Element) column;
+ if (UMLUtil.getStereotypeApplication(colUMLElement, Requirement.class) != null) {
+ Stereotype reqStereotype = colUMLElement.getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ Object listOfObjectsThatSatisfyRequirement = colUMLElement.getValue(reqStereotype, "satisfiedBy");
+ if (listOfObjectsThatSatisfyRequirement instanceof EList<?>) {
+ @SuppressWarnings("unchecked")
+ EList<EObject> list = (EList<EObject>) listOfObjectsThatSatisfyRequirement;
+ // check the list of elements that satisfy the requirement
+ // to see if the element in the current row in there
+ for (EObject eObjectThatSatisfiesRequirement : list) {
+ if (eObjectInRow.equals(eObjectThatSatisfiesRequirement)) {
+ return true;
+ }
+ }
+ }
+
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void setValue(TransactionalEditingDomain domain, Object columnElement, Object rowElement, Object newValue,
+ INattableModelManager tableManager) {
+ Object column = AxisUtils.getRepresentedElement(columnElement);
+ Object row = AxisUtils.getRepresentedElement(rowElement);
+ EObject eObjectInRow = (EObject) row;
+
+ if (column instanceof Element) {
+ Element colUMLElement = (Element) column;
+
+ if (Boolean.FALSE.equals(newValue)) {
+ if (UMLUtil.getStereotypeApplication(colUMLElement, Requirement.class) != null) {
+ Stereotype reqStereotype = colUMLElement
+ .getAppliedStereotype(I_SysMLStereotype.REQUIREMENT_STEREOTYPE);
+ Object listOfObjectsThatSatisfyRequirement = colUMLElement.getValue(reqStereotype, "satisfiedBy");
+ if (listOfObjectsThatSatisfyRequirement instanceof EList<?>) {
+ @SuppressWarnings("unchecked")
+ EList<EObject> list = (EList<EObject>) listOfObjectsThatSatisfyRequirement;
+ // check the list of elements that satisfy the
+ // requirement to see if the element in the current row
+ // in there
+ Dependency toDestroy = null;
+ for (EObject eObjectThatSatisfiesRequirement : list) {
+ if (toDestroy == null) {
+ if (eObjectInRow.equals(eObjectThatSatisfiesRequirement)) {
+ EList<Dependency> dependencies = ((NamedElement) eObjectThatSatisfiesRequirement)
+ .getClientDependencies();
+ Iterator<Dependency> iter = dependencies.iterator();
+ while (iter.hasNext() && toDestroy == null) {
+ Dependency dependency = iter.next();
+ if (dependency instanceof Abstraction) {
+ if (dependency
+ .getAppliedStereotype("SysML::Requirements::Satisfy") != null) {
+ if (dependency.getClients().contains(row)
+ && dependency.getSuppliers().contains(colUMLElement)) {
+ toDestroy = dependency;
+ }
+
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ if (toDestroy != null) {
+ DestroyElementRequest req = new DestroyElementRequest(toDestroy, false);
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toDestroy);
+ ICommand cmd = provider.getEditCommand(req);
+ if (cmd != null && cmd.canExecute()) {
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
+ }
+ }
+ }
+ }
+ } else if (Boolean.TRUE.equals(newValue)
+ || (newValue instanceof Abstraction && ((Abstraction) newValue).eContainer() == null)) {
+ IElementType type = ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.sysml.Satisfy");
+ if (row instanceof Element) {
+ Element container = ((Element) row).getNearestPackage();
+ CreateRelationshipRequest request = new CreateRelationshipRequest(domain, container, (EObject) row,
+ colUMLElement, type);
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container);
+ ICommand cmd = provider.getEditCommand(request);
+ // CreateR
+ if (cmd != null && cmd.canExecute()) {
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public Command getSetValueCommand(TransactionalEditingDomain domain, Object columnElement, Object rowElement,
+ Object newValue, INattableModelManager tableManager) {
+ return super.getSetValueCommand(domain, columnElement, rowElement, newValue, tableManager);
+ }
+
+ @Override
+ public boolean isCellEditable(Object columnElement, Object rowElement) {
+ Object column = AxisUtils.getRepresentedElement(columnElement);
+ Object row = AxisUtils.getRepresentedElement(rowElement);
+ if (row instanceof NamedElement && column instanceof Element) {
+ return UMLUtil.getStereotypeApplication((Element) column, Requirement.class) != null;
+ }
+ return false;
+ }
+}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/tester/RequirementTableTester.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/tester/RequirementTableTester.java
new file mode 100644
index 00000000000..04b0e612228
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/tester/RequirementTableTester.java
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.tester;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
+import org.eclipse.papyrus.infra.nattable.tester.ITableTester;
+import org.eclipse.papyrus.sysml.nattable.requirement.config.Activator;
+import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
+import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+
+public class RequirementTableTester implements ITableTester {
+
+ private static final IElementMatcher matcher = new RequirementMatcher();
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.nattable.tester.ITableTester#isAllowed(java.lang.Object)
+ *
+ * @param context
+ * @return
+ */
+ @Override
+ public IStatus isAllowed(Object context) {
+ if (context instanceof Element) {
+ Element el = (Element) context;
+ boolean result = context instanceof Package || matcher.matches(el);
+ if (result) {
+ final String packageQN = UMLUtil.getProfile(RequirementsPackage.eINSTANCE, el).getQualifiedName();
+ result = result && el.getNearestPackage().getAppliedProfile(packageQN, true) != null;
+ if (result) {
+ return new Status(IStatus.OK, Activator.PLUGIN_ID, "The context allowed to create a requirement matrix");
+ } else {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, String.format("The profile {0} is not applied on the model", packageQN));
+ }
+ }
+ }
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The context is not an UML Element");
+ }
+
+}

Back to the top