Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Dynamic path to Icon
Dynamic path to Icon [message #1397102] Wed, 09 July 2014 07:47 Go to next message
Raphael Faudou is currently offline Raphael FaudouFriend
Messages: 105
Registered: July 2009
Senior Member
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 #1397359 is a reply to message #1397102] Wed, 09 July 2014 15:57 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 503
Registered: July 2009
Location: Nantes, France
Senior Member
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


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Dynamic path to Icon [message #1397373 is a reply to message #1397359] Wed, 09 July 2014 16:23 Go to previous message
Raphael Faudou is currently offline Raphael FaudouFriend
Messages: 105
Registered: July 2009
Senior Member
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
>
>
Previous Topic:Sequence Diagram Graphical Elements Ordering
Next Topic:Edges in containers
Goto Forum:
  


Current Time: Fri Apr 16 03:25:47 GMT 2021

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

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

Back to the top