| Editor detecting changes made to a file while editing.... [message #88330] |
Fri, 22 August 2003 12:03  |
Eclipse User |
|
|
|
Originally posted by: gino.--no-spam--filicetti.net
Hi guys,
I'm writing a fairly complex multi page editor that implements
IMultiEditorPart directly. Although this is a complex editor, what it's
really editing is XML (sort of like the plug in editor), as for saving it
though, it is saved through own our storage manager and usually ends up in a
file on disk (but could possibly be stored in a DB or else where by other
storage managers).
I am now struggling with the problem of trying to stay aware of external
changes made to file that is open in my editor. IE: I've got one of my files
open in my eclipse editor, but edit it with notepad and save it.
It seems like the TextEditor knows when this happens and it prompts the user
to correct the situation. I looked at the code and it seems like A LOT of
this mechanism is implemented in the AbstractTextEditor and in the
AbstractDocumentProvider classes, both of which I do not use or inherit
from.
So my question is what is the best way to deal with this situation? I
thought it was really unfortunate that the detection mechanism was built
into the abstract text editor... where does that leave me now, someone
building a more abstract editor not based on text or necessarily files?
One path i tried exploring was in the visit() method of my implementation of
the IResourceDelta class I would detect the delta of:
Kind = CHANGED
Flags = CONTENT
However, in this case, I would only be notified after a project refresh that
a file had been updated on the filesystem, and even so, after a normal save
operation, I would detect this same delta... which meant I could not
distinguish between a file being updated underneath me, or a normal save
operation.
I checked the plugin.xml editor since it is a multipage editor like mine,
and it doesn't seem to detect changes to the underlying plugin.xml file at
all..... !
Any help is appreciated.
G
|
|
|
| Re: Editor detecting changes made to a file while editing.... [message #88832 is a reply to message #88330] |
Mon, 25 August 2003 01:26  |
Eclipse User |
|
|
|
Originally posted by: tom.eicher.gmx.ch.nodomain
You might want to have a look at the new org.eclipse.core.filebuffers
plugin released in the upcoming milestone build.
-tom
G. Filicetti wrote:
> Hi guys,
>
> I'm writing a fairly complex multi page editor that implements
> IMultiEditorPart directly. Although this is a complex editor, what it's
> really editing is XML (sort of like the plug in editor), as for saving it
> though, it is saved through own our storage manager and usually ends up in a
> file on disk (but could possibly be stored in a DB or else where by other
> storage managers).
>
> I am now struggling with the problem of trying to stay aware of external
> changes made to file that is open in my editor. IE: I've got one of my files
> open in my eclipse editor, but edit it with notepad and save it.
>
> It seems like the TextEditor knows when this happens and it prompts the user
> to correct the situation. I looked at the code and it seems like A LOT of
> this mechanism is implemented in the AbstractTextEditor and in the
> AbstractDocumentProvider classes, both of which I do not use or inherit
> from.
>
> So my question is what is the best way to deal with this situation? I
> thought it was really unfortunate that the detection mechanism was built
> into the abstract text editor... where does that leave me now, someone
> building a more abstract editor not based on text or necessarily files?
>
> One path i tried exploring was in the visit() method of my implementation of
> the IResourceDelta class I would detect the delta of:
>
> Kind = CHANGED
> Flags = CONTENT
>
> However, in this case, I would only be notified after a project refresh that
> a file had been updated on the filesystem, and even so, after a normal save
> operation, I would detect this same delta... which meant I could not
> distinguish between a file being updated underneath me, or a normal save
> operation.
>
> I checked the plugin.xml editor since it is a multipage editor like mine,
> and it doesn't seem to detect changes to the underlying plugin.xml file at
> all..... !
>
> Any help is appreciated.
>
> G
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03981 seconds