Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » where to implement a ChangeRecorder
where to implement a ChangeRecorder [message #1833747] Fri, 23 October 2020 08:41 Go to next message
Marcel Patzelt is currently offline Marcel PatzeltFriend
Messages: 3
Registered: October 2020
Junior Member
Hi, i have an emf model and an emf.forms editor generated..

I want to dynamically create and display a list of changes made to an EObject that includes date and changes.

I read the emf-Book and found an powerful ChangeRecorder Class that seems to be the best starting point.

I would be happy to receive hints on where to implement it.

i found a way in the Package Model Editor - for the emf.forms editor it doesn't work [message #1833910 is a reply to message #1833747] Tue, 27 October 2020 15:30 Go to previous messageGo to next message
Marcel Patzelt is currently offline Marcel PatzeltFriend
Messages: 3
Registered: October 2020
Junior Member
i found a way in the Package Model Editor (the generic non-emf.forms one)

i added a Member to the ~PackageEditor Class
public ChangeRecorder changerecorder;

and initialized it in the initializeEditingDomain() - Method at the End.

after this generated line:
editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());

changerecorder = new ChangeRecorder(editingDomain.getResourceSet());

..when the Save-Functions are called i can changerecorder.summarize() it and read the Changes. where the editingDomain gets disposed i dispose it too.

But i still have no idea how to get it running for the emf.forms Editor..
Can please anyone tell me ?
Re: where to implement a ChangeRecorder [message #1833914 is a reply to message #1833747] Tue, 27 October 2020 16:38 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 11
Registered: January 2017
Junior Member
Hi,

you can attach the ChangeRecorder with beginRecording() to an EObject (and its containments) and it will record all changes and on calling endRecording() return the changes, also see here:
https://download.eclipse.org/modeling/emf/emf/javadoc/2.4.3/org/eclipse/emf/ecore/change/util/ChangeRecorder.html

Hope this helps!

Cheers,
Maximilian



--
get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: where to implement a ChangeRecorder [message #1833915 is a reply to message #1833914] Tue, 27 October 2020 16:40 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 11
Registered: January 2017
Junior Member
Just realized you have already posted a follow-up question. Are you referring to the EMF Forms Editor? Can you please elaborate what you are trying to do.

Cheers,
Maximilian


--
get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: where to implement a ChangeRecorder [message #1833916 is a reply to message #1833915] Tue, 27 October 2020 17:36 Go to previous message
Marcel Patzelt is currently offline Marcel PatzeltFriend
Messages: 3
Registered: October 2020
Junior Member
I have Model describing a System containing some components. I generated the. Model, . Edit and. ViewModel.. Then i generated with the forms-genmodel the .Editor.

I want to fill the Attributes initially with the EMF.forms Editor, after everything is filled in i want to use the changerecorder and fill an viewable List with the changes to the System. All editing should be done with emf.forms Editor cause its so nice an conviniant.

In this article i found, that the forms Editor generates no Code..
https://eclipsesource.com/blogs/tutorials/emf-forms-editors/

I guess i have to read some more about creating a custom Editor using the. Forms Classes
org.eclipse.emfforms.spi.editor.GenericEditor
org.eclipse.emfforms.editor

Is there an Tutorial available?
Previous Topic:[CDO] Guidelines for upgrading from CDO 4.1 to 4.11
Next Topic:Source not found Edit Source Lookup Path
Goto Forum:
  


Current Time: Sun Apr 11 04:03:31 GMT 2021

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

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

Back to the top