PropertyTester for org.eclipse.core.runtime.product [message #328956] |
Mon, 09 June 2008 03:52  |
Eclipse User |
|
|
|
Originally posted by: charles.prevot.ago.fr
Hi,
I am trying to redefine the behavior of one of my plugin's command in
order to have a product-specific behavior. I managed to redefine the
behavior depending on the 'activePartId', but whatever I try I can't
find the right way to use the property tester for
org.eclipse.core.runtime.product, can anyone please help me with it ?
Here is a sample of my plugin.xml:
<extension
point="org.eclipse.ui.handlers">
<handler
class="application.SampleHandler"
commandId="MyApp.commands.sampleCommand">
<activeWhen>
<with
variable="platform">
<test
forcePluginActivation="true"
property="org.eclipse.core.runtime.product"
value="myProductId">
</test>
</with>
</activeWhen> </handler>
</extension>
Sincerely,
Charles
|
|
|
|
|
|
Re: PropertyTester for org.eclipse.core.runtime.product [message #329043 is a reply to message #329009] |
Wed, 11 June 2008 03:25  |
Eclipse User |
|
|
|
Originally posted by: charles.prevot.ago.fr
Thanks a lot Paul
Paul Webster a écrit :
> Charles Prevot wrote:
>> Thanks for your answer Paul
>>> In 3.3 the org.eclipse.core.runtime.Platform variable is not
>>> available, although the property tester is. But in theory it could
>>> be added programmatically (and I expect that would be convoluted).
>>
>> Can you give me some hints on how to do this programmatically ?
>
> In 3.3? I've attached a little plugin that makes the
> org.eclipse.core.runtime.Platform variable available in 3.3 (it's
> already there in 3.4). Because it is done using early startup it is in
> a plugin by itself. Also in 3.3, the handlers are evaluated before the
> early startup code is run, so it shows up as disabled unless you also
> couple the handler expression with a variable that changes (like
> selection or activePartId). The ability to request a property tester be
> re-evaluated is only available in 3.4.
>
> ex:
>
> <and>
> <with variable="org.eclipse.core.runtime.Platform">
> <test property="org.eclipse.core.runtime.product"
> value="org.eclipse.sdk.ide"/>
> </with>
> <with variable="selection">
> <count value="*"/>
> </with>
> </and>
> [/xml]
>
> The Platform test is valid in 3.3 and 3.4, and the example plugin is
> restricted to 3.3.x.
>
> Later,
> PW
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02931 seconds