Community
Participate
Working Groups
1.Create a generic project and create 2 xml files opening them in the XML Editor. 2.Make sure the preference General->Workspace->Refresh Automatically is false. 3.Go to the file system and edit the xml files and save them 4.Return to Eclipse and select the editor, you will see the file refresh automatically. You might have to switch to the other xml file to see the refresh. If you have the file closed when you edit them outside of eclipse when you come back and open in the xml editor you see the 'file is out of sync with the file system' message editor open briefly before the file is automatically refreshed. If you instead open the files in the regular text editor, you will see the platform behavior. An editor informing you the file is out of sync, or if the editor is already open a dialog pops up informing you of the same and asking if you want to refresh. This is a regression from WTP 3.5.2.
This will happen whenever AbstractTextEditor is used as a nested editor. It contains a boolean 'fHasBeenActivated'.This variable is used by handleEditorInputChanged() function to open MessageDialog, whenever input is outOfSync with file system.It is always false for nested TextEditor. One solution would be to override handleEditorInputChanged() in SSE.
There are two parts of this problem 1) Open a xml file in xml editor(don't close it).Change file in file system ,no pop dialog comes up telling us that it is out of sync.It comes up in normal Text Editor. 2)(Copied from description)If you have the file closed when you edit them outside of eclipse when you come back and open in the xml editor you see the 'file is out of sync with the file system' message editor open briefly before the file is automatically refreshed. These two problems are unrelated.
Created attachment 171623 [details] Patch problem 1) It is the patch for problem 1 mentioned in comment 2 .
(In reply to comment #3) > Created an attachment (id=171623) [details] > Patch problem 1) > > It is the patch for problem 1 mentioned in comment 2 . This patch is wrong .It fails for jsp and html editor.
Created attachment 171633 [details] Corrected patch problem 1 I had to use activation listener in SSE.
Created attachment 171689 [details] Patch problem 2 Whenever we open a non synchronized file , it gets automatically refreshed by DelegatingSourceValidatorForXML. I have turned it off for non-synchronized files,since user won't be able to see error,warnings markers in editor , unless he refreshes it.
Adding Valentin as a reviewer due to the changes to the DelegatingSourceValidatorForXML.
I can agree with the patch for the DelegatingSourceValidatorForXML, but not on the part activation listener. I opened Bug 337719 so that the abstract text editor will check if the active part can adapt to a text editor. Otherwise, it's a lot of redundant code in our editor. Code's been checked in.