Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/WTable.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | a52b820c9006 |
children |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
52 | 52 |
53 ListGridField type = new ListGridField("type", MESSAGE.type()); | 53 ListGridField type = new ListGridField("type", MESSAGE.type()); |
54 type.setType(ListGridFieldType.TEXT); | 54 type.setType(ListGridFieldType.TEXT); |
55 type.setWidth("50"); | 55 type.setWidth("50"); |
56 | 56 |
57 ListGridField startTime = createYearListGridField("starttime", MESSAGE.starttime()); | 57 ListGridField startTime = createYearListGridField( |
58 "starttime", MESSAGE.starttime()); | |
58 | 59 |
59 ListGridField stopTime = createYearListGridField("stoptime", MESSAGE.stoptime()); | 60 ListGridField stopTime = createYearListGridField( |
61 "stoptime", MESSAGE.stoptime()); | |
60 | 62 |
61 final NumberFormat nf = NumberFormat.getDecimalFormat(); | 63 final NumberFormat nf = NumberFormat.getDecimalFormat(); |
62 | 64 |
63 ListGridField value = new ListGridField("value", MESSAGE.wq_value_w()); | 65 ListGridField value = new ListGridField("value", MESSAGE.wq_value_w()); |
64 value.setType(ListGridFieldType.FLOAT); | 66 value.setType(ListGridFieldType.FLOAT); |
92 showField("select"); | 94 showField("select"); |
93 } | 95 } |
94 | 96 |
95 public static ListGridField createYearListGridField( | 97 public static ListGridField createYearListGridField( |
96 final String propertyName, String displayName) { | 98 final String propertyName, String displayName) { |
97 ListGridField listGridField = new ListGridField(propertyName, displayName); | 99 ListGridField listGridField = new ListGridField( |
100 propertyName, displayName); | |
98 listGridField.setType(ListGridFieldType.DATE); | 101 listGridField.setType(ListGridFieldType.DATE); |
99 listGridField.setWidth("50"); | 102 listGridField.setWidth("50"); |
100 listGridField.setCellFormatter(createYearDateFormatter(propertyName)); | 103 listGridField.setCellFormatter(createYearDateFormatter(propertyName)); |
101 return listGridField; | 104 return listGridField; |
102 } | 105 } |
103 | 106 |
104 /** Create CellFormatter that prints just the year of a date stored in attributeName. */ | 107 /** Create CellFormatter that prints just the year of a date |
105 private static CellFormatter createYearDateFormatter(final String attributeName) { | 108 * stored in attributeName. */ |
109 private static CellFormatter createYearDateFormatter( | |
110 final String attributeName | |
111 ) { | |
106 return new CellFormatter() { | 112 return new CellFormatter() { |
107 @Override | 113 @Override |
108 public String format(Object arg0, ListGridRecord record, int arg2, int arg3) { | 114 public String format( |
115 Object arg0, ListGridRecord record, int arg2, int arg3) { | |
109 Date date = record.getAttributeAsDate(attributeName); | 116 Date date = record.getAttributeAsDate(attributeName); |
110 if (date == null) { | 117 if (date == null) { |
111 return ""; | 118 return ""; |
112 } | 119 } |
113 DateTimeFormat fmt = DateTimeFormat.getFormat("yyyy"); | 120 DateTimeFormat fmt = DateTimeFormat.getFormat("yyyy"); |