use of net.sourceforge.nattable.ui.action.IMouseAction in project translationstudio8 by heartsome.
the class ButtonCellPainter method run.
/**
* Respond to mouse click. Simulate button press.
*/
public void run(final NatTable natTable, MouseEvent event) {
NatEventData eventData = (NatEventData) event.data;
columnPosClicked = eventData.getColumnPosition();
rowPosClicked = eventData.getRowPosition();
recentlyClicked = true;
new Timer().schedule(getButtonFlashTimerTask(natTable), buttonFlashTime);
natTable.fireLayerEvent(new CellVisualChangeEvent(natTable, columnPosClicked, rowPosClicked));
for (IMouseAction listener : clickLiseners) {
listener.run(natTable, event);
}
}
use of net.sourceforge.nattable.ui.action.IMouseAction 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));
}
}
use of net.sourceforge.nattable.ui.action.IMouseAction in project translationstudio8 by heartsome.
the class ConfigurableModeEventHandler method mouseMove.
@Override
public synchronized void mouseMove(MouseEvent event) {
IMouseAction mouseMoveAction = uiBindingRegistry.getMouseMoveAction(event);
if (mouseMoveAction != null) {
event.data = NatEventData.createInstanceFromEvent(event);
mouseMoveAction.run(natTable, event);
}
}
use of net.sourceforge.nattable.ui.action.IMouseAction in project translationstudio8 by heartsome.
the class DefaultSelectionBindings method configureBodyMouseClickBindings.
// *** Mouse bindings ***
protected void configureBodyMouseClickBindings(UiBindingRegistry uiBindingRegistry) {
IMouseAction action = new SelectCellAction();
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.NONE), action);
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.SHIFT), action);
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.CTRL), action);
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.SHIFT | SWT.CONTROL), action);
}
use of net.sourceforge.nattable.ui.action.IMouseAction in project translationstudio8 by heartsome.
the class RowOnlySelectionBindings method configureBodyMouseClickBindings.
@Override
protected void configureBodyMouseClickBindings(UiBindingRegistry uiBindingRegistry) {
IMouseAction action = new SelectRowAction();
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.NONE), action);
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.SHIFT), action);
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.CTRL), action);
uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.bodyLeftClick(SWT.SHIFT | SWT.CONTROL), action);
}
Aggregations