Skip to content

Commit

Permalink
#59: added editorSaveCaption and editorCancelCaption to Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Kerola committed Feb 12, 2015
1 parent 98313f3 commit 709a8b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addon/src/main/scala/vaadin/scala/Grid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
14 changes: 14 additions & 0 deletions addon/src/test/scala/vaadin/scala/tests/GridTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}

0 comments on commit 709a8b5

Please sign in to comment.