Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Detecting external changes to a resource
Detecting external changes to a resource [message #290915] Fri, 02 September 2005 22:05 Go to next message
Brad Townsend is currently offline Brad TownsendFriend
Messages: 9
Registered: July 2009
Junior Member
Greetings,

I'm looking for a way to detect changes to a workspace resource that
occur outside of Eclipse (so that I can keep my editor contents up to
date). I am already using an IResourceChangeListener on the workspace,
however this seems to only receive events that are triggered from within
eclipse.

If I open a file using the editor I've created in eclipse, then switch
to Windows explorer and delete the file, my IResourceChangeListener is
not notified.

I know there must be some way to determine outside changes because the
JDT Java editor handles this. If I open a Java editor, then delete the
file from Windows explorer, as soon as I switch back to eclipse the Java
editor will notify my that the file was deleted.

Any advice?

Thanks,
-Brad
Re: Detecting external changes to a resource [message #290978 is a reply to message #290915] Mon, 05 September 2005 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

It handles it by checking whether the resource is up-to-date when it compiles things it knows to have changed. It doesn't do a refresh on everything all the time.

The way to make this happen for your own editor would be to intercept the 'got focus' event, and do a check to see if the resource is up-to-date on this event. It's possible that this is what the JDT editor is doing, but I don't know this.
Re: Detecting external changes to a resource [message #291011 is a reply to message #290915] Tue, 06 September 2005 12:32 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can also set the Preferences>General>Workspace>Refresh Automatically
preference. It's not instantanious, but it does keep checking the
resources for you.

Later,
PW


Re: Detecting external changes to a resource [message #291082 is a reply to message #291011] Wed, 07 September 2005 15:12 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Paul Webster wrote:

> You can also set the Preferences>General>Workspace>Refresh
> Automatically preference. It's not instantanious, but it does keep
> checking the resources for you.

And causes a resource delta to be sent out.

Dani

>
> Later,
> PW
Previous Topic:package root setting
Next Topic:DefaultUndoManager runtime error on linux
Goto Forum:
  


Current Time: Thu Aug 29 23:37:07 GMT 2024

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

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

Back to the top