Search in sources :

Example 1 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class ObjectListPanel method createTable.

private BoxedTablePanel<SelectableBean<O>> createTable() {
    List<IColumn<SelectableBean<O>, String>> columns;
    if (isCustomColumnsListConfigured()) {
        columns = initCustomColumns();
    } else {
        columns = initColumns();
    }
    BaseSortableDataProvider<SelectableBean<O>> provider = initProvider();
    BoxedTablePanel<SelectableBean<O>> table = new BoxedTablePanel<SelectableBean<O>>(ID_TABLE, provider, columns, tableId, tableId == null ? 10 : parentPage.getSessionStorage().getUserProfile().getPagingSize(tableId)) {

        private static final long serialVersionUID = 1L;

        @Override
        protected WebMarkupContainer createHeader(String headerId) {
            return initSearch(headerId);
        }

        @Override
        public String getAdditionalBoxCssClasses() {
            return ObjectListPanel.this.getAdditionalBoxCssClasses();
        }

        @Override
        protected WebMarkupContainer createButtonToolbar(String id) {
            WebMarkupContainer bar = ObjectListPanel.this.createTableButtonToolbar(id);
            return bar != null ? bar : super.createButtonToolbar(id);
        }
    };
    table.setOutputMarkupId(true);
    String storageKey = getStorageKey();
    if (StringUtils.isNotEmpty(storageKey)) {
        PageStorage storage = getPageStorage(storageKey);
        if (storage != null) {
            table.setCurrentPage(storage.getPaging());
        }
    }
    return table;
}
Also used : IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) PageStorage(com.evolveum.midpoint.web.session.PageStorage)

Example 2 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class ProcessInstancesPanel method initLayout.

private void initLayout(UserProfileStorage.TableId tableId, int pageSize, View view, final IModel<String> currentInstanceIdModel) {
    BoxedTablePanel<ProcessInstanceDto> table = new BoxedTablePanel<ProcessInstanceDto>(ID_REQUESTS_TABLE, provider, initColumns(view), tableId, pageSize) {

        @Override
        protected Item<ProcessInstanceDto> customizeNewRowItem(Item<ProcessInstanceDto> item, final IModel<ProcessInstanceDto> rowModel) {
            item.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    if (currentInstanceIdModel == null || currentInstanceIdModel.getObject() == null) {
                        return "";
                    }
                    ProcessInstanceDto rowDto = rowModel.getObject();
                    if (currentInstanceIdModel.getObject().equals(rowDto.getProcessInstanceId())) {
                        return "info";
                    } else {
                        return "";
                    }
                }
            }));
            return item;
        }
    };
    table.setOutputMarkupId(true);
    table.setAdditionalBoxCssClasses("without-box-header-top-border");
    add(table);
}
Also used : Item(org.apache.wicket.markup.repeater.Item) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) IModel(org.apache.wicket.model.IModel) ProcessInstanceDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ProcessInstanceDto) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) AttributeAppender(org.apache.wicket.behavior.AttributeAppender)

Example 3 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class ResourceDetailsTabPanel method initLayout.

protected void initLayout(IModel model, PageBase parentPage) {
    PrismObject<ResourceType> resourceObject = (PrismObject<ResourceType>) model.getObject();
    ResourceType resource = resourceObject.asObjectable();
    add(createLastAvailabilityStatusInfo(resource));
    add(createSourceTargetInfo(resource));
    add(createSchemaStatusInfo(resource));
    CapabilitiesPanel capabilities = new CapabilitiesPanel(PANEL_CAPABILITIES, capabilitiesModel);
    add(capabilities);
    List<ResourceConfigurationDto> resourceConfigList = createResourceConfigList(resource);
    ListDataProvider<ResourceConfigurationDto> resourceConfigProvider = new ListDataProvider<ResourceConfigurationDto>(ResourceDetailsTabPanel.this, new ListModel<ResourceConfigurationDto>(resourceConfigList));
    List<ColumnTypeDto<String>> columns = Arrays.asList(new ColumnTypeDto<String>("ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart()), new ColumnTypeDto<String>("ShadowType.objectClass", "objectTypeDefinition.objectClass.localPart", ShadowType.F_OBJECT_CLASS.getLocalPart()), new ColumnTypeDto<String>("ShadowType.intent", "objectTypeDefinition.intent", ShadowType.F_INTENT.getLocalPart()), new ColumnTypeDto<String>("ResourceType.isSync", "sync", null));
    List<IColumn<SelectableBean<ResourceType>, String>> tableColumns = ColumnUtils.createColumns(columns);
    PropertyColumn tasksColumn = new PropertyColumn(PageBase.createStringResourceStatic(this, "ResourceType.tasks"), "definedTasks") {

        @Override
        public void populateItem(Item item, String componentId, final IModel rowModel) {
            ResourceConfigurationDto conf = (ResourceConfigurationDto) rowModel.getObject();
            RepeatingView repeater = new RepeatingView(componentId);
            for (final TaskType task : conf.getDefinedTasks()) {
                repeater.add(new LinkPanel(repeater.newChildId(), new Model<String>(task.getName().getOrig())) {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        ResourceDetailsTabPanel.this.taskDetailsPerformed(target, task.getOid());
                    }
                });
            }
            item.add(repeater);
        }
    };
    tableColumns.add(tasksColumn);
    BoxedTablePanel<ResourceConfigurationDto> resourceConfig = new BoxedTablePanel("resourceConfig", resourceConfigProvider, tableColumns);
    resourceConfig.setAdditionalBoxCssClasses("box-success");
    add(resourceConfig);
}
Also used : ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) RepeatingView(org.apache.wicket.markup.repeater.RepeatingView) ResourceConfigurationDto(com.evolveum.midpoint.web.page.admin.resources.dto.ResourceConfigurationDto) ColumnTypeDto(com.evolveum.midpoint.web.component.data.column.ColumnTypeDto) LinkPanel(com.evolveum.midpoint.web.component.data.column.LinkPanel) PrismObject(com.evolveum.midpoint.prism.PrismObject) Item(org.apache.wicket.markup.repeater.Item) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) IModel(org.apache.wicket.model.IModel) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) IModel(org.apache.wicket.model.IModel) ListModel(org.apache.wicket.model.util.ListModel) Model(org.apache.wicket.model.Model) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel)

Example 4 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class MultipleAssignmentSelector method searchPerformed.

private void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
    MultipleAssignmentSelector.this.searchQuery = query;
    if (filterModel != null && filterModel.getObject() != null) {
        if (query == null) {
            query = new ObjectQuery();
        }
        query.addFilter(filterModel.getObject());
        filterObjectIsAdded = true;
    }
    BoxedTablePanel panel = getTable();
    panel.setCurrentPage(null);
    provider.setQuery(query);
    target.add(panel);
}
Also used : BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Example 5 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class MultipleAssignmentSelector method initTablePanel.

private BoxedTablePanel initTablePanel() {
    List<IColumn<SelectableBean<AssignmentEditorDto>, String>> columns = initColumns();
    BoxedTablePanel table = new BoxedTablePanel(ID_TABLE, provider, columns, UserProfileStorage.TableId.TABLE_ROLES, ITEMS_PER_PAGE);
    updateBoxedTablePanelStyles(table);
    //hide footer menu
    table.getFooterMenu().setVisible(false);
    //hide footer count label
    table.getFooterCountLabel().setVisible(false);
    table.setOutputMarkupId(true);
    return table;
}
Also used : IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Aggregations

BoxedTablePanel (com.evolveum.midpoint.web.component.data.BoxedTablePanel)39 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)13 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)13 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)12 IModel (org.apache.wicket.model.IModel)10 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)9 ArrayList (java.util.ArrayList)9 Item (org.apache.wicket.markup.repeater.Item)9 QName (javax.xml.namespace.QName)6 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)6 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)6 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)5 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)5 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)5 List (java.util.List)5 Label (org.apache.wicket.markup.html.basic.Label)5 Form (org.apache.wicket.markup.html.form.Form)5 ListItem (org.apache.wicket.markup.html.list.ListItem)5 ReadOnlyModel (com.evolveum.midpoint.gui.api.model.ReadOnlyModel)4 ObjectOrdering (com.evolveum.midpoint.prism.query.ObjectOrdering)4