Search in sources :

Example 1 with IDragMode

use of net.sourceforge.nattable.ui.action.IDragMode in project translationstudio8 by heartsome.

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.SHIFT), dragMode);
    uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.CONTROL), dragMode);
    uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.bodyLeftClick(SWT.SHIFT | SWT.CONTROL), dragMode);
}
Also used : IDragMode(net.sourceforge.nattable.ui.action.IDragMode) RowSelectionDragMode(net.sourceforge.nattable.selection.action.RowSelectionDragMode)

Example 2 with IDragMode

use of net.sourceforge.nattable.ui.action.IDragMode in project translationstudio8 by heartsome.

the class ConfigurableModeEventHandler method mouseDown.

@Override
public void mouseDown(MouseEvent event) {
    IMouseAction mouseDownAction = uiBindingRegistry.getMouseDownAction(event);
    if (mouseDownAction != null) {
        event.data = NatEventData.createInstanceFromEvent(event);
        mouseDownAction.run(natTable, event);
    }
    IMouseAction singleClickAction = uiBindingRegistry.getSingleClickAction(event);
    IMouseAction doubleClickAction = uiBindingRegistry.getDoubleClickAction(event);
    IDragMode dragMode = uiBindingRegistry.getDragMode(event);
    if (singleClickAction != null || doubleClickAction != null || dragMode != null) {
        switchMode(new MouseModeEventHandler(getModeSupport(), natTable, event, singleClickAction, doubleClickAction, dragMode));
    }
}
Also used : IDragMode(net.sourceforge.nattable.ui.action.IDragMode) IMouseAction(net.sourceforge.nattable.ui.action.IMouseAction)

Aggregations

IDragMode (net.sourceforge.nattable.ui.action.IDragMode)2 RowSelectionDragMode (net.sourceforge.nattable.selection.action.RowSelectionDragMode)1 IMouseAction (net.sourceforge.nattable.ui.action.IMouseAction)1