Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » create and modify external resources for each diagram
create and modify external resources for each diagram [message #1792207] Thu, 12 July 2018 15:43 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,

Assume a WorkSpaceImage which takes its image path as an input from the user. That is, the user can click on browse button to select the image that he/she wants to assign to a WorkSpaceImage node. The the tool should store that external image somewhere so that it can bring it back the next time that the diagram is being opened. So, is there any way to define a ResourceSet that keeps track of all the imported resources. Or should I define it in the ecore meta model and keep it as a hidden model element maybe?

Something like this is on toolbar I'm not sure how it works (apparently it only shows the images within the project and not from outside the project) and why it shows nothing when I click browse on it (See below please):

index.php/fa/33382/0/

index.php/fa/33383/0/

Thanks,
Parsa

[Updated on: Thu, 12 July 2018 16:14]

Report message to a moderator

Re: create and modify external resources for each diagram [message #1792258 is a reply to message #1792207] Fri, 13 July 2018 13:14 Go to previous messageGo to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi, I found that I can create a folder in the project and put all the icons there and refer to it. I just need to keep the track of the selected files somewhere. do you think putting it in the model (to be defined in the meta-model) is a good idea?

Thanks,
Parsa

[Updated on: Fri, 13 July 2018 13:23]

Report message to a moderator

Re: create and modify external resources for each diagram [message #1792333 is a reply to message #1792258] Mon, 16 July 2018 08:18 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

I am not sure to understand your need.
The tool allows to select an image and if you save the change will be there at the next diagram opening if the project containing the images is opened in the same runtime at the project with the diagram.
Why would you need to keep tracks?

Regards


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: create and modify external resources for each diagram [message #1792390 is a reply to message #1792333] Mon, 16 July 2018 20:34 Go to previous messageGo to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi Pierre Guile,

Thanks for your reply. The thing is that I need to set an image for ALL the elements of a type and not just for one element. For example, I would like to set the image of all the elements of the MyClass type to the image that is selected by the user. I was thinking that a solution would be to keep track of the selected image by the user, and then in the editPart of that element type, set the image to the selected one. I hope I could convey the message!

Thanks,
Parsa
Re: create and modify external resources for each diagram [message #1792485 is a reply to message #1792390] Wed, 18 July 2018 14:34 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

This seems to me a really complicated need to implement.
Is the user choice a requirement or could you use the conditional style in the VSM to select an image in regard of the diagram context?

If it is a requirement, the solutions I see are:

- if you only need to apply the image for mapping of the current diagram: then you should provide your own color change action that will apply for all mapping with element of the type or use a resource set listener that will do all the changes when one is detected for current diagram.
-if you need the change to be applied for all mapping with element type of all diagram: you could use a custom style: https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html
This style would show default VSM image if no user override is done. And the user image if so.
The question is where the user override information is saved like ou asked.
The semantic model is not really a good idea. It is a technical detail that has nothing to do with your semantic model.
I don't have a good solution.

Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: create and modify external resources for each diagram [message #1792502 is a reply to message #1792485] Wed, 18 July 2018 18:02 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Thanks Pierre Guilet,

I already created a custom style and set an edit part to it. So, the only thing I need now is to store somewhere the user-selected image. I think for now I should probably have it in the metamodel as there is no other good solutions.

Thanks for your help,
Regards,
Parsa
Previous Topic:How to give the ID for dynamically created elements, and where to save the values
Next Topic:[Edited] Wrong forum
Goto Forum:
  


Current Time: Thu Mar 28 17:53:42 GMT 2024

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

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

Back to the top