import com.vaadin.data.Property;\r
import com.vaadin.data.TransactionalProperty;\r
import com.vaadin.data.Validator.InvalidValueException;\r
-import com.vaadin.data.fieldbinder.FormBuilder.FormBuilderException;\r
import com.vaadin.data.util.TransactionalPropertyWrapper;\r
import com.vaadin.tools.ReflectTools;\r
import com.vaadin.ui.Field;\r
}\r
\r
/**\r
- * FIXME Javadoc\r
- * \r
+ * CommitHandlers are used by {@link FieldGroup#commit()} as part of the\r
+ * commit transactions. CommitHandlers can perform custom operations as part\r
+ * of the commit and cause the commit to be aborted by throwing a\r
+ * {@link CommitException}.\r
*/\r
public interface CommitHandler extends Serializable {\r
/**\r
}\r
\r
/**\r
- * Binds fields for the given class.\r
+ * Binds member fields found in the given object.\r
+ * <p>\r
+ * This method processes all (Java) member fields whose type extends\r
+ * {@link Field} and that can be mapped to a property id. Property id\r
+ * mapping is done based on the field name or on a @{@link PropertyId}\r
+ * annotation on the field. All non-null fields for which a property id can\r
+ * be determined are bound to the property id.\r
+ * </p>\r
* <p>\r
- * This method processes all fields whose type extends {@link Field} and\r
- * that can be mapped to a property id. Property id mapping is done based on\r
- * the field name or on a {@link PropertyId} annotation on the field. All\r
- * non-null fields for which a property id can be determined are bound to\r
- * the property id.\r
+ * For example:\r
+ * \r
+ * <pre>\r
+ * public class MyForm extends VerticalLayout {\r
+ * private TextField firstName = new TextField("First name");\r
+ * @PropertyId("last")\r
+ * private TextField lastName = new TextField("Last name"); \r
+ * private TextField age = new TextField("Age"); ... }\r
+ * \r
+ * MyForm myForm = new MyForm(); \r
+ * ... \r
+ * fieldGroup.bindMemberFields(myForm);\r
+ * </pre>\r
* \r
- * @param object\r
- * The object to process\r
- * @throws FormBuilderException\r
- * If there is a problem building or binding a field\r
+ * </p>\r
+ * This binds the firstName TextField to a "firstName" property id in the\r
+ * item, lastName TextField to a "last" property and the age TextField to a\r
+ * "age" property id.\r
+ * \r
+ * @param objectWithMemberFields\r
+ * The object that contains (Java) member fields to bind\r
+ * @throws BindException\r
+ * If there is a problem binding a field\r
*/\r
- public void bindFields(Object object) throws BindException {\r
- Class<?> objectClass = object.getClass();\r
+ public void bindMemberFields(Object objectWithMemberFields)\r
+ throws BindException {\r
+ Class<?> objectClass = objectWithMemberFields.getClass();\r
\r
for (java.lang.reflect.Field f : objectClass.getDeclaredFields()) {\r
\r
try {\r
// Get the field from the object\r
Field<?> field = (Field<?>) ReflectTools.getJavaFieldValue(\r
- object, f);\r
+ objectWithMemberFields, f);\r
// Bind it to the property id\r
bind(field, propertyId);\r
} catch (Exception e) {\r