// This vbox contains all of the "extra" panel on the side
// of the calendar view.
final VerticalPanel vbox = new VerticalPanel();
setStyleName(vbox.getElement(), "datePickerMonthSelector");
final PushButton now = new PushButton("now");
now.setStyleName("datePickerNextButton");
now.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
box.setValue(new Date());
}
});
{
final Grid grid = new Grid(2, 9);
grid.setWidget(0, 0, newShiftDateButton(-3600, "1h"));
grid.setWidget(0, 1, newShiftDateButton(-600, "10m"));
grid.setWidget(0, 2, newShiftDateButton(-60, "1m"));
grid.setWidget(0, 3, new InlineHTML("‹"));
grid.setWidget(0, 4, now);
grid.setWidget(0, 5, new InlineHTML("›"));
grid.setWidget(0, 6, newShiftDateButton(+60, "1m"));
grid.setWidget(0, 7, newShiftDateButton(+600, "10m"));
grid.setWidget(0, 8, newShiftDateButton(+3600, "1h"));
grid.setWidget(1, 0, newShiftDateButton(-86400 * 30, "30d"));
grid.setWidget(1, 1, newShiftDateButton(-86400 * 7, "1w"));
grid.setWidget(1, 2, newShiftDateButton(-86400, "1d"));
grid.setWidget(1, 3, new InlineHTML("«"));
grid.setWidget(1, 4, new InlineHTML(" "));
grid.setWidget(1, 5, new InlineHTML("»"));
grid.setWidget(1, 6, newShiftDateButton(+86400, "1d"));
grid.setWidget(1, 7, newShiftDateButton(+86400 * 7, "1w"));
grid.setWidget(1, 8, newShiftDateButton(+86400 * 30, "30d"));
final CellFormatter formatter = grid.getCellFormatter();
formatter.setWidth(0, 4, "100%");
formatter.setWidth(1, 4, "100%");
vbox.add(grid);
}
{
hours_minutes = new Grid(4, 8);
setupAmUI();
hours_minutes.setWidget(0, 0, new InlineLabel("HH"));
final PushButton set_am = new PushButton("AM");
set_am.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
setupAmUI();
}
});
hours_minutes.setWidget(0, 7, set_am);
final PushButton set_pm = new PushButton("PM");
set_pm.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
setupPmUI();
}
});
hours_minutes.setWidget(1, 7, set_pm);