*/
public void setPreference(
String nodeName, IProject project, String name, String value)
throws IllegalArgumentException, Exception
{
IScopeContext context = InstanceScope.INSTANCE;
IEclipsePreferences globalPrefs = context.getNode(nodeName);
initializeDefaultPreferences(globalPrefs);
Option pref = preferences.get(name);
if (pref == null){
pref = options.get(name);
}
// set global
if (project == null){
validateValue(pref, name, value);
globalPrefs.put(name, value);
globalPrefs.flush();
}else{
context = new ProjectScope(project);
IEclipsePreferences projectPrefs = context.getNode(nodeName);
// if project value is the same as the global, then remove it.
if(value.equals(globalPrefs.get(name, null))){
projectPrefs.remove(name);
projectPrefs.flush();