summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-02-09 14:11:01 +0200
committerVaadin Code Review <review@vaadin.com>2015-02-09 19:17:32 +0000
commit2209a832943983e9e62b20c1e5e0bd982704f5e0 (patch)
tree62cb401ccd5614f8293873c40515a0f0f822533f /server/src
parentdc063db8dba26126d6c2f29359ec439b30176bc1 (diff)
downloadvaadin-framework-2209a832943983e9e62b20c1e5e0bd982704f5e0.tar.gz
vaadin-framework-2209a832943983e9e62b20c1e5e0bd982704f5e0.zip
Remove grid.[set|get]EditorField(Object, Field) (#16538)
Change-Id: Ia5c09b80e32f9842fb4680f035b53cea755cb451
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Grid.java74
1 files changed, 29 insertions, 45 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 6332520d2a..2bc42676c3 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -51,6 +51,7 @@ import com.vaadin.data.RpcDataProviderExtension.DataProviderKeyMapper;
import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.data.fieldgroup.DefaultFieldGroupFieldFactory;
import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.BindException;
import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
import com.vaadin.data.fieldgroup.FieldGroupFieldFactory;
import com.vaadin.data.sort.Sort;
@@ -2618,11 +2619,16 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
/**
* Sets the field component used to edit the properties in this column
- * when the item editor is active. Please refer to
- * {@link Grid#setEditorField(Object, Field)} for more information.
+ * when the item editor is active. If an item has not been set, then the
+ * binding is postponed until the item is set using
+ * {@link #editItem(Object)}.
+ * <p>
+ * Setting the field to <code>null</code> clears any previously set
+ * field, causing a new field to be created the next time the item
+ * editor is opened.
*
* @param editor
- * the editor field, cannot be null
+ * the editor field
* @return this column
*/
public Column setEditorField(Field<?> editor) {
@@ -2632,10 +2638,25 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
/**
* Returns the editor field used to edit the properties in this column
- * when the item editor is active. Please refer to
- * {@link Grid#getEditorField(Object)} for more information.
+ * when the item editor is active. Returns null if the column is not
+ * {@link Column#isEditable() editable}.
+ * <p>
+ * When {@link #editItem(Object) editItem} is called, fields are
+ * automatically created and bound for any unbound properties.
+ * <p>
+ * Getting a field before the editor has been opened depends on special
+ * support from the {@link FieldGroup} in use. Using this method with a
+ * user-provided <code>FieldGroup</code> might cause
+ * {@link BindException} to be thrown.
*
- * @return the editor field or null if this column is not editable
+ * @return the bound field; or <code>null</code> if the respective
+ * column is not editable
+ *
+ * @throws IllegalArgumentException
+ * if there is no column for the provided property id
+ * @throws BindException
+ * if no field has been configured and there is a problem
+ * building or binding
*/
public Field<?> getEditorField() {
return grid.getEditorField(getPropertyId());
@@ -4789,30 +4810,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
}
}
- /**
- * Gets the field component that represents a property in the item editor.
- * Returns null if the corresponding column is not
- * {@link Column#isEditable() editable}.
- * <p>
- * When {@link #editItem(Object) editItem} is called, fields are
- * automatically created and bound for any unbound properties.
- * <p>
- * Getting a field before the editor has been opened depends on special
- * support from the {@link FieldGroup} in use. Using this method with a
- * user-provided <code>FieldGroup</code> might cause {@link BindException}
- * to be thrown.
- *
- * @param propertyId
- * the property id of the property for which to find the field
- * @return the bound field or null if the respective column is not editable
- *
- * @throws IllegalArgumentException
- * if there is no column for the provided property id
- * @throws BindException
- * if no field has been configured and there is a problem
- * building or binding
- */
- public Field<?> getEditorField(Object propertyId) {
+ private Field<?> getEditorField(Object propertyId) {
checkColumnExists(propertyId);
if (!getColumn(propertyId).isEditable()) {
@@ -4870,21 +4868,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
}
}
- /**
- * Binds the field to the given propertyId. If an item has not been set,
- * then the binding is postponed until the item is set using
- * {@link #editItem(Object)}.
- * <p>
- * Setting the field to <code>null</code> clears any previously set field,
- * causing a new field to be created the next time the item editor is
- * opened.
- *
- * @param field
- * The field to bind
- * @param propertyId
- * The propertyId to bind the field to
- */
- public void setEditorField(Object propertyId, Field<?> field) {
+ private void setEditorField(Object propertyId, Field<?> field) {
checkColumnExists(propertyId);
Field<?> oldField = editorFieldGroup.getField(propertyId);