-package org.simantics.browsing.ui.nattable;\r
-\r
-import org.eclipse.nebula.widgets.nattable.NatTable;\r
-import org.eclipse.nebula.widgets.nattable.layer.LabelStack;\r
-import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;\r
-import org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher;\r
-import org.eclipse.swt.events.MouseEvent;\r
-\r
-public class SelectedCellEditorMatcher extends CellEditorMouseEventMatcher{\r
-\r
- public SelectedCellEditorMatcher( String regionLabel) {\r
- super(regionLabel);\r
- }\r
- \r
- ILayerCell previous;\r
- int previousTime = 0;\r
- @Override\r
- public boolean matches(NatTable natTable, MouseEvent event, LabelStack regionLabels) {\r
- if (super.matches(natTable, event, regionLabels)) {\r
- int px = natTable.getColumnPositionByX(event.x);\r
- int py = natTable.getRowPositionByY(event.y);\r
- ILayerCell cell = natTable.getCellByPosition(px,py);\r
- int time = event.time;\r
- if (previous != null &&\r
- cell.getColumnIndex() == previous.getColumnIndex() &&\r
- cell.getRowIndex() == previous.getRowIndex() &&\r
- time - previousTime > event.display.getDoubleClickTime())\r
- return true;\r
- previous = cell;\r
- previousTime = time;\r
- }\r
- return false;\r
- }\r
- \r
- \r
- \r
- \r
-\r
-}\r
+package org.simantics.browsing.ui.nattable;
+
+import org.eclipse.nebula.widgets.nattable.NatTable;
+import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
+import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
+import org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher;
+import org.eclipse.swt.events.MouseEvent;
+
+public class SelectedCellEditorMatcher extends CellEditorMouseEventMatcher{
+
+ public SelectedCellEditorMatcher( String regionLabel) {
+ super(regionLabel);
+ }
+
+ ILayerCell previous;
+ int previousTime = 0;
+ @Override
+ public boolean matches(NatTable natTable, MouseEvent event, LabelStack regionLabels) {
+ if (super.matches(natTable, event, regionLabels)) {
+ int px = natTable.getColumnPositionByX(event.x);
+ int py = natTable.getRowPositionByY(event.y);
+ ILayerCell cell = natTable.getCellByPosition(px,py);
+ int time = event.time;
+ if (previous != null &&
+ cell.getColumnIndex() == previous.getColumnIndex() &&
+ cell.getRowIndex() == previous.getRowIndex() &&
+ time - previousTime > event.display.getDoubleClickTime())
+ return true;
+ previous = cell;
+ previousTime = time;
+ }
+ return false;
+ }
+
+
+
+
+
+}