Skip to main content



      Home
Home » Eclipse Projects » GEF » reacting to a resouce going out of synch
reacting to a resouce going out of synch [message #192780] Mon, 22 August 2005 16:33 Go to next message
Eclipse UserFriend
Originally posted by: no.yes.maybe

Hi,
I have a custom editor opened on a file. The file contains a reference
to a second file. I want the editor to update when the second file
changes on disk. What strategy can I follow?

I thought I could "listen" for resources going out of synch, but I don't
see such functionality.

I could have a thread polling isOutOfSynch(), but I should also make
sure that any action the user might perform on the editor will validate
that the resource is not out of synch. Note that the resource is not the
file the editor is opened on, but a second one referred by such file.

So the question is: how do I intercept any user action in an editor to
verify whether my resource is out of synch?

Thanks,
Roberto
Re: reacting to a resouce going out of synch [message #193133 is a reply to message #192780] Wed, 24 August 2005 11:33 Go to previous message
Eclipse UserFriend
You can register with the workspace for any resource changes, take a look at
IFile.getWorkspace().addResourceChangeListener()

"roberto" <no@yes.maybe> wrote in message
news:dedco6$voo$1@news.eclipse.org...
> Hi,
> I have a custom editor opened on a file. The file contains a reference to
> a second file. I want the editor to update when the second file changes on
> disk. What strategy can I follow?
>
> I thought I could "listen" for resources going out of synch, but I don't
> see such functionality.
>
> I could have a thread polling isOutOfSynch(), but I should also make sure
> that any action the user might perform on the editor will validate that
> the resource is not out of synch. Note that the resource is not the file
> the editor is opened on, but a second one referred by such file.
>
> So the question is: how do I intercept any user action in an editor to
> verify whether my resource is out of synch?
>
> Thanks,
> Roberto
Previous Topic:Source refreshing
Next Topic:adding a child to a child
Goto Forum:
  


Current Time: Sat May 03 22:27:34 EDT 2025

Powered by FUDForum. Page generated in 0.27636 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top