use of io.jmix.dashboardsui.annotation.DashboardWidget in project jmix by jmix-framework.
the class WidgetRepositoryImpl method initializeWidgets.
protected void initializeWidgets() {
widgetTypeInfos = new ArrayList<>();
for (WindowInfo windowInfo : windowConfig.getWindows()) {
if (StringUtils.isNotBlank(windowInfo.getTemplate())) {
Class clazz = windowInfo.getControllerClass();
if (clazz.isAnnotationPresent(DashboardWidget.class)) {
DashboardWidget widgetAnnotation = (DashboardWidget) clazz.getAnnotation(DashboardWidget.class);
String editFragmentId = widgetAnnotation.editFragmentId();
if (StringUtils.isNotBlank(editFragmentId) && !windowConfig.hasWindow(editFragmentId)) {
log.error("Unable to find {} edit screen in screen config for widget {}", editFragmentId, widgetAnnotation.name());
throw new IllegalArgumentException(String.format("Unable to find %s edit screen in screen config for widget %s", editFragmentId, widgetAnnotation.name()));
}
widgetTypeInfos.add(new WidgetTypeInfo(widgetAnnotation.name(), windowInfo.getId(), editFragmentId));
}
}
}
}
Aggregations