From 4fc5861db267d5cf90ebc1b51e4405008979d6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 30 Sep 2023 12:25:08 +0200 Subject: [PATCH] ABCExplorer - copy whole row --- .../flash/gui/abc/ABCExplorerDialog.java | 14 +++++++++++++- .../gui/locales/abc/ABCExplorerDialog.properties | 1 + .../locales/abc/ABCExplorerDialog_cs.properties | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCExplorerDialog.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCExplorerDialog.java index ce5794db2..67ef1c80f 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCExplorerDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCExplorerDialog.java @@ -333,6 +333,11 @@ public class ABCExplorerDialog extends AppDialog { return null; } Object selection = tree.getLastSelectedPathComponent(); + if (selection != null) { + JMenuItem copyRowMenuItem = new JMenuItem(translate("copy.row"), View.getIcon("copy16")); + copyRowMenuItem.addActionListener(this::copyRowActionPerformed); + menu.add(copyRowMenuItem); + } if (selection instanceof ValueWithIndex) { ValueWithIndex vwi = (ValueWithIndex) selection; @@ -384,6 +389,13 @@ public class ABCExplorerDialog extends AppDialog { return menu; } + private void copyRowActionPerformed(ActionEvent e) { + Object selection = getCurrentTree().getLastSelectedPathComponent(); + if (selection != null) { + copyToClipboard(selection.toString()); + } + } + private void copyTitleActionPerformed(ActionEvent e) { Object selection = getCurrentTree().getLastSelectedPathComponent(); if (selection instanceof SimpleValue) { @@ -589,7 +601,7 @@ public class ABCExplorerDialog extends AppDialog { } @Override - public String toString() { + public String toString() { return title + (!value.isEmpty() ? ": " + value : ""); } diff --git a/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog.properties index f5e0fa300..bd3ff7ec3 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog.properties @@ -18,6 +18,7 @@ abc = ABC: abc.info = %index% of %count%, v%major%.%minor%, %size%, Frame %frame% abc.info.standalone = v%major%.%minor%, %size% +copy.row = Copy row to clipboard copy.typeid = Copy typeId to clipboard copy.title = Copy title to clipboard copy.value = Copy value to clipboard diff --git a/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog_cs.properties index b268a2e57..9c15f678c 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/abc/ABCExplorerDialog_cs.properties @@ -18,6 +18,7 @@ abc = ABC: abc.info = %index% z %count%, v%major%.%minor%, %size%, Sn\u00edmek %frame% abc.info.standalone = v%major%.%minor%, %size% +copy.row = Kop\u00edrovat \u0159\u00e1dek do schr\u00e1nky copy.typeid = Kop\u00edrovat typeId do schr\u00e1nky copy.title = Kop\u00edrovat titulek do schr\u00e1nky copy.value = Kop\u00edrovat hodnotu do schr\u00e1nky