Search in sources :

Example 1 with KeyEditAction

use of org.eclipse.nebula.widgets.nattable.edit.action.KeyEditAction 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());
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) LetterOrDigitKeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.LetterOrDigitKeyEventMatcher) KeyEditAction(org.eclipse.nebula.widgets.nattable.edit.action.KeyEditAction) CheckBoxPainter(org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter) LetterOrDigitKeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.LetterOrDigitKeyEventMatcher) MouseEditAction(org.eclipse.nebula.widgets.nattable.edit.action.MouseEditAction) CellPainterMouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.CellPainterMouseEventMatcher) CellEditorMouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher)

Aggregations

KeyEditAction (org.eclipse.nebula.widgets.nattable.edit.action.KeyEditAction)1 MouseEditAction (org.eclipse.nebula.widgets.nattable.edit.action.MouseEditAction)1 CheckBoxPainter (org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter)1 CellEditorMouseEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher)1 CellPainterMouseEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.CellPainterMouseEventMatcher)1 KeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher)1 LetterOrDigitKeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.LetterOrDigitKeyEventMatcher)1