From d05b66b40e91f14745b9157dd9cbc41bc3d74162 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Wed, 29 May 2024 21:01:00 +0900 Subject: [PATCH] fix: drop action listener in BaseMainWindowMenu Signed-off-by: Hiroshi Miura --- src/org/omegat/gui/main/BaseMainWindowMenu.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/org/omegat/gui/main/BaseMainWindowMenu.java b/src/org/omegat/gui/main/BaseMainWindowMenu.java index ee0f1277dc..619e989c3b 100644 --- a/src/org/omegat/gui/main/BaseMainWindowMenu.java +++ b/src/org/omegat/gui/main/BaseMainWindowMenu.java @@ -15,7 +15,7 @@ * 2014 Aaron Madlon-Kay * 2015 Didier Briel, Yu Tang * 2017 Didier Briel - * 2023 Hiroshi Miura + * 2023-2024 Hiroshi Miura * Home page: https://www.omegat.org/ * Support center: https://omegat.org/support * @@ -40,7 +40,6 @@ import static org.omegat.gui.main.MainWindowMenuHandler.findInProjectReuseLastWindow; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.io.File; import java.lang.reflect.Field; import java.util.EnumMap; @@ -113,7 +112,7 @@ * /src/org/omegat/gui/main/MainMenuShortcuts.mac.properties with the proper * shortcuts if set. */ -public abstract class BaseMainWindowMenu implements ActionListener, MenuListener, IMainMenu { +public abstract class BaseMainWindowMenu implements MenuListener, IMainMenu { /** menu bar instance */ protected final JMenuBar mainMenu = new JMenuBar(); @@ -652,14 +651,6 @@ public void onApplicationShutdown() { }); } - @Override - public void actionPerformed(ActionEvent evt) { - // Get item name from actionCommand. - String action = evt.getActionCommand(); - Log.logInfoRB("LOG_MENU_CLICK", action); - invokeAction(action, evt.getModifiers()); - } - /** * Code for dispatching events from components to event handlers. * @@ -736,7 +727,6 @@ protected JCheckBoxMenuItem createCheckboxMenuItem(Action action) { protected JCheckBoxMenuItem createCheckboxMenuItem(final String titleKey) { JCheckBoxMenuItem result = new JCheckBoxMenuItem(); Mnemonics.setLocalizedText(result, OStrings.getString(titleKey)); - result.addActionListener(this); return result; } @@ -760,7 +750,6 @@ protected JRadioButtonMenuItem createRadioButtonMenuItem(String titleKey, Button JRadioButtonMenuItem result = new JRadioButtonMenuItem(); Mnemonics.setLocalizedText(result, OStrings.getString(titleKey)); buttonGroup.add(result); - result.addActionListener(this); return result; }