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