Search in sources :

Example 1 with AbstractExportableColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method createMembersColumns.

protected List<IColumn<SelectableBean<ObjectType>, String>> createMembersColumns() {
    List<IColumn<SelectableBean<ObjectType>, String>> columns = new ArrayList<>();
    IColumn<SelectableBean<ObjectType>, String> column = new AbstractExportableColumn<SelectableBean<ObjectType>, String>(createStringResource("TreeTablePanel.fullName.displayName")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<SelectableBean<ObjectType>>> cellItem, String componentId, IModel<SelectableBean<ObjectType>> rowModel) {
            SelectableBean<ObjectType> bean = rowModel.getObject();
            ObjectType object = bean.getValue();
            cellItem.add(new Label(componentId, getMemberObjectDisplayName(object)));
        }

        @Override
        public IModel<String> getDataModel(IModel<SelectableBean<ObjectType>> rowModel) {
            return Model.of(getMemberObjectDisplayName(rowModel.getObject().getValue()));
        }
    };
    columns.add(column);
    column = new AbstractExportableColumn<SelectableBean<ObjectType>, String>(createStringResource("TreeTablePanel.identifier.description")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<SelectableBean<ObjectType>>> cellItem, String componentId, IModel<SelectableBean<ObjectType>> rowModel) {
            SelectableBean<ObjectType> bean = rowModel.getObject();
            ObjectType object = bean.getValue();
            cellItem.add(new Label(componentId, getMemberObjectIdentifier(object)));
        }

        @Override
        public IModel<String> getDataModel(IModel<SelectableBean<ObjectType>> rowModel) {
            return Model.of(getMemberObjectIdentifier(rowModel.getObject().getValue()));
        }
    };
    columns.add(column);
    return columns;
}
Also used : IModel(org.apache.wicket.model.IModel) AbstractExportableColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn) ArrayList(java.util.ArrayList) Label(org.apache.wicket.markup.html.basic.Label) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) Item(org.apache.wicket.markup.repeater.Item) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean)

Example 2 with AbstractExportableColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn 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;
}
Also used : InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) Item(org.apache.wicket.markup.repeater.Item) IModel(org.apache.wicket.model.IModel) AbstractExportableColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) Label(org.apache.wicket.markup.html.basic.Label)

Aggregations

InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)2 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)2 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)2 AbstractExportableColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn)2 Label (org.apache.wicket.markup.html.basic.Label)2 Item (org.apache.wicket.markup.repeater.Item)2 IModel (org.apache.wicket.model.IModel)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)1 ArrayList (java.util.ArrayList)1 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)1