1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 07:55: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,16 +33,19 @@ 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);
Boolean oldValue = new Boolean(isEnabled(project));
if (!oldValue.equals(newValue)) {
project.setPersistentProperty(activationKey, newValue.toString());
if (on) { if (on) {
addResource(project); addResource(project);
} else { } else {
removeResource(project); removeResource(project);
} }
} }
}
} catch (CoreException e) { } catch (CoreException e) {
} }
} }