Apache OpenOffice (AOO) Bugzilla – Issue 96641
[RFE] support css.frame.PopupMenuController for root PopupMenus in MenuBars
Last modified: 2013-01-29 21:40:00 UTC
Currently, css.frame.PopupMenuControllers are not supported for *root* PopupMenus (== a PopupMenu that is activated when a MenuBar item is selected). There may be several scenarios where an extensions developer wants to fill his own root menu at runtime (and this will be more easy and give him more customization than just adding a new menu in the Addons.xcu and then disabling/removing items at runtime). There is an API way of achieving something similar: The css.awt.MenuBar is accessible as a property of the UIElement (not null when it is a MenuBar, of course) returned by XLayoutManager.getElement(). But this way implies accessing OOo menu bar, what in general is dangerous; and it is much more work than a PopupMenuController: one has to access the MenuBar via the LayoutManager, create a new MenuBar item, and add the root PopupMenu to the MenuBar. This PopupMenu is transient, as the LayoutManager destroys and recreates the MenuBar under certain circumstances, so one has to listen to frame actions and recreate the MenuBar item added... In conclusion, a css.frame.PopupMenuController is easier and safer. This feature should be available for both add-on root PopupMenu and Office MenuBar merging.