Currently MenuBar only accepts Menu objects which limits the scope of what people may insert into a menu bar. For example nowadays, it's not uncomon to find search boxes, buttons and other controls (information display, scrolling text, combos, graph of audio signant, etc.) in a menu bar (ie: NetBeans 7 just happen to have a search box on the right side of its menu bar).
Now the Menu class does not allow to embed a node inside a menu, while the NodeMenuItem class seems to allow such thing.
It would probably be better to expand the scope of MenuBar to accept MenuItem instances instead of only Menu.
Would probably need to replace getMenus() by getItems() in the MenuBar API too.
A follow up suggestion would be to allow hitting at the placement of menus&menuitems in the bar (ie: on some platforms some secondary menus and items may be aligned on the right side of the bar instead of just flowing from the left.
Now the Menu class does not allow to embed a node inside a menu, while the NodeMenuItem class seems to allow such thing.
It would probably be better to expand the scope of MenuBar to accept MenuItem instances instead of only Menu.
Would probably need to replace getMenus() by getItems() in the MenuBar API too.
A follow up suggestion would be to allow hitting at the placement of menus&menuitems in the bar (ie: on some platforms some secondary menus and items may be aligned on the right side of the bar instead of just flowing from the left.