| Rev | Line | |
|---|
| 1 | package tmcsim.client.cadclientgui.screens; |
|---|
| 2 | |
|---|
| 3 | import javax.swing.table.DefaultTableCellRenderer; |
|---|
| 4 | |
|---|
| 5 | /** |
|---|
| 6 | * This is a quick hack to meet a specific customer request. |
|---|
| 7 | * The customer desires that incident number 100 be displayed as "Media". |
|---|
| 8 | * This TableCellRenderer is used for Integer fields in the table |
|---|
| 9 | * (of which there is currently only one: the incident number). |
|---|
| 10 | * When displaying any Integers in the table this class will be used. |
|---|
| 11 | * It simply filters for the special case of the number 100 |
|---|
| 12 | * and changes it to the string "Media". |
|---|
| 13 | * @author jdalbey |
|---|
| 14 | * @version 2019.3.2 |
|---|
| 15 | */ |
|---|
| 16 | class IncidentNumberRenderer extends DefaultTableCellRenderer { |
|---|
| 17 | public IncidentNumberRenderer() { super(); } |
|---|
| 18 | |
|---|
| 19 | public void setValue(Object value) |
|---|
| 20 | { |
|---|
| 21 | super.setValue(value); |
|---|
| 22 | // Change 100 to "Media" |
|---|
| 23 | if (value != null && value.equals(new Integer(100))) |
|---|
| 24 | { |
|---|
| 25 | setText("Media"); |
|---|
| 26 | } |
|---|
| 27 | } |
|---|
| 28 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.