1 package org.simantics.browsing.ui.nattable;
3 import org.eclipse.nebula.widgets.nattable.NatTable;
4 import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
5 import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
6 import org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher;
7 import org.eclipse.swt.events.MouseEvent;
9 public class SelectedCellEditorMatcher extends CellEditorMouseEventMatcher{
11 public SelectedCellEditorMatcher( String regionLabel) {
18 public boolean matches(NatTable natTable, MouseEvent event, LabelStack regionLabels) {
19 if (super.matches(natTable, event, regionLabels)) {
20 int px = natTable.getColumnPositionByX(event.x);
21 int py = natTable.getRowPositionByY(event.y);
22 ILayerCell cell = natTable.getCellByPosition(px,py);
23 int time = event.time;
24 if (previous != null &&
25 cell.getColumnIndex() == previous.getColumnIndex() &&
26 cell.getRowIndex() == previous.getRowIndex() &&
27 time - previousTime > event.display.getDoubleClickTime())