Search in sources :

Example 21 with KeyEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionBindings method configureMoveRightBindings.

// *** Arrow keys selection bindings ***
protected void configureMoveRightBindings(UiBindingRegistry uiBindingRegistry, IKeyAction action) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ARROW_RIGHT), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.ARROW_RIGHT), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.ARROW_RIGHT), new MoveToLastColumnAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.ARROW_RIGHT), new MoveToLastColumnAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.TAB), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.TAB), action);
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) MoveToLastColumnAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveToLastColumnAction)

Example 22 with KeyEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionBindings method configureEndButtonBindings.

// *** pg. up, pg. down, home, end keys selection bindings ***
protected void configureEndButtonBindings(UiBindingRegistry uiBindingRegistry, IKeyAction action) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.END), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.END), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.END), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.END), action);
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher)

Example 23 with KeyEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionBindings method configureMoveDownBindings.

protected void configureMoveDownBindings(UiBindingRegistry uiBindingRegistry, IKeyAction action) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ARROW_DOWN), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.ARROW_DOWN), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.ARROW_DOWN), new MoveToLastRowAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.ARROW_DOWN), new MoveToLastRowAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.CR), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.CR), action);
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) MoveToLastRowAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveToLastRowAction)

Example 24 with KeyEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionBindings method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    // Move up
    configureMoveUpBindings(uiBindingRegistry, new MoveSelectionAction(MoveDirectionEnum.UP));
    // Move down
    configureMoveDownBindings(uiBindingRegistry, new MoveSelectionAction(MoveDirectionEnum.DOWN));
    // Move left
    configureMoveLeftBindings(uiBindingRegistry, new MoveSelectionAction(MoveDirectionEnum.LEFT));
    // Move right
    configureMoveRightBindings(uiBindingRegistry, new MoveSelectionAction(MoveDirectionEnum.RIGHT));
    // Page Up
    configurePageUpButtonBindings(uiBindingRegistry, new PageUpAction());
    // Page down
    configurePageDownButtonBindings(uiBindingRegistry, new PageDownAction());
    // Home
    configureHomeButtonBindings(uiBindingRegistry, new MoveToHomeAction());
    // End
    configureEndButtonBindings(uiBindingRegistry, new MoveToEndAction());
    // Select all
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 'a'), new SelectAllAction());
    // Copy
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 'c'), new CopyDataAction());
    // Mouse bindings - select Cell
    configureBodyMouseClickBindings(uiBindingRegistry);
    // Mouse bindings - select columns
    configureColumnHeaderMouseClickBindings(uiBindingRegistry);
    // Mouse bindings - select rows
    configureRowHeaderMouseClickBindings(uiBindingRegistry);
    // Mouse bindings - Drag
    configureBodyMouseDragMode(uiBindingRegistry);
}
Also used : CopyDataAction(org.eclipse.nebula.widgets.nattable.copy.action.CopyDataAction) MoveToHomeAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveToHomeAction) PageDownAction(org.eclipse.nebula.widgets.nattable.selection.action.PageDownAction) KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) SelectAllAction(org.eclipse.nebula.widgets.nattable.selection.action.SelectAllAction) MoveSelectionAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction) PageUpAction(org.eclipse.nebula.widgets.nattable.selection.action.PageUpAction) MoveToEndAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveToEndAction)

Aggregations

KeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher)24 MoveSelectionAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction)3 IKeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.IKeyEventMatcher)3 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)2 MouseEditAction (org.eclipse.nebula.widgets.nattable.edit.action.MouseEditAction)2 ColumnGroupExpandCollapseAction (org.eclipse.nebula.widgets.nattable.group.action.ColumnGroupExpandCollapseAction)2 ColumnGroupHeaderReorderDragMode (org.eclipse.nebula.widgets.nattable.group.action.ColumnGroupHeaderReorderDragMode)2 ColumnHeaderReorderDragMode (org.eclipse.nebula.widgets.nattable.group.action.ColumnHeaderReorderDragMode)2 CreateColumnGroupAction (org.eclipse.nebula.widgets.nattable.group.action.CreateColumnGroupAction)2 UngroupColumnsAction (org.eclipse.nebula.widgets.nattable.group.action.UngroupColumnsAction)2 MoveToFirstRowAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveToFirstRowAction)2 AggregateDragMode (org.eclipse.nebula.widgets.nattable.ui.action.AggregateDragMode)2 CellDragMode (org.eclipse.nebula.widgets.nattable.ui.action.CellDragMode)2 VisualRefreshCommand (org.eclipse.nebula.widgets.nattable.command.VisualRefreshCommand)1 AbstractRegistryConfiguration (org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration)1 ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)1 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)1 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)1