use of org.eclipse.nebula.widgets.nattable.ui.action.IDragMode in project nebula.widgets.nattable by eclipse.
the class RowSelectionUIBindings method configureBodyMouseDragMode.
@Override
protected void configureBodyMouseDragMode(UiBindingRegistry uiBindingRegistry) {
IDragMode dragMode = new SingleRowSelectionDragMode();
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.NONE), dragMode);
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.SHIFT), dragMode);
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.MOD1), dragMode);
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.SHIFT | SWT.MOD1), dragMode);
}
use of org.eclipse.nebula.widgets.nattable.ui.action.IDragMode in project nebula.widgets.nattable by eclipse.
the class RowOnlySelectionBindings method configureBodyMouseDragMode.
@Override
protected void configureBodyMouseDragMode(UiBindingRegistry uiBindingRegistry) {
IDragMode dragMode = new RowSelectionDragMode();
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.NONE), dragMode);
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.MOD2), dragMode);
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.MOD1), dragMode);
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.MOD2 | SWT.MOD1), dragMode);
}
use of org.eclipse.nebula.widgets.nattable.ui.action.IDragMode in project nebula.widgets.nattable by eclipse.
the class ConfigurableModeEventHandler method mouseDown.
@Override
public void mouseDown(MouseEvent event) {
if (this.natTable.commitAndCloseActiveCellEditor()) {
IMouseAction mouseDownAction = getUiBindingRegistry().getMouseDownAction(event);
if (mouseDownAction != null) {
event.data = NatEventData.createInstanceFromEvent(event);
mouseDownAction.run(this.natTable, event);
}
IMouseAction singleClickAction = getUiBindingRegistry().getSingleClickAction(event);
IMouseAction doubleClickAction = getUiBindingRegistry().getDoubleClickAction(event);
IDragMode dragMode = getUiBindingRegistry().getDragMode(event);
if (singleClickAction != null || doubleClickAction != null || dragMode != null) {
switchMode(new MouseModeEventHandler(getModeSupport(), this.natTable, event, singleClickAction, doubleClickAction, dragMode));
}
}
}
Aggregations