use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class DecisionsPanel method initLayout.
protected void initLayout(UserProfileStorage.TableId tableId, int pageSize) {
List<IColumn<DecisionDto, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.user"), DecisionDto.F_USER));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.originalActor"), DecisionDto.F_ORIGINAL_ACTOR));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.stage"), DecisionDto.F_STAGE));
columns.add(createOutcomeColumn());
columns.add(new PropertyColumn<DecisionDto, String>(createStringResource("DecisionsPanel.comment"), DecisionDto.F_COMMENT) {
@Override
public void populateItem(Item<ICellPopulator<DecisionDto>> item, String componentId, IModel<DecisionDto> rowModel) {
super.populateItem(item, componentId, rowModel);
item.add(new AttributeAppender("style", "max-width: 200px; word-wrap: break-word;"));
}
});
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.when"), DecisionDto.F_TIME));
columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.escalation"), DecisionDto.F_ESCALATION_LEVEL_NUMBER));
ISortableDataProvider provider = new ListDataProvider<>(this, getModel());
BoxedTablePanel decisionsTable = new BoxedTablePanel<>(ID_DECISIONS_TABLE, provider, columns, tableId, pageSize);
add(decisionsTable);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class AddCapabilityDialog method initLayout.
private void initLayout(WebMarkupContainer container) {
List<IColumn<CapabilityDto<CapabilityType>, String>> columns = initColumns();
TablePanel<CapabilityDto<CapabilityType>> table = new TablePanel<>(ID_TABLE, createProvider(), columns);
table.setOutputMarkupId(true);
table.setShowPaging(false);
container.add(table);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL, createStringResource("addCapabilityDialog.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
cancelPerformed(ajaxRequestTarget);
}
};
container.add(cancelButton);
AjaxButton addButton = new AjaxButton(ID_ADD, createStringResource("addCapabilityDialog.button.Add")) {
@Override
public void onClick(AjaxRequestTarget target) {
addPerformed(target);
}
};
container.add(addButton);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class TaskResultTabPanel method initResultColumns.
private List<IColumn<OperationResult, String>> initResultColumns() {
List<IColumn<OperationResult, String>> columns = new ArrayList<IColumn<OperationResult, String>>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.token"), "token"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.operation"), "operation"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.status"), "status"));
columns.add(new AbstractColumn<OperationResult, String>(createStringResource("pageTaskEdit.opResult.message"), "message") {
@Override
public void populateItem(Item<ICellPopulator<OperationResult>> cellItem, String componentId, IModel<OperationResult> rowModel) {
Label label = new Label(componentId, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return WebComponentUtil.nl2br(rowModel.getObject().getMessage());
}
});
label.setEscapeModelStrings(false);
cellItem.add(label);
}
});
//columns.add(new PropertyColumn(createStringResource("pageTaskEdit.opResult.message"), "message"));
return columns;
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class TaskSubtasksAndThreadsTabPanel method initLayout.
private void initLayout(final IModel<TaskDto> taskDtoModel) {
WebMarkupContainer threadsConfigurationPanel = new WebMarkupContainer(ID_THREADS_CONFIGURATION_PANEL);
add(threadsConfigurationPanel);
threadsConfigurationPanel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return taskDtoModel.getObject().configuresWorkerThreads();
}
});
final TextField<Integer> workerThreads = new TextField<>(ID_WORKER_THREADS, new PropertyModel<Integer>(taskDtoModel, TaskDto.F_WORKER_THREADS));
workerThreads.setOutputMarkupId(true);
workerThreads.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
return parentPage.isEdit();
}
});
threadsConfigurationPanel.add(workerThreads);
VisibleEnableBehaviour hiddenWhenEditingOrNoSubtasks = new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !parentPage.isEdit() && !taskDtoModel.getObject().getSubtasks().isEmpty();
}
};
Label subtasksLabel = new Label(ID_SUBTASKS_LABEL, new ResourceModel("pageTaskEdit.subtasksLabel"));
subtasksLabel.add(hiddenWhenEditingOrNoSubtasks);
add(subtasksLabel);
SubtasksPanel subtasksPanel = new SubtasksPanel(ID_SUBTASKS_PANEL, new PropertyModel<List<TaskDto>>(taskDtoModel, TaskDto.F_SUBTASKS), parentPage.getWorkflowManager().isEnabled());
subtasksPanel.add(hiddenWhenEditingOrNoSubtasks);
add(subtasksPanel);
VisibleEnableBehaviour hiddenWhenNoSubtasks = new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
TaskDto taskDto = taskDtoModel.getObject();
return taskDto != null && !taskDto.getTransientSubtasks().isEmpty();
}
};
Label workerThreadsTableLabel = new Label(ID_WORKER_THREADS_TABLE_LABEL, new ResourceModel("TaskStatePanel.workerThreads"));
workerThreadsTableLabel.add(hiddenWhenNoSubtasks);
add(workerThreadsTableLabel);
List<IColumn<WorkerThreadDto, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn(createStringResourceStatic(this, "TaskStatePanel.subtaskName"), WorkerThreadDto.F_NAME));
columns.add(new EnumPropertyColumn<WorkerThreadDto>(createStringResourceStatic(this, "TaskStatePanel.subtaskState"), WorkerThreadDto.F_EXECUTION_STATUS));
columns.add(new PropertyColumn(createStringResourceStatic(this, "TaskStatePanel.subtaskObjectsProcessed"), WorkerThreadDto.F_PROGRESS));
ISortableDataProvider<WorkerThreadDto, String> threadsProvider = new ListDataProvider<>(this, new AbstractReadOnlyModel<List<WorkerThreadDto>>() {
@Override
public List<WorkerThreadDto> getObject() {
List<WorkerThreadDto> rv = new ArrayList<>();
TaskDto taskDto = taskDtoModel.getObject();
if (taskDto != null) {
for (TaskDto subtaskDto : taskDto.getTransientSubtasks()) {
rv.add(new WorkerThreadDto(subtaskDto));
}
}
return rv;
}
});
TablePanel<WorkerThreadDto> workerThreadsTablePanel = new TablePanel<>(ID_WORKER_THREADS_TABLE, threadsProvider, columns);
workerThreadsTablePanel.add(hiddenWhenNoSubtasks);
add(workerThreadsTablePanel);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.
the class RoleGovernanceRelationsPanel method createMembersColumns.
@Override
protected List<IColumn<SelectableBean<ObjectType>, String>> createMembersColumns() {
List<IColumn<SelectableBean<ObjectType>, String>> columns = super.createMembersColumns();
IColumn<SelectableBean<ObjectType>, String> column = new AbstractExportableColumn<SelectableBean<ObjectType>, String>(createStringResource("roleMemberPanel.relation")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ObjectType>>> cellItem, String componentId, IModel<SelectableBean<ObjectType>> rowModel) {
cellItem.add(new Label(componentId, getRelationValue((FocusType) rowModel.getObject().getValue())));
}
@Override
public IModel<String> getDataModel(IModel<SelectableBean<ObjectType>> rowModel) {
return Model.of(getRelationValue((FocusType) rowModel.getObject().getValue()));
}
};
columns.add(column);
return columns;
}
Aggregations