public Category setProperty(String propertyName, String propertyValue) {
String temp = getProperty(propertyName);
if( propertyValue == null ) {
properties.remove(propertyName);
firePropertyChangedEvent(
new ConfigurationChangedEventImpl(
PropertyChangedEvent.PROPERTY_REMOVED, this,
propertyName, temp, propertyValue));
return this;
}
properties.setProperty(propertyName, propertyValue);
if(temp == null) {
firePropertyChangedEvent(
new ConfigurationChangedEventImpl(
PropertyChangedEvent.PROPERTY_ADDED, this,
propertyName, temp, propertyValue));
}
else {
if (!temp.equals(propertyValue)) // thanks to Thorsten Jungbluth for the fix
firePropertyChangedEvent(
new ConfigurationChangedEventImpl(
PropertyChangedEvent.PROPERTY_CHANGED, this,
propertyName, temp, propertyValue));
}
return this;
}