Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml2
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/UnsetCellValueHandler.java34
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/EditorFactory.java12
4 files changed, 33 insertions, 17 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
index 4fa46aa1aab..9575b94ffd7 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
@@ -76,7 +76,7 @@ Require-Bundle: org.eclipse.gmf.runtime.emf.type.core;bundle-version="[1.9.0,2.0
javax.inject;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
-Bundle-Version: 6.5.0.qualifier
+Bundle-Version: 6.5.100.qualifier
Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.infra.nattable.Activator
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml
index 2dca78fa70c..760ad5fd80c 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.nattable</artifactId>
- <version>6.5.0-SNAPSHOT</version>
+ <version>6.5.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/UnsetCellValueHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/UnsetCellValueHandler.java
index 2a449e03872..de0ba95dcf5 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/UnsetCellValueHandler.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/UnsetCellValueHandler.java
@@ -1,3 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) 2015, 2016, 2020 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - bug 559968
+ *****************************************************************************/
+
package org.eclipse.papyrus.infra.nattable.handler;
import org.eclipse.core.commands.ExecutionEvent;
@@ -11,18 +26,17 @@ import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
import org.eclipse.nebula.widgets.nattable.ui.NatEventData;
import org.eclipse.papyrus.infra.nattable.manager.cell.CellManagerFactory;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.infra.nattable.utils.TableSelectionWrapper;
/**
- *
+ *
* This handler is used to unset cell values, that is to say, than we reset the cell value to the default value
*
*/
public class UnsetCellValueHandler extends AbstractTableHandler {
/**
- *
+ *
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*
* @param event
@@ -44,8 +58,8 @@ public class UnsetCellValueHandler extends AbstractTableHandler {
SelectionLayer layer = manager.getBodyLayerStack().getSelectionLayer();
int colIndex = layer.getColumnIndexByPosition(colPosition);
int rowIndex = layer.getRowIndexByPosition(rowposition);
- Object columnElement = AxisUtils.getRepresentedElement(manager.getColumnElement(colIndex));
- Object rowElement = AxisUtils.getRepresentedElement(manager.getRowElement(rowIndex));
+ Object columnElement = manager.getColumnElement(colIndex);
+ Object rowElement = manager.getRowElement(rowIndex);
Command command = CellManagerFactory.INSTANCE.getUnsetCellValueCommand(getContextEditingDomain(), columnElement, rowElement, manager);
if (command != null && command.canExecute()) {
@@ -75,21 +89,21 @@ public class UnsetCellValueHandler extends AbstractTableHandler {
}
/**
- *
+ *
* @param evaluationContext
- *
+ *
* @return
* <code>true</code> if the mouse is in the Body of the table and if cells are selected
*/
protected boolean canUnsetCell(Object evaluationContext) {
boolean enabled = false;
TableSelectionWrapper wrapper = getTableSelectionWrapper();
- if (wrapper!=null && !wrapper.getSelectedCells().isEmpty()) {
+ if (wrapper != null && !wrapper.getSelectedCells().isEmpty()) {
enabled = true;
NatEventData data = getNatEventData();
- if (data != null) { //null with JUnit tests
+ if (data != null) { // null with JUnit tests
LabelStack labels = data.getRegionLabels();
- if(labels!=null){ //seem null with JUnit tests
+ if (labels != null) { // seem null with JUnit tests
enabled = labels.hasLabel(GridRegion.BODY) && labels.getLabels().size() == 1;
}
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/EditorFactory.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/EditorFactory.java
index 967c32f863f..e25bfcb8e50 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/EditorFactory.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/EditorFactory.java
@@ -1,14 +1,16 @@
/*****************************************************************************
* Copyright (c) 2018 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
+ * are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.util;
@@ -18,7 +20,7 @@ import org.eclipse.swt.widgets.Composite;
/**
* The editor factory to create value editor.
- *
+ *
* @since 3.3
*/
@FunctionalInterface

Back to the top