Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumshow to update editor input?
https://www.eclipse.org/forums/index.php/mv/msg/92329/284447/#msg_284447
Originally posted by: joerni_78.gmx.de
Hi, i'm new to eclipse. I'm trying to build a Multipageeditor with a
FormPage and a texteditorpage, which shows the 'source' code (XML) of the
file to edit. These files are created and changed directly with the help
of an external jar. That means, editing the formPage results in an updated
file. Now I have the problem of updating the correspondend texteditorpage.
I thought the pageChange(int newPageIndex)-Method in FormEditor class
could be a good place to update the texteditor content.
Actually this updates the content of the editor when switching to the
editor page, but when I try to edit the texteditor content then, a
MessageDialog appears ->
"Update Conflict- The File has been changed on the File System. Do you
want to load the changes?"
How can I avoid this? I tried various things, but I just do not come to a
solution. How can I get the texteditor to simply rescan the file content
without checking, if the file has been changed?
Thank you!
Joern]]>2005-04-25T15:31:58-00:00Re: how to update editor input?
https://www.eclipse.org/forums/index.php/mv/msg/92329/284456/#msg_284456
Originally posted by: Wolflgang_Horn.onlinehome.de
Try creating an IFile resource pointing to the file and use method
refreshLocal
to update the workbench to the changed file.
See the API documentation for a description of IFile.refreshLocal.
Regards,
Joggerwolf
"Joern" <joerni_78@gmx.de> schrieb im Newsbeitrag
news:6eb962d8d460fac52aca30da47c31de6$1@www.eclipse.org...
> Hi, i'm new to eclipse. I'm trying to build a Multipageeditor with a
> FormPage and a texteditorpage, which shows the 'source' code (XML) of the
> file to edit. These files are created and changed directly with the help
> of an external jar. That means, editing the formPage results in an updated
> file. Now I have the problem of updating the correspondend texteditorpage.
>
> I thought the pageChange(int newPageIndex)-Method in FormEditor class
> could be a good place to update the texteditor content.
>
> I tried the following:
>
> IEditorInput editorInput = ...
> textEditor.setInput(editorInput);
>
> Actually this updates the content of the editor when switching to the
> editor page, but when I try to edit the texteditor content then, a
> MessageDialog appears ->
> "Update Conflict- The File has been changed on the File System. Do you
> want to load the changes?"
>
> How can I avoid this? I tried various things, but I just do not come to a
> solution. How can I get the texteditor to simply rescan the file content
> without checking, if the file has been changed?
>
> Thank you!
> Joern
>]]>2005-04-25T18:46:17-00:00Re: how to update editor input?
https://www.eclipse.org/forums/index.php/mv/msg/92329/284488/#msg_284488
Originally posted by: joerni_78.xxx.de
Thank you,
but unfortunately it doesn't seem to help. Same problem. Any other ideas?]]>2005-04-26T13:22:56-00:00Re: how to update editor input?
https://www.eclipse.org/forums/index.php/mv/msg/92329/1708921/#msg_1708921
ResourceSet resSet = new ResourceSetImpl();
org.eclipse.emf.ecore.resource.Resource res = resSet.getResource(URI.createDeviceURI(inputArchFile.getLocationURI().toString()), true);]]>Abhishek Chakraborty2015-09-22T13:27:22-00:00