Skip to main content



      Home
Home » Eclipse Projects » Sirius » Saving a second (and third) model loaded into one diagram(Saving should be done when the user presses save or uses the shortcut ctr + s)
Saving a second (and third) model loaded into one diagram [message #1738034] Fri, 15 July 2016 05:35 Go to next message
Eclipse UserFriend
Hi all,

in my editor I have a diagram description where I provide a toolbar button with which the user can load a model extension into the diagram. This works fine and thanks to various java service methods all of the required nodes are shown.

Since I not only want to display the attributes but also want to change their value the problem occured that those changes are not saved even though I specifically set the underlying extension model resource to modified.
There is of course the possibility to just call
resource.save(null)
after a java service method made a change which saves the resource immediately. The diagram however is then still marked as dirty but the extension model is saved so doing so would take the possibility to discard unwanted changes.

My question is if there is any way to tell my diagram that now two (and later three) models are loaded at the same time and by saving the diagrams current state that all of these loaded models are also saved when something has changed?

Greetings,
Michael
Re: Saving a second (and third) model loaded into one diagram [message #1738241 is a reply to message #1738034] Mon, 18 July 2016 06:49 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

When you load a model using your java services, do you add the loaded
resource to the current Sirius Session (see
org.eclipse.sirius.business.api.session.Session.addSemanticResource(URI,
IProgressMonitor))? This way the model will be properly added to the
Session editing domain allowing you to manipulate the newly loaded model
like other ressources in the session. You will be able to save and the
dirty status will be properly handled.

Regards,
Steve


Le 15/07/2016 à 11:35, Michael Junker a écrit :
> Hi all,
>
> in my editor I have a diagram description where I provide a toolbar
> button with which the user can load a model extension into the diagram.
> This works fine and thanks to various java service methods all of the
> required nodes are shown.
>
> Since I not only want to display the attributes but also want to change
> their value the problem occured that those changes are not saved even
> though I specifically set the underlying extension model resource to
> modified.
> There is of course the possibility to just call resource.save(null)
> after a java service method made a change which saves the resource
> immediately. The diagram however is then still marked as dirty but the
> extension model is saved so doing so would take the possibility to
> discard unwanted changes.
>
> My question is if there is any way to tell my diagram that now two (and
> later three) models are loaded at the same time and by saving the
> diagrams current state that all of these loaded models are also saved
> when something has changed?
>
> Greetings,
> Michael


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Saving a second (and third) model loaded into one diagram [message #1738242 is a reply to message #1738241] Mon, 18 July 2016 06:55 Go to previous messageGo to next message
Eclipse UserFriend
Hey Steve,

nope, didn't consider that, thanks a lot. That totally solved my problem! Smile
Re: Saving a second (and third) model loaded into one diagram [message #1738247 is a reply to message #1738242] Mon, 18 July 2016 07:38 Go to previous message
Eclipse UserFriend
Le 18/07/2016 à 12:55, Michael Junker a écrit :
> Hey Steve,
>
> nope, didn't consider that, thanks a lot. That totally solved my
> problem! :)
Great! :)

--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Viewpoint selection is empty with an XText DSL instance.
Next Topic:Can't get crosstable working
Goto Forum:
  


Current Time: Sat Mar 15 11:11:42 EDT 2025

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

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

Back to the top