use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.
the class ButtonCellPainter method run.
/**
* Respond to mouse click. Simulate button press.
*/
@Override
public void run(final NatTable natTable, MouseEvent event) {
NatEventData eventData = (NatEventData) event.data;
this.columnPosClicked = eventData.getColumnPosition();
this.rowPosClicked = eventData.getRowPosition();
this.recentlyClicked = true;
new Timer().schedule(getButtonFlashTimerTask(natTable), this.buttonFlashTime);
natTable.fireLayerEvent(new CellVisualChangeEvent(natTable, this.columnPosClicked, this.rowPosClicked));
for (IMouseAction listener : this.clickLiseners) {
listener.run(natTable, event);
}
}
use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.
the class DefaultSelectionBindings method configureBodyMouseClickBindings.
// *** Mouse bindings ***
protected void configureBodyMouseClickBindings(UiBindingRegistry uiBindingRegistry) {
IMouseAction action = new SelectCellAction();
uiBindingRegistry.registerMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.NONE), action);
uiBindingRegistry.registerMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.MOD2), action);
uiBindingRegistry.registerMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.MOD1), action);
uiBindingRegistry.registerMouseDownBinding(MouseEventMatcher.bodyLeftClick(SWT.MOD2 | SWT.MOD1), action);
}
use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction in project nebula.widgets.nattable by eclipse.
the class ConfigurableModeEventHandler method mouseMove.
@Override
public synchronized void mouseMove(MouseEvent event) {
if (event.x >= 0 && event.y >= 0) {
IMouseAction mouseMoveAction = getUiBindingRegistry().getMouseMoveAction(event);
if (mouseMoveAction != null) {
event.data = NatEventData.createInstanceFromEvent(event);
mouseMoveAction.run(this.natTable, event);
} else {
this.natTable.setCursor(null);
}
}
}
use of org.eclipse.nebula.widgets.nattable.ui.action.IMouseAction 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