From b3b5f90bf6d4bd9274642e0437ab8ca2ec5c1db8 Mon Sep 17 00:00:00 2001 From: tmattsso Date: Fri, 18 Jan 2019 12:55:59 +0200 Subject: [PATCH] Adds missing Status enum to dataprovider example (#11425) --- .../datamodel/datamodel-providers.asciidoc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 @@ -19,6 +19,25 @@ Regardless of how the items are loaded, the component is configured with one or In the following example, a [classname]#ComboBox# that lists status items is configured to use the [classname]#Status#.[methodname]#getCaption()# method to represent each status. There is also a [classname]#Grid#, which is configured with one column from the person's name and another showing the year of birth. +[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 comboBox = new ComboBox<>(); -- 2.39.5