Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding IWorkbenchWindowActionDelegate action in context menu
Adding IWorkbenchWindowActionDelegate action in context menu [message #460147] Fri, 15 December 2006 02:42 Go to next message
Eclipse UserFriend
Originally posted by: alice_ace9.yahoo.com

Hi all,

In my RCP application, I have a top-level action that implements IWorkbenchWindowActionDelegate. Now I want to add this same action in context menu of a treeviewer. How can I do this because context menu's can only have actions implementing IAction interface.

Thanks in advance!
Re: Adding IWorkbenchWindowActionDelegate action in context menu [message #460156 is a reply to message #460147] Fri, 15 December 2006 09:26 Go to previous messageGo to next message
Eclipse UserFriend
It sounds like you're mixing 2 metaphors ...
IWorkbenchWindowActionDelegate is a implementation for a declarative
action, and IAction is what you use if you are adding directly to an
IMenuManager or IToolBarManager.

Try using org.eclipse.ui.popupMenus to add a viewerContribution ... you
can use the same class, although you will probably have to implement
IObjectActionDelegate as well. You can reuse the code, although they
will be different instances of the object.


Later,
PW
Re: Adding IWorkbenchWindowActionDelegate action in context menu [message #460216 is a reply to message #460156] Mon, 18 December 2006 04:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alice_ace9.yahoo.com

Thanks for ur help. The thing is I already have a plugin which has an action set only. My application shows these actions in its top-level menu. Now I want to add these actions in the view's context menu. Without modifying that plugin can I reuse these actions?
Re: Adding IWorkbenchWindowActionDelegate action in context menu [message #460237 is a reply to message #460216] Mon, 18 December 2006 09:14 Go to previous messageGo to next message
Eclipse UserFriend
alice9 wrote:
> Thanks for ur help. The thing is I already have a plugin which has an action set only. My application shows these actions in its top-level menu. Now I want to add these actions in the view's context menu. Without modifying that plugin can I reuse these actions?

no.

PW
Re: Adding IWorkbenchWindowActionDelegate action in context menu [message #460239 is a reply to message #460216] Mon, 18 December 2006 09:18 Go to previous message
Eclipse UserFriend
Well, I guess my last answer is not entirely true. There's no natural
way to just link IWorkbenchWindowActionDelegates into your view dropdown
menu.

If you defined definition ids so that the action set <action/> elements
reference a command, you can create view actions in your view that just
execute the command. That would work.

If you are interested you can check out
http://wiki.eclipse.org/index.php/Platform_Command_Framework #Using_an_IActionDelegate_to_execute_a_command

Later,
PW
Previous Topic:Using update manager to update plugins in commercial applications
Next Topic:Animated error message
Goto Forum:
  


Current Time: Wed Mar 19 16:48:18 EDT 2025

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

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

Back to the top