| 
| Setting GlobalActionHandler for command [message #335482] | Fri, 10 April 2009 06:08  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 I'm using ver. 3.3 and I'm trying to retarget the global delete action
 using the commands framework. I've written my own DeleteHandler which
 extends AbstractHandler.
 
 <handler
 class="mypackage.handlers.DeleteHandler"
 commandId="org.eclipse.ui.edit.delete">
 <activeWhen>
 <with
 variable="activePartId">
 <equals
 value="mypackage.views.myview">
 </equals>
 </with>
 </activeWhen>
 </handler>
 
 If I add the "org.eclipse.ui.edit.delete" command as a popup menu in my
 view it works fine - my handler is called and the delete key works.
 However, I need to get it working from the "Edit" menu in the main RCP
 menu.
 
 I know, in my view, I need to call:
 getViewSite().getActionBars().setGlobalActionHandler("org.eclipse.ui.edit.delete ",
 someIAction);
 My problem is, this method takes an IAction parameter. All I have is an
 AbstractHandler? I thought the abstraction of commands meant we didn't
 have to instantiate actions ourselves? Any idea what I should pass to this
 method?
 
 Thanks!
 |  |  |  | 
|  | 
Powered by 
FUDForum. Page generated in 0.32315 seconds