This works when i press Ctrl-P @ActionReference(path = "Shortcuts", name = "C-P")
This doesn't work when i press Command-P in mac, i only see menu is blinking @ActionReference(path = "Shortcuts", name = "M-P") Thanks >From Peter ________________________________ From: Peter Cheung <[email protected]> Sent: Monday, February 26, 2018 12:52 AM To: [email protected] Cc: [email protected] Subject: ActionReference has bug ? Hi All Why "Menu/Navigate" will put my action into another Navigate menu rather than the existing one? Why i press the shortcut key, i only see the menu is blinking but the actionPerformed() hasn't run? Thanks package hk.quantr.netbeansquickoutline; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; import org.openide.awt.ActionRegistration; import org.openide.util.NbBundle.Messages; @ActionID( category = "Navigate", id = "hk.quantr.netbeansquickoutline.SomeAction" ) @ActionRegistration( displayName = "#CTL_SomeAction" ) @ActionReferences({ @ActionReference(path = "Menu/Navigate", position = 9999) , @ActionReference(path = "Shortcuts", name = "M-P") }) @Messages("CTL_SomeAction=MyMenu") public final class SomeAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, "hey"); } }
