Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » ActionDelegateHandlerProxy and isEnabled
ActionDelegateHandlerProxy and isEnabled [message #541213] Fri, 18 June 2010 13:31 Go to next message
Eclipse UserFriend
Hi all,

I am trying to get my menu entries activated at the right time, but I am a bit confused with the ActionDelegateHandlerProxy. Indeed, I have a pop-up menu that defines an action for Copy, and this action is bound to the org.eclipse.ui.edit.copy command, in order to get the keyboard shortcuts working.
However the side effect of it is that this action registers a ActionDelegateHandlerProxy to the org.eclipse.ui.edit.copy command, and that ActionDelegateHandlerProxy has its isEnabled method returning true even if the selection does not match the <enablement/> definition of the action in the plugin.xml. In that case, the action that is wrapped in ActionDelegateHandlerProxy is null, and then the isEnabled return true.
I thougnt that a wrapper with a null action should rather cause enablment to be false... Is there something I misunderstood here to get my enablement correctly updated?

Thanks in advance

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Re: ActionDelegateHandlerProxy and isEnabled [message #541519 is a reply to message #541213] Mon, 21 June 2010 09:07 Go to previous message
Eclipse UserFriend
Mickael Istria wrote:
> Hi all,
>
> I am trying to get my menu entries activated at the right time, but I am
> a bit confused with the ActionDelegateHandlerProxy. Indeed, I have a
> pop-up menu that defines an action for Copy, and this action is bound to
> the org.eclipse.ui.edit.copy command, in order to get the keyboard
> shortcuts working.

objectContributions can't be key bindings (at least, not properly).
Prior to 3.6 there was a bug that allowed an objectContribution to be
registered for a command (like copy) but it was fixed in 3.6.

The only reason to put a command id in an objectContribution
definitionId is so that the appropriate keybinding is displayed in the
context menu as well.

Later,
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/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Previous Topic:Excluded files from build path get exported to jar
Next Topic:empty run menu visible after disabling all related actions
Goto Forum:
  


Current Time: Wed Jul 23 08:40:24 EDT 2025

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

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

Back to the top