Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHide/Show MenuItems in a Menu
https://www.eclipse.org/forums/index.php/mv/msg/167243/530265/#msg_530265
Neither Menu provides something like menu.setVisible (int index_of_menu_item) nor MenuItem provides anything like menuitem.setVisible (boolean)
Thus, for menus whose contents change depending on the context, the code for creating menu is repeated over and over again (during each pop-up of the menu) which involves adding listeners for menu selection too.
This is quite inefficient I guess.
Simple hide/show mechanism will enable create-once-use-forever approach which will be very efficient.
]]>Missing name Mising name2010-04-29T07:16:25-00:00Re: Hide/Show MenuItems in a Menu
https://www.eclipse.org/forums/index.php/mv/msg/167243/530487/#msg_530487
back in the correct place involves creating the MenuItem with the
correct index.
In the eclipse Platform we use MenuManager and ContributionItems that
manage the logic of when to dispose and when to recreate MenuItems.
They come from org.eclipse.jface.