Skip to content

Commit

Permalink
Fixes #123 - [UI Binding] IDragMode should be cancellable
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
  • Loading branch information
fipro78 committed Oct 10, 2024
1 parent 67b8c2e commit 243f00c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import org.eclipse.nebula.widgets.nattable.ui.mode.ModeSupport;
import org.eclipse.nebula.widgets.nattable.ui.mode.MouseModeEventHandler;
import org.eclipse.nebula.widgets.nattable.ui.util.MouseEventHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.MouseEvent;

public class DragModeEventHandler extends AbstractModeEventHandler {
Expand Down Expand Up @@ -92,4 +94,11 @@ public void focusLost(FocusEvent event) {
// initial mouseDown event
mouseUp(this.mouseDownEvent);
}

@Override
public void keyPressed(KeyEvent event) {
if (event.keyCode == SWT.ESC) {
mouseUp(this.mouseDownEvent);
}
}
}

0 comments on commit 243f00c

Please sign in to comment.