Search in sources :

Example 1 with FillHandleEventMatcher

use of org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleEventMatcher in project nebula.widgets.nattable by eclipse.

the class FillHandleConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    FillHandleEventMatcher matcher = new FillHandleEventMatcher(this.painter);
    // Mouse move
    // Show fill handle cursor
    uiBindingRegistry.registerFirstMouseMoveBinding(matcher, new FillHandleCursorAction());
    uiBindingRegistry.registerMouseMoveBinding(new MouseEventMatcher(), new ClearCursorAction());
    // Mouse drag
    // trigger the handle drag operations
    uiBindingRegistry.registerFirstMouseDragMode(matcher, new FillHandleDragMode(this.selectionLayer, this.clipboard));
    // Mouse click
    // ensure no selection is triggered on mouse down on the handle
    uiBindingRegistry.registerFirstMouseDownBinding(matcher, new NoOpMouseAction());
}
Also used : FillHandleDragMode(org.eclipse.nebula.widgets.nattable.fillhandle.action.FillHandleDragMode) MouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher) FillHandleCursorAction(org.eclipse.nebula.widgets.nattable.fillhandle.action.FillHandleCursorAction) ClearCursorAction(org.eclipse.nebula.widgets.nattable.ui.action.ClearCursorAction) NoOpMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.NoOpMouseAction) FillHandleEventMatcher(org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleEventMatcher)

Example 2 with FillHandleEventMatcher

use of org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleEventMatcher in project nebula.widgets.nattable by eclipse.

the class DefaultFormulaConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    // ui binding for deleting a cell value on pressing DEL
    uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.DEL), new DeleteSelectionAction());
    // ui binding to perform a paste action on pressing CTRL+V
    uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.MOD1, 'v'), new PasteDataAction());
    // ui binding to perform paste or selection movement on ENTER
    uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.CR), new PasteOrMoveSelectionAction(this.clipboard));
    // ui binding to clear the InternalCellClipboard
    uiBindingRegistry.registerFirstKeyBinding(new KeyEventMatcher(SWT.NONE, SWT.ESC), new ClearClipboardAction(this.clipboard));
    // Mouse drag
    // trigger the handle drag operations
    // Note: we ensure a FillHandleLayerPainter is set in configureLayer
    uiBindingRegistry.registerFirstMouseDragMode(new FillHandleEventMatcher((FillHandleLayerPainter) this.selectionLayer.getLayerPainter()), new FormulaFillHandleDragMode(this.selectionLayer, this.clipboard, this.dataProvider));
}
Also used : FillHandleLayerPainter(org.eclipse.nebula.widgets.nattable.fillhandle.FillHandleLayerPainter) FormulaFillHandleDragMode(org.eclipse.nebula.widgets.nattable.formula.action.FormulaFillHandleDragMode) ClearClipboardAction(org.eclipse.nebula.widgets.nattable.copy.action.ClearClipboardAction) KeyEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher) DeleteSelectionAction(org.eclipse.nebula.widgets.nattable.edit.action.DeleteSelectionAction) PasteDataAction(org.eclipse.nebula.widgets.nattable.copy.action.PasteDataAction) PasteOrMoveSelectionAction(org.eclipse.nebula.widgets.nattable.copy.action.PasteOrMoveSelectionAction) FillHandleEventMatcher(org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleEventMatcher)

Aggregations

FillHandleEventMatcher (org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleEventMatcher)2 ClearClipboardAction (org.eclipse.nebula.widgets.nattable.copy.action.ClearClipboardAction)1 PasteDataAction (org.eclipse.nebula.widgets.nattable.copy.action.PasteDataAction)1 PasteOrMoveSelectionAction (org.eclipse.nebula.widgets.nattable.copy.action.PasteOrMoveSelectionAction)1 DeleteSelectionAction (org.eclipse.nebula.widgets.nattable.edit.action.DeleteSelectionAction)1 FillHandleLayerPainter (org.eclipse.nebula.widgets.nattable.fillhandle.FillHandleLayerPainter)1 FillHandleCursorAction (org.eclipse.nebula.widgets.nattable.fillhandle.action.FillHandleCursorAction)1 FillHandleDragMode (org.eclipse.nebula.widgets.nattable.fillhandle.action.FillHandleDragMode)1 FormulaFillHandleDragMode (org.eclipse.nebula.widgets.nattable.formula.action.FormulaFillHandleDragMode)1 ClearCursorAction (org.eclipse.nebula.widgets.nattable.ui.action.ClearCursorAction)1 NoOpMouseAction (org.eclipse.nebula.widgets.nattable.ui.action.NoOpMouseAction)1 KeyEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.KeyEventMatcher)1 MouseEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher)1