summaryrefslogtreecommitdiffstats
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-22 16:05:19 +0200
commit3ba586254af13c89d528fc95f1dfeeeff5c37fd2 (patch)
tree64ff1b2965eed681bb30f11c5c735a760a2bc53b /documentation
parentc68a716f0f872dd1520d3e5ea8113208f422a473 (diff)
downloadvaadin-framework-3ba586254af13c89d528fc95f1dfeeeff5c37fd2.tar.gz
vaadin-framework-3ba586254af13c89d528fc95f1dfeeeff5c37fd2.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);