Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Only respond to Resource Change Events caused by external changes to a file
Only respond to Resource Change Events caused by external changes to a file [message #1017503] Mon, 11 March 2013 20:16 Go to previous message
Jesse Steinfort is currently offline Jesse Steinfort
Messages: 7
Registered: October 2009
Junior Member
Hello Folks,

I have an RCP application with an editor for a particular type of file (that contains an EMF model). If that file gets modified by some external editor or process while the editor has the file open, I want to prompt the user with the option to "reload."

I added a ResourceChangeListener that responds to POST_CHANGE and this works well for me. Now, when someone uses Notepad or other to edit a file, my application can deal with it.

However, I now have the problem that this listener responds to changes caused by a simple save action! This is not external and does not require a "reload".

Is there some way to suppress the Resource Changed event without causing a race condition? Am I going about this wrong?

I'm trying to replicate behavior that one usually sees with a text editor where it will prompt you to "reload" if the file has "changed on disk" (e.g. like Notepad++ does)

-Jesse
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:Project Explorer View
Next Topic:How to change error image in titleareadialog
Goto Forum:
  


Current Time: Thu May 23 22:26:47 EDT 2013

Powered by FUDForum. Page generated in 0.02050 seconds