Search in sources :

Example 16 with ICellPopulator

use of org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator in project midpoint by Evolveum.

the class PageTasks method initNodeColumns.

private List<IColumn<NodeDto, String>> initNodeColumns() {
    List<IColumn<NodeDto, String>> columns = new ArrayList<>();
    IColumn column = new CheckBoxHeaderColumn<>();
    columns.add(column);
    column = new PropertyColumn<>(createStringResource("pageTasks.node.name"), "name", "name");
    columns.add(column);
    columns.add(new EnumPropertyColumn<NodeDto>(createStringResource("pageTasks.node.executionStatus"), "executionStatus") {

        @Override
        protected String translate(Enum en) {
            return createStringResource(en).getString();
        }
    });
    columns.add(new PropertyColumn(createStringResource("pageTasks.node.managementPort"), "managementPort"));
    columns.add(new AbstractColumn<NodeDto, String>(createStringResource("pageTasks.node.lastCheckInTime")) {

        @Override
        public void populateItem(Item<ICellPopulator<NodeDto>> item, String componentId, final IModel<NodeDto> rowModel) {
            item.add(new Label(componentId, new AbstractReadOnlyModel<Object>() {

                @Override
                public Object getObject() {
                    return createLastCheckInTime(rowModel);
                }
            }));
        }
    });
    CheckBoxColumn check = new CheckBoxColumn(createStringResource("pageTasks.node.clustered"), "clustered");
    check.setEnabled(false);
    columns.add(check);
    columns.add(new PropertyColumn(createStringResource("pageTasks.node.statusMessage"), "statusMessage"));
    IColumn<NodeDto, String> menuColumn = new InlineMenuButtonColumn<NodeDto>(createNodesInlineMenu(false), 2, PageTasks.this) {

        @Override
        protected int getHeaderNumberOfButtons() {
            return 2;
        }

        @Override
        protected List<InlineMenuItem> getHeaderMenuItems() {
            return createNodesInlineMenu(true);
        }
    };
    columns.add(menuColumn);
    return columns;
}
Also used : PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) Label(org.apache.wicket.markup.html.basic.Label) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) PrismObject(com.evolveum.midpoint.prism.PrismObject) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Aggregations

ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)16 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)14 Label (org.apache.wicket.markup.html.basic.Label)10 IModel (org.apache.wicket.model.IModel)10 ArrayList (java.util.ArrayList)9 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)6 PropertyColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn)5 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)4 TooltipBehavior (com.evolveum.midpoint.web.util.TooltipBehavior)4 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)4 Model (org.apache.wicket.model.Model)3 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)3 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)2 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 DateLabelComponent (com.evolveum.midpoint.web.component.DateLabelComponent)2 CheckBoxHeaderColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn)2 InlineMenuable (com.evolveum.midpoint.web.component.data.column.InlineMenuable)2 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)2 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2 CertCaseOrWorkItemDto (com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseOrWorkItemDto)2