aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/datamodel/datamodel-providers.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/datamodel/datamodel-providers.asciidoc')
-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);