use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class ExpressionVariableEditorDialog method initLayout.
public void initLayout(WebMarkupContainer content) {
Form form = new Form(ID_MAIN_FORM);
form.setOutputMarkupId(true);
content.add(form);
// TODO - shouldn't this be some AutoCompleteField? If yer, where do we
// get value?
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_VARIABLE + ".name.localPart"), createStringResource("ExpressionVariableEditor.label.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(name);
TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_VARIABLE + ".description"), createStringResource("ExpressionVariableEditor.label.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(description);
TextFormGroup path = new TextFormGroup(ID_PATH, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_PATH), createStringResource("ExpressionVariableEditor.label.path"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(path);
DropDownFormGroup objectReference = new DropDownFormGroup<>(ID_OBJECT_REFERENCE, new PropertyModel<ObjectReferenceType>(model, ExpressionVariableDefinitionTypeDto.F_VARIABLE + ".objectRef"), new AbstractReadOnlyModel<List<ObjectReferenceType>>() {
@Override
public List<ObjectReferenceType> getObject() {
return WebModelServiceUtils.createObjectReferenceList(ObjectType.class, getPageBase(), objectMap);
}
}, new ObjectReferenceChoiceRenderer(objectMap), createStringResource("ExpressionVariableEditor.label.objectRef"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(objectReference);
TextAreaFormGroup value = new TextAreaFormGroup(ID_VALUE, new PropertyModel<String>(model, ExpressionVariableDefinitionTypeDto.F_VALUE), createStringResource("ExpressionVariableEditor.label.value"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(value);
AjaxSubmitButton cancel = new AjaxSubmitButton(ID_BUTTON_CANCEL, createStringResource("ExpressionVariableEditor.button.cancel")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
cancelPerformed(target);
}
};
form.add(cancel);
AjaxSubmitButton save = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("ExpressionVariableEditor.button.apply")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
savePerformed(target);
}
};
form.add(save);
}
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<Boolean>(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<Boolean>(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<Boolean>(item.getModelObject(), PropertyLimitationsTypeDto.F_PRESENTATION), createStringResource("LimitationsEditorDialog.label.presentation"), ID_LABEL_SIZE, ID_INPUT_SIZE);
presentation.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(presentation);
DropDownChoicePanel 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 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 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<String>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".minOccurs"), createStringResource("LimitationsEditorDialog.label.minOccurs"), "SchemaHandlingStep.limitations.tooltip.minOccurs", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, false);
minOccurs.getField().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(minOccurs);
TextFormGroup maxOccurs = new TextFormGroup(ID_MAX_OCCURS, new PropertyModel<String>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".maxOccurs"), createStringResource("LimitationsEditorDialog.label.maxOccurs"), "SchemaHandlingStep.limitations.tooltip.maxOccurs", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, false);
maxOccurs.getField().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(maxOccurs);
CheckFormGroup ignore = new CheckFormGroup(ID_IGNORE, new PropertyModel<Boolean>(item.getModelObject(), PropertyLimitationsTypeDto.F_LIMITATION + ".ignore"), createStringResource("LimitationsEditorDialog.label.ignore"), "SchemaHandlingStep.limitations.tooltip.ignore", true, ID_LABEL_SIZE, ID_INPUT_SIZE);
ignore.getCheck().add(prepareAjaxOnComponentTagUpdateBehavior());
body.add(ignore);
Label layersTooltip = new Label(ID_T_LAYERS);
layersTooltip.add(new InfoTooltipBehavior(true) {
@Override
public String getModalContainer(Component component) {
return body.getMarkupId();
}
});
body.add(layersTooltip);
Label propertyTooltip = new Label(ID_T_PROPERTY);
propertyTooltip.add(new InfoTooltipBehavior(true) {
@Override
public String getModalContainer(Component component) {
return body.getMarkupId();
}
});
body.add(propertyTooltip);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class SynchronizationActionEditorDialog method initLayout.
private void initLayout(WebMarkupContainer content) {
Form form = new Form(ID_MAIN_FORM);
form.setOutputMarkupId(true);
content.add(form);
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(model, SynchronizationActionTypeDto.F_ACTION_OBJECT + ".name"), createStringResource("SynchronizationActionEditorDialog.label.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(name);
TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, SynchronizationActionTypeDto.F_ACTION_OBJECT + ".description"), createStringResource("SynchronizationActionEditorDialog.label.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(description);
DropDownFormGroup<SynchronizationActionTypeDto.HandlerUriActions> handlerUri = new DropDownFormGroup<SynchronizationActionTypeDto.HandlerUriActions>(ID_HANDLER_URI, new PropertyModel<SynchronizationActionTypeDto.HandlerUriActions>(model, SynchronizationActionTypeDto.F_HANDLER_URI), WebComponentUtil.createReadonlyModelFromEnum(SynchronizationActionTypeDto.HandlerUriActions.class), new EnumChoiceRenderer<SynchronizationActionTypeDto.HandlerUriActions>(this), createStringResource("SynchronizationActionEditorDialog.label.handlerUri"), "SynchronizationStep.action.tooltip.handlerUri", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) {
@Override
protected DropDownChoice createDropDown(String id, IModel<List<SynchronizationActionTypeDto.HandlerUriActions>> choices, IChoiceRenderer<SynchronizationActionTypeDto.HandlerUriActions> renderer, boolean required) {
DropDownChoice choice = new DropDownChoice<>(id, getModel(), choices, renderer);
choice.setNullValid(true);
return choice;
}
};
form.add(handlerUri);
DropDownFormGroup<BeforeAfterType> order = new DropDownFormGroup<BeforeAfterType>(ID_ORDER, new PropertyModel<BeforeAfterType>(model, SynchronizationActionTypeDto.F_ACTION_OBJECT + ".order"), WebComponentUtil.createReadonlyModelFromEnum(BeforeAfterType.class), new EnumChoiceRenderer<BeforeAfterType>(this), createStringResource("SynchronizationActionEditorDialog.label.order"), "SynchronizationStep.action.tooltip.order", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) {
@Override
protected DropDownChoice createDropDown(String id, IModel<List<BeforeAfterType>> choices, IChoiceRenderer<BeforeAfterType> renderer, boolean required) {
DropDownChoice choice = new DropDownChoice<>(id, getModel(), choices, renderer);
choice.setNullValid(true);
return choice;
}
};
form.add(order);
initButtons(form);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class ReportConfigurationPanel method initLayout.
protected void initLayout() {
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), ID_NAME), createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(name);
TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), ID_DESCRIPTION), createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(description);
IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
IChoiceRenderer renderer = new EnumChoiceRenderer();
DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new PropertyModel<ExportType>(getModel(), ReportDto.F_EXPORT_TYPE), choices, renderer, createStringResource("ReportType.export"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(exportType);
TextFormGroup virtualizerKickOn = null;
DropDownFormGroup virtualizer = new DropDownFormGroup(ID_VIRTUALIZER, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER), createVirtualizerListModel(), new ChoiceRenderer<String>(), createStringResource("ReportType.virtualizer"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
//virtualizer.add(new VirtualizerAjaxFormUpdatingBehaviour(virtualizerKickOn));
add(virtualizer);
virtualizerKickOn = new TextFormGroup(ID_VIRTUALIZER_KICKON, new PropertyModel<String>(getModel(), ReportDto.F_VIRTUALIZER_KICKON), createStringResource("ReportType.virtualizerKickOn"), ID_LABEL_SIZE, "col-md-4", false);
add(virtualizerKickOn);
TextFormGroup maxPages = new TextFormGroup(ID_MAXPAGES, new PropertyModel<String>(getModel(), ReportDto.F_MAXPAGES), createStringResource("ReportType.maxPages"), ID_LABEL_SIZE, "col-md-4", false);
add(maxPages);
TextFormGroup timeout = new TextFormGroup(ID_TIMEOUT, new PropertyModel<String>(getModel(), ReportDto.F_TIMEOUT), createStringResource("ReportType.timeout"), ID_LABEL_SIZE, "col-md-4", false);
add(timeout);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class UserReportConfigPanel method initLayout.
private void initLayout(final Component component) {
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), UserReportDto.F_NAME), createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(name);
TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), UserReportDto.F_DESCRIPTION), createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(description);
IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
IChoiceRenderer renderer = new EnumChoiceRenderer();
DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new PropertyModel<ExportType>(getModel(), UserReportDto.F_EXPORT_TYPE), choices, renderer, createStringResource("UserReportConfigPanel.exportFileType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(exportType);
DateFormGroup dateFrom = new DateFormGroup(ID_DATE_FROM, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_FROM_GREG), createStringResource("UserReportConfigPanel.dateFrom"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(dateFrom);
DateFormGroup dateTo = new DateFormGroup(ID_DATE_TO, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_TO_GREG), createStringResource("UserReportConfigPanel.dateTo"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(dateTo);
}
Aggregations