MenuSelectionManager (Java SE 15 & JDK 15) (original) (raw)


public class MenuSelectionManager extends Object

A MenuSelectionManager owns the selection in menu hierarchy.

Since:

1.2

Fields

Modifier and Type Field Description
protected ChangeEvent changeEvent Only one ChangeEvent is needed per button model instance since the event's only state is the source property.
protected EventListenerList listenerList The collection of registered listeners

Constructors

Constructor Description
MenuSelectionManager()
Modifier and Type Method Description
void addChangeListener​(ChangeListener l) Adds a ChangeListener to the button.
void clearSelectedPath() Tell the menu selection to close and unselect all the menu components.
Component componentForPoint​(Component source,Point sourcePoint) Returns the component in the currently selected path which contains sourcePoint.
static MenuSelectionManager defaultManager() Returns the default menu selection manager.
protected void fireStateChanged() Notifies all listeners that have registered interest for notification on this event type.
ChangeListener[] getChangeListeners() Returns an array of all the ChangeListeners added to this MenuSelectionManager with addChangeListener().
MenuElement[] getSelectedPath() Returns the path to the currently selected menu item
boolean isComponentPartOfCurrentMenu​(Component c) Return true if c is part of the currently used menu
void processKeyEvent​(KeyEvent e) When a MenuElement receives an event from a KeyListener, it should never process the event directly.
void processMouseEvent​(MouseEvent event) When a MenuElement receives an event from a MouseListener, it should never process the event directly.
void removeChangeListener​(ChangeListener l) Removes a ChangeListener from the button.
void setSelectedPath​(MenuElement[] path) Changes the selection in the menu hierarchy.

Methods declared in class java.lang.Object

[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)