Search in sources :

Example 1 with IDragMode

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);
}
Also used : IDragMode(org.eclipse.nebula.widgets.nattable.ui.action.IDragMode)

Example 2 with IDragMode

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);
}
Also used : IDragMode(org.eclipse.nebula.widgets.nattable.ui.action.IDragMode) RowSelectionDragMode(org.eclipse.nebula.widgets.nattable.selection.action.RowSelectionDragMode)

Example 3 with IDragMode

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));
        }
    }
}
Also used : IDragMode(org.eclipse.nebula.widgets.nattable.ui.action.IDragMode) IMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction)

Aggregations

IDragMode (org.eclipse.nebula.widgets.nattable.ui.action.IDragMode)3 RowSelectionDragMode (org.eclipse.nebula.widgets.nattable.selection.action.RowSelectionDragMode)1 IMouseAction (org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction)1