Search in sources :

Example 1 with MoveSelectionAction

use of org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionBindings method configureMoveUpBindings.

protected void configureMoveUpBindings(UiBindingRegistry uiBindingRegistry, IKeyAction action) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ARROW_UP), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.ARROW_UP), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.ARROW_UP), new MoveToFirstRowAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.ARROW_UP), new MoveToFirstRowAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.CR), new MoveSelectionAction(MoveDirectionEnum.UP, false, false));
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.CR), action);
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) MoveToFirstRowAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveToFirstRowAction) MoveSelectionAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction)

Example 2 with MoveSelectionAction

use of org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionBindings method configureMoveLeftBindings.

protected void configureMoveLeftBindings(UiBindingRegistry uiBindingRegistry, IKeyAction action) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ARROW_LEFT), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.ARROW_LEFT), action);
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, SWT.ARROW_LEFT), new MoveToFirstColumnAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.ARROW_LEFT), new MoveToFirstColumnAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2, SWT.TAB), new MoveSelectionAction(MoveDirectionEnum.LEFT, false, false));
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD2 | SWT.MOD1, SWT.TAB), action);
}
Also used : MoveToFirstColumnAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveToFirstColumnAction) KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) MoveSelectionAction(org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction)

Example 3 with MoveSelectionAction

use of org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction 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

MoveSelectionAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveSelectionAction)3 KeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher)3 CopyDataAction (org.eclipse.nebula.widgets.nattable.copy.action.CopyDataAction)1 MoveToEndAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveToEndAction)1 MoveToFirstColumnAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveToFirstColumnAction)1 MoveToFirstRowAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveToFirstRowAction)1 MoveToHomeAction (org.eclipse.nebula.widgets.nattable.selection.action.MoveToHomeAction)1 PageDownAction (org.eclipse.nebula.widgets.nattable.selection.action.PageDownAction)1 PageUpAction (org.eclipse.nebula.widgets.nattable.selection.action.PageUpAction)1 SelectAllAction (org.eclipse.nebula.widgets.nattable.selection.action.SelectAllAction)1