Class MenuSelectionManager
MenuSelectionManager — present so migrated
code that names the type still compiles after the import swap, WARN-stubbed
throughout because SB-Emulators models no menu-selection machinery to manage.
Why a stub rather than JDK reuse. Its whole API traffics in
MenuElement, which SB-Emulators ports, so the JDK class could not accept a
ported element as an argument. Same forcing as MenuElement's own
port. The behaviour it would manage — a selected menu path driven by mouse
and key traversal — is Vaadin's own: SJMenuBar plus
MenuTreeBuilder rebuild the whole Vaadin menu tree from the emulator
hierarchy and the browser owns highlight and traversal from there (D_menu_tree).
What that leaves is more than a stub. The selected path itself is pure
bookkeeping, so setSelectedPath(MenuElement[]) really keeps it, really calls each element's
menuSelectionChanged, and really fires — the declined effect is the *highlight*,
one layer down in each element (R_decline_effect_only). Nothing inside SB-Emulators ever
calls it, so a migrator driving menus by hand is the only writer; the mouse and key
processing that would drive it on the desktop stays WARN-stubbed, since those events
never reach the server.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcomponentForPoint(Component source, Point sourcePoint) static MenuSelectionManagerMirrorsMenuSelectionManager.defaultManager()— one shared instance.protected voidJDK-faithful fan-out overlistenerList.booleanThe JDK's own walk, and it reaches less far here than there: aJMenuowns noJPopupMenu(D_menu_tree rebuilds the Vaadin tree instead), sogetSubElements()is empty and the walk stops at the root.voidvoidprocessMouseEvent(MouseEvent event) voidvoidsetSelectedPath(MenuElement[] path) Replaces the selected path, walking the JDK's body: keep the shared prefix, tell each dropped element it left the selection, tell each added one it joined, then fire.
-
Field Details
-
listenerList
-
changeEvent
-
-
Constructor Details
-
MenuSelectionManager
public MenuSelectionManager()
-
-
Method Details
-
defaultManager
MirrorsMenuSelectionManager.defaultManager()— one shared instance. -
setSelectedPath
Replaces the selected path, walking the JDK's body: keep the shared prefix, tell each dropped element it left the selection, tell each added one it joined, then fire.Pure bookkeeping and notification, so both land (R_decline_effect_only) even though nothing in SB-Emulators ever calls this: the browser owns menu highlight and traversal (
SJMenuBar+MenuTreeBuilderrebuild the Vaadin tree, D_menu_tree). What is declined is the *rendering* of a selection — which is each element's ownmenuSelectionChanged, called here and WARNing there.- Parameters:
path-nullis treated as an empty path, as in the JDK
-
getSelectedPath
-
clearSelectedPath
public void clearSelectedPath() -
addChangeListener
-
removeChangeListener
-
getChangeListeners
-
isComponentPartOfCurrentMenu
The JDK's own walk, and it reaches less far here than there: aJMenuowns noJPopupMenu(D_menu_tree rebuilds the Vaadin tree instead), sogetSubElements()is empty and the walk stops at the root. It widens on its own if that structural gap ever closes.- Returns:
- true if
cis the component of any element under the selected path's root
-
processMouseEvent
-
processKeyEvent
-
componentForPoint
-
fireStateChanged
protected void fireStateChanged()JDK-faithful fan-out overlistenerList. Nothing in SB-Emulators calls it (the selection never changes server-side), but a subclass that does gets the JDK's delivery.
-