Home » Modeling » EMF » Strange behaviour after saving
Strange behaviour after saving [message #1240186] |
Wed, 05 February 2014 22:27 |
Phil H Messages: 267 Registered: November 2012 |
Senior Member |
|
|
Hi,
I observed something strange in my custom editorpart, after using the emf save mechanism (strg+s). Before I use saving, everything works fine, but after saving it seems that attributes are not updated anymore, which breaks further methods. For this reason I printed out the object, which gave something interesting.
That's the object before I save, whcih is pretty fine so far:
pld.impl.VariationpointImpl@598a6f (name: Ethernetshild, description: <unset>, configStatus: Selected)
After saving, Iget the following message, which I don't really understand, but it seems to break my other functionality, as the editor don't get attributes changes anymore:
pld.impl.VariationpointImpl@c517f4 (eProxyURI: platform:/resource/test/default.pld#_1OUj8IgeEeOXj_Il_6BA_w)
Can someone tell me what the eProxyURI stuff means and why it is there?
Cheers,
Phil
|
|
|
Re: Strange behaviour after saving [message #1240971 is a reply to message #1240186] |
Fri, 07 February 2014 09:32 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Phil,
Comments below.
On 05/02/2014 11:27 PM, Phil H wrote:
> Hi,
>
> I observed something strange in my custom editorpart, after using the
> emf save mechanism (strg+s). Before I use saving, everything works
> fine, but after saving it seems that attributes are not updated
> anymore, which breaks further methods. For this reason I printed out
> the object, which gave something interesting.
>
> That's the object before I save, whcih is pretty fine so far:
>
>
> pld.impl.VariationpointImpl@598a6f (name: Ethernetshild, description:
> <unset>, configStatus: Selected)
>
>
> After saving, Iget the following message, which I don't really
> understand, but it seems to break my other functionality, as the
> editor don't get attributes changes anymore:
>
> pld.impl.VariationpointImpl@c517f4 (eProxyURI:
> platform:/resource/test/default.pld#_1OUj8IgeEeOXj_Il_6BA_w)
>
>
> Can someone tell me what the eProxyURI stuff means and why it is there?
Saving won't convert an object to a proxy. So do you mean you have this
problem after loading the saved model?
>
> Cheers,
> Phil
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: Strange behaviour after saving [message #1260399 is a reply to message #1241081] |
Sat, 01 March 2014 12:15 |
Phil H Messages: 267 Registered: November 2012 |
Senior Member |
|
|
Hi Ed, sry for the late response.
I've set a breakpoint to handleChangedResources, but it seems that it's never really called.
My editor is extended by several tabs, which represent the model in different ways. Every tab extends EditorPart, hitting saving will call public void doSave(final IProgressMonitor progressMonitor) of the XYEditor class.
Using the saving mechanism in one of the tabs give objects the eProxyURI (whatever this means).
Closing the editor and reopen it, solve this then and everything work, till I save again.
Just to clarify: When the eProxyURI is shown, it means that the model is unloaded?
If so, which methods could possibly responsible for this behaviour?
Cheers,
Phil
|
|
|
Re: Strange behaviour after saving [message #1260576 is a reply to message #1260399] |
Sat, 01 March 2014 16:57 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Phil,
Comments below.
On 01/03/2014 1:15 PM, Phil H wrote:
> Hi Ed, sry for the late response.
>
> I've set a breakpoint to handleChangedResources, but it seems that
> it's never really called.
That's strange.
>
> My editor is extended by several tabs, which represent the model in
> different ways. Every tab extends EditorPart, hitting saving will call
> public void doSave(final IProgressMonitor progressMonitor) of the
> XYEditor class.
>
> Using the saving mechanism in one of the tabs give objects the
> eProxyURI (whatever this means).
>
> Closing the editor and reopen it, solve this then and everything work,
> till I save again.
>
> Just to clarify: When the eProxyURI is shown, it means that the model
> is unloaded?
Yes.
> If so, which methods could possibly responsible for this behaviour?
Resource.unload, but the method that calls this in the generated editor
is handledChangedResources, which you say is never really called...
>
> Cheers,
> Phil
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: Strange behaviour after saving [message #1264963 is a reply to message #1263790] |
Wed, 05 March 2014 16:49 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Phil,
I can't say more than I already did. Clearly you're printing out
something that indicates you have a proxy and the debug prints you added
seem to indicate that nothing has attempted to resolve that proxy or
that the proxy can't resolve...
On 04/03/2014 8:44 PM, Phil H wrote:
> So when I use the following code to check if the resource is loaded:
>
>
> System.out.println(fm);
> for(Resource res : getEditingDomain().getResourceSet().getResources()){
> System.out.println(res.isLoaded());
> }
>
>
> I get the following outline, which tells me that the resoure is loaded:
>
> pld.impl.FeatureMImpl@7b8df466 (eProxyURI:
> platform:/resource/test/default.pld#_1ZhZQYgcEeOXj_Il_6BA_w)
> true
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Fri Apr 19 18:51:31 GMT 2024
Powered by FUDForum. Page generated in 0.03305 seconds
|