diff options
Diffstat (limited to 'libjava/classpath/javax/swing/JPopupMenu.java')
-rw-r--r-- | libjava/classpath/javax/swing/JPopupMenu.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libjava/classpath/javax/swing/JPopupMenu.java b/libjava/classpath/javax/swing/JPopupMenu.java index a54bd77..c7890ea 100644 --- a/libjava/classpath/javax/swing/JPopupMenu.java +++ b/libjava/classpath/javax/swing/JPopupMenu.java @@ -52,6 +52,7 @@ import java.util.EventListener; import javax.accessibility.Accessible; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleRole; +import javax.swing.event.MenuKeyListener; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; import javax.swing.plaf.PopupMenuUI; @@ -410,6 +411,36 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement } /** + * Adds a MenuKeyListener to the popup. + * + * @param l - the listener to add. + */ + public void addMenuKeyListener(MenuKeyListener l) + { + listenerList.add(MenuKeyListener.class, l); + } + + /** + * Removes a MenuKeyListener from the popup. + * + * @param l - the listener to remove. + */ + public void removeMenuKeyListener(MenuKeyListener l) + { + listenerList.remove(MenuKeyListener.class, l); + } + + /** + * Returns array of getMenuKeyListeners that are listening to JPopupMenu. + * + * @return array of getMenuKeyListeners that are listening to JPopupMenu + */ + public MenuKeyListener[] getMenuKeyListeners() + { + return ((MenuKeyListener[]) listenerList.getListeners(MenuKeyListener.class)); + } + + /** * Adds popupMenuListener to listen for PopupMenuEvents fired * by the JPopupMenu * |