There is a preference that tells Eclipse to poll the file system looking for changes (Windows->Preferences expand General -> Workspace -> "Refresh using native hooks or polling").
I'm trying to override this property (PREF_AUTO_REFRESH) and set it to true. I've tried this in preWindowOpen() method of a class that extends WorkbenchWindowAdvisor:
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES);
// auto-refresh default
node.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, true);
try {
node.flush();
} catch (BackingStoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
When i run the plug-in the preference is checked in Window->Preferences->General->Workspace but it's still not working. If I change it externally (from another editor) the file isn't refreshed as it should have. It is just checked but doesn't have the required behavior.
Am I not persisting the property right?