[commands] override a handler [message #337100] |
Tue, 28 July 2009 01:43 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Will Horn![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=will.horn%40gmail.com) Messages: 265 Registered: July 2009 |
Senior Member |
|
|
I'm writing a plugin (for RCP applications), and I need to launch two
different versions of a wizard, depending on whether the workspace
(org.eclipse.core.resources) bundle is available. Currently, my setup is:
com.example - defines view, a basic wizard, a command and a handler that
launches the basic wizard
com.example.resources - defines a more advanced resource-aware wizard, and a
handler that launches it
The goal is to be able to use the first plug-in stand alone, and drop in the
second if the RCP application uses the workspace and wants the added
functionality.
I have been investigating the activeWhen condition for handlers and have
succeeded by creating a dummy property tester and adding it to the
enablement condition in the com.example.resources handler. It seems that a
condition with "and(A, B)" gets higher priority than "A" by itself, even if
"B" is a dummy test.
I am wondering if this is a valid/supported approach or if there are better
ways to do this. Is there a way to add a simple true branch in a condition
that would avoid the property tester?
Thanks,
Will
|
|
|
Re: [commands] override a handler [message #369120 is a reply to message #337100] |
Tue, 28 July 2009 17:32 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Will Horn![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=will.horn%40gmail.com) Messages: 265 Registered: July 2009 |
Senior Member |
|
|
"Will Horn" <will.horn@gmail.com> wrote in message
news:h4ll4f$ujn$1@build.eclipse.org...
> I'm writing a plugin (for RCP applications), and I need to launch two
> different versions of a wizard, depending on whether the workspace
> (org.eclipse.core.resources) bundle is available. Currently, my setup is:
>
> com.example - defines view, a basic wizard, a command and a handler that
> launches the basic wizard
> com.example.resources - defines a more advanced resource-aware wizard, and
> a handler that launches it
>
> The goal is to be able to use the first plug-in stand alone, and drop in
> the second if the RCP application uses the workspace and wants the added
> functionality.
>
> I have been investigating the activeWhen condition for handlers and have
> succeeded by creating a dummy property tester and adding it to the
> enablement condition in the com.example.resources handler. It seems that
> a condition with "and(A, B)" gets higher priority than "A" by itself, even
> if "B" is a dummy test.
I spoke to soon - this does NOT work. I was looking at the wrong thing and
upon further investigation the two handlers do still conflict. So I do not
have a solution and would appreciate any suggestions.
Thanks,
Will
|
|
|
|
Powered by
FUDForum. Page generated in 0.03160 seconds