use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class ReconciliationPopupPanel method initLayout.
private void initLayout(IModel<List<ResourceItemDto>> resources, final Component component) {
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), ReconciliationReportDto.F_NAME), createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(name);
TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), ReconciliationReportDto.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(), ReconciliationReportDto.F_EXPORT_TYPE), choices, renderer, createStringResource("ReconciliationPopupPanel.exportFileType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(exportType);
DropDownFormGroup resourceDropDown = new DropDownFormGroup(ID_RESOURCE, createModel(resources.getObject()), resources, renderer, createStringResource("ReconciliationPopupPanel.resource"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(resourceDropDown);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class AuditPopupPanel method initLayout.
@SuppressWarnings("serial")
private void initLayout(final Component component) {
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), AuditReportDto.F_NAME), createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(name);
TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), AuditReportDto.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(), AuditReportDto.F_EXPORT_TYPE), choices, renderer, createStringResource("AuditPopulPanel.exportType.label"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(exportType);
choices = WebComponentUtil.createReadonlyModelFromEnum(AuditEventType.class);
DropDownFormGroup auditEventType = new DropDownFormGroup(ID_AUDITEVENTTYPE, new PropertyModel<AuditEventType>(getModel(), AuditReportDto.F_AUDITEVENTTYPE), choices, renderer, createStringResource("AuditPopupPanel.auditEventType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(auditEventType);
DateFormGroup dateFrom = new DateFormGroup(ID_DATE_FROM, new PropertyModel<XMLGregorianCalendar>(getModel(), AuditReportDto.F_FROM_GREG), createStringResource("AuditPopupPanel.dateFrom"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(dateFrom);
DateFormGroup dateTo = new DateFormGroup(ID_DATE_TO, new PropertyModel<XMLGregorianCalendar>(getModel(), AuditReportDto.F_TO_GREG), createStringResource("AuditPopupPanel.dateTo"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(dateTo);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class RichHyperlinkConfigDialog 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_LABEL, new PropertyModel<String>(model, RichHyperlinkType.F_LABEL.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.label"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
form.add(name);
TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, RichHyperlinkType.F_DESCRIPTION.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.description"), ID_LABEL_SIZE, ID_INPUT_SIZE);
description.setVisible(!isMenuItem);
form.add(description);
TextFormGroup targetUrl = new TextFormGroup(ID_TARGET_URL, new PropertyModel<String>(model, RichHyperlinkType.F_TARGET_URL.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.targetUrl"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(targetUrl);
TextFormGroup color = new TextFormGroup(ID_COLOR, new PropertyModel<String>(model, RichHyperlinkType.F_COLOR.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.color"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
color.setVisible(!isMenuItem);
form.add(color);
MultiValueTextFormGroup authorizations = new MultiValueTextFormGroup(ID_AUTHORIZATION, new PropertyModel<List<String>>(model, RichHyperlinkType.F_AUTHORIZATION.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.authorization"), ID_LABEL_SIZE, ID_MULTIPLE_INPUT_SIZE, false);
authorizations.setVisible(!isMenuItem);
form.add(authorizations);
TextFormGroup icon = new TextFormGroup(ID_ICON, new PropertyModel<String>(model, RichHyperlinkType.F_ICON.getLocalPart() + "." + IconType.F_CSS_CLASS.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.icon"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(icon);
initButtons(form);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class NotificationConfigTabPanel method initLayout.
protected void initLayout() {
PrismPropertyWrapperModel<NotificationConfigurationType, MailConfigurationType> mailConfig = PrismPropertyWrapperModel.fromContainerWrapper(getModel(), NotificationConfigurationType.F_MAIL);
add(createHeader(ID_MAIL_CONFIG_HEADER, mailConfig));
PropertyModel<MailConfigurationType> mailConfigType = new ItemRealValueModel<>(new PropertyModel<>(mailConfig, "values[0]"));
if (mailConfigType.getObject() == null) {
// TODO: This fails for deprecated "mail" element if it's missing, so it's not deprecated yet.
// Reason: mailConfig.getObject() == null
// Root cause: ItemWrapperFactoryImpl.skipCreateWrapper() has a code to skip empty & deprecated stuff.
// The object for mailConfig can't be created with createItemWrapper either as it would be skipped again and return null.
// Let's create new GUI for the new transport configuration first without to-be deprecated components.
mailConfigType.setObject(new MailConfigurationType());
}
add(new TextFormGroup(ID_DEFAULT_FROM, new PropertyModel<>(mailConfigType, "defaultFrom"), createStringResource(mailConfig.getObject().getTypeName().getLocalPart() + ".defaultFrom"), "", getInputCssClass(), false, true));
add(new TextFormGroup(ID_REDIRECT_TO_FILE, new PropertyModel<>(mailConfigType, "redirectToFile"), createStringResource(mailConfig.getObject().getTypeName().getLocalPart() + ".redirectToFile"), "", getInputCssClass(), false, true));
add(new TextFormGroup(ID_LOG_TO_FILE, new PropertyModel<>(mailConfigType, "logToFile"), createStringResource(mailConfig.getObject().getTypeName().getLocalPart() + ".logToFile"), "", getInputCssClass(), false, true));
add(new TriStateFormGroup(ID_DEBUG, new PropertyModel<>(mailConfigType, "debug"), createStringResource(mailConfig.getObject().getTypeName().getLocalPart() + ".debug"), "", getInputCssClass(), false, true));
add(createHeader(ID_MAIL_SERVER_CONFIG_HEADER, MailServerConfigurationType.COMPLEX_TYPE.getLocalPart() + ".details"));
add(initServersTable(mailConfigType));
add(createHeader(ID_FILE_CONFIG_HEADER, FileConfigurationType.COMPLEX_TYPE.getLocalPart() + ".details"));
IModel<PrismPropertyWrapper<FileConfigurationType>> fileConfig = PrismPropertyWrapperModel.fromContainerWrapper(getModel(), NotificationConfigurationType.F_FILE);
WebMarkupContainer files = new WebMarkupContainer(ID_FILE_CONFIG);
files.setOutputMarkupId(true);
add(files);
ListView<PrismPropertyValueWrapper<FileConfigurationType>> values = new ListView<>("values", new PropertyModel<>(fileConfig, "values")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<PrismPropertyValueWrapper<FileConfigurationType>> item) {
FileConfigurationType fileConfigType = item.getModelObject().getRealValue();
item.add(createHeader(ID_VALUE_HEADER, fileConfigType == null || fileConfigType.getName() == null || fileConfigType.getName().isEmpty() ? (FileConfigurationType.COMPLEX_TYPE.getLocalPart() + ".details") : fileConfigType.getName()));
AjaxLink<Void> removeButton = new AjaxLink<>(ID_REMOVE_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
((PrismPropertyValue<FileConfigurationType>) item.getModelObject()).setValue(null);
item.getParent().remove(item.getId());
target.add(files);
}
};
item.add(removeButton);
TextFormGroup name = new TextFormGroup(ID_FILE_NAME, fileConfigType != null ? new PropertyModel<>(fileConfigType, "name") : Model.of(""), createStringResource(fileConfigType == null ? "" : (fileConfigType.COMPLEX_TYPE.getLocalPart() + ".name")), "", getInputCssClass(), false, true);
name.getField().add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
item.getModelObject().getRealValue().setName(name.getModelObject());
}
});
item.add(name);
TextFormGroup file = new TextFormGroup(ID_FILE_PATH, fileConfigType != null ? new PropertyModel<>(fileConfigType, "file") : Model.of(""), createStringResource(fileConfigType == null ? "" : (fileConfigType.COMPLEX_TYPE.getLocalPart() + ".file")), "", getInputCssClass(), false, true);
file.getField().add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
item.getModelObject().getRealValue().setFile(file.getModelObject());
}
});
item.add(file);
item.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return fileConfigType != null;
}
});
}
};
values.add(new AttributeModifier("class", "col-md-6"));
values.setReuseItems(true);
files.add(values);
AjaxLink<Void> addButton = new AjaxLink<>(ID_ADD_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
PrismPropertyWrapper<FileConfigurationType> propertyWrapper = fileConfig.getObject();
PrismPropertyValue<FileConfigurationType> newValue = getPrismContext().itemFactory().createPropertyValue();
PrismPropertyValueWrapper<FileConfigurationType> newValueWrapper = WebPrismUtil.createNewValueWrapper(propertyWrapper, newValue, getPageBase(), target);
// TODO: do we really need to set real value?? why??
newValueWrapper.setRealValue(new FileConfigurationType());
target.add(files);
}
};
add(addButton);
}
use of com.evolveum.midpoint.web.component.form.TextFormGroup in project midpoint by Evolveum.
the class RichHyperlinkConfigPanel method initLayout.
private void initLayout() {
Form form = new Form(ID_MAIN_FORM);
form.setOutputMarkupId(true);
add(form);
TextFormGroup name = new TextFormGroup(ID_LABEL, new PropertyModel<String>(model, RichHyperlinkType.F_LABEL.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.label"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
form.add(name);
TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, RichHyperlinkType.F_DESCRIPTION.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.description"), ID_LABEL_SIZE, ID_INPUT_SIZE);
description.setVisible(!isMenuItem);
form.add(description);
TextFormGroup targetUrl = new TextFormGroup(ID_TARGET_URL, new PropertyModel<String>(model, RichHyperlinkType.F_TARGET_URL.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.targetUrl"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(targetUrl);
TextFormGroup color = new TextFormGroup(ID_COLOR, new PropertyModel<String>(model, RichHyperlinkType.F_COLOR.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.color"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
color.setVisible(!isMenuItem);
form.add(color);
MultiValueTextFormGroup authorizations = new MultiValueTextFormGroup(ID_AUTHORIZATION, new PropertyModel<List<String>>(model, RichHyperlinkType.F_AUTHORIZATION.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.authorization"), ID_LABEL_SIZE, ID_MULTIPLE_INPUT_SIZE, false);
authorizations.setVisible(!isMenuItem);
form.add(authorizations);
TextFormGroup icon = new TextFormGroup(ID_ICON, new PropertyModel<String>(model, RichHyperlinkType.F_ICON.getLocalPart() + "." + IconType.F_CSS_CLASS.getLocalPart()), createStringResource("RichHyperlinkConfigDialog.icon"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
form.add(icon);
initButtons(form);
}
Aggregations