Search in sources :

Example 1 with TaskTablePanel

use of com.evolveum.midpoint.web.page.admin.server.TaskTablePanel in project midpoint by Evolveum.

the class TaskSubtasksAndThreadsPanel method initLayout.

protected void initLayout() {
    Label subtasksLabel = new Label(ID_SUBTASKS_LABEL, new ResourceModel("pageTaskEdit.subtasksLabel"));
    add(subtasksLabel);
    TaskTablePanel subtasksPanel = new TaskTablePanel(ID_SUBTASKS_PANEL, createOperationOptions()) {

        @Override
        protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
            return createSelectableBeanObjectDataProvider(() -> createSubtasksQuery(), null);
        }

        @Override
        protected List<Component> createToolbarButtonsList(String buttonId) {
            return new ArrayList<>();
        }

        @Override
        protected List<IColumn<SelectableBean<TaskType>, String>> createDefaultColumns() {
            List<IColumn<SelectableBean<TaskType>, String>> columns = super.createDefaultColumns();
            // });
            return columns;
        }

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.TABLE_SUBTASKS;
        }

        @Override
        @NotNull
        protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
            return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, getObjectDetailsModels().getRootTaskModelObject());
        }
    };
    add(subtasksPanel);
    Label workerThreadsTableLabel = new Label(ID_WORKER_THREADS_TABLE_LABEL, new ResourceModel("TaskStatePanel.workerThreads"));
    add(workerThreadsTableLabel);
    TaskTablePanel workerThreadsTable = new TaskTablePanel(ID_WORKER_THREADS_TABLE, null) {

        @Override
        protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
            return new SelectableListDataProvider<>(TaskSubtasksAndThreadsPanel.this, createWorkersModel());
        }

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.TABLE_WORKERS;
        }

        @Override
        protected boolean isHeaderVisible() {
            return false;
        }

        @Override
        protected List<Component> createToolbarButtonsList(String buttonId) {
            return new ArrayList<>();
        }

        @Override
        @NotNull
        protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
            return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, getObjectDetailsModels().getRootTaskModelObject());
        }
    };
    add(workerThreadsTable);
}
Also used : UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) TaskTablePanel(com.evolveum.midpoint.web.page.admin.server.TaskTablePanel) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) SelectableListDataProvider(com.evolveum.midpoint.web.component.util.SelectableListDataProvider) Label(org.apache.wicket.markup.html.basic.Label) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) ArrayList(java.util.ArrayList) ResourceModel(org.apache.wicket.model.ResourceModel) Component(org.apache.wicket.Component)

Aggregations

SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)1 SelectableListDataProvider (com.evolveum.midpoint.web.component.util.SelectableListDataProvider)1 TaskTablePanel (com.evolveum.midpoint.web.page.admin.server.TaskTablePanel)1 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)1 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)1 ArrayList (java.util.ArrayList)1 Component (org.apache.wicket.Component)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 Label (org.apache.wicket.markup.html.basic.Label)1 ResourceModel (org.apache.wicket.model.ResourceModel)1