|Re: GMF multidiagram editor - avoid data lost [message #1692604 is a reply to message #1692564]
||Thu, 16 April 2015 18:58
|| Nikos Margaritis
Registered: September 2014
Ok, then it is clear that you do not deal with a multipage editor here. |
This is a multipage editor and what I was referring as tabs. (look at selection|tree|etc|Diagram at the bottom)
In your case you just have a different instance of the same file opened in new eclipse tabs. It is like you open three instances of a single file and attempt to edit them without saving. When you attempt to save the file, eclipse identifies that this resource has changed and that's why you get the message that "File Changed - The File Has Been changed on the file system do you want to load the changes" when you attempt to open the other tabs. Because when you opened them the IEditorInput(the content of the file) given to eclipse in order to display the file was different. This is a "strategy" of eclipse in order to prevent data loss.
Sharing the editingDomain is not applicable in your case. Generally, I believe that this is not a good approach to edit the file (through partitioning). Even if you move and save each tab separately, when you move back to the previous tabs you will get the dialog message.
Possibly you could search on how to refresh all the open instances of the same file if that changes (without closing them). In case that you do something like that, you will then need to call it in the method doSave of your xxxDiagramEditor that is located under pluginName.diagram -> src --> part --> xxxDiagramEditor.java --> doSave method. However, I still say that this is not a good approach to deal with the problem.
You could combine, all the nodes in a single editor(having them all available in your palette) and allow elements and relations to be added only under/in those containers, that are of course resizable. This is consider partitioning too, in a different way..
[Updated on: Thu, 16 April 2015 19:20]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01813 seconds