public void setValue(String key, String value) throws ReadOnlyException {
if (isReadOnly(key)) {
throw new ReadOnlyException(EXCEPTIONS.getString(
"error.preference.readonly", key));
}
InternalPortletPreference pref = (InternalPortletPreference)
preferences.get(key);
if (pref != null) {
pref.setValues(new String[] { value });
} else {
pref = new PortletPreferenceImpl(key, new String[] { value });
preferences.put(key, pref);
}
}