use of com.evolveum.midpoint.web.component.assignment.AssignmentHeaderPanel in project midpoint by Evolveum.
the class MyAssignmentsPanel method initLayout.
private void initLayout() {
List<IColumn<AssignmentItemDto, String>> columns = new ArrayList<>();
columns.add(new IconColumn<AssignmentItemDto>(null) {
private static final long serialVersionUID = 1L;
@Override
protected DisplayType getIconDisplayType(IModel<AssignmentItemDto> rowModel) {
AssignmentItemDto item = rowModel.getObject();
String iconClass = "";
if (item.getType() == null) {
iconClass = OperationResultStatusPresentationProperties.FATAL_ERROR.getIcon() + " fa-lg";
} else {
iconClass = item.getType().getIconCssClass();
}
return GuiDisplayTypeUtil.createDisplayType(iconClass, "", AssignmentsUtil.createAssignmentIconTitleModel(MyAssignmentsPanel.this, rowModel.getObject().getType()).getObject());
}
});
columns.add(new AbstractColumn<AssignmentItemDto, String>(createStringResource("MyAssignmentsPanel.assignment.displayName")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<AssignmentItemDto>> cellItem, String componentId, final IModel<AssignmentItemDto> rowModel) {
AssignmentHeaderPanel panel = new AssignmentHeaderPanel(componentId, rowModel);
panel.add(new AttributeModifier("class", "dash-assignment-header"));
cellItem.add(panel);
}
});
ISortableDataProvider provider = new ListDataProvider(this, getModel());
TablePanel accountsTable = new TablePanel<>(ID_ASSIGNMETNS_TABLE, provider, columns);
accountsTable.setShowPaging(false);
add(accountsTable);
}
Aggregations