@Override public void populate(FBValidation validation) throws FormBuilderException { if (!(validation instanceof ANDValidation)) { throw new FormBuilderException( i18n.RepNotOfType(validation.getClass().getName(), "ANDValidation")); } subValidations.clearItems(); ANDValidation and = (ANDValidation) validation; List<FBValidation> subVals = and.getValidations(); for (FBValidation subVal : subVals) { FBValidationItem item = createValidation(subVal); subValidations.addItem(item); } }
@Override public void populate(FormItemRepresentation rep) throws FormBuilderException { if (!(rep instanceof ComboBoxRepresentation)) { throw new FormBuilderException( i18n.RepNotOfType(rep.getClass().getName(), "TextFieldRepresentation")); } super.populate(rep); ComboBoxRepresentation crep = (ComboBoxRepresentation) rep; List<OptionRepresentation> options = crep.getElements(); this.items.clear(); if (options != null) { for (OptionRepresentation option : options) { this.items.put(option.getLabel(), option.getValue()); this.listBox.addItem(option.getLabel(), option.getValue()); } } this.listBox.clear(); addItems(this.items, this.listBox); this.name = crep.getName(); this.id = crep.getId(); populate(this.listBox); }
@Override public String getName() { return i18n.ANDValidationName(); }