Source source = new Source(gadgetName, "application/xml");
source.setTextContent(text);
source.setLastModified(Calendar.getInstance());
try {
sourceStorage.saveSource(gadget, source);
uiManagement.removeChild(UIGadgetEditor.class);
// This will update the source and also update the gadget related
// cached meta data
// from the source
uiManagement.initData();