|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.ui.components.grid.EditorRow
public class EditorRow
A class for configuring the editor row in a grid.
Grid,
Serialized Form| Method Summary | ||
|---|---|---|
void |
bind(java.lang.Object propertyId,
Field<?> field)
Binds the field with the given propertyId from the current item. |
|
|
buildAndBind(java.lang.Object propertyId,
java.lang.Class<T> fieldComponent)
Builds a field using the given caption and binds it to the given property id using the field binder. |
|
void |
cancel()
Cancels the currently active edit if any. |
|
void |
commit()
Commits all changes done to the bound fields. |
|
void |
discard()
Discards all changes done to the bound fields. |
|
void |
editItem(java.lang.Object itemId)
Sets an item as editable. |
|
java.lang.Object |
getEditedItemId()
Gets the id of the item that is currently being edited. |
|
Field<?> |
getField(java.lang.Object propertyId)
Gets the field component that represents a property. |
|
FieldGroup |
getFieldGroup()
Gets the field group that is backing this editor row. |
|
protected void |
internalCancel()
|
|
protected void |
internalEditItem(java.lang.Object itemId)
|
|
boolean |
isEditing()
Returns whether this editor row is currently editing an item. |
|
boolean |
isEnabled()
Checks whether the editor row feature is enabled for the grid or not. |
|
boolean |
isPropertyEditable(java.lang.Object propertyId)
Checks whether a property is uneditable or not. |
|
void |
setEnabled(boolean isEnabled)
Sets whether or not the editor row feature is enabled for the grid. |
|
void |
setFieldFactory(FieldGroupFieldFactory factory)
Sets the field factory for the FieldGroup. |
|
void |
setFieldGroup(FieldGroup fieldGroup)
Sets the field group that is backing this editor row. |
|
void |
setPropertyEditable(java.lang.Object propertyId,
boolean editable)
Sets a property editable or not. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isEnabled()
true iff the editor row feature is enabled for the
gridgetEditedItemId()
public void setEnabled(boolean isEnabled)
throws java.lang.IllegalStateException
isEnabled - true to enable the feature, false
otherwise
java.lang.IllegalStateException - if an item is currently being editedgetEditedItemId()public FieldGroup getFieldGroup()
public void setFieldGroup(FieldGroup fieldGroup)
fieldGroup - the backing field group
public <T extends Field<?>> T buildAndBind(java.lang.Object propertyId,
java.lang.Class<T> fieldComponent)
throws FieldGroup.BindException
Note: This is a pass-through call to the backing field group.
propertyId - The property id to bind to. Must be present in the field
finderfieldType - The type of field that we want to create
Field.
FieldGroup.BindException - If the field could not be created
public void bind(java.lang.Object propertyId,
Field<?> field)
throws FieldGroup.BindException
editItem(Object).
This method also adds validators when applicable.
Note: This is a pass-through call to the backing field group.
field - The field to bindpropertyId - The propertyId to bind to the field
FieldGroup.BindException - If the property id is already bound to another field by this
field binderpublic void setFieldFactory(FieldGroupFieldFactory factory)
FieldGroup. The field factory is
only used when FieldGroup creates a new field.
Note: This is a pass-through call to the backing field group.
fieldFactory - The field factory to usepublic Field<?> getField(java.lang.Object propertyId)
When editItem is called, fields are
automatically created and bound to any unbound properties.
propertyId - the property id of the property for which to find the field
#setPropertyUneditable(Object)
public void setPropertyEditable(java.lang.Object propertyId,
boolean editable)
In order for a user to edit a particular value with a Field, it needs to be both non-readonly and editable.
The difference between read-only and uneditable is that the read-only state is propagated back into the property, while the editable property is internal metadata for the editor row.
propertyId - the id of the property to set as editable stateeditable - whether or not propertyId chould be editablepublic boolean isPropertyEditable(java.lang.Object propertyId)
This only checks whether the property is configured as uneditable in this editor row. The property's or field's readonly status will ultimately decide whether the value can be edited or not.
propertyId - the id of the property to check for editable status
true iff the property is editable according to this
editor row
public void commit()
throws FieldGroup.CommitException
Note: This is a pass-through call to the backing field group.
FieldGroup.CommitException - If the commit was abortedpublic void discard()
Note: This is a pass-through call to the backing field group.
public void editItem(java.lang.Object itemId)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
itemId - the id of the item to edit
java.lang.IllegalStateException - if the editor row is not enabled
java.lang.IllegalArgumentException - if the itemId is not in the backing containersetEnabled(boolean)protected void internalEditItem(java.lang.Object itemId)
public void cancel()
protected void internalCancel()
public boolean isEditing()
public java.lang.Object getEditedItemId()
null if no item is being edited at the moment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||