Переглянути джерело

Adds missing Status enum to dataprovider example (#11425)

tags/8.8.0.beta1
tmattsso 5 роки тому
джерело
коміт
b3b5f90bf6

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

Завантаження…
Відмінити
Зберегти