/** * Adds a new property to form and create corresponding field. * * @see Item#addItemProperty(Object, Property) */ @Override public boolean addItemProperty(Object id, Property property) { // Checks inputs if (id == null || property == null) { throw new NullPointerException("Id and property must be non-null"); } // Checks that the property id is not reserved if (propertyIds.contains(id)) { return false; } propertyIds.add(id); ownProperties.put(id, property); // Gets suitable field final Field<?> field = fieldFactory.createField(this, id, this); if (field == null) { return false; } // Configures the field bindPropertyToField(id, property, field); // Register and attach the created field addField(id, field); return true; }
this); if (f != null) { bindPropertyToField(id, property, f); addField(id, f);