diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java index 61f44a5d91b501dcde96b940bdc0956f69e3a1c8..ec84f3aa0488e4a06c5d56bd09fa73e4ef055714 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java @@ -4311,7 +4311,7 @@ public abstract class LightGrid extends Canvas { private void addDragAndDropSupport() { - final int operations = DND.DROP_MOVE;//DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT; + final int operations = DND.DROP_MOVE | DND.DROP_COPY;// | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT; final DragSource source = new DragSource(this, operations); source.setTransfer(GridColumnTransfer.INSTANCE, TextTransfer.getInstance()); diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/panel/grouping/GroupingResultsDecorator.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/panel/grouping/GroupingResultsDecorator.java index ce086655ca8c42d03652c264aeafed33ae858bab..b7613e2c113461bd3bff987e04754177f93a707d 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/panel/grouping/GroupingResultsDecorator.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/panel/grouping/GroupingResultsDecorator.java @@ -16,6 +16,7 @@ */ package org.jkiss.dbeaver.ui.controls.resultset.panel.grouping; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swt.dnd.*; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.model.DBPEvaluationContext; @@ -61,7 +62,7 @@ public class GroupingResultsDecorator implements IResultSetDecorator { if (oldDropTarget instanceof DropTarget) { ((DropTarget) oldDropTarget).dispose(); } - DropTarget dropTarget = new DropTarget(presentation.getControl(), DND.DROP_MOVE); + DropTarget dropTarget = new DropTarget(presentation.getControl(), DND.DROP_MOVE | DND.DROP_COPY); dropTarget.setTransfer(LightGrid.GridColumnTransfer.INSTANCE, TextTransfer.getInstance()); dropTarget.addDropListener(new DropTargetAdapter() { @Override @@ -87,7 +88,7 @@ public class GroupingResultsDecorator implements IResultSetDecorator { @Override public void drop(DropTargetEvent event) { handleDragEvent(event); - if (event.detail == DND.DROP_MOVE) { + if (event.detail == DND.DROP_MOVE || event.detail == DND.DROP_COPY) { dropColumns(event); } } @@ -101,7 +102,9 @@ public class GroupingResultsDecorator implements IResultSetDecorator { if (!isDropSupported(event)) { event.detail = DND.DROP_NONE; } else { - event.detail = DND.DROP_MOVE; + if (event.detail == DND.DROP_NONE) { + event.detail = DND.DROP_MOVE; + } } event.feedback = DND.FEEDBACK_SELECT; } @@ -127,6 +130,13 @@ public class GroupingResultsDecorator implements IResultSetDecorator { if (!attributeBindings.isEmpty()) { container.addGroupingAttributes(attributeBindings); } + if (event.detail == DND.DROP_COPY) { + GroupingConfigDialog dialog = new GroupingConfigDialog(container.getResultSetController().getControl().getShell(), container); + if (dialog.open() != IDialogConstants.OK_ID) { + container.clearGrouping(); + return; + } + } try { container.rebuildGrouping(); } catch (DBException e) {