Skip to content

Commit 76a6af0

Browse files
committed
Fix multiple action listeners being attatched to the same action
1 parent 7d1576f commit 76a6af0

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/main/java/org/scijava/ui/swing/script/EditorPane.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,6 @@ private JMenuItem getMenuItem(final String label, final String actionID, final b
288288
final Action action = getActionMap().get(actionID);
289289
final JMenuItem jmi = new JMenuItem(action);
290290
jmi.setAccelerator(getPaneActions().getAccelerator(actionID));
291-
jmi.addActionListener(e -> {
292-
if (editingAction && isLocked()) {
293-
UIManager.getLookAndFeel().provideErrorFeedback(this);
294-
} else try {
295-
action.actionPerformed(e);
296-
} catch (final Exception | Error ex) {
297-
log.debug(ex);
298-
}
299-
});
300291
jmi.setText(label);
301292
return jmi;
302293
}

src/main/java/org/scijava/ui/swing/script/TextEditor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,7 @@ private JMenu applyThemeMenu() {
17891789
return;
17901790
}
17911791
final JRadioButtonMenuItem item = new JRadioButtonMenuItem(k);
1792+
item.setActionCommand(v); // needed for #updateThemeControls()
17921793
themeRadioGroup.add(item);
17931794
item.addActionListener(e -> {
17941795
try {

0 commit comments

Comments
 (0)