Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ActionDelegateHandlerProxy and isEnabled
ActionDelegateHandlerProxy and isEnabled [message #541213] Fri, 18 June 2010 13:31 Go to next message
Mickael Istria is currently offline Mickael Istria
Messages: 720
Registered: July 2009
Location: Grenoble, France
Senior Member
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
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

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: Sat Apr 19 05:56:37 EDT 2014

Powered by FUDForum. Page generated in 0.02023 seconds