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: 91
Registered: August 2017
Member
Hello,

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.

Thanks,

Louis
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 org.eclipse.ui.views.properties.PropertySheetEntry or org.eclipse.gef.ui.properties.UndoablePropertySheetEntry 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.

Regards,
Glenn


Glenn Plouhinec - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Loading Model created using Eclipse-Sirius
Next Topic:Any ELK Grid Layouts in the Wild?
Goto Forum:
  


Current Time: Wed Sep 28 17:14:36 GMT 2022

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

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

Back to the top