emf forms observable updates across threads [message #1749187] |
Fri, 02 December 2016 20:11 |
Jay Norwood Messages: 155 Registered: July 2009 |
Senior Member |
|
|
I'm seeing a null pointer exception in SetCommand.java:362 in org.eclipse.emf.edit.command.SetCommand.create, if I use the emf forms editor to change an attribute in a model instance that is being viewed in two tabs. This is in a RAP workbench application.
What is interesting is that when using the programming api, the values are updated in both views without the exception.
I see in some descriptions that these TAB views are each in their own UI thread in RAP. Is that correct?
If so, then this error suggests to me that emf forms observable updates need to be delayed until their individual UI is active. That's just my guess. I'll attach the stack unwind at the exception:
-
Attachment: err.txt
(Size: 5.11KB, Downloaded 229 times)
[Updated on: Fri, 02 December 2016 20:17] Report message to a moderator
|
|
|
|
Re: emf forms observable updates across threads [message #1749438 is a reply to message #1749283] |
Tue, 06 December 2016 18:07 |
Jay Norwood Messages: 155 Registered: July 2009 |
Senior Member |
|
|
The model instance is loaded from an xmi file.
dsloaded = (Dsense) resource.getContents().get(0);
The list being displayed is cleared, then repopulated. I've tried repopulating the list both directly via emf api calls, or by executing a command to add a list of new items, such as below:
EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(cameraRecordings);
Command command = AddCommand.create(editingDomain, cameraRecordings, cameraRecordings.getRecordings(),crn.getRecordings());
editingDomain.getCommandStack().execute(command);
These api accesses seem to work ok to modify the model, and the values are updated in the various views with an error.
I get an error, though, if I try to manually edit the class attributes using the emf forms editing dialogs.
However, if I create a copy of the full model for each tab view, using ECoreUtil.copy, then the emf forms dialog editing works without error.
dsense = EcoreUtil.copy(DemoWorkbench.getDsenseInstance());
So, does EcoreUtil.copy have some side-effect wrt the editing domain that would enable the emf forms operation? I was guessing that the problem was that listeners in the other UI threads (per tab) were being notified by the emf forms databinding while the threads were not active.
I'll attempt to make some small example.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03132 seconds