From cb53607dddc6c5375af9886a050c455e9f99e821 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sat, 25 May 2024 15:10:20 +0900 Subject: [PATCH] feat: MainWindowMenu deprecate old menu creation methods Signed-off-by: Hiroshi Miura --- src/org/omegat/gui/main/BaseMainWindowMenu.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/omegat/gui/main/BaseMainWindowMenu.java b/src/org/omegat/gui/main/BaseMainWindowMenu.java index a3d2d999a8..c64ccea6ce 100644 --- a/src/org/omegat/gui/main/BaseMainWindowMenu.java +++ b/src/org/omegat/gui/main/BaseMainWindowMenu.java @@ -131,7 +131,7 @@ public BaseMainWindowMenu(IMainWindow mainWindow) { */ void initComponents() { createComponents(); - setActionCommands(); + // setActionCommands(); constructMenu(); createMenuBar(); PropertiesShortcuts.getMainMenuShortcuts().bindKeyStrokes(mainMenu); @@ -737,6 +737,7 @@ protected JCheckBoxMenuItem createCheckboxMenuItemFromAction(String commandKey) * title name key in resource bundle * @return menu item instance */ + @Deprecated protected JCheckBoxMenuItem createCheckboxMenuItem(final String titleKey) { JCheckBoxMenuItem result = new JCheckBoxMenuItem(); Mnemonics.setLocalizedText(result, OStrings.getString(titleKey)); @@ -763,6 +764,7 @@ protected JRadioButtonMenuItem createRadioButtonMenuItemFromAction(String comman * title name key in resource bundle * @return menu item instance */ + @Deprecated protected JRadioButtonMenuItem createRadioButtonMenuItem(final String titleKey, ButtonGroup buttonGroup) { JRadioButtonMenuItem result = new JRadioButtonMenuItem(); Mnemonics.setLocalizedText(result, OStrings.getString(titleKey)); @@ -775,6 +777,7 @@ protected JRadioButtonMenuItem createRadioButtonMenuItem(final String titleKey, * Set 'actionCommand' for all menu items. TODO: change to key from resource * bundle values */ + @Deprecated protected void setActionCommands() { try { for (Field f : StaticUtils.getAllModelFields(this.getClass())) {