Search in sources :

Example 21 with CheckBox

use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.

the class WebComponentUtil method createAjaxCheckBox.

public static CheckBox createAjaxCheckBox(String id, IModel<Boolean> model) {
    CheckBox checkBox = new CheckBox(id, model);
    checkBox.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    return checkBox;
}
Also used : EmptyOnChangeAjaxFormUpdatingBehavior(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior) CheckBox(org.apache.wicket.markup.html.form.CheckBox)

Example 22 with CheckBox

use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.

the class SystemConfigPanel method initLayout.

protected void initLayout() {
    ChooseTypePanel<ValuePolicyType> passPolicyChoosePanel = new ChooseTypePanel<ValuePolicyType>(ID_GLOBAL_PASSWORD_POLICY_CHOOSER, new PropertyModel<ObjectViewDto<ValuePolicyType>>(getModel(), SystemConfigurationDto.F_PASSWORD_POLICY));
    ChooseTypePanel<SecurityPolicyType> securityPolicyChoosePanel = new ChooseTypePanel<SecurityPolicyType>(ID_GLOBAL_SECURITY_POLICY_CHOOSER, new PropertyModel<ObjectViewDto<SecurityPolicyType>>(getModel(), SystemConfigurationDto.F_SECURITY_POLICY));
    add(passPolicyChoosePanel);
    add(securityPolicyChoosePanel);
    ObjectPolicyConfigurationEditor objectPolicyEditor = new ObjectPolicyConfigurationEditor(ID_OBJECT_POLICY_EDITOR, new PropertyModel<List<ObjectPolicyConfigurationTypeDto>>(getModel(), SystemConfigurationDto.F_OBJECT_POLICY_LIST));
    add(objectPolicyEditor);
    DropDownChoice<AEPlevel> aepLevel = new DropDownChoice<>(ID_GLOBAL_AEP, new PropertyModel<AEPlevel>(getModel(), SystemConfigurationDto.F_AEP_LEVEL), WebComponentUtil.createReadonlyModelFromEnum(AEPlevel.class), new EnumChoiceRenderer<AEPlevel>(SystemConfigPanel.this));
    aepLevel.setOutputMarkupId(true);
    if (aepLevel.getModel().getObject() == null) {
        aepLevel.getModel().setObject(null);
    }
    aepLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    add(aepLevel);
    TextField<String> auditRecordsField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_AUDIT_RECORDS, new PropertyModel<String>(getModel(), SystemConfigurationDto.F_AUDIT_CLEANUP));
    TextField<String> closedTasksField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_CLOSED_TASKS, new PropertyModel<String>(getModel(), SystemConfigurationDto.F_TASK_CLEANUP));
    add(auditRecordsField);
    add(closedTasksField);
    createTooltip(ID_CLEANUP_AUDIT_RECORDS_TOOLTIP);
    createTooltip(ID_CLEANUP_CLOSED_TASKS_TOOLTIP);
    CheckBox experimentalCodeCheck = WebComponentUtil.createAjaxCheckBox(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel<Boolean>(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE));
    add(experimentalCodeCheck);
}
Also used : ValuePolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.ValuePolicyType) AEPlevel(com.evolveum.midpoint.web.page.admin.configuration.dto.AEPlevel) SecurityPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.SecurityPolicyType) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) CheckBox(org.apache.wicket.markup.html.form.CheckBox) List(java.util.List) ObjectViewDto(com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto) ObjectPolicyConfigurationEditor(com.evolveum.midpoint.web.component.ObjectPolicyConfigurationEditor)

Example 23 with CheckBox

use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.

the class ProfilingConfigPanel method initLayout.

private void initLayout(PageSystemConfiguration parentPage) {
    WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
    profilingEnabledNote.setVisible(!parentPage.getMidpointConfiguration().isProfilingEnabled());
    add(profilingEnabledNote);
    //Entry-Exit profiling init
    DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<>("profilingLevel", new PropertyModel<ProfilingLevel>(getModel(), "profilingLevel"), WebComponentUtil.createReadonlyModelFromEnum(ProfilingLevel.class), new EnumChoiceRenderer<ProfilingLevel>(this));
    profilingLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    add(profilingLevel);
    DropDownChoice<String> profilingAppender = new DropDownChoice<>("profilingAppender", new PropertyModel<String>(getModel(), "profilingAppender"), createAppendersListModel());
    profilingAppender.setNullValid(true);
    profilingAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    add(profilingAppender);
    //Subsystem and general profiling init
    CheckBox requestFilter = WebComponentUtil.createAjaxCheckBox("requestFilter", new PropertyModel<Boolean>(getModel(), "requestFilter"));
    CheckBox performanceStatistics = WebComponentUtil.createAjaxCheckBox("performanceStatistics", new PropertyModel<Boolean>(getModel(), "performanceStatistics"));
    CheckBox subsystemModel = WebComponentUtil.createAjaxCheckBox("subsystemModel", new PropertyModel<Boolean>(getModel(), "subsystemModel"));
    CheckBox subsystemRepository = WebComponentUtil.createAjaxCheckBox("subsystemRepository", new PropertyModel<Boolean>(getModel(), "subsystemRepository"));
    CheckBox subsystemProvisioning = WebComponentUtil.createAjaxCheckBox("subsystemProvisioning", new PropertyModel<Boolean>(getModel(), "subsystemProvisioning"));
    //CheckBox subsystemUcf = WebComponentUtil.createAjaxCheckBox("subsystemUcf", new PropertyModel<Boolean>(getModel(), "subsystemUcf"));
    CheckBox subsystemResourceObjectChangeListener = WebComponentUtil.createAjaxCheckBox("subsystemSynchronizationService", new PropertyModel<Boolean>(getModel(), "subsystemSynchronizationService"));
    CheckBox subsystemTaskManager = WebComponentUtil.createAjaxCheckBox("subsystemTaskManager", new PropertyModel<Boolean>(getModel(), "subsystemTaskManager"));
    CheckBox subsystemWorkflow = WebComponentUtil.createAjaxCheckBox("subsystemWorkflow", new PropertyModel<Boolean>(getModel(), "subsystemWorkflow"));
    add(requestFilter);
    add(performanceStatistics);
    add(subsystemModel);
    add(subsystemRepository);
    add(subsystemProvisioning);
    //add(subsystemUcf);
    add(subsystemResourceObjectChangeListener);
    add(subsystemTaskManager);
    add(subsystemWorkflow);
    TextField<Integer> dumpInterval = WebComponentUtil.createAjaxTextField("dumpInterval", new PropertyModel<Integer>(getModel(), "dumpInterval"));
    add(dumpInterval);
    Label dumpIntervalTooltip = new Label(ID_DUMP_INTERVAL_TOOLTIP);
    dumpIntervalTooltip.add(new InfoTooltipBehavior());
    add(dumpIntervalTooltip);
}
Also used : ProfilingLevel(com.evolveum.midpoint.web.page.admin.configuration.dto.ProfilingLevel) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) CheckBox(org.apache.wicket.markup.html.form.CheckBox)

Example 24 with CheckBox

use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.

the class ObjectPolicyPanel method initLayout.

//	public void updateModel(AjaxRequestTarget target, ObjectPolicyConfigurationTypeDto config) {
//		model.setObject(new ObjectPolicyDialogDto(config, getPageBase()));
//		target.add(getContent());
//	}
public void initLayout() {
    Form form = new Form(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    DropDownFormGroup type = new DropDownFormGroup<>(ID_TYPE, new PropertyModel<QName>(model, ObjectPolicyDialogDto.F_TYPE), createTypeChoiceList(), new QNameChoiceRenderer(), createStringResource("ObjectPolicyDialog.type"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(type);
    type.getInput().setNullValid(false);
    type.getInput().setRequired(true);
    TextField<String> fieldSubtype = new TextField<>(ID_SUBTYPE, new PropertyModel<String>(model, ObjectPolicyDialogDto.F_SUBTYPE));
    form.add(fieldSubtype);
    form.add(fieldSubtype);
    DropDownFormGroup template = new DropDownFormGroup<>(ID_OBJECT_TEMPLATE, new PropertyModel<ObjectTemplateConfigTypeReferenceDto>(model, ObjectPolicyDialogDto.F_TEMPLATE_REF), createObjectTemplateList(), new ChoiceableChoiceRenderer<ObjectTemplateConfigTypeReferenceDto>(), createStringResource("ObjectPolicyDialog.template"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
    form.add(template);
    template.getInput().setNullValid(false);
    template.getInput().setRequired(true);
    ListView repeater = new ListView<PropertyConstraintTypeDto>(ID_REPEATER, new PropertyModel<List<PropertyConstraintTypeDto>>(model, ObjectPolicyDialogDto.F_PROPERTY_LIST)) {

        @Override
        protected void populateItem(final ListItem item) {
            WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
            textWrapper.add(AttributeAppender.prepend("class", new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    if (item.getIndex() > 0) {
                        return OFFSET_CLASS + " " + CLASS_MULTI_VALUE;
                    }
                    return null;
                }
            }));
            item.add(textWrapper);
            TextField property = new TextField<>(ID_PROPERTY, new PropertyModel<String>(item.getModel(), PropertyConstraintTypeDto.F_PROPERTY_PATH));
            property.add(new AjaxFormComponentUpdatingBehavior("blur") {

                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                }
            });
            property.add(AttributeAppender.replace("placeholder", createStringResource("ObjectPolicyDialog.property.placeholder")));
            textWrapper.add(property);
            CheckBox oidBound = new CheckBox(ID_OID_BOUND, new PropertyModel<Boolean>(item.getModel(), PropertyConstraintTypeDto.F_OID_BOUND));
            oidBound.add(AttributeModifier.replace("title", createStringResource("ObjectPolicyDialog.label.oidBound.help")));
            textWrapper.add(oidBound);
            WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
            buttonGroup.add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    if (item.getIndex() > 0) {
                        return CLASS_MULTI_VALUE;
                    }
                    return null;
                }
            }));
            item.add(buttonGroup);
            initButtons(buttonGroup, item);
        }
    };
    form.add(repeater);
    AjaxSubmitButton cancel = new AjaxSubmitButton(ID_BUTTON_CANCEL, createStringResource("ObjectPolicyDialog.button.cancel")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            cancelPerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form<?> form) {
            cancelPerformed(target);
        }
    };
    form.add(cancel);
    AjaxSubmitButton save = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("ObjectPolicyDialog.button.save")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            savePerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form<?> form) {
            target.add(form);
        }
    };
    form.add(save);
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Form(org.apache.wicket.markup.html.form.Form) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ListView(org.apache.wicket.markup.html.list.ListView) TextField(org.apache.wicket.markup.html.form.TextField) ArrayList(java.util.ArrayList) List(java.util.List) AjaxFormComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior) QNameChoiceRenderer(com.evolveum.midpoint.web.component.input.QNameChoiceRenderer) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) DropDownFormGroup(com.evolveum.midpoint.web.component.form.DropDownFormGroup) QName(javax.xml.namespace.QName) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectTemplateConfigTypeReferenceDto(com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectTemplateConfigTypeReferenceDto) CheckBox(org.apache.wicket.markup.html.form.CheckBox) ListItem(org.apache.wicket.markup.html.list.ListItem)

Example 25 with CheckBox

use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.

the class LoggingConfigPanel method initAudit.

private void initAudit() {
    CheckBox auditLog = WebComponentUtil.createAjaxCheckBox("auditLog", new PropertyModel<Boolean>(getModel(), "auditLog"));
    add(auditLog);
    CheckBox auditDetails = WebComponentUtil.createAjaxCheckBox("auditDetails", new PropertyModel<Boolean>(getModel(), "auditDetails"));
    add(auditDetails);
    DropDownChoice<String> auditAppender = new DropDownChoice<>("auditAppender", new PropertyModel<String>(getModel(), "auditAppender"), createAppendersListModel());
    auditAppender.setNullValid(true);
    auditAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
    add(auditAppender);
}
Also used : DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) CheckBox(org.apache.wicket.markup.html.form.CheckBox)

Aggregations

CheckBox (org.apache.wicket.markup.html.form.CheckBox)39 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)24 Label (org.apache.wicket.markup.html.basic.Label)20 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)16 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)14 ArrayList (java.util.ArrayList)12 List (java.util.List)12 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)11 PropertyModel (org.apache.wicket.model.PropertyModel)11 Form (org.apache.wicket.markup.html.form.Form)10 TextField (org.apache.wicket.markup.html.form.TextField)10 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)9 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)8 IModel (org.apache.wicket.model.IModel)7 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)5 Model (org.apache.wicket.model.Model)5 EmptyOnChangeAjaxFormUpdatingBehavior (com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior)4 StringChoiceRenderer (com.gitblit.wicket.StringChoiceRenderer)4 AjaxCheckBox (org.apache.wicket.ajax.markup.html.form.AjaxCheckBox)4 ListItem (org.apache.wicket.markup.html.list.ListItem)4