Search in sources :

Example 1 with AssignmentHeaderPanel

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);
}
Also used : ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) AssignmentHeaderPanel(com.evolveum.midpoint.web.component.assignment.AssignmentHeaderPanel) DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) ArrayList(java.util.ArrayList) ISortableDataProvider(org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider) AttributeModifier(org.apache.wicket.AttributeModifier) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) AssignmentItemDto(com.evolveum.midpoint.web.page.admin.home.dto.AssignmentItemDto) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Aggregations

AssignmentHeaderPanel (com.evolveum.midpoint.web.component.assignment.AssignmentHeaderPanel)1 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)1 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)1 AssignmentItemDto (com.evolveum.midpoint.web.page.admin.home.dto.AssignmentItemDto)1 DisplayType (com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)1 ArrayList (java.util.ArrayList)1 AttributeModifier (org.apache.wicket.AttributeModifier)1 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 ISortableDataProvider (org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider)1