Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Undo effects outside of model changes in service calls
Undo effects outside of model changes in service calls [message #1849653] Thu, 27 January 2022 21:14 Go to next message
Louis Detweiler is currently offline Louis DetweilerFriend
Messages: 100
Registered: August 2017
Senior Member

I am storing the preference to show a full label or an abbreviated label on a node in an Eclipse scoped preference store.

I use a menu Operation Action that calls a service which updates the preference in the preference store.

The problem is, if this action is undone via ctrl + z the preference is not updated to the state it was in before the action was performed.

Is there a way to make undoable service calls, or is there a better way to achieve this preference idea? I would want any solution to be able to have the preference toggleable from the Eclipse Window -> Preferences menu as well.


Re: Undo effects outside of model changes in service calls [message #1849727 is a reply to message #1849653] Mon, 31 January 2022 10:14 Go to previous message
Glenn Plouhinec is currently offline Glenn PlouhinecFriend
Messages: 22
Registered: April 2020
Junior Member
Hi Louis,

At first sight I don't think that updating the preferences for your use case is the right thing to do. You should use a field in the property view, I haven't had a chance to implement it, but you could use or if you change your mind.

Concerning the Undo, we generally use org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand implementations to modify representations.
As far as I know, there is no preference page that implements the Undo functionality. The closest thing to it might be org.eclipse.jface.preference.FieldEditorPreferencePage.performDefaults() and the call to org.eclipse.jface.preference.FieldEditor.loadDefault()
I hope this helps.


Glenn Plouhinec - Obeo

Need training or professional services for Sirius?
Previous Topic:Loading Model created using Eclipse-Sirius
Next Topic:Any ELK Grid Layouts in the Wild?
Goto Forum:

Current Time: Fri Jun 21 02:41:54 GMT 2024

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

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

Back to the top