List of usage examples for org.apache.wicket.markup.html.form EnumChoiceRenderer EnumChoiceRenderer
public EnumChoiceRenderer(Component resourceSource)
From source file:com.chitek.ignition.drivers.generictcp.meta.config.ui.WritebackConfigUI.java
License:Apache License
private void addComponents() { editForm = new Form<Object>("edit-form"); add(editForm);/*w w w. j a v a 2 s.c o m*/ WebMarkupContainer tableContainer = new WebMarkupContainer("table-container", getDefaultModel()); tableContainer.setOutputMarkupId(true); enabledCheckBox = getEnabledCheckBox(); tableContainer.add(enabledCheckBox); settingsTable = new WebMarkupContainer("settings-table"); settingsTable.setOutputMarkupId(true); settingsTable.setEnabled(getConfig().isEnabled()); tableContainer.add(settingsTable); messageIdTypeDropDown = getMessageIdTypeDropdown(); settingsTable.add(messageIdTypeDropDown); dataTypeDropDown = new DropDownChoice<WritebackDataType>("dataType", WritebackDataType.getOptions(), new EnumChoiceRenderer<WritebackDataType>(this)); settingsTable.add(dataTypeDropDown); usePrefixCheckBox = getUsePrefixCheckBox(); settingsTable.add(usePrefixCheckBox); prefixTextField = getPrefixTextField(); settingsTable.add(prefixTextField); settingsTable.add(new CheckBox("sendOnValueChange")); sendInitialValueCheckBox = getSendInitialValueCheckBox(); settingsTable.add(sendInitialValueCheckBox); initialValueTextField = getInitialValueTextField(); settingsTable.add(initialValueTextField); initialIdTextField = getInitialIdTextField(); settingsTable.add(initialIdTextField); editForm.add(tableContainer); editForm.add(new WritebackFormValidator()); }
From source file:com.chitek.ignition.drivers.generictcp.meta.config.ui.WritebackConfigUI.java
License:Apache License
private DropDownChoice<OptionalDataType> getMessageIdTypeDropdown() { DropDownChoice<OptionalDataType> dropDown = new DropDownChoice<OptionalDataType>("messageIdType", OptionalDataType.getOptions(), new EnumChoiceRenderer<OptionalDataType>(this)); dropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override/*from w ww . j a va 2 s . co m*/ protected void onUpdate(AjaxRequestTarget target) { target.add(getComponent().getParent().get("initialId") .setEnabled(getConfig().getMessageIdType() != OptionalDataType.None)); } }); return dropDown; }
From source file:com.evolveum.midpoint.gui.api.component.MultiTypesMemberPopupTabPanel.java
License:Apache License
@Override protected void onInitialize() { super.onInitialize(); WebMarkupContainer typePanel = new WebMarkupContainer(ID_TYPE_SELECT_PANEL); typePanel.setOutputMarkupId(true);/*from ww w . ja va 2 s . c om*/ add(typePanel); DropDownChoice<ObjectTypes> typeSelect = new DropDownChoice<>(ID_TYPE, new LoadableModel<ObjectTypes>() { @Override protected ObjectTypes load() { return defaultObjectType; } }, getSupportedTypesList(), new EnumChoiceRenderer<>(this)); typeSelect.add(new OnChangeAjaxBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { defaultObjectType = typeSelect.getModelObject(); MultiTypesMemberPopupTabPanel.this.addOrReplace(initObjectListPanel()); target.add(MultiTypesMemberPopupTabPanel.this); } }); typePanel.add(typeSelect); add(typePanel); }
From source file:com.evolveum.midpoint.gui.impl.page.admin.configuration.component.ProfilingConfigurationTabPanel.java
License:Apache License
protected void initLayout() { WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE); profilingEnabledNote.add(new VisibleEnableBehaviour() { private static final long serialVersionUID = 1L; @Override/*from w w w . j a v a 2 s . co m*/ public boolean isVisible() { return !getPageBase().getMidpointConfiguration().isProfilingEnabled(); } }); add(profilingEnabledNote); PrismContainerPanel<ProfilingConfigurationType> profilingPanel = new PrismContainerPanel<ProfilingConfigurationType>( ID_PROFILING, getProfilingModel(), true, new Form<>("form"), null, getPageBase()); add(profilingPanel); IModel<ContainerWrapper<ClassLoggerConfigurationType>> loggerModel = new Model<>( getLoggingModel().getObject().findContainerWrapper(ItemPath .create(SystemConfigurationType.F_LOGGING, LoggingConfigurationType.F_CLASS_LOGGER))); ContainerValueWrapper<ClassLoggerConfigurationType> profilingLogger = null; for (ContainerValueWrapper<ClassLoggerConfigurationType> logger : loggerModel.getObject().getValues()) { if (LOGGER_PROFILING.equals( new RealContainerValueFromContainerValueWrapperModel<>(logger).getObject().getPackage())) { profilingLogger = logger; continue; } } if (profilingLogger == null) { profilingLogger = WebModelServiceUtils.createNewItemContainerValueWrapper(getPageBase(), loggerModel); new RealContainerValueFromContainerValueWrapperModel<>(profilingLogger).getObject() .setPackage(LOGGER_PROFILING); } ValueWrapperOfSingleValuePropertyFromSingleValueContainerValueWrapperModel<LoggingLevelType, ClassLoggerConfigurationType> level = new ValueWrapperOfSingleValuePropertyFromSingleValueContainerValueWrapperModel<>( profilingLogger, ClassLoggerConfigurationType.F_LEVEL); DropDownFormGroup<ProfilingLevel> dropDownProfilingLevel = new DropDownFormGroup<>( ID_PROFILING_LOGGER_LEVEL, new Model<ProfilingLevel>() { private static final long serialVersionUID = 1L; private PropertyModel<LoggingLevelType> levelModel = new PropertyModel<LoggingLevelType>(level, "value.value"); @Override public ProfilingLevel getObject() { return ProfilingLevel.fromLoggerLevelType(levelModel.getObject()); } @Override public void setObject(ProfilingLevel object) { super.setObject(object); levelModel.setObject(ProfilingLevel.toLoggerLevelType(object)); } }, WebComponentUtil.createReadonlyModelFromEnum(ProfilingLevel.class), new EnumChoiceRenderer<>(this), createStringResource("LoggingConfigPanel.subsystem.level"), "", getInputCssClass(), false, true); add(dropDownProfilingLevel); PropertyWrapper appenders = (PropertyWrapper) profilingLogger .findPropertyWrapperByName(ClassLoggerConfigurationType.F_APPENDER); appenders.setPredefinedValues(WebComponentUtil.createAppenderChoices(getPageBase())); PrismPropertyPanel<PropertyWrapper> profilingLoggerLevel = new PrismPropertyPanel<PropertyWrapper>( ID_PROFILING_LOGGER_APPENDERS, new Model(appenders), new Form<>("form"), itemWrapper -> getAppendersPanelVisibility(itemWrapper.getPath()), getPageBase()); add(profilingLoggerLevel); }
From source file:com.evolveum.midpoint.web.component.input.ExpressionEditorPanel.java
License:Apache License
@Override protected void initLayout() { loadModel();/*from w w w . j a v a2 s . c om*/ Label typeLabel = new Label(ID_LABEL_TYPE, createStringResource(getTypeLabelKey())); add(typeLabel); DropDownChoice type = new DropDownChoice<>(ID_TYPE, new PropertyModel<ExpressionUtil.ExpressionEvaluatorType>(model, ExpressionTypeDto.F_TYPE), WebMiscUtil.createReadonlyModelFromEnum(ExpressionUtil.ExpressionEvaluatorType.class), new EnumChoiceRenderer<ExpressionUtil.ExpressionEvaluatorType>(this)); type.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateExpressionType(); target.add(get(ID_LANGUAGE_CONTAINER), get(ID_POLICY_CONTAINER), get(ID_EXPRESSION)); } }); type.setOutputMarkupId(true); type.setOutputMarkupPlaceholderTag(true); type.setNullValid(true); add(type); WebMarkupContainer languageContainer = new WebMarkupContainer(ID_LANGUAGE_CONTAINER); languageContainer.setOutputMarkupId(true); languageContainer.setOutputMarkupPlaceholderTag(true); languageContainer.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return ExpressionUtil.ExpressionEvaluatorType.SCRIPT.equals(model.getObject().getType()); } }); add(languageContainer); DropDownChoice language = new DropDownChoice<>(ID_LANGUAGE, new PropertyModel<ExpressionUtil.Language>(model, ExpressionTypeDto.F_LANGUAGE), WebMiscUtil.createReadonlyModelFromEnum(ExpressionUtil.Language.class), new EnumChoiceRenderer<ExpressionUtil.Language>(this)); language.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateExpressionLanguage(); target.add(get(ID_LANGUAGE_CONTAINER), get(ID_POLICY_CONTAINER), get(ID_EXPRESSION)); } }); language.setNullValid(false); languageContainer.add(language); WebMarkupContainer policyContainer = new WebMarkupContainer(ID_POLICY_CONTAINER); policyContainer.setOutputMarkupId(true); policyContainer.setOutputMarkupPlaceholderTag(true); policyContainer.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return ExpressionUtil.ExpressionEvaluatorType.GENERATE.equals(model.getObject().getType()); } }); add(policyContainer); DropDownChoice policyRef = new DropDownChoice<>(ID_POLICY_REF, new PropertyModel<ObjectReferenceType>(model, ExpressionTypeDto.F_POLICY_REF), new AbstractReadOnlyModel<List<ObjectReferenceType>>() { @Override public List<ObjectReferenceType> getObject() { return createPasswordPolicyList(); } }, new IChoiceRenderer<ObjectReferenceType>() { @Override public Object getDisplayValue(ObjectReferenceType object) { return policyMap.get(object.getOid()); } @Override public String getIdValue(ObjectReferenceType object, int index) { return Integer.toString(index); } }); policyRef.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateExpressionValuePolicyRef(); target.add(get(ID_LANGUAGE_CONTAINER), get(ID_POLICY_CONTAINER), get(ID_EXPRESSION)); } }); policyRef.setNullValid(true); policyContainer.add(policyRef); Label expressionLabel = new Label(ID_LABEL_EXPRESSION, createStringResource(getExpressionLabelKey())); add(expressionLabel); TextArea expression = new TextArea<>(ID_EXPRESSION, new PropertyModel<String>(model, ExpressionTypeDto.F_EXPRESSION)); expression.setOutputMarkupId(true); add(expression); AjaxSubmitLink update = new AjaxSubmitLink(ID_BUTTON_UPDATE) { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { updateExpressionPerformed(target); } }; add(update); Label typeTooltip = new Label(ID_T_TYPE); typeTooltip.add(new InfoTooltipBehavior()); add(typeTooltip); Label languageTooltip = new Label(ID_T_LANGUAGE); languageTooltip.add(new InfoTooltipBehavior()); languageContainer.add(languageTooltip); Label policyTooltip = new Label(ID_T_POLICY); policyTooltip.add(new InfoTooltipBehavior()); policyContainer.add(policyTooltip); Label expressionTooltip = new Label(ID_T_EXPRESSION); expressionTooltip.add(new InfoTooltipBehavior()); add(expressionTooltip); }
From source file:com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.modal.MappingEditorDialog.java
License:Apache License
public void initLayout(WebMarkupContainer content) { Form form = new Form(ID_MAIN_FORM); form.setOutputMarkupId(true);/*w w w .j a va 2s. c o m*/ content.add(form); TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(model, MappingTypeDto.F_MAPPING + ".name"), createStringResource("MappingEditorDialog.label.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false); form.add(name); TextAreaFormGroup description = new TextAreaFormGroup(ID_DESCRIPTION, new PropertyModel<String>(model, MappingTypeDto.F_MAPPING + ".description"), createStringResource("MappingEditorDialog.label.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false); form.add(description); CheckFormGroup authoritative = new CheckFormGroup(ID_AUTHORITATIVE, new PropertyModel<Boolean>(model, MappingTypeDto.F_MAPPING + ".authoritative"), createStringResource("MappingEditorDialog.label.authoritative"), "SchemaHandlingStep.mapping.tooltip.authoritative", true, ID_LABEL_SIZE, ID_INPUT_SIZE); form.add(authoritative); CheckFormGroup exclusive = new CheckFormGroup(ID_EXCLUSIVE, new PropertyModel<Boolean>(model, MappingTypeDto.F_MAPPING + ".exclusive"), createStringResource("MappingEditorDialog.label.exclusive"), "SchemaHandlingStep.mapping.tooltip.exclusive", true, ID_LABEL_SIZE, ID_INPUT_SIZE); form.add(exclusive); DropDownFormGroup strength = new DropDownFormGroup<>(ID_STRENGTH, new PropertyModel<MappingStrengthType>(model, MappingTypeDto.F_MAPPING + ".strength"), WebMiscUtil.createReadonlyModelFromEnum(MappingStrengthType.class), new EnumChoiceRenderer<MappingStrengthType>(this), createStringResource("MappingEditorDialog.label.strength"), "SchemaHandlingStep.mapping.tooltip.strength", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false); form.add(strength); MultiValueDropDownPanel channel = new MultiValueDropDownPanel<String>(ID_CHANNEL, new PropertyModel<List<String>>(model, MappingTypeDto.F_MAPPING + ".channel"), true) { @Override protected String createNewEmptyItem() { return ""; } @Override protected IModel<List<String>> createChoiceList() { return new AbstractReadOnlyModel<List<String>>() { @Override public List<String> getObject() { return WebMiscUtil.getChannelList(); } }; } @Override protected IChoiceRenderer<String> createRenderer() { return new IChoiceRenderer<String>() { @Override public Object getDisplayValue(String object) { String[] fields = object.split("#"); String label = fields[1]; return getString("Channel." + label); } @Override public String getIdValue(String object, int index) { return Integer.toString(index); } }; } }; form.add(channel); MultiValueDropDownPanel exceptChannel = new MultiValueDropDownPanel<String>(ID_EXCEPT_CHANNEL, new PropertyModel<List<String>>(model, MappingTypeDto.F_MAPPING + ".exceptChannel"), true) { @Override protected String createNewEmptyItem() { return ""; } @Override protected IModel<List<String>> createChoiceList() { return new AbstractReadOnlyModel<List<String>>() { @Override public List<String> getObject() { return WebMiscUtil.getChannelList(); } }; } @Override protected IChoiceRenderer<String> createRenderer() { return new IChoiceRenderer<String>() { @Override public Object getDisplayValue(String object) { String[] fields = object.split("#"); String label = fields[1]; return getString("Channel." + label); } @Override public String getIdValue(String object, int index) { return Integer.toString(index); } }; } }; form.add(exceptChannel); //TODO - create some nice ItemPathType editor in near future MultiValueTextPanel source = new MultiValueTextPanel<>(ID_SOURCE, new PropertyModel<List<String>>(model, MappingTypeDto.F_SOURCE)); form.add(source); //TODO - create some nice ItemPathType editor in near future TextFormGroup target = new TextFormGroup(ID_TARGET, new PropertyModel<String>(model, MappingTypeDto.F_TARGET), createStringResource("MappingEditorDialog.label.target"), "SchemaHandlingStep.mapping.tooltip.target", true, ID_LABEL_SIZE, ID_INPUT_SIZE, isInbound); target.setOutputMarkupId(true); form.add(target); FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK); feedback.setOutputMarkupId(true); feedback.setOutputMarkupPlaceholderTag(true); form.add(feedback); DropDownFormGroup<ExpressionUtil.ExpressionEvaluatorType> expressionType = new DropDownFormGroup<ExpressionUtil.ExpressionEvaluatorType>( ID_EXPRESSION_TYPE, new PropertyModel<ExpressionUtil.ExpressionEvaluatorType>(model, MappingTypeDto.F_EXPRESSION_TYPE), WebMiscUtil.createReadonlyModelFromEnum(ExpressionUtil.ExpressionEvaluatorType.class), new EnumChoiceRenderer<ExpressionUtil.ExpressionEvaluatorType>(this), createStringResource("MappingEditorDialog.label.expressionType"), "SchemaHandlingStep.mapping.tooltip.expressionType", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) { @Override protected DropDownChoice createDropDown(String id, IModel<List<ExpressionUtil.ExpressionEvaluatorType>> choices, IChoiceRenderer<ExpressionUtil.ExpressionEvaluatorType> renderer, boolean required) { return new DropDownChoice<>(id, getModel(), choices, renderer); } }; expressionType.getInput().add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateExpression(); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_EXPRESSION)); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_EXPRESSION_LANG)); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_EXPRESSION_POLICY_REF)); } }); form.add(expressionType); DropDownFormGroup expressionLanguage = new DropDownFormGroup<>(ID_EXPRESSION_LANG, new PropertyModel<ExpressionUtil.Language>(model, MappingTypeDto.F_EXPRESSION_LANG), WebMiscUtil.createReadonlyModelFromEnum(ExpressionUtil.Language.class), new EnumChoiceRenderer<ExpressionUtil.Language>(this), createStringResource("MappingEditorDialog.label.language"), "SchemaHandlingStep.mapping.tooltip.expressionLanguage", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false); expressionLanguage.setOutputMarkupId(true); expressionLanguage.setOutputMarkupPlaceholderTag(true); expressionLanguage.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return ExpressionUtil.ExpressionEvaluatorType.SCRIPT.equals(model.getObject().getExpressionType()); } }); form.add(expressionLanguage); expressionLanguage.getInput().add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateExpressionLanguage(); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_EXPRESSION)); } }); DropDownFormGroup<ObjectReferenceType> expressionGeneratePolicy = new DropDownFormGroup<ObjectReferenceType>( ID_EXPRESSION_POLICY_REF, new PropertyModel<ObjectReferenceType>(model, MappingTypeDto.F_EXPRESSION_POLICY_REF), new AbstractReadOnlyModel<List<ObjectReferenceType>>() { @Override public List<ObjectReferenceType> getObject() { return createPasswordPolicyList(); } }, new IChoiceRenderer<ObjectReferenceType>() { @Override public Object getDisplayValue(ObjectReferenceType object) { return policyMap.get(object.getOid()); } @Override public String getIdValue(ObjectReferenceType object, int index) { return Integer.toString(index); } }, createStringResource("MappingEditorDialog.label.passPolicyRef"), "SchemaHandlingStep.mapping.tooltip.expressionValuePolicyRef", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) { @Override protected DropDownChoice createDropDown(String id, IModel<List<ObjectReferenceType>> choices, IChoiceRenderer<ObjectReferenceType> renderer, boolean required) { return new DropDownChoice<>(id, getModel(), choices, renderer); } }; expressionGeneratePolicy.setOutputMarkupId(true); expressionGeneratePolicy.setOutputMarkupPlaceholderTag(true); expressionGeneratePolicy.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return ExpressionUtil.ExpressionEvaluatorType.GENERATE .equals(model.getObject().getExpressionType()); } }); expressionGeneratePolicy.getInput().add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateExpressionGeneratePolicy(); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_EXPRESSION)); } }); form.add(expressionGeneratePolicy); TextAreaFormGroup expression = new TextAreaFormGroup(ID_EXPRESSION, new PropertyModel<String>(model, MappingTypeDto.F_EXPRESSION), createStringResource("MappingEditorDialog.label.expression"), "SchemaHandlingStep.mapping.tooltip.expression", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, CODE_ROW_COUNT); expression.setOutputMarkupId(true); form.add(expression); DropDownFormGroup<ExpressionUtil.ExpressionEvaluatorType> conditionType = new DropDownFormGroup<ExpressionUtil.ExpressionEvaluatorType>( ID_CONDITION_TYPE, new PropertyModel<ExpressionUtil.ExpressionEvaluatorType>(model, MappingTypeDto.F_CONDITION_TYPE), WebMiscUtil.createReadonlyModelFromEnum(ExpressionUtil.ExpressionEvaluatorType.class), new EnumChoiceRenderer<ExpressionUtil.ExpressionEvaluatorType>(this), createStringResource("MappingEditorDialog.label.conditionType"), "SchemaHandlingStep.mapping.tooltip.conditionType", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) { @Override protected DropDownChoice createDropDown(String id, IModel<List<ExpressionUtil.ExpressionEvaluatorType>> choices, IChoiceRenderer<ExpressionUtil.ExpressionEvaluatorType> renderer, boolean required) { return new DropDownChoice<>(id, getModel(), choices, renderer); } }; conditionType.getInput().add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateCondition(); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_CONDITION)); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_CONDITION_LANG)); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_CONDITION_POLICY_REF)); } }); form.add(conditionType); DropDownFormGroup conditionLanguage = new DropDownFormGroup<>(ID_CONDITION_LANG, new PropertyModel<ExpressionUtil.Language>(model, MappingTypeDto.F_CONDITION_LANG), WebMiscUtil.createReadonlyModelFromEnum(ExpressionUtil.Language.class), new EnumChoiceRenderer<ExpressionUtil.Language>(this), createStringResource("MappingEditorDialog.label.language"), "SchemaHandlingStep.mapping.tooltip.conditionLanguage", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false); conditionLanguage.setOutputMarkupId(true); conditionLanguage.setOutputMarkupPlaceholderTag(true); conditionLanguage.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return ExpressionUtil.ExpressionEvaluatorType.SCRIPT.equals(model.getObject().getConditionType()); } }); conditionLanguage.getInput().add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateConditionLanguage(); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_CONDITION)); } }); form.add(conditionLanguage); DropDownFormGroup<ObjectReferenceType> conditionGeneratePolicy = new DropDownFormGroup<ObjectReferenceType>( ID_CONDITION_POLICY_REF, new PropertyModel<ObjectReferenceType>(model, MappingTypeDto.F_CONDITION_POLICY_REF), new AbstractReadOnlyModel<List<ObjectReferenceType>>() { @Override public List<ObjectReferenceType> getObject() { return createPasswordPolicyList(); } }, new IChoiceRenderer<ObjectReferenceType>() { @Override public Object getDisplayValue(ObjectReferenceType object) { return policyMap.get(object.getOid()); } @Override public String getIdValue(ObjectReferenceType object, int index) { return Integer.toString(index); } }, createStringResource("MappingEditorDialog.label.passPolicyRef"), "SchemaHandlingStep.mapping.tooltip.conditionValuePolicyRef", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false) { @Override protected DropDownChoice createDropDown(String id, IModel<List<ObjectReferenceType>> choices, IChoiceRenderer<ObjectReferenceType> renderer, boolean required) { return new DropDownChoice<>(id, getModel(), choices, renderer); } }; conditionGeneratePolicy.setOutputMarkupId(true); conditionGeneratePolicy.setOutputMarkupPlaceholderTag(true); conditionGeneratePolicy.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return ExpressionUtil.ExpressionEvaluatorType.GENERATE.equals(model.getObject().getConditionType()); } }); conditionGeneratePolicy.getInput().add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { model.getObject().updateConditionGeneratePolicy(); target.add(get(getContentId() + ":" + ID_MAIN_FORM + ":" + ID_CONDITION)); } }); form.add(conditionGeneratePolicy); TextAreaFormGroup condition = new TextAreaFormGroup(ID_CONDITION, new PropertyModel<String>(model, MappingTypeDto.F_CONDITION), createStringResource("MappingEditorDialog.label.condition"), "SchemaHandlingStep.mapping.tooltip.condition", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, CODE_ROW_COUNT); condition.setOutputMarkupId(true); form.add(condition); Label channelTooltip = new Label(ID_T_CHANNEL); channelTooltip.add(new InfoTooltipBehavior(true)); form.add(channelTooltip); Label exceptChannelTooltip = new Label(ID_T_EXCEPT_CHANNEL); exceptChannelTooltip.add(new InfoTooltipBehavior(true)); form.add(exceptChannelTooltip); Label sourceTooltip = new Label(ID_T_SOURCE); sourceTooltip.add(new InfoTooltipBehavior(true)); form.add(sourceTooltip); AjaxSubmitButton cancel = new AjaxSubmitButton(ID_BUTTON_CANCEL, createStringResource("MappingEditorDialog.button.cancel")) { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { cancelPerformed(target); } }; form.add(cancel); AjaxSubmitButton save = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("MappingEditorDialog.button.save")) { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { savePerformed(target); } }; form.add(save); }
From source file:com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.ResourceActivationEditor.java
License:Apache License
private void prepareActivationPanelBody(String containerValue, String fetchStrategyId, String outboundId, String inboundId) {/*from www . jav a2 s . c o m*/ DropDownChoice fetchStrategy = new DropDownChoice<>(fetchStrategyId, new PropertyModel<AttributeFetchStrategyType>(getModel(), containerValue + ".fetchStrategy"), WebMiscUtil.createReadonlyModelFromEnum(AttributeFetchStrategyType.class), new EnumChoiceRenderer<AttributeFetchStrategyType>(this)); fetchStrategy.setNullValid(true); add(fetchStrategy); MultiValueTextEditPanel outbound = new MultiValueTextEditPanel<MappingType>(outboundId, new PropertyModel<List<MappingType>>(getModel(), containerValue + ".outbound"), false) { @Override protected IModel<String> createTextModel(final IModel<MappingType> model) { return new Model<String>() { @Override public String getObject() { return MappingTypeDto.createMappingLabel(model.getObject(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }; } @Override protected MappingType createNewEmptyItem() { return WizardUtil.createEmptyMapping(); } @Override protected void editPerformed(AjaxRequestTarget target, MappingType object) { mappingEditPerformed(target, object, false); } }; add(outbound); MultiValueTextEditPanel inbound = new MultiValueTextEditPanel<MappingType>(inboundId, new PropertyModel<List<MappingType>>(getModel(), containerValue + ".inbound"), false) { @Override protected IModel<String> createTextModel(final IModel<MappingType> model) { return new Model<String>() { @Override public String getObject() { return MappingTypeDto.createMappingLabel(model.getObject(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }; } @Override protected MappingType createNewEmptyItem() { return WizardUtil.createEmptyMapping(); } @Override protected void editPerformed(AjaxRequestTarget target, MappingType object) { mappingEditPerformed(target, object, true); } }; inbound.setOutputMarkupId(true); add(inbound); }
From source file:com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.ResourceAssociationEditor.java
License:Apache License
@Override protected void initLayout() { Label label = new Label(ID_LABEL, new AbstractReadOnlyModel<String>() { @Override// w w w .j ava2 s .c o m public String getObject() { ResourceObjectAssociationType association = getModelObject(); if (association.getDisplayName() == null && association.getRef() == null) { return getString("ResourceAssociationEditor.label.new"); } else { if (association.getRef().getItemPath() != null) { return getString("ResourceAssociationEditor.label.edit", association.getRef().getItemPath().toString()); } return getString("ResourceAssociationEditor.label.edit", ""); } } }); add(label); DropDownChoice kind = new DropDownChoice<>(ID_KIND, new PropertyModel<ShadowKindType>(getModel(), "kind"), WebMiscUtil.createReadonlyModelFromEnum(ShadowKindType.class), new EnumChoiceRenderer<ShadowKindType>(this)); kind.setNullValid(false); add(kind); MultiValueTextPanel intent = new MultiValueTextPanel<>(ID_INTENT, new PropertyModel<List<String>>(getModel(), "intent")); add(intent); DropDownChoice direction = new DropDownChoice<>(ID_DIRECTION, new PropertyModel<ResourceObjectAssociationDirectionType>(getModel(), "direction"), WebMiscUtil.createReadonlyModelFromEnum(ResourceObjectAssociationDirectionType.class), new EnumChoiceRenderer<ResourceObjectAssociationDirectionType>(this)); direction.setNullValid(true); add(direction); DropDownChoice associationAttribute = new DropDownChoice<>(ID_ASSOCIATION_ATTRIBUTE, new PropertyModel<QName>(getModel(), "associationAttribute"), new AbstractReadOnlyModel<List<QName>>() { @Override public List<QName> getObject() { return loadObjectReferences(false); } }, new IChoiceRenderer<QName>() { @Override public Object getDisplayValue(QName object) { return prepareReferenceDisplayValue(object); } @Override public String getIdValue(QName object, int index) { return Integer.toString(index); } }); associationAttribute.setNullValid(true); add(associationAttribute); DropDownChoice valueAttribute = new DropDownChoice<>(ID_VALUE_ATTRIBUTE, new PropertyModel<QName>(getModel(), "valueAttribute"), new AbstractReadOnlyModel<List<QName>>() { @Override public List<QName> getObject() { return loadObjectReferences(false); } }, new IChoiceRenderer<QName>() { @Override public Object getDisplayValue(QName object) { return prepareReferenceDisplayValue(object); } @Override public String getIdValue(QName object, int index) { return Integer.toString(index); } }); valueAttribute.setNullValid(true); add(valueAttribute); CheckBox explicitRefIntegrity = new CheckBox(ID_EXPLICIT_REF_INTEGRITY, new PropertyModel<Boolean>(getModel(), "explicitReferentialIntegrity")); add(explicitRefIntegrity); QNameEditorPanel nonSchemaRefPanel = new QNameEditorPanel(ID_ASSOCIATION_ATTRIBUTE_PANEL, new PropertyModel<ItemPathType>(getModel(), "ref"), "SchemaHandlingStep.association.label.associationName", "SchemaHandlingStep.association.tooltip.associationLocalPart", "SchemaHandlingStep.association.label.associationNamespace", "SchemaHandlingStep.association.tooltip.associationNamespace"); nonSchemaRefPanel.setOutputMarkupId(true); nonSchemaRefPanel.setOutputMarkupPlaceholderTag(true); add(nonSchemaRefPanel); TextField displayName = new TextField<>(ID_DISPLAY_NAME, new PropertyModel<String>(getModel(), "displayName")); add(displayName); TextArea description = new TextArea<>(ID_DESCRIPTION, new PropertyModel<String>(getModel(), "description")); add(description); AjaxLink limitations = new AjaxLink(ID_BUTTON_LIMITATIONS) { @Override public void onClick(AjaxRequestTarget target) { limitationsEditPerformed(target); } }; add(limitations); CheckBox exclusiveStrong = new CheckBox(ID_EXCLUSIVE_STRONG, new PropertyModel<Boolean>(getModel(), "exclusiveStrong")); add(exclusiveStrong); CheckBox tolerant = new CheckBox(ID_TOLERANT, new PropertyModel<Boolean>(getModel(), "tolerant")); add(tolerant); MultiValueTextPanel tolerantVP = new MultiValueTextPanel<>(ID_TOLERANT_VP, new PropertyModel<List<String>>(getModel(), "tolerantValuePattern")); add(tolerantVP); MultiValueTextPanel intolerantVP = new MultiValueTextPanel<>(ID_INTOLERANT_VP, new PropertyModel<List<String>>(getModel(), "intolerantValuePattern")); add(intolerantVP); DropDownChoice fetchStrategy = new DropDownChoice<>(ID_FETCH_STRATEGY, new PropertyModel<AttributeFetchStrategyType>(getModel(), "fetchStrategy"), WebMiscUtil.createReadonlyModelFromEnum(AttributeFetchStrategyType.class), new EnumChoiceRenderer<AttributeFetchStrategyType>(this)); fetchStrategy.setNullValid(true); add(fetchStrategy); DropDownChoice matchingRule = new DropDownChoice<>(ID_MATCHING_RULE, new PropertyModel<QName>(getModel(), "matchingRule"), new AbstractReadOnlyModel<List<QName>>() { @Override public List<QName> getObject() { return WebMiscUtil.getMatchingRuleList(); } }, new IChoiceRenderer<QName>() { @Override public Object getDisplayValue(QName object) { return object.getLocalPart(); } @Override public String getIdValue(QName object, int index) { return Integer.toString(index); } }); matchingRule.setNullValid(true); add(matchingRule); TextField outboundLabel = new TextField<>(ID_OUTBOUND_LABEL, new AbstractReadOnlyModel<String>() { @Override public String getObject() { ResourceObjectAssociationType association = getModel().getObject(); if (association == null) { return null; } return MappingTypeDto.createMappingLabel(association.getOutbound(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }); outboundLabel.setOutputMarkupId(true); outboundLabel.setEnabled(false); add(outboundLabel); AjaxSubmitButton outbound = new AjaxSubmitButton(ID_BUTTON_OUTBOUND) { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { outboundEditPerformed(target); } }; outbound.setOutputMarkupId(true); add(outbound); MultiValueTextEditPanel inbound = new MultiValueTextEditPanel<MappingType>(ID_INBOUND, new PropertyModel<List<MappingType>>(getModel(), "inbound"), false) { @Override protected IModel<String> createTextModel(final IModel<MappingType> model) { return new Model<String>() { @Override public String getObject() { return MappingTypeDto.createMappingLabel(model.getObject(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }; } @Override protected MappingType createNewEmptyItem() { return WizardUtil.createEmptyMapping(); } @Override protected void editPerformed(AjaxRequestTarget target, MappingType object) { inboundEditPerformed(target, object); } }; inbound.setOutputMarkupId(true); add(inbound); Label kindTooltip = new Label(ID_T_KIND); kindTooltip.add(new InfoTooltipBehavior()); add(kindTooltip); Label intentTooltip = new Label(ID_T_INTENT); intentTooltip.add(new InfoTooltipBehavior()); add(intentTooltip); Label directionTooltip = new Label(ID_T_DIRECTION); directionTooltip.add(new InfoTooltipBehavior()); add(directionTooltip); Label assAttributeTooltip = new Label(ID_T_ASSOCIATION_ATTRIBUTE); assAttributeTooltip.add(new InfoTooltipBehavior()); add(assAttributeTooltip); Label valueAttributeTooltip = new Label(ID_T_VALUE_ATTRIBUTE); valueAttributeTooltip.add(new InfoTooltipBehavior()); add(valueAttributeTooltip); Label integrityTooltip = new Label(ID_T_EXPLICIT_REF_INTEGRITY); integrityTooltip.add(new InfoTooltipBehavior()); add(integrityTooltip); Label limitationsTooltip = new Label(ID_T_LIMITATIONS); limitationsTooltip.add(new InfoTooltipBehavior()); add(limitationsTooltip); Label exclusiveStrongTooltip = new Label(ID_T_EXCLUSIVE_STRONG); exclusiveStrongTooltip.add(new InfoTooltipBehavior()); add(exclusiveStrongTooltip); Label tolerantTooltip = new Label(ID_T_TOLERANT); tolerantTooltip.add(new InfoTooltipBehavior()); add(tolerantTooltip); Label tolerantVPTooltip = new Label(ID_T_TOLERANT_VP); tolerantVPTooltip.add(new InfoTooltipBehavior()); add(tolerantVPTooltip); Label intolerantVPTooltip = new Label(ID_T_INTOLERANT_VP); intolerantVPTooltip.add(new InfoTooltipBehavior()); add(intolerantVPTooltip); Label fetchTooltip = new Label(ID_T_FETCH); fetchTooltip.add(new InfoTooltipBehavior()); add(fetchTooltip); Label matchingRuleTooltip = new Label(ID_T_MATCHING_RULE); matchingRuleTooltip.add(new InfoTooltipBehavior()); add(matchingRuleTooltip); Label outboundTooltip = new Label(ID_T_OUTBOUND); outboundTooltip.add(new InfoTooltipBehavior()); add(outboundTooltip); Label inboundTooltip = new Label(ID_T_INBOUND); inboundTooltip.add(new InfoTooltipBehavior()); add(inboundTooltip); initModals(); }
From source file:com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.ResourceAttributeEditor.java
License:Apache License
@Override protected void initLayout() { Label label = new Label(ID_LABEL, new AbstractReadOnlyModel<String>() { @Override/*w ww.j a v a2 s . co m*/ public String getObject() { ResourceAttributeDefinitionType attribute = getModelObject(); if (attribute.getRef() == null || attribute.getRef().equals(new ItemPathType())) { return getString("ResourceAttributeEditor.label.new"); } else { return getString("ResourceAttributeEditor.label.edit", ItemPathUtil.getOnlySegmentQName(attribute.getRef()).getLocalPart()); } } }); add(label); QNameEditorPanel nonSchemaRefPanel = new QNameEditorPanel(ID_NON_SCHEMA_REF_PANEL, new PropertyModel<ItemPathType>(getModel(), "ref"), "SchemaHandlingStep.attribute.label.attributeName", "SchemaHandlingStep.attribute.tooltip.attributeLocalPart", "SchemaHandlingStep.attribute.label.attributeNamespace", "SchemaHandlingStep.attribute.tooltip.attributeNamespace"); nonSchemaRefPanel.setOutputMarkupId(true); nonSchemaRefPanel.setOutputMarkupPlaceholderTag(true); nonSchemaRefPanel.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return nonSchemaRefValueAllowed; } }); add(nonSchemaRefPanel); WebMarkupContainer schemaRefPanel = new WebMarkupContainer(ID_SCHEMA_REF_PANEL); schemaRefPanel.setOutputMarkupId(true); schemaRefPanel.setOutputMarkupPlaceholderTag(true); schemaRefPanel.add(new VisibleEnableBehaviour() { @Override public boolean isVisible() { return !nonSchemaRefValueAllowed; } }); add(schemaRefPanel); Label refTooltip = new Label(ID_T_REF); refTooltip.add(new InfoTooltipBehavior()); refTooltip.setOutputMarkupId(true); refTooltip.setOutputMarkupId(true); schemaRefPanel.add(refTooltip); DropDownChoice refSelect = new DropDownChoice<ItemPathType>(ID_REFERENCE_SELECT, new PropertyModel<ItemPathType>(getModel(), "ref"), new AbstractReadOnlyModel<List<ItemPathType>>() { @Override public List<ItemPathType> getObject() { return loadObjectReferences(); } }, new IChoiceRenderer<ItemPathType>() { @Override public Object getDisplayValue(ItemPathType object) { return prepareReferenceDisplayValue(object); } @Override public String getIdValue(ItemPathType object, int index) { return Integer.toString(index); } }) { @Override protected boolean isSelected(ItemPathType object, int index, String selected) { if (getModelObject() == null || getModelObject().equals(new ItemPathType())) { return false; } QName referenceQName = ItemPathUtil.getOnlySegmentQName(getModelObject()); QName optionQName = ItemPathUtil.getOnlySegmentQName(object); return referenceQName.equals(optionQName); } }; refSelect.setNullValid(false); refSelect.setOutputMarkupId(true); refSelect.setOutputMarkupPlaceholderTag(true); schemaRefPanel.add(refSelect); CheckBox allowNonSchema = new CheckBox(ID_REFERENCE_ALLOW, new PropertyModel<Boolean>(this, "nonSchemaRefValueAllowed")); allowNonSchema.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { target.add(get(ID_NON_SCHEMA_REF_PANEL), get(ID_SCHEMA_REF_PANEL)); } }); add(allowNonSchema); TextField displayName = new TextField<>(ID_DISPLAY_NAME, new PropertyModel<String>(getModel(), "displayName")); add(displayName); TextArea description = new TextArea<>(ID_DESCRIPTION, new PropertyModel<String>(getModel(), "description")); add(description); AjaxLink limitations = new AjaxLink(ID_BUTTON_LIMITATIONS) { @Override public void onClick(AjaxRequestTarget target) { limitationsEditPerformed(target); } }; add(limitations); CheckBox exclusiveStrong = new CheckBox(ID_EXCLUSIVE_STRONG, new PropertyModel<Boolean>(getModel(), "exclusiveStrong")); add(exclusiveStrong); CheckBox tolerant = new CheckBox(ID_TOLERANT, new PropertyModel<Boolean>(getModel(), "tolerant")); add(tolerant); MultiValueTextPanel tolerantVP = new MultiValueTextPanel<>(ID_TOLERANT_VP, new PropertyModel<List<String>>(getModel(), "tolerantValuePattern")); add(tolerantVP); MultiValueTextPanel intolerantVP = new MultiValueTextPanel<>(ID_INTOLERANT_VP, new PropertyModel<List<String>>(getModel(), "intolerantValuePattern")); add(intolerantVP); DropDownChoice fetchStrategy = new DropDownChoice<>(ID_FETCH_STRATEGY, new PropertyModel<AttributeFetchStrategyType>(getModel(), "fetchStrategy"), WebMiscUtil.createReadonlyModelFromEnum(AttributeFetchStrategyType.class), new EnumChoiceRenderer<AttributeFetchStrategyType>(this)); fetchStrategy.setNullValid(true); add(fetchStrategy); DropDownChoice matchingRule = new DropDownChoice<>(ID_MATCHING_RULE, new PropertyModel<QName>(getModel(), "matchingRule"), new AbstractReadOnlyModel<List<QName>>() { @Override public List<QName> getObject() { return WebMiscUtil.getMatchingRuleList(); } }, new IChoiceRenderer<QName>() { @Override public Object getDisplayValue(QName object) { return object.getLocalPart(); } @Override public String getIdValue(QName object, int index) { return Integer.toString(index); } }); matchingRule.setNullValid(true); add(matchingRule); TextField outboundLabel = new TextField<>(ID_OUTBOUND_LABEL, new AbstractReadOnlyModel<String>() { @Override public String getObject() { ResourceAttributeDefinitionType attributeDefinition = getModel().getObject(); if (attributeDefinition == null) { return null; } return MappingTypeDto.createMappingLabel(attributeDefinition.getOutbound(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }); outboundLabel.setEnabled(false); outboundLabel.setOutputMarkupId(true); add(outboundLabel); AjaxSubmitLink outbound = new AjaxSubmitLink(ID_BUTTON_OUTBOUND) { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { outboundEditPerformed(target); } }; outbound.setOutputMarkupId(true); add(outbound); MultiValueTextEditPanel inbound = new MultiValueTextEditPanel<MappingType>(ID_INBOUND, new PropertyModel<List<MappingType>>(getModel(), "inbound"), false) { @Override protected IModel<String> createTextModel(final IModel<MappingType> model) { return new Model<String>() { @Override public String getObject() { return MappingTypeDto.createMappingLabel(model.getObject(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }; } @Override protected MappingType createNewEmptyItem() { return WizardUtil.createEmptyMapping(); } @Override protected void editPerformed(AjaxRequestTarget target, MappingType object) { inboundEditPerformed(target, object); } }; inbound.setOutputMarkupId(true); add(inbound); Label allowTooltip = new Label(ID_T_ALLOW); allowTooltip.add(new InfoTooltipBehavior()); add(allowTooltip); Label limitationsTooltip = new Label(ID_T_LIMITATIONS); limitationsTooltip.add(new InfoTooltipBehavior()); add(limitationsTooltip); Label exclusiveStrongTooltip = new Label(ID_T_EXCLUSIVE_STRONG); exclusiveStrongTooltip.add(new InfoTooltipBehavior()); add(exclusiveStrongTooltip); Label tolerantTooltip = new Label(ID_T_TOLERANT); tolerantTooltip.add(new InfoTooltipBehavior()); add(tolerantTooltip); Label tolerantVPTooltip = new Label(ID_T_TOLERANT_VP); tolerantVPTooltip.add(new InfoTooltipBehavior()); add(tolerantVPTooltip); Label intolerantVPTooltip = new Label(ID_T_INTOLERANT_VP); intolerantVPTooltip.add(new InfoTooltipBehavior()); add(intolerantVPTooltip); Label fetchTooltip = new Label(ID_T_FETCH); fetchTooltip.add(new InfoTooltipBehavior()); add(fetchTooltip); Label matchingRuleTooltip = new Label(ID_T_MATCHING_RULE); matchingRuleTooltip.add(new InfoTooltipBehavior()); add(matchingRuleTooltip); Label outboundTooltip = new Label(ID_T_OUTBOUND); outboundTooltip.add(new InfoTooltipBehavior()); add(outboundTooltip); Label inboundTooltip = new Label(ID_T_INBOUND); inboundTooltip.add(new InfoTooltipBehavior()); add(inboundTooltip); initModals(); }
From source file:com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.ResourceCredentialsEditor.java
License:Apache License
@Override protected void initLayout() { DropDownChoice fetchStrategy = new DropDownChoice<>(ID_FETCH_STRATEGY, new PropertyModel<AttributeFetchStrategyType>(getModel(), "password.fetchStrategy"), WebMiscUtil.createReadonlyModelFromEnum(AttributeFetchStrategyType.class), new EnumChoiceRenderer<AttributeFetchStrategyType>(this)); add(fetchStrategy);// w w w .j av a 2 s .c o m TextField outboundLabel = new TextField<>(ID_OUTBOUND_LABEL, new AbstractReadOnlyModel<String>() { @Override public String getObject() { ResourceCredentialsDefinitionType credentials = getModel().getObject(); if (credentials == null || credentials.getPassword() == null) { return null; } return MappingTypeDto.createMappingLabel(credentials.getPassword().getOutbound(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }); outboundLabel.setEnabled(false); outboundLabel.setOutputMarkupId(true); add(outboundLabel); AjaxSubmitLink outbound = new AjaxSubmitLink(ID_OUTBOUND_BUTTON) { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { outboundEditPerformed(target); } }; outbound.setOutputMarkupId(true); add(outbound); MultiValueTextEditPanel inbound = new MultiValueTextEditPanel<MappingType>(ID_INBOUND, new PropertyModel<List<MappingType>>(getModel(), "password.inbound"), false) { @Override protected IModel<String> createTextModel(final IModel<MappingType> model) { return new Model<String>() { @Override public String getObject() { return MappingTypeDto.createMappingLabel(model.getObject(), LOGGER, getPageBase().getPrismContext(), getString("MappingType.label.placeholder"), getString("MultiValueField.nameNotSpecified")); } }; } @Override protected MappingType createNewEmptyItem() { return WizardUtil.createEmptyMapping(); } @Override protected void editPerformed(AjaxRequestTarget target, MappingType object) { inboundEditPerformed(target, object); } }; inbound.setOutputMarkupId(true); add(inbound); DropDownChoice passwordPolicy = new DropDownChoice<>(ID_PASS_POLICY, new PropertyModel<ObjectReferenceType>(getModel(), "password.passwordPolicyRef"), new AbstractReadOnlyModel<List<ObjectReferenceType>>() { @Override public List<ObjectReferenceType> getObject() { return createPasswordPolicyList(); } }, new IChoiceRenderer<ObjectReferenceType>() { @Override public Object getDisplayValue(ObjectReferenceType object) { return passPolicyMap.get(object.getOid()); } @Override public String getIdValue(ObjectReferenceType object, int index) { return Integer.toString(index); } }); add(passwordPolicy); Label fetchTooltip = new Label(ID_T_FETCH); fetchTooltip.add(new InfoTooltipBehavior()); add(fetchTooltip); Label outTooltip = new Label(ID_T_OUT); outTooltip.add(new InfoTooltipBehavior()); add(outTooltip); Label inTooltip = new Label(ID_T_IN); inTooltip.add(new InfoTooltipBehavior()); add(inTooltip); Label passPolicyTooltip = new Label(ID_T_PASS_POLICY); passPolicyTooltip.add(new InfoTooltipBehavior()); add(passPolicyTooltip); initModals(); }