]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8095 Method renames based on API review meeting
authorArtur Signell <artur@vaadin.com>
Thu, 22 Dec 2011 08:48:03 +0000 (10:48 +0200)
committerArtur Signell <artur@vaadin.com>
Thu, 22 Dec 2011 08:48:03 +0000 (10:48 +0200)
setFieldsEnabled -> setEnabled
setFieldsReadonly -> setReadonly
setFieldsBuffered -> setBuffered
remove -> unbind
protected getUnboundPropertyIds -> public getUnboundPropertyIds
getFieldForPropertyId -> getField
getPropertyIdForField -> getPropertyId

src/com/vaadin/data/fieldbinder/BeanFieldGroup.java
src/com/vaadin/data/fieldbinder/FieldGroup.java
tests/testbench/com/vaadin/tests/fieldbinder/BasicPersonForm.java

index a01c6e08791f6077c080889c8954696d0b191edd..bd4b519a95c3ca5088b6d7dd035069f17e351e75 100644 (file)
@@ -117,7 +117,7 @@ public class BeanFieldGroup<T> extends FieldGroup {
         // Add Bean validators if there are annotations\r
         if (BeanValidationValidator.isImplementationAvailable()) {\r
             BeanValidationValidator validator = new BeanValidationValidator(\r
-                    beanType, getPropertyIdForField(field).toString());\r
+                    beanType, getPropertyId(field).toString());\r
             field.addValidator(validator);\r
             if (field.getLocale() != null) {\r
                 validator.setLocale(field.getLocale());\r
index a5cf6b993eb2d7ab8eb3a4f152787dfa4782f2a4..d54fe117babcd27ae5e58a37eb1455bacf5ff822 100644 (file)
@@ -48,10 +48,10 @@ public class FieldGroup implements Serializable {
             .getName());\r
 \r
     private Item itemDataSource;\r
-    private boolean fieldsBuffered = true;\r
+    private boolean buffered = true;\r
 \r
-    private boolean fieldsEnabled = true;\r
-    private boolean fieldsReadOnly = false;\r
+    private boolean enabled = true;\r
+    private boolean readOnly = false;\r
 \r
     private HashMap<Object, Field<?>> propertyIdToField = new HashMap<Object, Field<?>>();\r
     private LinkedHashMap<Field<?>, Object> fieldToPropertyId = new LinkedHashMap<Field<?>, Object>();\r
@@ -96,7 +96,7 @@ public class FieldGroup implements Serializable {
      * {@link #commit()} for the item to be updated unless buffered mode has\r
      * been switched off.\r
      * \r
-     * @see #setFieldsBuffered(boolean)\r
+     * @see #setBuffered(boolean)\r
      * @see #commit()\r
      * \r
      * @return The item used by this FieldBinder\r
@@ -109,14 +109,14 @@ public class FieldGroup implements Serializable {
      * Checks the buffered mode for the bound fields.\r
      * <p>\r
      * \r
-     * @see #setFieldsBuffered(boolean) for more details on buffered mode\r
+     * @see #setBuffered(boolean) for more details on buffered mode\r
      * \r
-     * @see Field#isFieldsBuffered()\r
+     * @see Field#isBuffered()\r
      * @return true if buffered mode is on, false otherwise\r
      * \r
      */\r
-    public boolean isFieldsBuffered() {\r
-        return fieldsBuffered;\r
+    public boolean isBuffered() {\r
+        return buffered;\r
     }\r
 \r
     /**\r
@@ -130,18 +130,18 @@ public class FieldGroup implements Serializable {
      * The default is to use buffered mode.\r
      * </p>\r
      * \r
-     * @see Field#setFieldsBuffered(boolean)\r
-     * @param fieldsBuffered\r
+     * @see Field#setBuffered(boolean)\r
+     * @param buffered\r
      *            true to turn on buffered mode, false otherwise\r
      */\r
-    public void setFieldsBuffered(boolean fieldsBuffered) {\r
-        if (fieldsBuffered == this.fieldsBuffered) {\r
+    public void setBuffered(boolean buffered) {\r
+        if (buffered == this.buffered) {\r
             return;\r
         }\r
 \r
-        this.fieldsBuffered = fieldsBuffered;\r
+        this.buffered = buffered;\r
         for (Field<?> field : getFields()) {\r
-            field.setBuffered(fieldsBuffered);\r
+            field.setBuffered(buffered);\r
         }\r
     }\r
 \r
@@ -150,12 +150,12 @@ public class FieldGroup implements Serializable {
      * <p>\r
      * Note that this will not accurately represent the enabled status of all\r
      * fields if you change the enabled status of the fields through some other\r
-     * method than {@link #setFieldsEnabled(boolean)}.\r
+     * method than {@link #setEnabled(boolean)}.\r
      * \r
      * @return true if the fields are enabled, false otherwise\r
      */\r
-    public boolean isFieldsEnabled() {\r
-        return fieldsEnabled;\r
+    public boolean isEnabled() {\r
+        return enabled;\r
     }\r
 \r
     /**\r
@@ -164,8 +164,8 @@ public class FieldGroup implements Serializable {
      * @param fieldsEnabled\r
      *            true to enable all bound fields, false to disable them\r
      */\r
-    public void setFieldsEnabled(boolean fieldsEnabled) {\r
-        this.fieldsEnabled = fieldsEnabled;\r
+    public void setEnabled(boolean fieldsEnabled) {\r
+        enabled = fieldsEnabled;\r
         for (Field<?> field : getFields()) {\r
             field.setEnabled(fieldsEnabled);\r
         }\r
@@ -176,12 +176,12 @@ public class FieldGroup implements Serializable {
      * <p>\r
      * Note that this will not accurately represent the read only status of all\r
      * fields if you change the read only status of the fields through some\r
-     * other method than {@link #setFieldsReadOnly(boolean)}.\r
+     * other method than {@link #setReadOnly(boolean)}.\r
      * \r
      * @return true if the fields are set to read only, false otherwise\r
      */\r
-    public boolean isFieldsReadOnly() {\r
-        return fieldsReadOnly;\r
+    public boolean isReadOnly() {\r
+        return readOnly;\r
     }\r
 \r
     /**\r
@@ -191,8 +191,8 @@ public class FieldGroup implements Serializable {
      *            true to set all bound fields to read only, false to set them\r
      *            to read write\r
      */\r
-    public void setFieldsReadOnly(boolean fieldsReadOnly) {\r
-        this.fieldsReadOnly = fieldsReadOnly;\r
+    public void setReadOnly(boolean fieldsReadOnly) {\r
+        readOnly = fieldsReadOnly;\r
     }\r
 \r
     /**\r
@@ -284,7 +284,7 @@ public class FieldGroup implements Serializable {
      *             If the field is not bound by this field binder or not bound\r
      *             to the correct property id\r
      */\r
-    public void remove(Field<?> field) throws BindException {\r
+    public void unbind(Field<?> field) throws BindException {\r
         Object propertyId = fieldToPropertyId.get(field);\r
         if (propertyId == null) {\r
             throw new BindException(\r
@@ -313,10 +313,10 @@ public class FieldGroup implements Serializable {
      *            The field to update\r
      */\r
     protected void configureField(Field<?> field) {\r
-        field.setBuffered(isFieldsBuffered());\r
+        field.setBuffered(isBuffered());\r
 \r
-        field.setEnabled(isFieldsEnabled());\r
-        field.setReadOnly(isFieldsReadOnly());\r
+        field.setEnabled(isEnabled());\r
+        field.setReadOnly(isReadOnly());\r
     }\r
 \r
     /**\r
@@ -374,7 +374,7 @@ public class FieldGroup implements Serializable {
      * \r
      * @return A collection of property ids that have not been bound to fields\r
      */\r
-    protected Collection<Object> getUnboundPropertyIds() {\r
+    public Collection<Object> getUnboundPropertyIds() {\r
         if (getItemDataSource() == null) {\r
             return new ArrayList<Object>();\r
         }\r
@@ -397,7 +397,7 @@ public class FieldGroup implements Serializable {
      *             If the commit was aborted\r
      */\r
     public void commit() throws CommitException {\r
-        if (!isFieldsBuffered()) {\r
+        if (!isBuffered()) {\r
             // Not using buffered mode, nothing to do\r
             return;\r
         }\r
@@ -489,7 +489,7 @@ public class FieldGroup implements Serializable {
      * @return The field that is bound to the property id or null if no field is\r
      *         bound to that property id\r
      */\r
-    public Field<?> getFieldForPropertyId(Object propertyId) {\r
+    public Field<?> getField(Object propertyId) {\r
         return propertyIdToField.get(propertyId);\r
     }\r
 \r
@@ -501,7 +501,7 @@ public class FieldGroup implements Serializable {
      * @return The property id that is bound to the field or null if the field\r
      *         is not bound to any property id by this FieldBinder\r
      */\r
-    public Object getPropertyIdForField(Field field) {\r
+    public Object getPropertyId(Field<?> field) {\r
         return fieldToPropertyId.get(field);\r
     }\r
 \r
@@ -608,7 +608,7 @@ public class FieldGroup implements Serializable {
      * \r
      * @return true if all bound fields are valid, false otherwise.\r
      */\r
-    public boolean isAllFieldsValid() {\r
+    public boolean isValid() {\r
         try {\r
             for (Field<?> field : getFields()) {\r
                 field.validate();\r
@@ -624,7 +624,7 @@ public class FieldGroup implements Serializable {
      * \r
      * @return true if at least on field has been modified, false otherwise\r
      */\r
-    public boolean isAnyFieldModified() {\r
+    public boolean isModified() {\r
         for (Field<?> field : getFields()) {\r
             if (field.isModified()) {\r
                 return true;\r
index 24901e655cf25b9daeb59b995c567879c929ba44..0a6fa40b3ab2c81ef0f70c999a0419ac55150480 100644 (file)
@@ -67,7 +67,7 @@ public class BasicPersonForm extends TestBase {
                     configuration);\r
             FieldGroup confBinder = new FieldGroup(bi);\r
             confBinder.setItemDataSource(bi);\r
-            confBinder.setFieldsBuffered(false);\r
+            confBinder.setBuffered(false);\r
 \r
             FormBuilder builder = new FormBuilder(confBinder);\r
             for (Object propertyId : bi.getItemPropertyIds()) {\r
@@ -108,7 +108,7 @@ public class BasicPersonForm extends TestBase {
             }\r
         });\r
 \r
-        binder.setFieldsBuffered(true);\r
+        binder.setBuffered(true);\r
 \r
         FormBuilder builder = new FormBuilder(binder);\r
         builder.buildAndBindFields(this);\r