private W3CWidget setPreferences(W3CWidget widget) {
//
// Add each preferences from the instance to the widget
//
for (IPreference pref : instance.getPreferences()) {
PreferenceEntity newPref = (PreferenceEntity) getPreference(
pref.getDkey(), widget);
newPref.setValue(pref.getDvalue());
newPref.setReadOnly(pref.isReadOnly());
widget.getPreferences().add(newPref);
}
return widget;
}