Search in sources :

Example 1 with KeyEventMatcher

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

the class KeyEventMatcherTest method testMap.

@Test
public void testMap() {
    Map<IKeyEventMatcher, String> map = new HashMap<IKeyEventMatcher, String>();
    map.put(new KeyEventMatcher(12, 101), "ABC");
    Assert.assertEquals(1, map.size());
    map.remove(new KeyEventMatcher(12, 101));
    Assert.assertEquals(0, map.size());
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) IKeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.IKeyEventMatcher) IKeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.IKeyEventMatcher) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 2 with KeyEventMatcher

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

the class KeyEventMatcherTest method testNotEqual.

@Test
public void testNotEqual() {
    IKeyEventMatcher matcher = new KeyEventMatcher(12, 101);
    Assert.assertFalse(matcher.equals(new KeyEventMatcher(11, 101)));
    Assert.assertFalse(matcher.equals(new KeyEventMatcher(12, 102)));
    Assert.assertFalse(matcher.equals(new KeyEventMatcher(11, 102)));
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) IKeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.IKeyEventMatcher) IKeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.IKeyEventMatcher) Test(org.junit.Test)

Example 3 with KeyEventMatcher

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

the class DefaultFilterRowConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    uiBindingRegistry.registerFirstSingleClickBinding(new FilterRowMouseEventMatcher(), new MouseEditAction());
    uiBindingRegistry.registerFirstSingleClickBinding(new ClearFilterIconMouseEventMatcher(this.cellPainter), new ClearFilterAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(this.showHideKeyConstant), new ToggleFilterRowAction());
}
Also used : ToggleFilterRowAction(org.eclipse.nebula.widgets.nattable.filterrow.action.ToggleFilterRowAction) KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) FilterRowMouseEventMatcher(org.eclipse.nebula.widgets.nattable.filterrow.event.FilterRowMouseEventMatcher) MouseEditAction(org.eclipse.nebula.widgets.nattable.edit.action.MouseEditAction) ClearFilterAction(org.eclipse.nebula.widgets.nattable.filterrow.action.ClearFilterAction) ClearFilterIconMouseEventMatcher(org.eclipse.nebula.widgets.nattable.filterrow.event.ClearFilterIconMouseEventMatcher)

Example 4 with KeyEventMatcher

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

the class DefaultFreezeGridBindings method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1 | SWT.MOD2, 'f'), new FreezeGridAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1 | SWT.MOD2, 'u'), new UnFreezeGridAction());
}
Also used : KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) FreezeGridAction(org.eclipse.nebula.widgets.nattable.freeze.action.FreezeGridAction) UnFreezeGridAction(org.eclipse.nebula.widgets.nattable.freeze.action.UnFreezeGridAction) UnFreezeGridAction(org.eclipse.nebula.widgets.nattable.freeze.action.UnFreezeGridAction)

Example 5 with KeyEventMatcher

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

the class DefaultColumnGroupHeaderLayerConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    // Column Group Header is a part of the Group Header.
    // Register the 'column group header matcher' first so that it gets
    // picked up before the more general 'column header matcher'.
    uiBindingRegistry.registerMouseDragMode(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.NONE), new AggregateDragMode(new CellDragMode(), new ColumnGroupHeaderReorderDragMode(this.columnGroupModel)));
    uiBindingRegistry.registerMouseDragMode(MouseEventMatcher.columnHeaderLeftClick(SWT.NONE), new AggregateDragMode(new CellDragMode(), new ColumnHeaderReorderDragMode(this.columnGroupModel)));
    // added NoOpMouseAction on single click because of Bug 428901
    if (!this.enableColumnGroupSelectionHandling) {
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.NONE), new NoOpMouseAction());
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.MOD1), new NoOpMouseAction());
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.MOD2), new NoOpMouseAction());
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.MOD1 | SWT.MOD2), new NoOpMouseAction());
    } else {
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.NONE), new ViewportSelectColumnGroupAction(false, false));
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.MOD1), new ViewportSelectColumnGroupAction(false, true));
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.MOD2), new ViewportSelectColumnGroupAction(true, false));
        uiBindingRegistry.registerFirstSingleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.MOD1 | SWT.MOD2), new ViewportSelectColumnGroupAction(true, true));
    }
    uiBindingRegistry.registerDoubleClickBinding(MouseEventMatcher.columnGroupHeaderLeftClick(SWT.NONE), new ColumnGroupExpandCollapseAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 'g'), new CreateColumnGroupAction());
    uiBindingRegistry.registerKeyBinding(new KeyEventMatcher(SWT.MOD1, 'u'), new UngroupColumnsAction());
}
Also used : ViewportSelectColumnGroupAction(org.eclipse.nebula.widgets.nattable.group.action.ViewportSelectColumnGroupAction) ColumnGroupHeaderReorderDragMode(org.eclipse.nebula.widgets.nattable.group.action.ColumnGroupHeaderReorderDragMode) KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) AggregateDragMode(org.eclipse.nebula.widgets.nattable.ui.action.AggregateDragMode) ColumnHeaderReorderDragMode(org.eclipse.nebula.widgets.nattable.group.action.ColumnHeaderReorderDragMode) CellDragMode(org.eclipse.nebula.widgets.nattable.ui.action.CellDragMode) UngroupColumnsAction(org.eclipse.nebula.widgets.nattable.group.action.UngroupColumnsAction) ColumnGroupExpandCollapseAction(org.eclipse.nebula.widgets.nattable.group.action.ColumnGroupExpandCollapseAction) NoOpMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.NoOpMouseAction) CreateColumnGroupAction(org.eclipse.nebula.widgets.nattable.group.action.CreateColumnGroupAction)

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