// Create sorted structure of widgets by processing their annotations
Map<String, List<Class<? extends ProcessToolWidget>>> sortedWidgets = new HashMap<String, List<Class<? extends ProcessToolWidget>>>();
for (Class<? extends ProcessToolWidget> widgetClass : viewableWidgets.values()) {
String widgetGroupName = "unsorted";
WidgetGroup widgetGroup = Classes.getClassAnnotation(widgetClass, WidgetGroup.class);
if (widgetGroup != null) {
widgetGroupName = widgetGroup.value();
}
List<Class<? extends ProcessToolWidget>> widgetGroupItems = sortedWidgets.get(widgetGroupName);
if (widgetGroupItems == null) {
widgetGroupItems = new ArrayList<Class<? extends ProcessToolWidget>>();