Search in sources :

Example 1 with ViewportSelectColumnGroupAction

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

ColumnGroupExpandCollapseAction (org.eclipse.nebula.widgets.nattable.group.action.ColumnGroupExpandCollapseAction)1 ColumnGroupHeaderReorderDragMode (org.eclipse.nebula.widgets.nattable.group.action.ColumnGroupHeaderReorderDragMode)1 ColumnHeaderReorderDragMode (org.eclipse.nebula.widgets.nattable.group.action.ColumnHeaderReorderDragMode)1 CreateColumnGroupAction (org.eclipse.nebula.widgets.nattable.group.action.CreateColumnGroupAction)1 UngroupColumnsAction (org.eclipse.nebula.widgets.nattable.group.action.UngroupColumnsAction)1 ViewportSelectColumnGroupAction (org.eclipse.nebula.widgets.nattable.group.action.ViewportSelectColumnGroupAction)1 AggregateDragMode (org.eclipse.nebula.widgets.nattable.ui.action.AggregateDragMode)1 CellDragMode (org.eclipse.nebula.widgets.nattable.ui.action.CellDragMode)1 NoOpMouseAction (org.eclipse.nebula.widgets.nattable.ui.action.NoOpMouseAction)1 KeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher)1