Browse Source

Adds missing Status enum to dataprovider example (#11425)

tags/8.8.0.beta1
tmattsso 5 years ago
parent
commit
b3b5f90bf6
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      documentation/datamodel/datamodel-providers.asciidoc

+ 19
- 0
documentation/datamodel/datamodel-providers.asciidoc View File

@@ -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<Status> comboBox = new ComboBox<>();

Loading…
Cancel
Save