Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2015-12-15 06:38:49 +0000
committerGerrit Code Review @ Eclipse.org2016-01-12 10:36:01 +0000
commitb03213ac35f6c0f3bb9702558d3d3c58c2e39ef8 (patch)
tree4588f2ba99b0cb63c29da65abfb4809cbf1398ee /plugins/infra
parentd66e1e7a7ea0b40e92e0cd8b229c838c4f3352fa (diff)
downloadorg.eclipse.papyrus-b03213ac35f6c0f3bb9702558d3d3c58c2e39ef8.tar.gz
org.eclipse.papyrus-b03213ac35f6c0f3bb9702558d3d3c58c2e39ef8.tar.xz
org.eclipse.papyrus-b03213ac35f6c0f3bb9702558d3d3c58c2e39ef8.zip
Bug 484029: [Table] Delete action doesn't work on cell selection
containing cell with N/A https://bugs.eclipse.org/bugs/show_bug.cgi?id=484029 The 'Delete' action that must unset values didn't work on column/row/corner selection. The grid region selection have no importance for this action. Change-Id: Ib8a4904449b984872fe855baf154ac12e282db77 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
Diffstat (limited to 'plugins/infra')
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/handler/UnsetCellValueHandler.java22
1 files changed, 4 insertions, 18 deletions
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 66a9b6e8c52..ba7135f426b 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,14 +1,11 @@
package org.eclipse.papyrus.infra.nattable.handler;
+
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate;
-import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
-import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
-import org.eclipse.nebula.widgets.nattable.ui.NatEventData;
-import org.eclipse.papyrus.infra.nattable.handler.AbstractTableHandler;
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;
@@ -79,21 +76,10 @@ 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
+ * <code>true</code> if cells are selected (any selected region must be managed)
*/
protected boolean canUnsetCell(Object evaluationContext) {
- boolean enabled = false;
- TableSelectionWrapper wrapper = getTableSelectionWrapper(evaluationContext);
- if (!wrapper.getSelectedCells().isEmpty()) {
- enabled = true;
- NatEventData data = getNatEventData();
- if (data != null) { //null with JUnit tests
- LabelStack labels = data.getRegionLabels();
- if(labels!=null){ //seem null with JUnit tests
- enabled = labels.hasLabel(GridRegion.BODY) && labels.getLabels().size() == 1;
- }
- }
- }
- return enabled;
+ final TableSelectionWrapper wrapper = getTableSelectionWrapper(evaluationContext);
+ return null != wrapper ? !wrapper.getSelectedCells().isEmpty() : false;
}
}

Back to the top