aboutsummaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authortmattsso <thomas@vaadin.com>2019-01-18 12:55:59 +0200
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>2019-01-18 12:55:59 +0200
commitb3b5f90bf6d4bd9274642e0437ab8ca2ec5c1db8 (patch)
tree30a62716ada25f05b68d1bd78be1f8b5d3f2c364 /documentation
parent39736ca95cc512bf88e7fc941e304f521529ef11 (diff)
downloadvaadin-framework-b3b5f90bf6d4bd9274642e0437ab8ca2ec5c1db8.tar.gz
vaadin-framework-b3b5f90bf6d4bd9274642e0437ab8ca2ec5c1db8.zip
Adds missing Status enum to dataprovider example (#11425)
Diffstat (limited to 'documentation')
-rw-r--r--documentation/datamodel/datamodel-providers.asciidoc19
1 files changed, 19 insertions, 0 deletions
diff --git a/documentation/datamodel/datamodel-providers.asciidoc b/documentation/datamodel/datamodel-providers.asciidoc
index e4e16df24f..d66f45a47c 100644
--- a/documentation/datamodel/datamodel-providers.asciidoc
+++ b/documentation/datamodel/datamodel-providers.asciidoc
@@ -21,6 +21,25 @@ There is also a [classname]#Grid#, which is configured with one column from the
[source, java]
----
+public enum Status {
+ TODO, IN_PROGRESS, DONE;
+
+ public String getCaption() {
+ switch (this) {
+ case TODO:
+ return "To do";
+ case IN_PROGRESS:
+ return "In Progress";
+ case DONE:
+ return "Done";
+ }
+ return "";
+ }
+}
+----
+
+[source, java]
+----
ComboBox<Status> comboBox = new ComboBox<>();
comboBox.setItemCaptionGenerator(Status::getCaption);