diff --git a/plugins/org.jkiss.dbeaver.ui.editors.data/plugin.xml b/plugins/org.jkiss.dbeaver.ui.editors.data/plugin.xml
index 50593e0412b64a059868ea379fb79f64fe146d56..9eef1207d1d1acd55923eb32409975434cbd9be1 100644
--- a/plugins/org.jkiss.dbeaver.ui.editors.data/plugin.xml
+++ b/plugins/org.jkiss.dbeaver.ui.editors.data/plugin.xml
@@ -246,7 +246,9 @@
-
+
+
+
diff --git a/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java b/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java
index 222d1dd0084626b98ace518420d9a8fe1cc664c1..1745fc9771db22b0a271dc54606fbbe052d7d262 100644
--- a/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java
+++ b/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java
@@ -306,8 +306,20 @@ public class ResultSetHandlerMain extends AbstractHandler {
}
case CMD_COPY_COLUMN_NAMES: {
StringBuilder buffer = new StringBuilder();
+ String columnNames = event.getParameter("columns");
+
IResultSetSelection selection = rsv.getSelection();
List attrs = selection.isEmpty() ? rsv.getModel().getVisibleAttributes() : selection.getSelectedAttributes();
+ if (!CommonUtils.isEmpty(columnNames) && attrs.size() == 1) {
+ attrs = new ArrayList<>();
+ for (String colName : columnNames.split(",")) {
+ for (DBDAttributeBinding attr : rsv.getModel().getVisibleAttributes()) {
+ if (colName.equals(attr.getName())) {
+ attrs.add(attr);
+ }
+ }
+ }
+ }
ResultSetCopySettings settings = new ResultSetCopySettings();
if (attrs.size() > 1) {
diff --git a/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java b/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
index 527dfb4c183f611695372d8998d6379331f94f98..d433f6d6d6c7e9909adc20fec5afae5cfc58bc2e 100644
--- a/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
+++ b/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
@@ -2196,7 +2196,15 @@ public class ResultSetViewer extends Viewer
if (attr == null && row != null) {
manager.add(ActionUtils.makeCommandContribution(site, ResultSetHandlerMain.CMD_COPY_ROW_NAMES));
} else if (attr != null && row == null) {
- manager.add(ActionUtils.makeCommandContribution(site, ResultSetHandlerMain.CMD_COPY_COLUMN_NAMES));
+ manager.add(ActionUtils.makeCommandContribution(
+ site,
+ ResultSetHandlerMain.CMD_COPY_COLUMN_NAMES,
+ SWT.PUSH,
+ null,
+ null,
+ null,
+ false,
+ Collections.singletonMap("columns", attr.getName())));
} else {
manager.add(ActionUtils.makeCommandContribution(site, IWorkbenchCommandConstants.EDIT_COPY));
}
diff --git a/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java b/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
index f16b388967ba634585182759e7f1f4a2f49afeaf..8ce52c41039d42228d27c5b3b751c19da16cb285 100644
--- a/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
+++ b/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
@@ -784,6 +784,10 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
if (attr != null && row == null) {
final List