Skip to content

Commit

Permalink
- fix copy field to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jpage4500 committed Jan 16, 2025
1 parent ffc8813 commit f0b31c7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,15 @@ private void handleCopyClipboardFieldCommand() {

List<Device> selectedDeviceList = getSelectedDevices(true);
if (selectedDeviceList.isEmpty()) return;
if (table.getSelectedColumn() < 0) return;
int selectedColumn = table.getSelectedColumn();
int modelCol = table.convertColumnIndexToModel(selectedColumn);
if (modelCol < 0) return;
log.trace("handleCopyClipboardFieldCommand: col:{}, devices:{}", modelCol, selectedDeviceList.size());

StringBuilder sb = new StringBuilder();
for (Device device : selectedDeviceList) {
if (!sb.isEmpty()) sb.append("\n");
String value = model.deviceValue(device, table.getSelectedColumn());
String value = model.deviceValue(device, modelCol);
sb.append(value != null ? value : "");
}
StringSelection stringSelection = new StringSelection(sb.toString());
Expand Down

0 comments on commit f0b31c7

Please sign in to comment.