1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 23:15:24 +02:00

Check if it was already enabled.

This commit is contained in:
Alain Magloire 2002-11-12 22:16:00 +00:00
parent 5e27de87ed
commit 0f475ccc84

View file

@ -33,14 +33,17 @@ public class IndexModel {
} }
public void setEnabled(IProject project, boolean on) { public void setEnabled(IProject project, boolean on) {
String prop = new Boolean(on).toString();
try { try {
if (project != null) { if (project != null) {
project.setPersistentProperty(activationKey, prop); Boolean newValue = new Boolean(on);
if (on) { Boolean oldValue = new Boolean(isEnabled(project));
addResource(project); if (!oldValue.equals(newValue)) {
} else { project.setPersistentProperty(activationKey, newValue.toString());
removeResource(project); if (on) {
addResource(project);
} else {
removeResource(project);
}
} }
} }
} catch (CoreException e) { } catch (CoreException e) {