PropertyTester for org.eclipse.core.runtime.product [message #328956] |
Mon, 09 June 2008 07:52 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #328995 is a reply to message #328977] |
Tue, 10 June 2008 07: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) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: charles.prevot.ago.fr
Thanks for your answer Paul
Paul Webster a écrit :
> Charles Prevot wrote:
>> org.eclipse.core.runtime.product, can anyone please help me with it
>
>
> It will work in 3.4 (>=RC3) using this expression:
>
>
> <with variable="org.eclipse.core.runtime.Platform">
> <test property="org.eclipse.core.runtime.product"
> value="myProductId"/>
> </with>
> [/xml]
>
> As a general rule, we don't use forcePluginActivation through.
I just add it to see if the problem came from here...
>
> 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 ?
>
> PW
>
>
|
|
|
Re: PropertyTester for org.eclipse.core.runtime.product [message #329009 is a reply to message #328995] |
Tue, 10 June 2008 13:58 ![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) |
|
This is a multi-part message in MIME format.
--------------040707000302060001090207
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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
--
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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
--------------040707000302060001090207
Content-Type: application/zip;
name="add.platform.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="add.platform.zip"
UEsDBBQACAAIAClPyjgAAAAAAAAAAAAAAAAYAAAAei5leC5wbGF0Zm9ybS8u Y2xhc3NwYXRo
lZDBSgMxEIbP9imW3DtriwcPuy0iK7RgLe3Wa0mTYTsaJ3GSFPv2umCpCAq9 zT988/Ez1fTj
zRUHlEieazWCa1UgG2+Ju1pt2ofhrZpOBpVxOsag034yuDoH5CTH4pXY1sp4 VkW/rJWXDtA4
ChHhxSZwOrPZfxlhvmq290+L9m62aFblb444obB2YHGXO8j0fYkC66TZarH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TUVUQS1JTkYvTUFO SUZFU1QuTUZQ
SwECFAAUAAgACAApT8o4P4jEscQBAACeBAAALgAAAAAAAAAAAAAAAADdBQAA ei5leC5wbGF0
Zm9ybS9zcmMvei9leC9wbGF0Zm9ybS9BY3RpdmF0b3IuamF2YVBLAQIUABQA CAAIAClPyjib
GmfwHgEAAE0CAAA7AAAAAAAAAAAAAAAAAP0HAAB6LmV4LnBsYXRmb3JtL3Ny Yy96L2V4L3Bs
YXRmb3JtL1BsYXRmb3JtU291cmNlUHJvdmlkZXIuamF2YVBLAQIUABQACAAI AClPyjjfkAti
nQEAAP0EAAAuAAAAAAAAAAAAAAAAAIQJAAB6LmV4LnBsYXRmb3JtL3NyYy96 L2V4L3BsYXRm
b3JtL1N0YXJ0TWVVcC5qYXZhUEsFBgAAAAAJAAkA7QIAAH0LAAAAAA==
--------------040707000302060001090207--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: PropertyTester for org.eclipse.core.runtime.product [message #329043 is a reply to message #329009] |
Wed, 11 June 2008 07:25 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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.03930 seconds