Dynamic path to Icon [message #1397102] |
Wed, 09 July 2014 03:47  |
Eclipse User |
|
|
|
Hi all,
I would like to retrieve icon according to the name of a component of my
DSL.
I can use conditional styles but I still have to give a static path to
my icon.
Is it possible to reference an icon path with an expression based on
semantics? something like '/xxx/YYY/' + self.name + '.png'
Thanks
Raphaël
|
|
|
|
Re: Dynamic path to Icon [message #1397373 is a reply to message #1397359] |
Wed, 09 July 2014 12:23  |
Eclipse User |
|
|
|
Thanks a lot Maxime for your quick and clear answer.
I'll try your solution.
Best regards
raphaël
Le 09/07/2014 17:57, Maxime Porhel a écrit :
> Le 09/07/2014 09:47, FAUDOU raphael a écrit :
>> Hi all,
>
> Hi Raphael,
>
>>
>> I would like to retrieve icon according to the name of a component of my
>> DSL.
>> I can use conditional styles but I still have to give a static path to
>> my icon.
>> Is it possible to reference an icon path with an expression based on
>> semantics? something like '/xxx/YYY/' + self.name + '.png'
>
> The current expect path is a static path. Dynamic or interpreted
> expression have a yellow background color in the VSM editor [1]. There
> is no current plan to make the icon path dynamic.
>
> However, there could be another but global solution: you should look
> into the getImage() method of your generated item providers, you could
> replace the @generated by @generate-not or @not-generated and modify the
> image computation. Then it will affect the representations and the
> views, wizards, .. not only in Sirius but in all the places where the
> label provider asks the adapter factory to get the image.
>
>> Thanks
>>
>> Raphaël
>
> Regards,
>
> Maxime
>
> [1]
> https://www.eclipse.org/sirius/doc/specifier/general/Specifying_Viewpoints.html#interpreted_expressions
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05978 seconds