Pārlūkot izejas kodu

Adds missing Status enum to dataprovider example (#11425)

tags/8.8.0.beta1
tmattsso pirms 5 gadiem
vecāks
revīzija
b3b5f90bf6
1 mainītis faili ar 19 papildinājumiem un 0 dzēšanām
  1. 19
    0
      documentation/datamodel/datamodel-providers.asciidoc

+ 19
- 0
documentation/datamodel/datamodel-providers.asciidoc Parādīt failu

@@ -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<>();

Notiek ielāde…
Atcelt
Saglabāt