T - public interface Editor<T> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
Registration |
addCancelListener(EditorCancelListener<T> listener)
Adds an editor cancel
listener. |
Registration |
addOpenListener(EditorOpenListener<T> listener)
Adds an editor open
listener. |
Registration |
addSaveListener(EditorSaveListener<T> listener)
Adds an editor save
listener. |
void |
cancel()
Close the editor discarding any unsaved changes.
|
void |
editRow(int rowNumber)
Opens the editor interface for the provided row.
|
Binder<T> |
getBinder()
Returns the underlying Binder from Editor.
|
String |
getCancelCaption()
Gets the caption of the cancel button in buffered mode.
|
EditorErrorGenerator<T> |
getErrorGenerator()
Gets the error message generator of this editor.
|
Grid<T> |
getGrid()
Gets the Grid instance which this editor belongs to.
|
String |
getSaveCaption()
Gets the caption of the save button in buffered mode.
|
boolean |
isBuffered()
Returns whether Editor is buffered or not.
|
boolean |
isEnabled()
Returns whether Editor is enabled or not.
|
boolean |
isOpen()
Returns whether Editor is open or not.
|
boolean |
save()
Saves any changes from the Editor fields to the edited bean.
|
Editor<T> |
setBinder(Binder<T> binder)
Sets the underlying Binder to this Editor.
|
Editor<T> |
setBuffered(boolean buffered)
Sets the Editor buffered mode.
|
Editor<T> |
setCancelCaption(String cancelCaption)
Sets the caption of the cancel button in buffered mode.
|
Editor<T> |
setEnabled(boolean enabled)
Enables or disabled the Editor.
|
Editor<T> |
setErrorGenerator(EditorErrorGenerator<T> errorGenerator)
Sets the error message generator for this editor.
|
Editor<T> |
setSaveCaption(String saveCaption)
Sets the caption of the save button in buffered mode.
|
Editor<T> setBinder(Binder<T> binder)
binder - the binder for updating editor fields; not nullBinder<T> getBinder()
nullEditor<T> setBuffered(boolean buffered)
buffered - true if editor should be buffered; false if
notEditor<T> setEnabled(boolean enabled)
enabled - true if editor should be enabled; false if notboolean isBuffered()
true if editor is buffered; false if notsetBuffered(boolean)boolean isEnabled()
true if editor is enabled; false if notboolean isOpen()
true if editor is open; false if notboolean save()
true if save succeeded; false if notvoid cancel()
void editRow(int rowNumber)
rowNumber - the row number of the edited itemIllegalStateException - if the editor is not enabled or already editing a different
item in buffered modeIllegalArgumentException - if the rowNumber is not in the backing data providersetEnabled(boolean)Editor<T> setSaveCaption(String saveCaption)
saveCaption - the save button captionEditor<T> setCancelCaption(String cancelCaption)
cancelCaption - the cancel button captionString getSaveCaption()
String getCancelCaption()
Editor<T> setErrorGenerator(EditorErrorGenerator<T> errorGenerator)
The default message is a concatenation of column field validation failures and bean validation failures.
errorGenerator - the function to generate error messages; not nullEditorErrorGeneratorEditorErrorGenerator<T> getErrorGenerator()
nullEditorErrorGeneratorRegistration addSaveListener(EditorSaveListener<T> listener)
listener.listener - save listenerRegistration addCancelListener(EditorCancelListener<T> listener)
listener.listener - cancel listenerRegistration addOpenListener(EditorOpenListener<T> listener)
listener.listener - open listenerCopyright © 2018 Vaadin Ltd. All rights reserved.