Search in sources :

Example 1 with CheckBoxPanel

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

the class RoleMemberPanel method initSearch.

@Override
protected void initSearch(Form form) {
    List<QName> allowedTypes = WebComponentUtil.createFocusTypeList();
    allowedTypes.add(FocusType.COMPLEX_TYPE);
    DropDownChoice<QName> typeSelect = createDropDown(ID_OBJECT_TYPE, Model.of(FocusType.COMPLEX_TYPE), allowedTypes, new QNameChoiceRenderer());
    add(typeSelect);
    DropDownChoice<OrgType> tenant = createDropDown(ID_TENANT, new Model(), createTenantList(), new ObjectTypeChoiceRenderer<OrgType>());
    add(tenant);
    tenant.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return isRole();
        }
    });
    DropDownChoice<OrgType> project = createDropDown(ID_PROJECT, new Model(), createProjectList(), new ObjectTypeChoiceRenderer<OrgType>());
    add(project);
    project.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return isRole();
        }
    });
    CheckBoxPanel includeIndirectMembers = new CheckBoxPanel(ID_INDIRECT_MEMBERS, new Model<Boolean>(false)) {

        private static final long serialVersionUID = 1L;

        public void onUpdate(AjaxRequestTarget target) {
            refreshTable(target);
        }
    };
    add(includeIndirectMembers);
    // TODO shouldn't we hide also the label?
    includeIndirectMembers.add(new VisibleBehaviour(this::isRole));
}
Also used : QNameChoiceRenderer(com.evolveum.midpoint.web.component.input.QNameChoiceRenderer) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) QName(javax.xml.namespace.QName) CheckBoxPanel(com.evolveum.midpoint.web.component.data.column.CheckBoxPanel) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) OrgType(com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType) IModel(org.apache.wicket.model.IModel) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Model(org.apache.wicket.model.Model) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Example 2 with CheckBoxPanel

use of com.evolveum.midpoint.web.component.data.column.CheckBoxPanel 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)

Aggregations

CheckBoxPanel (com.evolveum.midpoint.web.component.data.column.CheckBoxPanel)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 IModel (org.apache.wicket.model.IModel)2 CheckBoxColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxColumn)1 CheckBoxHeaderColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn)1 QNameChoiceRenderer (com.evolveum.midpoint.web.component.input.QNameChoiceRenderer)1 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 JasperReportParameterDto (com.evolveum.midpoint.web.page.admin.reports.dto.JasperReportParameterDto)1 OrgType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType)1 ArrayList (java.util.ArrayList)1 QName (javax.xml.namespace.QName)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 Item (org.apache.wicket.markup.repeater.Item)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1 Model (org.apache.wicket.model.Model)1