Bug 519406: [Table] Richtext editor must be available for Requirement
description field
- Add a cell editor configuration for Requirement::text
Change-Id: Idf6427be9cf3bbacb41a17b5303101892523df4e
Signed-off-by: Thanh Liem PHAN <thanhliem.phan@all4tec.net>
diff --git a/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/util/SysMLQualifiedName.java b/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/util/SysMLQualifiedName.java
index 7a36d26..bff5f51 100644
--- a/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/util/SysMLQualifiedName.java
+++ b/core/org.eclipse.papyrus.sysml14/src/org/eclipse/papyrus/sysml14/util/SysMLQualifiedName.java
@@ -26,4 +26,9 @@
*/
@Deprecated
public static final String STEREOTYPE_FLOWPORT_DIRECTION = "SysML::DeprecatedElements::FlowPort::direction"; //$NON-NLS-1$
+
+ /**
+ * QN of SysML::Requirement::Requirement::text.
+ */
+ public static final String SYSML_REQUIREMENTS_REQUIREMENT_TEXT_QN = "SysML::Requirements::Requirement::text"; //$NON-NLS-1$
}
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.allocation/META-INF/MANIFEST.MF b/table/org.eclipse.papyrus.sysml14.nattable.allocation/META-INF/MANIFEST.MF
index 51bce0e..4839d23 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.allocation/META-INF/MANIFEST.MF
+++ b/table/org.eclipse.papyrus.sysml14.nattable.allocation/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@
Require-Bundle: org.eclipse.ui;bundle-version="[3.107.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.11.1,4.0.0)",
org.eclipse.uml2.uml;bundle-version="[5.1.0,6.0.0)",
- org.eclipse.gmf.runtime.diagram.core;bundle-version="[1.7.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.core;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.infra.nattable.common;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.nattable;bundle-version="[4.0.0,5.0.0)",
org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.nattable.model;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.sysml14;bundle-version="0.11.0",
org.eclipse.papyrus.sysml14.service.types;bundle-version="0.11.0",
org.eclipse.papyrus.sysml14.nattable.common;bundle-version="0.11.0"
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.requirement/META-INF/MANIFEST.MF b/table/org.eclipse.papyrus.sysml14.nattable.requirement/META-INF/MANIFEST.MF
index 8ae1540..7d328c8 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.requirement/META-INF/MANIFEST.MF
+++ b/table/org.eclipse.papyrus.sysml14.nattable.requirement/META-INF/MANIFEST.MF
@@ -3,11 +3,14 @@
org.eclipse.core.runtime;bundle-version="[3.11.1,4.0.0)",
org.eclipse.uml2.uml;bundle-version="[5.1.0,6.0.0)",
org.eclipse.gmf.runtime.diagram.core;bundle-version="[1.7.0,2.0.0)",
+ org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.infra.emf.nattable;bundle-version="3.0.0",
org.eclipse.papyrus.infra.nattable.common;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.nattable;bundle-version="[4.0.0,5.0.0)",
- org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.nattable.model;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.uml.nattable;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.uml.nattable.richtext;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.sysml14;bundle-version="0.11.0",
org.eclipse.papyrus.sysml14.service.types;bundle-version="0.11.0"
Bundle-Vendor: %Bundle-Vendor
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.requirement/plugin.xml b/table/org.eclipse.papyrus.sysml14.nattable.requirement/plugin.xml
index 84813b4..8022055 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.requirement/plugin.xml
+++ b/table/org.eclipse.papyrus.sysml14.nattable.requirement/plugin.xml
@@ -91,5 +91,11 @@
icon="icons/table_SysML_Requirement_new.png">
</image>
</extension>
-
+ <extension
+ point="org.eclipse.papyrus.infra.nattable.celleditor.configuration">
+ <cellAxisConfiguration
+ class="org.eclipse.papyrus.sysml14.nattable.requirement.config.RequirementTextStringCellEditorConfiguration"
+ order="149"><!--This configuration has priority over the RichTextCellEditorConfiguration-->
+ </cellAxisConfiguration>
+ </extension>
</plugin>
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.requirement/src/org/eclipse/papyrus/sysml14/nattable/requirement/config/RequirementTextStringCellEditorConfiguration.java b/table/org.eclipse.papyrus.sysml14.nattable.requirement/src/org/eclipse/papyrus/sysml14/nattable/requirement/config/RequirementTextStringCellEditorConfiguration.java
new file mode 100644
index 0000000..fe13daa
--- /dev/null
+++ b/table/org.eclipse.papyrus.sysml14.nattable.requirement/src/org/eclipse/papyrus/sysml14/nattable/requirement/config/RequirementTextStringCellEditorConfiguration.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * 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:
+ * Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 519406
+ *****************************************************************************/
+
+package org.eclipse.papyrus.sysml14.nattable.requirement.config;
+
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.sysml14.util.SysMLQualifiedName;
+import org.eclipse.papyrus.uml.nattable.richtext.celleditor.config.RichTextCellEditorConfiguration;
+import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
+
+/**
+ * Cell Editor configuration for the Text field of Requirement table.
+ *
+ * @since 0.11.0
+ */
+public class RequirementTextStringCellEditorConfiguration extends RichTextCellEditorConfiguration {
+
+ /** The ID of this cell editor. */
+ private static final String ID = "org.eclipse.papyrus.sysml14.nattable.requirement.config.RequirementTextStringCellEditorConfiguration";//$NON-NLS-1$
+
+ /** Requirement Text column ID in SysML Requirements table. */
+ private static final String SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID = UMLTableUtils.PROPERTY_OF_STEREOTYPE_PREFIX + SysMLQualifiedName.SYSML_REQUIREMENTS_REQUIREMENT_TEXT_QN;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.nattable.configuration.IPapyrusNatTableConfiguration#getConfigurationId()
+ */
+ @Override
+ public String getConfigurationId() {
+ return ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.nattable.configuration.IPapyrusNatTableConfiguration#getConfigurationDescription()
+ */
+ @Override
+ public String getConfigurationDescription() {
+ return "This configuration provides a Rich Text Editor for the Text field of Requirement table";
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration#handles(org.eclipse.papyrus.infra.nattable.model.nattable.Table, java.lang.Object)
+ */
+ @Override
+ public boolean handles(final Table table, final Object axisElement) {
+
+ // Handle only the Requirement::text column in Requirement table
+ return (SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID.equals(AxisUtils.getPropertyId(axisElement)));
+ }
+}