try {
String value = (String) ((ApplicationShortcut) resource).getParameters().get(def.getName());
if (value == null) {
value = def.getDefaultValue();
}
ShortcutParameterItem item = new ShortcutParameterItem(des, def, value, locale);
if (log.isDebugEnabled())
log.debug("Adding item " + item.getName());
parameterItems.add(item);
} catch (Exception e) {
log.warn("Failed to create shortcut parameter for " + def.getName()
+ ". Probably a problem with the extension descriptor.", e);
}
}
}
Collections.sort(parameterItems);
// Now we have a sorted list of parameter items, build up the list of
// categories
categories = new ArrayList<String>();
categoryTitles = new ArrayList<String>();
for (Iterator i = parameterItems.iterator(); i.hasNext();) {
ShortcutParameterItem spi = (ShortcutParameterItem) i.next();
String category = String.valueOf(spi.getCategory());
if (!categories.contains(category)) {
categories.add(category);
categoryTitles.add(spi.getLocalisedCategory());
}
}
}