Search in sources :

Example 16 with TablePanel

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

the class LoggingConfigPanel method initLoggers.

private void initLoggers() {
    initRoot();
    ISortableDataProvider<LoggerConfiguration, String> provider = new ListDataProvider<>(this, new PropertyModel<List<LoggerConfiguration>>(getModel(), "loggers"));
    TablePanel table = new TablePanel<>(ID_LOGGERS_TABLE, provider, initLoggerColumns());
    table.setOutputMarkupId(true);
    table.setShowPaging(true);
    add(table);
    AjaxButton addStandardLogger = new AjaxButton(ID_BUTTON_ADD_STANDARD_LOGGER, createStringResource("LoggingConfigPanel.button.addStandardLogger")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addStandardLoggerPerformed(target);
        }
    };
    add(addStandardLogger);
    AjaxButton addComponentLogger = new AjaxButton("addComponentLogger", createStringResource("LoggingConfigPanel.button.addComponentLogger")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addComponentLoggerPerformed(target);
        }
    };
    add(addComponentLogger);
    AjaxButton addClassLogger = new AjaxButton("addClassLogger", createStringResource("LoggingConfigPanel.button.addClassLogger")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addClassLoggerPerformed(target);
        }
    };
    add(addClassLogger);
    AjaxButton deleteLogger = new AjaxButton("deleteLogger", createStringResource("LoggingConfigPanel.button.deleteLogger")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            deleteLoggerPerformed(target);
        }
    };
    add(deleteLogger);
}
Also used : LoggerConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.LoggerConfiguration) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) List(java.util.List) ArrayList(java.util.ArrayList) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 17 with TablePanel

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

the class LoggingConfigPanel method initAppenders.

private void initAppenders() {
    ISortableDataProvider<AppenderConfiguration, String> provider = new ListDataProvider<>(this, new PropertyModel<List<AppenderConfiguration>>(getModel(), LoggingDto.F_APPENDERS));
    TablePanel table = new TablePanel<>(ID_TABLE_APPENDERS, provider, initAppenderColumns());
    table.setOutputMarkupId(true);
    table.setShowPaging(false);
    add(table);
    AjaxButton addConsoleAppender = new AjaxButton(ID_BUTTON_ADD_CONSOLE_APPENDER, createStringResource("LoggingConfigPanel.button.addConsoleAppender")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addConsoleAppenderPerformed(target);
        }
    };
    add(addConsoleAppender);
    AjaxButton addFileAppender = new AjaxButton(ID_BUTTON_ADD_FILE_APPENDER, createStringResource("LoggingConfigPanel.button.addFileAppender")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            addFileAppenderPerformed(target);
        }
    };
    add(addFileAppender);
    AjaxButton deleteAppender = new AjaxButton(ID_BUTTON_DELETE_APPENDER, createStringResource("LoggingConfigPanel.button.deleteAppender")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            deleteAppenderPerformed(target);
        }
    };
    add(deleteAppender);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) List(java.util.List) ArrayList(java.util.ArrayList) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 18 with TablePanel

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

the class ObjectSelectionPanel method updateTablePerformed.

public void updateTablePerformed(AjaxRequestTarget target, ObjectQuery query) {
    TablePanel table = getTablePanel();
    DataTable dataTable = table.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) dataTable.getDataProvider();
    provider.setQuery(query);
    target.add(this, WebComponentUtil.getPageBase(this).getFeedbackPanel(), table);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 19 with TablePanel

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

the class ObjectSelectionPanel method updateTableByTypePerformed.

public void updateTableByTypePerformed(AjaxRequestTarget target, Class<? extends ObjectType> newType) {
    this.objectType = newType;
    TablePanel table = getTablePanel();
    DataTable dataTable = table.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) dataTable.getDataProvider();
    provider.setType(objectType);
    target.add(this, WebComponentUtil.getPageBase(this).getFeedbackPanel(), table);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 20 with TablePanel

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

the class AssignmentPreviewDialog method initLayout.

public void initLayout() {
    List<IColumn<AssignmentsPreviewDto, String>> columns = initColumns();
    ListDataProvider provider = new ListDataProvider(pageBase, data);
    WebMarkupContainer content = new WebMarkupContainer(ID_CONTENT);
    content.setOutputMarkupId(true);
    add(content);
    TablePanel table = new TablePanel<>(ID_TABLE, provider, columns);
    table.setOutputMarkupId(true);
    content.add(table);
    AjaxButton addButton = new AjaxButton(ID_BUTTON_ADD, createStringResource("userBrowserDialog.button.selectButton")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<AssignmentsPreviewDto> previewDtos = data.getObject();
            List<AssignmentsPreviewDto> selectedDtos = new ArrayList<>();
            for (AssignmentsPreviewDto dto : previewDtos) {
                if (dto.isSelected()) {
                    selectedDtos.add(dto);
                }
            }
            AssignmentPreviewDialog.this.addButtonClicked(target, selectedDtos);
        }
    };
    addButton.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return multiselect;
        }
    });
    content.add(addButton);
    AjaxButton cancelButton = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("AssignmentPreviewDialog.button.cancel")) {

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            ((PageBase) getPage()).hideMainPopup(ajaxRequestTarget);
        }
    };
    content.add(cancelButton);
}
Also used : ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) ArrayList(java.util.ArrayList) PageBase(com.evolveum.midpoint.gui.api.page.PageBase) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Aggregations

TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)26 ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)13 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)9 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)9 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)8 ArrayList (java.util.ArrayList)8 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)7 DataTable (org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable)7 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)6 List (java.util.List)5 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 Label (org.apache.wicket.markup.html.basic.Label)4 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 LoggingDto (com.evolveum.midpoint.web.page.admin.configuration.dto.LoggingDto)3 ClassLoggerConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType)3 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)2 ObjectSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectSearchDto)2 ConfigurationStorage (com.evolveum.midpoint.web.session.ConfigurationStorage)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 AttributeModifier (org.apache.wicket.AttributeModifier)2