Search in sources :

Example 1 with CheckBoxColumn

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

the class PageConnectorHosts method initConnectorHostsColumns.

private List<IColumn<ConnectorHostType, String>> initConnectorHostsColumns() {
    List<IColumn<ConnectorHostType, String>> columns = new ArrayList<>();
    IColumn column = new CheckBoxHeaderColumn<ConnectorHostType>();
    columns.add(column);
    column = new LinkColumn<SelectableBean<ConnectorHostType>>(createStringResource("pageResources.connector.name"), "name", "value.name") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ConnectorHostType>> rowModel) {
            ConnectorHostType host = rowModel.getObject().getValue();
        // resourceDetailsPerformed(target, host.getOid());
        }
    };
    columns.add(column);
    columns.add(new PropertyColumn(createStringResource("pageResources.connector.hostname"), "value.hostname"));
    columns.add(new PropertyColumn(createStringResource("pageResources.connector.port"), "value.port"));
    columns.add(new PropertyColumn(createStringResource("pageResources.connector.timeout"), "value.timeout"));
    columns.add(new CheckBoxColumn(createStringResource("pageResources.connector.protectConnection"), "value.protectConnection"));
    InlineMenuHeaderColumn menu = new InlineMenuHeaderColumn(initInlineHostsMenu());
    columns.add(menu);
    return columns;
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) InlineMenuHeaderColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuHeaderColumn) PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) ArrayList(java.util.ArrayList) CheckBoxColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxColumn) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) CheckBoxHeaderColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean)

Example 2 with CheckBoxColumn

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

the class JasperReportConfigurationPanel method initParameterColumns.

private List<IColumn<JasperReportParameterDto, String>> initParameterColumns() {
    List<IColumn<JasperReportParameterDto, String>> columns = new ArrayList<>();
    IColumn<JasperReportParameterDto, String> column = new CheckBoxHeaderColumn<>();
    columns.add(column);
    // name editing column
    columns.add(buildEditableLinkColumn("JasperReportConfigurationPanel.parameterName", null, "name", true));
    // class editing column
    columns.add(buildEditableLinkColumn("JasperReportConfigurationPanel.parameterClass", null, "typeAsString", true));
    columns.add(buildEditableLinkColumn("JasperReportConfigurationPanel.nestedClass", null, "nestedTypeAsString", true));
    columns.add(new LinkColumn<JasperReportParameterDto>(createStringResource("JasperReportConfigurationPanel.properties")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target, IModel<JasperReportParameterDto> rowModel) {
            showPropertiesPopup(target, rowModel);
        }

        @Override
        protected IModel createLinkModel(IModel<JasperReportParameterDto> rowModel) {
            return createStringResource("JasperReportConfigurationPanel.configure");
        }
    });
    CheckBoxColumn<JasperReportParameterDto> forPrompting = new CheckBoxColumn<JasperReportParameterDto>(createStringResource("JasperReportConfigurationPanel.forPrompting"), "forPrompting") {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<JasperReportParameterDto>> cellItem, String componentId, IModel<JasperReportParameterDto> rowModel) {
            CheckBoxPanel checkBox = new CheckBoxPanel(componentId, new PropertyModel<Boolean>(rowModel, getPropertyExpression()), new Model<>(true));
            cellItem.add(checkBox);
        }
    };
    columns.add(forPrompting);
    return columns;
}
Also used : IModel(org.apache.wicket.model.IModel) ArrayList(java.util.ArrayList) CheckBoxPanel(com.evolveum.midpoint.web.component.data.column.CheckBoxPanel) JasperReportParameterDto(com.evolveum.midpoint.web.page.admin.reports.dto.JasperReportParameterDto) CheckBoxColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxColumn) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Item(org.apache.wicket.markup.repeater.Item) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) CheckBoxHeaderColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn)

Example 3 with CheckBoxColumn

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

the class LoggingConfigPanel method initAppenderColumns.

private List<IColumn<AppenderConfiguration, String>> initAppenderColumns() {
    List<IColumn<AppenderConfiguration, String>> columns = new ArrayList<>();
    IColumn column = new CheckBoxHeaderColumn<AppenderConfiguration>();
    columns.add(column);
    //name columns (editable)
    column = new EditableLinkColumn<AppenderConfiguration>(createStringResource("LoggingConfigPanel.appenders.name"), "name") {

        @Override
        public void onClick(AjaxRequestTarget target, IModel<AppenderConfiguration> rowModel) {
            appenderEditPerformed(target, rowModel);
        }

        @Override
        protected Component createInputPanel(String componentId, IModel<AppenderConfiguration> model) {
            TextPanel<String> panel = new TextPanel<String>(componentId, new PropertyModel(model, getPropertyExpression()));
            panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
            return panel;
        }
    };
    columns.add(column);
    //pattern column (editable)
    column = new EditablePropertyColumn(createStringResource("LoggingConfigPanel.appenders.pattern"), "pattern") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            InputPanel panel = super.createInputPanel(componentId, model);
            panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
            return panel;
        }
    };
    columns.add(column);
    //file path column (editable)
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.filePath"), "filePath");
    columns.add(column);
    //file pattern column (editable)                                                                               jj
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.filePattern"), "filePattern");
    columns.add(column);
    //max history column (editable)
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.maxHistory"), "maxHistory") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            TextPanel panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
            FormComponent component = panel.getBaseFormComponent();
            component.add(new AttributeModifier("size", 5));
            component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            addAjaxFormComponentUpdatingBehavior(component);
            return panel;
        }
    };
    columns.add(column);
    //max file size column (editable)
    column = new FileAppenderColumn(createStringResource("LoggingConfigPanel.appenders.maxFileSize"), "maxFileSize") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            TextPanel<String> panel = new TextPanel<>(componentId, new PropertyModel<String>(model, getPropertyExpression()));
            FormComponent component = panel.getBaseFormComponent();
            component.add(new AttributeModifier("size", 5));
            component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            component.add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(component);
            return panel;
        }
    };
    columns.add(column);
    CheckBoxColumn check = new EditableCheckboxColumn(createStringResource("LoggingConfigPanel.appenders.appending"), "appending") {

        @Override
        protected InputPanel createInputPanel(String componentId, IModel model) {
            InputPanel panel = super.createInputPanel(componentId, model);
            panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            panel.getBaseFormComponent().add(new NotNullValidator<String>("message.emptyString"));
            addAjaxFormComponentUpdatingBehavior(panel.getBaseFormComponent());
            return panel;
        }
    };
    check.setEnabled(false);
    columns.add(check);
    return columns;
}
Also used : FormComponent(org.apache.wicket.markup.html.form.FormComponent) ArrayList(java.util.ArrayList) TextPanel(com.evolveum.midpoint.web.component.input.TextPanel) AppenderConfiguration(com.evolveum.midpoint.web.page.admin.configuration.dto.AppenderConfiguration) CheckBoxHeaderColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn) EditablePropertyColumn(com.evolveum.midpoint.web.component.data.column.EditablePropertyColumn) Component(org.apache.wicket.Component) FormComponent(org.apache.wicket.markup.html.form.FormComponent) IModel(org.apache.wicket.model.IModel) InputPanel(com.evolveum.midpoint.web.component.prism.InputPanel) PropertyModel(org.apache.wicket.model.PropertyModel) NotNullValidator(com.evolveum.midpoint.web.component.input.validator.NotNullValidator) AttributeModifier(org.apache.wicket.AttributeModifier) CheckBoxColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxColumn) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) EditableCheckboxColumn(com.evolveum.midpoint.web.component.data.column.EditableCheckboxColumn) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)

Example 4 with CheckBoxColumn

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

the class PageConnectorHosts method initColumns.

private List<IColumn<SelectableBean<ConnectorHostType>, String>> initColumns() {
    List<IColumn<SelectableBean<ConnectorHostType>, String>> columns = new ArrayList<>();
    columns.add(new PropertyColumn(createStringResource("pageResources.connector.hostname"), "value.hostname"));
    columns.add(new PropertyColumn(createStringResource("pageResources.connector.port"), "value.port"));
    columns.add(new PropertyColumn(createStringResource("pageResources.connector.timeout"), "value.timeout"));
    columns.add(new CheckBoxColumn(createStringResource("pageResources.connector.protectConnection"), "value.protectConnection"));
    return columns;
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) ArrayList(java.util.ArrayList) CheckBoxColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxColumn)

Example 5 with CheckBoxColumn

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

the class SearchPropertiesConfigPanel method getTableColumns.

private List<IColumn<SelectableBean<ValueSearchFilterItem>, String>> getTableColumns() {
    List<IColumn<SelectableBean<ValueSearchFilterItem>, String>> columns = new ArrayList<>();
    CheckBoxHeaderColumn<SelectableBean<ValueSearchFilterItem>> checkboxColumn = new CheckBoxHeaderColumn<>();
    columns.add(checkboxColumn);
    IColumn<SelectableBean<ValueSearchFilterItem>, String> propertyColumn = new PropertyColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.property"), "value." + ValueSearchFilterItem.F_PROPERTY_NAME) {

        private static final long serialVersionUID = 1L;

        @Override
        public String getCssClass() {
            return getColumnStyleClass();
        }
    };
    columns.add(propertyColumn);
    IColumn<SelectableBean<ValueSearchFilterItem>, String> valueColumn = new AbstractColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.value")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<SelectableBean<ValueSearchFilterItem>>> item, String id, IModel<SelectableBean<ValueSearchFilterItem>> rowModel) {
            item.add(new SwitchablePropertyValuePanel(id, rowModel));
        }

        @Override
        public String getCssClass() {
            return "max-width-column";
        }
    };
    columns.add(valueColumn);
    IColumn<SelectableBean<ValueSearchFilterItem>, String> filterColumn = new AbstractColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.filter")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<SelectableBean<ValueSearchFilterItem>>> item, String id, IModel<SelectableBean<ValueSearchFilterItem>> rowModel) {
            List<ValueSearchFilterItem.FilterName> availableFilterNames = rowModel.getObject().getValue().getAvailableFilterNameList();
            DropDownChoicePanel<ValueSearchFilterItem.FilterName> filterPanel = WebComponentUtil.createEnumPanel(id, Model.ofList(availableFilterNames), new PropertyModel<>(rowModel, "value." + ValueSearchFilterItem.F_FILTER_TYPE_NAME), SearchPropertiesConfigPanel.this, false, getPageBase().createStringResource("SearchPropertiesConfigPanel.selectFilter").getString());
            filterPanel.setOutputMarkupId(true);
            filterPanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            filterPanel.getBaseFormComponent().add(new EnableBehaviour(() -> availableFilterNames.size() > 1));
            item.add(filterPanel);
        }

        @Override
        public String getCssClass() {
            return getColumnStyleClass();
        }
    };
    columns.add(filterColumn);
    IColumn<SelectableBean<ValueSearchFilterItem>, String> matchingRuleColumn = new AbstractColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.matchingRule")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void populateItem(Item<ICellPopulator<SelectableBean<ValueSearchFilterItem>>> item, String id, IModel<SelectableBean<ValueSearchFilterItem>> rowModel) {
            DropDownChoicePanel<ValueSearchFilterItem.MatchingRule> matchingRulePanel = WebComponentUtil.createEnumPanel(id, Model.ofList(rowModel.getObject().getValue().getAvailableMatchingRuleList()), new PropertyModel<>(rowModel, "value." + ValueSearchFilterItem.F_MATCHING_RULE), SearchPropertiesConfigPanel.this, true, getPageBase().createStringResource("SearchPropertiesConfigPanel.selectMatchingRule").getString());
            matchingRulePanel.setOutputMarkupId(true);
            matchingRulePanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
            item.add(matchingRulePanel);
        }

        @Override
        public String getCssClass() {
            return getColumnStyleClass();
        }
    };
    columns.add(matchingRuleColumn);
    CheckBoxColumn<SelectableBean<ValueSearchFilterItem>> negationColumn = new CheckBoxColumn<SelectableBean<ValueSearchFilterItem>>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.applyNegotiation"), "value." + ValueSearchFilterItem.F_APPLY_NEGATION) {

        private static final long serialVersionUID = 1L;

        @Override
        public String getCssClass() {
            return "min-width-column";
        }
    };
    columns.add(negationColumn);
    InlineMenuButtonColumn<SelectableBean<ValueSearchFilterItem>> actionsColumn = new InlineMenuButtonColumn<SelectableBean<ValueSearchFilterItem>>(getTableMenuItems(), getPageBase()) {

        private static final long serialVersionUID = 1L;

        @Override
        public String getCssClass() {
            return "min-width-column";
        }
    };
    columns.add(actionsColumn);
    return columns;
}
Also used : PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) ArrayList(java.util.ArrayList) EmptyOnBlurAjaxFormUpdatingBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) Item(org.apache.wicket.markup.repeater.Item) ValueSearchFilterItem(com.evolveum.midpoint.web.component.search.filter.ValueSearchFilterItem) CheckBoxHeaderColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) EnableBehaviour(com.evolveum.midpoint.web.component.util.EnableBehaviour) IModel(org.apache.wicket.model.IModel) InlineMenuButtonColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn) AbstractColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn) CheckBoxColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxColumn) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ValueSearchFilterItem(com.evolveum.midpoint.web.component.search.filter.ValueSearchFilterItem)

Aggregations

CheckBoxColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxColumn)5 ArrayList (java.util.ArrayList)5 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)5 CheckBoxHeaderColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn)4 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)3 PropertyColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn)3 IModel (org.apache.wicket.model.IModel)3 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)2 ConnectorHostType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType)2 Item (org.apache.wicket.markup.repeater.Item)2 CheckBoxPanel (com.evolveum.midpoint.web.component.data.column.CheckBoxPanel)1 EditableCheckboxColumn (com.evolveum.midpoint.web.component.data.column.EditableCheckboxColumn)1 EditablePropertyColumn (com.evolveum.midpoint.web.component.data.column.EditablePropertyColumn)1 InlineMenuButtonColumn (com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn)1 InlineMenuHeaderColumn (com.evolveum.midpoint.web.component.data.column.InlineMenuHeaderColumn)1 TextPanel (com.evolveum.midpoint.web.component.input.TextPanel)1 NotNullValidator (com.evolveum.midpoint.web.component.input.validator.NotNullValidator)1 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)1 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)1 InputPanel (com.evolveum.midpoint.web.component.prism.InputPanel)1