From 709a8b5fd0901837a8f3d43983f9faab8b8470c7 Mon Sep 17 00:00:00 2001 From: Henri Kerola Date: Wed, 11 Feb 2015 18:32:53 -0800 Subject: [PATCH] #59: added editorSaveCaption and editorCancelCaption to Grid --- addon/src/main/scala/vaadin/scala/Grid.scala | 6 ++++++ .../test/scala/vaadin/scala/tests/GridTests.scala | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/addon/src/main/scala/vaadin/scala/Grid.scala b/addon/src/main/scala/vaadin/scala/Grid.scala index 9be9fbfe..b42e30c5 100644 --- a/addon/src/main/scala/vaadin/scala/Grid.scala +++ b/addon/src/main/scala/vaadin/scala/Grid.scala @@ -393,4 +393,10 @@ class Grid(override val p: VaadinGrid with GridMixin) def editorFieldFactory = wrapperFor[FieldGroupFieldFactory](p.getEditorFieldGroup.getFieldFactory).get def editorFieldFactory_=(fieldFactory: FieldGroupFieldFactory) = p.setEditorFieldFactory(fieldFactory.p) + def editorSaveCaption: String = p.getEditorSaveCaption + def editorSaveCaption_=(saveCaption: String): Unit = p.setEditorSaveCaption(saveCaption) + + def editorCancelCaption: String = p.getEditorCancelCaption + def editorCancelCaption_=(cancelCaption: String): Unit = p.setEditorCancelCaption(cancelCaption) + } diff --git a/addon/src/test/scala/vaadin/scala/tests/GridTests.scala b/addon/src/test/scala/vaadin/scala/tests/GridTests.scala index b9fdfc1a..9b1f3557 100644 --- a/addon/src/test/scala/vaadin/scala/tests/GridTests.scala +++ b/addon/src/test/scala/vaadin/scala/tests/GridTests.scala @@ -654,4 +654,18 @@ class GridTests extends ScaladinTestSuite { assert(fieldFactory == grid.editorFieldFactory) } + test("editorSaveCaption") { + assert("Save" == grid.editorSaveCaption) + + grid.editorSaveCaption = "Tallenna" + assert("Tallenna" == grid.editorSaveCaption) + } + + test("editorCancelCaption") { + assert("Cancel" == grid.editorCancelCaption) + + grid.editorCancelCaption = "Peruuta" + assert("Peruuta" == grid.editorCancelCaption) + } + }