use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.
the class RowSelectionUIBindings method configureMoveUpBindings.
@Override
protected void configureMoveUpBindings(UiBindingRegistry uiBindingRegistry, IKeyAction action) {
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ARROW_UP), action);
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.SHIFT, SWT.ARROW_UP), action);
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.ARROW_UP), new MoveToFirstRowAction());
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.SHIFT | SWT.MOD1, SWT.ARROW_UP), new MoveToFirstRowAction());
}
use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.
the class KeyEventMatcherTest method testEquals.
@Test
public void testEquals() {
IKeyEventMatcher matcher1 = new KeyEventMatcher(12, 101);
IKeyEventMatcher matcher2 = new KeyEventMatcher(12, 101);
Assert.assertEquals(matcher1, matcher2);
}
use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.
the class DefaultEditBindings method configureUiBindings.
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
// configure the space key to activate a cell editor via keyboard
// this is especially useful for changing the value for a checkbox
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, 32), new KeyEditAction());
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.F2), new KeyEditAction());
uiBindingRegistry.registerKeyBinding(new LetterOrDigitKeyEventMatcher(), new KeyEditAction());
uiBindingRegistry.registerKeyBinding(new LetterOrDigitKeyEventMatcher(SWT.MOD2), new KeyEditAction());
uiBindingRegistry.registerSingleClickBinding(new CellEditorMouseEventMatcher(GridRegion.BODY), new MouseEditAction());
uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.BODY, MouseEventMatcher.LEFT_BUTTON, CheckBoxPainter.class), new MouseEditAction());
}
use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.
the class DefaultDataChangeConfiguration method configureUiBindings.
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 's'), new IKeyAction() {
@Override
public void run(NatTable natTable, KeyEvent event) {
natTable.doCommand(new SaveDataChangesCommand());
}
});
uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 'd'), new IKeyAction() {
@Override
public void run(NatTable natTable, KeyEvent event) {
natTable.doCommand(new DiscardDataChangesCommand());
}
});
}
use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.
the class DefaultFormulaConfiguration method configureUiBindings.
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
// ui binding for deleting a cell value on pressing DEL
uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.DEL), new DeleteSelectionAction());
// ui binding to perform a paste action on pressing CTRL+V
uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.MOD1, 'v'), new PasteDataAction());
// ui binding to perform paste or selection movement on ENTER
uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.CR), new PasteOrMoveSelectionAction(this.clipboard));
// ui binding to clear the InternalCellClipboard
uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ESC), new ClearClipboardAction(this.clipboard));
// Mouse drag
// trigger the handle drag operations
// Note: we ensure a FillHandleLayerPainter is set in configureLayer
uiBindingRegistry.registerFirstMouseDragMode(new FillHandleEventMatcher((FillHandleLayerPainter) this.selectionLayer.getLayerPainter()), new FormulaFillHandleDragMode(this.selectionLayer, this.clipboard, this.dataProvider));
}
Aggregations