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());
}
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)));
}
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());
}
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());
}
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());
}
Aggregations