diff options
author | Henrik Paul <henrik@vaadin.com> | 2015-02-02 16:51:49 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2015-02-05 11:37:37 +0200 |
commit | 9b3af21f49acea5b36c81a978116026550e06f5e (patch) | |
tree | 8dc1fc41b7473ec895b295e1861d6f2a5463a00b /server/src | |
parent | 6cebf0cfac31c09ce3e849ba6a5d8dc5327b572e (diff) | |
download | vaadin-framework-9b3af21f49acea5b36c81a978116026550e06f5e.tar.gz vaadin-framework-9b3af21f49acea5b36c81a978116026550e06f5e.zip |
Makes it possible to change save/cancel captions in Grid editor (#16551)
Change-Id: I4e303613f66a13b3ad6a9b2284537e5548391a4a
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/com/vaadin/ui/Grid.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index 63d86b0b02..a228e62ce9 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -4845,6 +4845,56 @@ public class Grid extends AbstractComponent implements SelectionNotifier, return editorFieldGroup.getFieldFactory(); } + /** + * Sets the caption on the save button in the Grid editor. + * + * @param saveCaption + * the caption to set + * @throws IllegalArgumentException + * if {@code saveCaption} is {@code null} + */ + public void setEditorSaveCaption(String saveCaption) + throws IllegalArgumentException { + if (saveCaption == null) { + throw new IllegalArgumentException("Save caption cannot be null"); + } + getState().editorSaveCaption = saveCaption; + } + + /** + * Gets the current caption of the save button in the Grid editor. + * + * @return the current caption of the save button + */ + public String getEditorSaveCaption() { + return getState(false).editorSaveCaption; + } + + /** + * Sets the caption on the cancel button in the Grid editor. + * + * @param cancelCaption + * the caption to set + * @throws IllegalArgumentException + * if {@code cancelCaption} is {@code null} + */ + public void setEditorCancelCaption(String cancelCaption) + throws IllegalArgumentException { + if (cancelCaption == null) { + throw new IllegalArgumentException("Cancel caption cannot be null"); + } + getState().editorCancelCaption = cancelCaption; + } + + /** + * Gets the current caption of the cancel button in the Grid editor. + * + * @return the current caption of the cancel button + */ + public String getCancelCaption() { + return getState(false).editorCancelCaption; + } + @Override public void addItemClickListener(ItemClickListener listener) { addListener(GridConstants.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, |