Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Dynamic popup menu and objectContribution
Dynamic popup menu and objectContribution [message #323602] Thu, 03 January 2008 15:31 Go to next message
Eclipse UserFriend
Originally posted by: juraj.bak.gmail.com

Hi,

I try to create dynamic popup menu on select treeitem in standard Package
explorer or Navigator view. Extension org.eclipse.ui.popupMenus does not
offer possibility to create menu dynamically, but it gives information
about selected items. Extension org.eclipse.ui.menus gives the possibility
to create such menu, but there's no information about selected objects (if
any).

I created one static menu item via org.eclipse.ui.menus and use its
information about selected item while creating dynamic items for
org.eclipse.ui.popupMenus. But it's nasty solution.

Is there a nicer way how to create dynamic popup menu for tree?

Thanks for every advice.

Juraj
Re: Dynamic popup menu and objectContribution [message #323783 is a reply to message #323602] Tue, 08 January 2008 15:50 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Executing a command from a popup menu will provide the popup menu
selection. When using org.eclipse.ui.menus to fill a popup menu, you
can use "visibleWhen/with variable=activeMenuSelection" to determine
which which of your menu contributions should be included.

Or is your question about using a dynamic element, but the selection is
not provided to your compound contribution item?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:Deactivating/superseding another plugin
Next Topic:NullPointerException when I install my update site
Goto Forum:
  


Current Time: Sat Dec 21 14:40:26 GMT 2024

Powered by FUDForum. Page generated in 0.03019 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top