one
one

Reputation: 511

Set Eclipse "Refresh using native hooks or polling" to true through java code?

Is there a way to set "Preferences -> General -> Workspace -> Refresh using native hooks or polling" to true through java code? I'm developing an eclipse plugin that changes the resources a lot and therefore, the projects are always out of sync.

Upvotes: 0

Views: 1181

Answers (1)

one
one

Reputation: 511

Found the answer:

IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode("org.eclipse.core.resources");
prefs.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, true);
prefs.flush();

Thanks all.

Upvotes: 2

Related Questions