Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauricio Alferez2016-05-15 06:47:54 +0000
committerMauricio Alferez2016-05-15 14:00:24 +0000
commit0238feba5f2c801775fb115ca742f57613135ed2 (patch)
tree064880ee05d134d6f81a955e5cb66fafdbc08524
parentad98ea002397b7b19c64af586e0515409aa94f70 (diff)
downloadorg.eclipse.papyrus-0238feba5f2c801775fb115ca742f57613135ed2.tar.gz
org.eclipse.papyrus-0238feba5f2c801775fb115ca742f57613135ed2.tar.xz
org.eclipse.papyrus-0238feba5f2c801775fb115ca742f57613135ed2.zip
Bug 493664 - [Extra][Requirements] Refactoring
common cell editors, testers, axis and cell managers in matrices Change-Id: I63ee395e339928e75b39916e9568ffd89ffc58e9 Signed-off-by: Mauricio Alferez <mauricio.alferez@cea.fr>
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.classpath7
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.project28
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/META-INF/MANIFEST.MF24
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/about.html28
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/build.properties7
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/plugin.xml38
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/pom.xml13
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/Activator.java64
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/axismanager/NamedElementsWithoutRequirementsAndDependenciesAxisManager.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixElementAxisManager.java)4
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/celleditor/BooleanMatrixCellEditorConfiguration.java106
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/cellmanager/RowEqualsColumCellManager.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/RowEqualsColumCellManager.java)10
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/cellmanager/SameStereotypeCellManager.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/cellmanager/SameStereotypeCellManager.java)30
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/helpers/Helper.java99
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/tester/RequirementTableTester.java (renamed from extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/tester/RequirementTableTester.java)4
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/META-INF/MANIFEST.MF5
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/build.properties1
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.nattableconfiguration12
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.pngbin302 -> 0 bytes
-rw-r--r--extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/plugin.xml28
-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/cellmanager/SatisfyMatrixCellManager.java55
-rw-r--r--features/papyrus-extra-features/org.eclipse.papyrus.requirements.feature/feature.xml6
-rw-r--r--releng/extra/pom.xml1
24 files changed, 477 insertions, 125 deletions
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.classpath b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.classpath
new file mode 100644
index 00000000000..b862a296d38
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.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.common/.project b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.project
new file mode 100644
index 00000000000..794d34c365d
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.requirements.sysml.matrix.common</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.common/.settings/org.eclipse.jdt.core.prefs b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..295926d9641
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/.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.common/META-INF/MANIFEST.MF b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..3aff99f9a95
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Papyrus Req - Common Parts for Matrices
+Bundle-SymbolicName: org.eclipse.papyrus.requirements.sysml.matrix.common;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.requirements.sysml.matrix.common.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.nattable,
+ org.eclipse.papyrus.infra.viewpoints.policy,
+ org.eclipse.uml2.uml,
+ org.eclipse.papyrus.sysml.service.types,
+ org.eclipse.papyrus.sysml,
+ org.eclipse.papyrus.sysml.nattable,
+ org.eclipse.papyrus.requirements.sysml.common
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.papyrus.requirements.sysml.matrix.common,
+ org.eclipse.papyrus.requirements.sysml.matrix.common.axismanager,
+ org.eclipse.papyrus.requirements.sysml.matrix.common.celleditor,
+ org.eclipse.papyrus.requirements.sysml.matrix.common.cellmanager,
+ org.eclipse.papyrus.requirements.sysml.matrix.common.helpers,
+ org.eclipse.papyrus.requirements.sysml.matrix.common.tester
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/about.html b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/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.common/build.properties b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/build.properties
new file mode 100644
index 00000000000..e0e105b23b5
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html
+src.includes = about.html
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/plugin.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/plugin.xml
new file mode 100644
index 00000000000..eeef545fb66
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/plugin.xml
@@ -0,0 +1,38 @@
+<?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.common.tester.RequirementTableTester"
+ id="org.eclipse.papyrus.requirements.sysml.matrix.common.tester.RequirementTableTester">
+ </tester>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.axismanager">
+ <axisManager
+ id="org.eclipse.papyrus.requirements.sysml.matrix.common.axismanager.NamedElementsWithoutRequirementsAndDependenciesAxisManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.common.axismanager.NamedElementsWithoutRequirementsAndDependenciesAxisManager">
+ </axisManager>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.cellmanager">
+ <cellManager
+ id="org.eclipse.papyrus.requirements.sysml.matrix.common.cellmanager.RowEqualsColumCellManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.common.cellmanager.RowEqualsColumCellManager"
+ order="3">
+ </cellManager>
+ <cellManager
+ id="org.eclipse.papyrus.requirements.sysml.matrix.common.cellmanager.SameStereotypeCellManager"
+ manager="org.eclipse.papyrus.requirements.sysml.matrix.common.cellmanager.SameStereotypeCellManager"
+ order="5">
+ </cellManager>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.celleditor.configuration">
+ <cellAxisConfiguration
+ class="org.eclipse.papyrus.requirements.sysml.matrix.common.celleditor.BooleanMatrixCellEditorConfiguration"
+ order="29">
+ </cellAxisConfiguration>
+ </extension>
+</plugin>
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/pom.xml b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/pom.xml
new file mode 100644
index 00000000000..32f07023168
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/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.common</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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/Activator.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/Activator.java
new file mode 100644
index 00000000000..5d0a87da2ef
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/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.common;
+
+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.common"; //$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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/axismanager/NamedElementsWithoutRequirementsAndDependenciesAxisManager.java
index 8048f5ab3fc..30639ec7006 100644
--- 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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/axismanager/NamedElementsWithoutRequirementsAndDependenciesAxisManager.java
@@ -12,7 +12,7 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.axismanager;
+package org.eclipse.papyrus.requirements.sysml.matrix.common.axismanager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.TreeFillingConfiguration;
import org.eclipse.papyrus.sysml.requirements.Requirement;
@@ -22,7 +22,7 @@ import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.util.UMLUtil;
-public class SatisfyMatrixElementAxisManager extends UMLElementTreeAxisManagerForEventList {
+public class NamedElementsWithoutRequirementsAndDependenciesAxisManager extends UMLElementTreeAxisManagerForEventList {
@Override
public boolean isAllowedContents(Object objectToTest, Object semanticParent, TreeFillingConfiguration conf,
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/celleditor/BooleanMatrixCellEditorConfiguration.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/celleditor/BooleanMatrixCellEditorConfiguration.java
new file mode 100644
index 00000000000..6b9ed85403c
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/celleditor/BooleanMatrixCellEditorConfiguration.java
@@ -0,0 +1,106 @@
+/*****************************************************************************
+ * 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.common.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.requirements.sysml.matrix.common.Activator;
+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 BooleanMatrixCellEditorConfiguration implements ICellAxisConfiguration {
+ /**
+ * the id of this editor
+ */
+ private static final String ID = Activator.PLUGIN_ID
+ + ".celleditor.BooleanMatrixCellEditorConfiguration.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() {
+ 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("VerifiedByMatrix")||
+ table.getTableConfiguration().getType().equals("SatisfyMatrix")||
+ table.getTableConfiguration().getType().equals("DerivedFromMatrix")) {
+ 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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/cellmanager/RowEqualsColumCellManager.java
index a212ebf588b..5ae2efd39db 100644
--- 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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/cellmanager/RowEqualsColumCellManager.java
@@ -12,29 +12,29 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager;
+package org.eclipse.papyrus.requirements.sysml.matrix.common.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;
+import org.eclipse.papyrus.requirements.sysml.matrix.common.Activator;
public class RowEqualsColumCellManager extends AbstractCellManager {
- public static final String CELL_MANAGER_ID = Activator.PLUGIN_ID + ".RowEqualsColumnCellManager";
+ public static final String CELL_MANAGER_ID = Activator.PLUGIN_ID + ".cellmanager.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 true;
}
return false;
}
@Override
protected Object doGetValue(Object columnElement, Object rowElement, INattableModelManager tableManager) {
- return "N/A";//"same element";
+ return "N/A";
}
}
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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/cellmanager/SameStereotypeCellManager.java
index ddcf805d2db..2349111af99 100644
--- 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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/cellmanager/SameStereotypeCellManager.java
@@ -12,18 +12,21 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.cellmanager;
+package org.eclipse.papyrus.requirements.sysml.matrix.common.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.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.requirements.sysml.matrix.satisfiedBy.config.Activator;
+import org.eclipse.papyrus.requirements.sysml.matrix.common.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";
+ public static final String CELL_MANAGER_ID = Activator.PLUGIN_ID + ".cellmanager.SameStereotypeCellManager";
@Override
public boolean handles(Object columnElement, Object rowElement) {
@@ -32,9 +35,22 @@ public class SameStereotypeCellManager extends AbstractCellManager {
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)){
+ // This cell manager must be applied only to SatisfyMatrix and
+ // VerifiedByMatrix and not to other type of matrix, such as
+ // DerivedFromMatrix, where columns and rows have the same stereotype
+ 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") && !type.equals("VerifiedByMatrix")) {
+ return false;
+ }
+ }
+
+ EList<Stereotype> stereotypesInRowUMLElement = rowUMLElement.getAppliedStereotypes();
+ for (Stereotype s : colUMLElement.getAppliedStereotypes()) {
+ if (stereotypesInRowUMLElement.contains(s)) {
return true;
}
}
@@ -44,7 +60,7 @@ public class SameStereotypeCellManager extends AbstractCellManager {
@Override
protected Object doGetValue(Object columnElement, Object rowElement, INattableModelManager tableManager) {
- return "N/A";//"No relationship";
+ return "N/A";
}
}
diff --git a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/helpers/Helper.java b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/helpers/Helper.java
new file mode 100644
index 00000000000..e34d16e4b8f
--- /dev/null
+++ b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/helpers/Helper.java
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ * 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.common.helpers;
+
+import java.util.Iterator;
+
+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.requests.DestroyElementRequest;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+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;
+
+@SuppressWarnings("deprecation")
+public class Helper {
+ /**
+ * Deletes a relationship between an stereotyped UML element represented in
+ * a column, and an element represented in the row.
+ *
+ * @param domain
+ * the TransactionalEditingDomain
+ * @param row
+ * the element in the row represented by the IAxis using
+ * IAxis.getElement(), otherwise the element itself
+ * @param colUMLElement
+ * the UML element in the column
+ * @param columnStereotypeQN
+ * the qualified name of the stereotype of the UML element in the
+ * column, ex. "SysML::Requirements::Requirement"
+ * @param columnStereotypePropertyName
+ * the qualified name of the property of the stereotype of the
+ * UML element in the column, ex. "verifiedBy"
+ * @param abstractionStereotypeToDeleteQN
+ * the qualified name of the stereotype of the abstraction that
+ * we will deleted, ex. SysML::Requirements::Verify
+ */
+ public static void deleteRelationshipInIntersection(final TransactionalEditingDomain domain, final Object row,
+ final Element colUMLElement, final String columnStereotypeQN, final String columnStereotypePropertyName,
+ final String abstractionStereotypeToDeleteQN) {
+ EObject eObjectInRow = (EObject) row;
+ Stereotype columnStereotype = colUMLElement.getAppliedStereotype(columnStereotypeQN);
+ Object listOfPropertySatisfyingObjects = colUMLElement.getValue(columnStereotype, columnStereotypePropertyName);
+ if (listOfPropertySatisfyingObjects instanceof EList<?>) {
+ @SuppressWarnings("unchecked")
+ EList<EObject> list = (EList<EObject>) listOfPropertySatisfyingObjects;
+ // Check if the element in the current row is in the list
+ Dependency toDestroy = null;
+ for (EObject propertySatisfyingObject : list) {
+ if (toDestroy == null) {
+ if (eObjectInRow.equals(propertySatisfyingObject)) {
+ EList<Dependency> dependencies = ((NamedElement) propertySatisfyingObject)
+ .getClientDependencies();
+ Iterator<Dependency> iter = dependencies.iterator();
+ while (iter.hasNext() && toDestroy == null) {
+ Dependency dependency = iter.next();
+ if (dependency instanceof Abstraction) {
+ if (dependency.getAppliedStereotype(abstractionStereotypeToDeleteQN) != null) {
+ if (dependency.getClients().contains(row)
+ && dependency.getSuppliers().contains(colUMLElement)) {
+ toDestroy = dependency;
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ if (toDestroy != null) {
+ DestroyElementRequest req = new DestroyElementRequest(toDestroy, true);
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(toDestroy);
+ ICommand cmd = provider.getEditCommand(req);
+ if (cmd != null && cmd.canExecute()) {
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
+ }
+ }
+ }
+ }
+}
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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/tester/RequirementTableTester.java
index 17bd0af3157..143ea005029 100644
--- 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.common/src/org/eclipse/papyrus/requirements/sysml/matrix/common/tester/RequirementTableTester.java
@@ -12,13 +12,13 @@
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.tester;
+package org.eclipse.papyrus.requirements.sysml.matrix.common.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.requirements.sysml.matrix.common.Activator;
import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
import org.eclipse.uml2.uml.Element;
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
index b9ba7840524..9726d274c81 100644
--- 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
@@ -12,6 +12,7 @@ Require-Bundle: org.eclipse.ui,
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.requirements.sysml.common;bundle-version="0.7.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",
@@ -30,7 +31,7 @@ Require-Bundle: org.eclipse.ui,
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-version="0.7.0",
- org.eclipse.papyrus.requirements.common.ui;bundle-version="0.7.0"
+ org.eclipse.papyrus.requirements.common.ui;bundle-version="0.7.0",
+ org.eclipse.papyrus.requirements.sysml.matrix.common;bundle-version="0.7.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
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
index 20df2a8e6c6..1d3a92ff998 100644
--- 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
@@ -4,6 +4,5 @@ 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.nattableconfiguration b/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/config/SatisfyMatrix.nattableconfiguration
index e8acf1aefa5..155e875b8c5 100644
--- 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
@@ -6,8 +6,9 @@
<intListValue>0</intListValue>
<intListValue>1</intListValue>
<intListValue>2</intListValue>
+ <intListValue>3</intListValue>
</styles>
- <creationTester xsi:type="nattabletester:JavaTableTester" tester="org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config.tester.RequirementTableTester.java"/>
+ <creationTester xsi:type="nattabletester:JavaTableTester" tester="org.eclipse.papyrus.requirements.sysml.matrix.common.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"/>
@@ -26,14 +27,19 @@
<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"/>
+ <ownedAxisConfigurations xsi:type="nattableaxisconfiguration:TreeFillingConfiguration" depth="3" labelProvider="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.1" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.treefilling.feature.labelprovider">
+ <axisUsedAsAxisProvider xsi:type="nattableaxis:EStructuralFeatureAxis" alias="">
+ <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.requirements.sysml.matrix.common.axismanager.NamedElementsWithoutRequirementsAndDependenciesAxisManager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider" headerLabelConfiguration="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.0" specificAxisConfigurations="//@rowHeaderAxisConfiguration/@ownedAxisConfigurations.0 //@rowHeaderAxisConfiguration/@ownedAxisConfigurations.1 //@rowHeaderAxisConfiguration/@ownedAxisConfigurations.2 //@rowHeaderAxisConfiguration/@ownedAxisConfigurations.3"/>
</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"/>
+ <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.sysml.nattable.requirement.axis.manager" 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"/>
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
deleted file mode 100644
index a3254323439..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/icons/table_SysML_Requirement.png
+++ /dev/null
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
index 82599d0b4ba..0ac4798d3e7 100644
--- 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
@@ -2,24 +2,6 @@
<?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"
@@ -29,16 +11,6 @@
<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">
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
deleted file mode 100644
index a40fd749015..00000000000
--- a/extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config/src/org/eclipse/papyrus/requirements/sysml/matrix/satisfiedBy/config/axismanager/SatisfyMatrixRequirementsAxisManager.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2016 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.requirements.sysml.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/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
index fedb9088eb6..f5c1c1e2a65 100644
--- 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
@@ -15,8 +15,6 @@
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;
@@ -25,7 +23,6 @@ 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;
@@ -36,10 +33,10 @@ 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.common.helpers.Helper;
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;
@@ -47,7 +44,6 @@ 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
@@ -90,7 +86,7 @@ public class SatisfyMatrixCellManager extends AbstractCellManager {
@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
+ // to see if the element in the current row
for (EObject eObjectThatSatisfiesRequirement : list) {
if (eObjectInRow.equals(eObjectThatSatisfiesRequirement)) {
return true;
@@ -108,56 +104,15 @@ public class SatisfyMatrixCellManager extends AbstractCellManager {
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));
- }
- }
- }
+ Helper.deleteRelationshipInIntersection(domain, row, colUMLElement,
+ I_SysMLStereotype.REQUIREMENT_STEREOTYPE, I_SysMLStereotype.REQUIREMENT_SATISFIEDBY_ATT,
+ I_SysMLStereotype.SATISFY_STEREOTYPE);
}
} else if (Boolean.TRUE.equals(newValue)
|| (newValue instanceof Abstraction && ((Abstraction) newValue).eContainer() == null)) {
diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.requirements.feature/feature.xml b/features/papyrus-extra-features/org.eclipse.papyrus.requirements.feature/feature.xml
index df7b47541cc..a1fbd19b7fd 100644
--- a/features/papyrus-extra-features/org.eclipse.papyrus.requirements.feature/feature.xml
+++ b/features/papyrus-extra-features/org.eclipse.papyrus.requirements.feature/feature.xml
@@ -212,4 +212,10 @@ http://www.eclipse.org/legal/epl-v10.html
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.eclipse.papyrus.requirements.sysml.matrix.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
diff --git a/releng/extra/pom.xml b/releng/extra/pom.xml
index 56714da8f5e..c10911eb44e 100644
--- a/releng/extra/pom.xml
+++ b/releng/extra/pom.xml
@@ -185,6 +185,7 @@
<module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.commands</module>
<module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.handlers</module>
<module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.traceability.ui</module>
+ <module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.common</module>
<module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.matrix.satisfiedBy.config</module>
<module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.sysml.verification</module>
<module>../../extraplugins/requirements/org.eclipse.papyrus.requirements.metrics.library</module>

Back to the top