use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class TaskResultTabPanel method initLayout.
private void initLayout() {
IModel<List<OperationResult>> resultModel = new ReadOnlyModel<>(() -> createOperationResultList());
SelectableListDataProvider<SelectableBean<OperationResult>, OperationResult> provider = new SelectableListDataProvider<>(this, resultModel);
BoxedTablePanel<SelectableBean<OperationResult>> resultTablePanel = new BoxedTablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
AjaxFallbackLink<Void> showResult = new AjaxFallbackLink<Void>(ID_SHOW_RESULT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(Optional<AjaxRequestTarget> optionalTarget) {
if (!optionalTarget.isPresent()) {
LOGGER.warn("Cannot show result in interactive way, request target not present.");
return;
}
AjaxRequestTarget target = optionalTarget.get();
PrismObjectWrapper<TaskType> taskWrapper = TaskResultTabPanel.this.getModelObject();
TaskType taskType = taskWrapper.getObject().asObjectable();
OperationResult opResult = OperationResult.createOperationResult(taskType.getResult());
OpResult result = opResult != null ? OpResult.getOpResult(getPageBase(), opResult) : null;
OperationResultPanel body = new OperationResultPanel(getPageBase().getMainPopupBodyId(), new Model<>(result));
body.add(new VisibleBehaviour(() -> opResult != null));
body.setOutputMarkupId(true);
getPageBase().showMainPopup(body, target);
}
};
showResult.setOutputMarkupId(true);
add(showResult);
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class TaskTablePanel method createNodesColumn.
private AbstractColumn<SelectableBean<TaskType>, String> createNodesColumn() {
return new AbstractColumn<>(createStringResource("pageTasks.task.executingAt")) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<TaskType>>> cellItem, String componentId, IModel<SelectableBean<TaskType>> rowModel) {
TaskInformation taskInformation = getAttachedTaskInformation(rowModel.getObject());
cellItem.add(new Label(componentId, taskInformation.getNodesDescription()));
}
};
}
use of com.evolveum.midpoint.web.component.util.SelectableBean in project midpoint by Evolveum.
the class TaskTablePanel method createErrorsColumn.
private AbstractColumn<SelectableBean<TaskType>, String> createErrorsColumn() {
return new AbstractColumn<>(createStringResource("pageTasks.task.errors")) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<TaskType>>> cellItem, String componentId, IModel<SelectableBean<TaskType>> rowModel) {
TaskInformation taskInformation = getAttachedTaskInformation(rowModel.getObject());
cellItem.add(new Label(componentId, taskInformation.getAllErrors()));
}
};
}
Aggregations