Java: Swing: Components: Menus: JMenuItem
JMenuItem has almost nothing interesting:
FocusListener to repaint on focus lost (but not on focus gained) ???
re-implemented action code
need set/isArmed (delegate to the model)
setEnabled (needlessly) sets armed to false (that is also done in the button model)
alwaysOnTop is sometimes true (-> painting)
accelerator property ("just a property")
MenuElement implementations
interesting/weird: processMenuDragMouseEvent - RELEASED will only be fired when the event before was a DRAGGED.
menuSelectionChanged maps to setArmed
NOT: mapping standard mouse/key events to MenuSelectionManager. This must be done by the MenuItemUI.
NOT: mapping ButtonModel changes back to menu selected path changes (This is also not done by BasicMenuItemUI, thus these changes do not influence the menu selection; for example doClick() changes the state (and repaints by an AbstractButton listener) and fires the usual events, but does not set or clear the menu selection path, so the menu will stay open if it was before; nor does it play a sound).
JCheckBoxMenuItem/JRadioButtonMenuItem have even less (check box has set/getState, radio button not?). One can argue that these extra classes are superfluous.
(C) 2001-2009 Christian Kaufhold (swing@chka.de)