Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » More than one Handler for a command
More than one Handler for a command [message #632622] Wed, 13 October 2010 15:46 Go to next message
Sebastian  is currently offline Sebastian Friend
Messages: 22
Registered: September 2010
Junior Member
Hey,

is it possible to register more than one handler for an existing command?

What I am trying to do is to add a double click command for a table viewer that behaves differently depending on the active perspective.

So, what I did was to create a command with no default handler, and two handlers with the enableWhen properties set.

When I run it with only one handler it works the way I expect it, but when I add the second handler with a different perspective restriction the call to command.isEnabled() returns false.
Re: More than one Handler for a command [message #632641 is a reply to message #632622] Wed, 13 October 2010 16:52 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 771
Registered: July 2009
Location: Grenoble, France
Senior Member
Le 13/10/2010 17:46, Sebastian a écrit :
> Hey,
> is it possible to register more than one handler for an existing command?

Yes, it is totally possible, and commands are made for that!

> What I am trying to do is to add a double click command for a table
> viewer that behaves differently depending on the active perspective.
>
> So, what I did was to create a command with no default handler, and two
> handlers with the enableWhen properties set.

You should try the activeWhen attribute.

--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
Re: More than one Handler for a command [message #632781 is a reply to message #632622] Thu, 14 October 2010 09:13 Go to previous message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
Here is a great article that should help you out of this:

http:// blog.eclipse-tips.com/2009/01/commands-part-2-selection-and. html

Alexandra.
Previous Topic:RCP Start View
Next Topic:IWorkbenchConfigurer->setSaveAndRestore and perspectives.
Goto Forum:
  


Current Time: Sun Dec 21 16:02:35 GMT 2014

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

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