1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-07 00:05:53 +02:00

setEnabled() adn isEnabled() new methods.

This commit is contained in:
Alain Magloire 2002-11-12 18:52:09 +00:00
parent 573ff6a188
commit 4e3f536f36

View file

@ -5,15 +5,42 @@ package org.eclipse.cdt.core.index;
* All Rights Reserved.
*/
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.internal.core.index.IndexManager;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.cdt.internal.core.index.IndexManager;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
public class IndexModel {
static IndexModel indexModel = null;
static IndexManager manager = null;
final static String INDEX_MODEL_ID = CCorePlugin.PLUGIN_ID + ".indexmodel";
final static String ACTIVATION = "enable";
static QualifiedName activationKey = new QualifiedName(INDEX_MODEL_ID, ACTIVATION);
public boolean isEnabled(IProject project) {
String prop = null;
try {
if (project != null) {
prop = project.getPersistentProperty(activationKey);
}
} catch (CoreException e) {
}
return ((prop != null) && prop.equalsIgnoreCase("true"));
}
public void setEnabled(IProject project, boolean on) {
String prop = new Boolean(on).toString();
try {
if (project != null) {
project.setPersistentProperty(activationKey, prop);
}
} catch (CoreException e) {
}
}
/**
* Search Project for tag symbol.