//
if (data instanceof LocalGadgetData) {
try {
String gadgetName = def.getName();
LocalGadgetData localData = (LocalGadgetData) data;
Resource resource = localData.getResources().getFile(localData.getFileName()).getContentResource();
String content = new String(resource.getData(), resource.getEncoding());
GadgetSpec gadgetSpec = new GadgetSpec(Uri.parse(getGadgetURL(gadgetName)), content);
ModulePrefs prefs = gadgetSpec.getModulePrefs();
String title = prefs.getDirectoryTitle();
if (title == null || title.trim().length() < 1) {