}
years.setSelectedIndex(50);
horizontalPanel.add(years);
// Add months
ConstantsCore constants = ((ConstantsCore) GWT.create(ConstantsCore.class));
months.addItem(constants.January());
months.addItem(constants.February());
months.addItem(constants.March());
months.addItem(constants.April());
months.addItem(constants.May());
months.addItem(constants.June());
months.addItem(constants.July());
months.addItem(constants.August());
months.addItem(constants.September());
months.addItem(constants.October());
months.addItem(constants.November());
months.addItem(constants.December());
months.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
fillDates();
}
});
horizontalPanel.add(months);
// Add dates
fillDates();
horizontalPanel.add(dates);
showTime = hasTime(formatter);
if (showTime) {
// Hours
for (int i = 0; i < 24; i++) {
hours.addItem(Integer.toString(i));
}
horizontalPanel.add(timeHyphenLabel);
horizontalPanel.add(hours);
// Minutes
for (int i = 0; i < 60; i++) {
minutes.addItem(Integer.toString(i));
}
horizontalPanel.add(timeColonLabel);
horizontalPanel.add(minutes);
}
Button okButton = new Button(constants.OK());
okButton.addClickHandler(okClickHandler);
horizontalPanel.add(okButton);
add(horizontalPanel);
}