summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2015-02-02 16:51:49 +0200
committerVaadin Code Review <review@vaadin.com>2015-02-05 06:50:44 +0000
commit323e8bb4588fcb4eefa6e988cceb8444f963d733 (patch)
tree38d6251431c43fabe3ba4e4c3afdf3edbe939ac3 /server
parent2a67b961a466b512532b1f554b0fc2903d185f50 (diff)
downloadvaadin-framework-323e8bb4588fcb4eefa6e988cceb8444f963d733.tar.gz
vaadin-framework-323e8bb4588fcb4eefa6e988cceb8444f963d733.zip
Makes it possible to change save/cancel captions in Grid editor (#16551)
Change-Id: I4e303613f66a13b3ad6a9b2284537e5548391a4a
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/Grid.java50
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 458522f58e..f3c3bfa26b 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -4862,6 +4862,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,