use of com.evolveum.midpoint.web.page.admin.server.dto.TaskChangesDto in project midpoint by Evolveum.
the class TaskWfParentPanel method getComponentsToUpdate.
public Collection<Component> getComponentsToUpdate() {
TaskDto curr = parentPage.getCurrentTaskDto();
TaskDto prev = parentPage.getPreviousTaskDto();
List<TaskChangesDto> prevList = prev != null ? prev.getChangesCategorizationList() : null;
List<TaskChangesDto> currList = curr.getChangesCategorizationList();
boolean changesChanged = prev == null || !prevList.equals(currList);
List<Component> rv = new ArrayList<>();
if (changesChanged) {
rv.add(changesContainer);
} else {
for (int i = 0; i < currList.size(); i++) {
currList.get(i).applyFoldingFrom(prevList.get(i));
}
}
rv.add(processInstancesPanel);
return rv;
}
use of com.evolveum.midpoint.web.page.admin.server.dto.TaskChangesDto in project midpoint by Evolveum.
the class TaskWfParentPanel method initLayout.
private void initLayout(final IModel<TaskDto> taskDtoModel) {
final PropertyModel<List<ProcessInstanceDto>> requestsModel = new PropertyModel<>(taskDtoModel, TaskDto.F_WORKFLOW_REQUESTS);
final ISortableDataProvider<ProcessInstanceDto, String> requestsProvider = new ListDataProvider<>(this, requestsModel);
processInstancesPanel = new ProcessInstancesPanel(ID_REQUESTS, requestsProvider, null, 10, ProcessInstancesPanel.View.TASKS_FOR_PROCESS, null);
processInstancesPanel.setOutputMarkupId(true);
add(processInstancesPanel);
add(WebComponentUtil.createHelp(ID_REQUESTS_HELP));
changesContainer = new WebMarkupContainer(ID_CHANGES_CONTAINER);
for (int i = 1; i <= CHANGES_NUMBER; i++) {
final int index = i;
final String changesId = ID_CHANGES_PREFIX + i;
final String changesContentId = changesId + ID_CHANGES_CONTENT_SUFFIX;
final WebMarkupContainer changes = new WebMarkupContainer(changesId);
final IModel<TaskChangesDto> changesModel = new AbstractReadOnlyModel<TaskChangesDto>() {
@Override
public TaskChangesDto getObject() {
return taskDtoModel.getObject().getChangesForIndex(index);
}
};
final TaskChangesPanel changesPanel = new TaskChangesPanel(changesContentId, changesModel);
changes.add(changesPanel);
changes.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return changesModel.getObject() != null;
}
});
changesContainer.add(changes);
}
changesContainer.setOutputMarkupId(true);
add(changesContainer);
}
Aggregations