Sets up the custom UI of the date picker.
()
| 244 | |
| 245 | /** Sets up the custom UI of the date picker. */ |
| 246 | @Override |
| 247 | protected void setup() { |
| 248 | final HorizontalPanel panel = new HorizontalPanel(); |
| 249 | initWidget(panel); |
| 250 | setStyleName(panel.getElement(), "gwt-DatePicker"); |
| 251 | |
| 252 | { |
| 253 | final VerticalPanel vbox = new VerticalPanel(); |
| 254 | setStyleName("gwt-DatePicker"); |
| 255 | vbox.add(super.getMonthSelector()); |
| 256 | vbox.add(super.getView()); |
| 257 | |
| 258 | panel.add(vbox); |
| 259 | } |
| 260 | |
| 261 | { |
| 262 | // This vbox contains all of the "extra" panel on the side |
| 263 | // of the calendar view. |
| 264 | final VerticalPanel vbox = new VerticalPanel(); |
| 265 | setStyleName(vbox.getElement(), "datePickerMonthSelector"); |
| 266 | |
| 267 | final PushButton now = new PushButton("now"); |
| 268 | now.setStyleName("datePickerNextButton"); |
| 269 | now.addClickHandler(new ClickHandler() { |
| 270 | public void onClick(final ClickEvent event) { |
| 271 | box.setValue(new Date()); |
| 272 | } |
| 273 | }); |
| 274 | |
| 275 | { |
| 276 | final Grid grid = new Grid(2, 9); |
| 277 | grid.setWidget(0, 0, newShiftDateButton(-3600, "1h")); |
| 278 | grid.setWidget(0, 1, newShiftDateButton(-600, "10m")); |
| 279 | grid.setWidget(0, 2, newShiftDateButton(-60, "1m")); |
| 280 | grid.setWidget(0, 3, new InlineHTML("‹")); |
| 281 | grid.setWidget(0, 4, now); |
| 282 | grid.setWidget(0, 5, new InlineHTML("›")); |
| 283 | grid.setWidget(0, 6, newShiftDateButton(+60, "1m")); |
| 284 | grid.setWidget(0, 7, newShiftDateButton(+600, "10m")); |
| 285 | grid.setWidget(0, 8, newShiftDateButton(+3600, "1h")); |
| 286 | grid.setWidget(1, 0, newShiftDateButton(-86400 * 30, "30d")); |
| 287 | grid.setWidget(1, 1, newShiftDateButton(-86400 * 7, "1w")); |
| 288 | grid.setWidget(1, 2, newShiftDateButton(-86400, "1d")); |
| 289 | grid.setWidget(1, 3, new InlineHTML("«")); |
| 290 | grid.setWidget(1, 4, new InlineHTML(" ")); |
| 291 | grid.setWidget(1, 5, new InlineHTML("»")); |
| 292 | grid.setWidget(1, 6, newShiftDateButton(+86400, "1d")); |
| 293 | grid.setWidget(1, 7, newShiftDateButton(+86400 * 7, "1w")); |
| 294 | grid.setWidget(1, 8, newShiftDateButton(+86400 * 30, "30d")); |
| 295 | final CellFormatter formatter = grid.getCellFormatter(); |
| 296 | formatter.setWidth(0, 4, "100%"); |
| 297 | formatter.setWidth(1, 4, "100%"); |
| 298 | vbox.add(grid); |
| 299 | } |
| 300 | |
| 301 | { |
| 302 | hours_minutes = new Grid(4, 8); |
| 303 | setupAmUI(); |
nothing calls this directly
no test coverage detected