use of com.evolveum.midpoint.web.page.admin.server.dto.ProcessedItemDto in project midpoint by Evolveum.
the class ActivitiesItemProcessingPanel method initLayoutNew.
private void initLayoutNew() {
ListView<ActivityItemProcessingDto> activitiesView = new ListView<>(ID_ACTIVITIES, new PropertyModel<>(getModel(), ActivitiesItemProcessingDto.F_ACTIVITIES)) {
@Override
protected void populateItem(ListItem<ActivityItemProcessingDto> listItem) {
IModel<ActivityItemProcessingDto> itemProcessingModel = listItem.getModel();
Label summary = new Label(ID_SUMMARY, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_TITLE));
summary.setOutputMarkupId(true);
listItem.add(summary);
Label wallClockThroughput = new Label(ID_WALL_CLOCK_THROUGHPUT, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_WALL_CLOCK_THROUGHPUT));
summary.setOutputMarkupId(true);
listItem.add(wallClockThroughput);
ChartJsPanel<PieChartConfiguration> chartPanel = new ChartJsPanel<>(ID_CHART, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_CHART));
listItem.add(chartPanel);
chartPanel.add(new VisibleBehaviour(() -> itemProcessingModel.getObject().getTotalCount() > 0));
PropertyModel<List<ProcessedItemDto>> currentItemsModel = PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_CURRENT_ITEMS);
BoxedTablePanel<ProcessedItemDto> currentItems = new BoxedTablePanel<>(ID_CURRENT_ITEMS, new ListDataProvider<>(ActivitiesItemProcessingPanel.this, currentItemsModel), createCurrentItemsColumns()) {
@Override
protected boolean hideFooterIfSinglePage() {
return true;
}
@Override
public String getAdditionalBoxCssClasses() {
return " box-info ";
}
};
currentItems.setOutputMarkupId(true);
currentItems.add(new VisibleBehaviour(() -> CollectionUtils.isNotEmpty(currentItemsModel.getObject())));
listItem.add(currentItems);
listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_SUCCESS_BOX), ID_SUCCESS_ITEM));
listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_FAILED_BOX), ID_FAILED_ITEM));
listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_SKIP_BOX), ID_SKIPPED_ITEM));
}
};
activitiesView.setOutputMarkupId(true);
add(activitiesView);
}
Aggregations