Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to make dynamic object contributions at runtime
How to make dynamic object contributions at runtime [message #323818] Wed, 09 January 2008 09:11 Go to next message
Eclipse UserFriend
Originally posted by: tas.frangoullides.barclaysglobal.com

Hi,

Could anyone please give me a quick pointer on how to dynamically
contribute actions to an object menu at runtime.

I am able to contribute a menu called "Connect" by using the
objectContribution elemnt of the org.eclipse.ui.popupMenus extension
point. However I cannot work out how to hook into this menu at runtime and
contribute actions. I cannot statically declare actions using the <action>
element becuase the avialalbe actions are only known at runtime.

Thanks for your help,

Tas
Re: How to make dynamic object contributions at runtime [message #323823 is a reply to message #323818] Wed, 09 January 2008 10:20 Go to previous messageGo to next message
Eclipse UserFriend
If you own the view you can create the actions at runtime directly into
the menu manaqer.

If you are just trying to make a dynamic object contribution, you can't
do that with the action framework.

With menu contributions/commands you can use org.eclipse.ui.menus to add
a dynamic element to a popup menu, which implements
CompoundContributionItem.

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
Re: How to make dynamic object contributions at runtime [message #323826 is a reply to message #323823] Wed, 09 January 2008 10:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tas.frangoullides.barclaysglobal.com

Paul,

Thanks for helping out.

I don't own the view. I want this menu anytime an object of a particular
class is right clicked. I've had a look at the org.eclipse.ui.menus
extension point but I can't see where to hook in the dynamic menu
creation. Where is a CompundContributionItem hooked in?

Thanks again,
Tas
Re: How to make dynamic object contributions at runtime [message #323835 is a reply to message #323826] Wed, 09 January 2008 12:27 Go to previous messageGo to next message
Eclipse UserFriend
Check out the example matrix off of
http://wiki.eclipse.org/Menu_Contributions especially the 2 for problems
view.

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
Re: How to make dynamic object contributions at runtime [message #323854 is a reply to message #323835] Thu, 10 January 2008 09:01 Go to previous message
Eclipse UserFriend
Originally posted by: tas.frangoullides.barclaysglobal.com

I'm with you now. I was using Eclipse 3.2 and couldn't see the elements.
Thanks very much for your help.

Tas
Previous Topic:ResourceBundle located in another Plugin without Classes
Next Topic:Avoid flooding the SWT UI Thread. alternative to jface.deferred
Goto Forum:
  


Current Time: Wed Jul 16 14:39:31 EDT 2025

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

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

Back to the top