use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class LimitationsEditorDialog method initLimitationBody.
private void initLimitationBody(final WebMarkupContainer body, ListItem<PropertyLimitationsTypeDto> item) {
CheckFormGroup schema = new CheckFormGroup(ID_LAYER_SCHEMA, new PropertyModel<>(item.getModelObject(), PropertyLimitationsTypeDto.F_SCHEMA), createStringResource("LimitationsEditorDialog.label.schema"), ID_LABEL_SIZE, ID_INPUT_SIZE);
schema.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(schema);
CheckFormGroup model = new CheckFormGroup(ID_LAYER_MODEL, new PropertyModel<>(item.getModelObject(), PropertyLimitationsTypeDto.F_MODEL), createStringResource("LimitationsEditorDialog.label.model"), ID_LABEL_SIZE, ID_INPUT_SIZE);
model.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(model);
CheckFormGroup presentation = new CheckFormGroup(ID_LAYER_PRESENTATION, new PropertyModel<>(item.getModelObject(), PropertyLimitationsTypeDto.F_PRESENTATION), createStringResource("LimitationsEditorDialog.label.presentation"), ID_LABEL_SIZE, ID_INPUT_SIZE);
presentation.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(presentation);
DropDownChoicePanel<PropertyAccess> add = new DropDownChoicePanel<>(ID_ACCESS_ADD, getAddPropertyAccessModel(item.getModel()), WebComponentUtil.createReadonlyModelFromEnum(PropertyAccess.class), false);
FormComponent<PropertyAccess> addInput = add.getBaseFormComponent();
addInput.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
addInput.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
DropDownChoicePanel<PropertyAccess> read = new DropDownChoicePanel<>(ID_ACCESS_READ, getReadPropertyAccessModel(item.getModel()), WebComponentUtil.createReadonlyModelFromEnum(PropertyAccess.class), false);
FormComponent<PropertyAccess> readInput = read.getBaseFormComponent();
readInput.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
readInput.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
DropDownChoicePanel<PropertyAccess> modify = new DropDownChoicePanel<>(ID_ACCESS_MODIFY, getModifyPropertyAccessModel(item.getModel()), WebComponentUtil.createReadonlyModelFromEnum(PropertyAccess.class), false);
FormComponent<PropertyAccess> modifyInput = modify.getBaseFormComponent();
modifyInput.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
modifyInput.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
body.add(add);
body.add(read);
body.add(modify);
TextFormGroup minOccurs = new TextFormGroup(ID_MIN_OCCURS, new PropertyModel<>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".minOccurs"), createStringResource("LimitationsEditorDialog.label.minOccurs"), "SchemaHandlingStep.limitations.tooltip.minOccurs", ID_LABEL_SIZE, ID_INPUT_SIZE, false, false);
minOccurs.getField().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(minOccurs);
TextFormGroup maxOccurs = new TextFormGroup(ID_MAX_OCCURS, new PropertyModel<>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".maxOccurs"), createStringResource("LimitationsEditorDialog.label.maxOccurs"), "SchemaHandlingStep.limitations.tooltip.maxOccurs", ID_LABEL_SIZE, ID_INPUT_SIZE, false, false);
maxOccurs.getField().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(maxOccurs);
CheckFormGroup ignore = new CheckFormGroup(ID_IGNORE, new PropertyModel<>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".ignore"), createStringResource("LimitationsEditorDialog.label.ignore"), "SchemaHandlingStep.limitations.tooltip.ignore", ID_LABEL_SIZE, ID_INPUT_SIZE);
ignore.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(ignore);
Label layersTooltip = new Label(ID_T_LAYERS);
layersTooltip.add(new InfoTooltipBehavior());
body.add(layersTooltip);
Label propertyTooltip = new Label(ID_T_PROPERTY);
propertyTooltip.add(new InfoTooltipBehavior());
body.add(propertyTooltip);
}
Aggregations