Search in sources :

Example 1 with IMouseAction

use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.

the class RowOnlySelectionBindings method configureBodyMouseClickBindings.

@Override
protected void configureBodyMouseClickBindings(UiBindingRegistry uiBindingRegistry) {
    IMouseAction action = new SelectRowAction();
    uiBindingRegistry.registerFirstMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.NONE), action);
    uiBindingRegistry.registerFirstMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.MOD2), action);
    uiBindingRegistry.registerFirstMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.MOD1), action);
    uiBindingRegistry.registerFirstMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.MOD2 | SWT.MOD1), action);
}
Also used : IMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction) SelectRowAction(org.eclipse.nebula.widgets.nattable.selection.action.SelectRowAction)

Example 2 with IMouseAction

use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.

the class ConfigurableModeEventHandler method mouseEnter.

@Override
public synchronized void mouseEnter(MouseEvent event) {
    if (event.x >= 0 && event.y >= 0) {
        IMouseAction mouseEnterAction = getUiBindingRegistry().getMouseEnterAction(event);
        if (mouseEnterAction != null) {
            event.data = NatEventData.createInstanceFromEvent(event);
            mouseEnterAction.run(this.natTable, event);
        } else {
            this.natTable.setCursor(null);
        }
    }
}
Also used : IMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction)

Example 3 with IMouseAction

use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.

the class ConfigurableModeEventHandler method mouseExit.

@Override
public synchronized void mouseExit(MouseEvent event) {
    IMouseAction mouseExitAction = getUiBindingRegistry().getMouseExitAction(event);
    if (mouseExitAction != null) {
        event.data = NatEventData.createInstanceFromEvent(event);
        mouseExitAction.run(this.natTable, event);
    } else {
        this.natTable.setCursor(null);
    }
}
Also used : IMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction)

Example 4 with IMouseAction

use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.

the class ConfigurableModeEventHandler method mouseHover.

@Override
public synchronized void mouseHover(MouseEvent event) {
    if (event.x >= 0 && event.y >= 0) {
        IMouseAction mouseHoverAction = getUiBindingRegistry().getMouseHoverAction(event);
        if (mouseHoverAction != null) {
            event.data = NatEventData.createInstanceFromEvent(event);
            mouseHoverAction.run(this.natTable, event);
        }
    }
}
Also used : IMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction)

Example 5 with IMouseAction

use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.

the class DefaultRowGroupHeaderLayerConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    final IMouseAction action = new SelectRowGroupsAction();
    uiBindingRegistry.registerSingleClickBinding(MouseEventMatcher.rowGroupHeaderLeftClick(SWT.NONE), action);
    uiBindingRegistry.registerSingleClickBinding(MouseEventMatcher.rowGroupHeaderLeftClick(SWT.MOD1), action);
    uiBindingRegistry.registerSingleClickBinding(MouseEventMatcher.rowGroupHeaderLeftClick(SWT.MOD2), action);
    uiBindingRegistry.registerDoubleClickBinding(MouseEventMatcher.rowGroupHeaderLeftClick(SWT.NONE), new RowGroupExpandCollapseAction());
}
Also used : RowGroupExpandCollapseAction(org.eclipse.nebula.widgets.nattable.group.action.RowGroupExpandCollapseAction) IMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction) SelectRowGroupsAction(org.eclipse.nebula.widgets.nattable.selection.action.SelectRowGroupsAction)

Aggregations

IMouseAction (org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction)9 Timer (java.util.Timer)1 RowGroupExpandCollapseAction (org.eclipse.nebula.widgets.nattable.group.action.RowGroupExpandCollapseAction)1 CellVisualChangeEvent (org.eclipse.nebula.widgets.nattable.layer.event.CellVisualChangeEvent)1 SelectCellAction (org.eclipse.nebula.widgets.nattable.selection.action.SelectCellAction)1 SelectRowAction (org.eclipse.nebula.widgets.nattable.selection.action.SelectRowAction)1 SelectRowGroupsAction (org.eclipse.nebula.widgets.nattable.selection.action.SelectRowGroupsAction)1 NatEventData (org.eclipse.nebula.widgets.nattable.ui.NatEventData)1 IDragMode (org.eclipse.nebula.widgets.nattable.ui.action.IDragMode)1