Search in sources :

Example 1 with HierarchicalTreeColumnReorderDragMode

use of org.eclipse.nebula.widgets.nattable.hierarchical.action.HierarchicalTreeColumnReorderDragMode in project nebula.widgets.nattable by eclipse.

the class DefaultHierarchicalTreeLayerConfiguration method configureUiBindings.

@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
    TreeExpandCollapseAction treeExpandCollapseAction = new TreeExpandCollapseAction();
    CellPainterMouseEventMatcher treeImagePainterMouseEventMatcher = new CellPainterMouseEventMatcher(GridRegion.BODY, MouseEventMatcher.LEFT_BUTTON, TreeImagePainter.class);
    uiBindingRegistry.registerFirstSingleClickBinding(treeImagePainterMouseEventMatcher, treeExpandCollapseAction);
    // Obscure any mouse down bindings for this image painter
    uiBindingRegistry.registerFirstMouseDownBinding(treeImagePainterMouseEventMatcher, new NoOpMouseAction());
    // configure a specialized ColumnReorderDragMode
    uiBindingRegistry.registerMouseDragMode(MouseEventMatcher.columnHeaderLeftClick(SWT.NONE), new AggregateDragMode(new CellDragMode(), new HierarchicalTreeColumnReorderDragMode(this.treeLayer)));
}
Also used : AggregateDragMode(org.eclipse.nebula.widgets.nattable.ui.action.AggregateDragMode) CellDragMode(org.eclipse.nebula.widgets.nattable.ui.action.CellDragMode) TreeExpandCollapseAction(org.eclipse.nebula.widgets.nattable.tree.action.TreeExpandCollapseAction) CellPainterMouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.CellPainterMouseEventMatcher) HierarchicalTreeColumnReorderDragMode(org.eclipse.nebula.widgets.nattable.hierarchical.action.HierarchicalTreeColumnReorderDragMode) NoOpMouseAction(org.eclipse.nebula.widgets.nattable.ui.action.NoOpMouseAction)

Aggregations

HierarchicalTreeColumnReorderDragMode (org.eclipse.nebula.widgets.nattable.hierarchical.action.HierarchicalTreeColumnReorderDragMode)1 TreeExpandCollapseAction (org.eclipse.nebula.widgets.nattable.tree.action.TreeExpandCollapseAction)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 CellPainterMouseEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.CellPainterMouseEventMatcher)1