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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations