From 874496317ffabe882faaccc95c8d5a4bde6974bc Mon Sep 17 00:00:00 2001 From: argius Date: Mon, 2 Dec 2013 22:15:27 +0900 Subject: [PATCH] Fix #32187: anyActionPerformed -> getActionMap().get(cmd).actionPerformed... --- src/net/argius/stew/ui/window/DatabaseInfoTree.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/net/argius/stew/ui/window/DatabaseInfoTree.java b/src/net/argius/stew/ui/window/DatabaseInfoTree.java index 7189470..8d2f8a1 100644 --- a/src/net/argius/stew/ui/window/DatabaseInfoTree.java +++ b/src/net/argius/stew/ui/window/DatabaseInfoTree.java @@ -77,15 +77,10 @@ final class DatabaseInfoTree extends JTree implements AnyActionListener, TextSea public void anyActionPerformed(AnyActionEvent ev) { log.atEnter("anyActionPerformed", ev); if (ev.isAnyOf(copy)) { - Object src = ev.getSource(); - if (src != null && src instanceof JMenuItem) { - KeyStroke k = ((JMenuItem)src).getAccelerator(); - if (k != null) { - ActionListener action = getActionForKeyStroke(k); - if (action != null) { - action.actionPerformed(new ActionEvent(this, 1001, "")); - } - } + final String cmd = ev.getActionCommand(); + Action action = getActionMap().get(cmd); + if (action != null) { + action.actionPerformed(new ActionEvent(this, 1001, cmd)); } } else if (ev.isAnyOf(copySimpleName)) { copySimpleName(); -- 2.11.0