pnlMinutes.addStyleName("timepickr-row");
pnlSuffix.addStyleName("timepickr-row");
for (int i = 0; i < timeSlices; i++) {
int min = i * (60 / timeSlices);
InlineLabel minuteLabel = createInlineLabel(
NumberFormat.getFormat("00").format(min),
"timepickr-button");
minuteLabel.addMouseOverHandler(minuteSelectedHandler);
minuteLabel.addClickHandler(closePopupHandler);
minuteLabel.addMouseOutHandler(isOkToCloseHandler);
minuteLabel.getElement().setPropertyInt("minute", i);
pnlMinutes.add(minuteLabel);
minuteLabels.add(minuteLabel);
}
// AM hours
for (int i = (startHour < 12 ? startHour : 12); i < (endHour < 12 ? endHour
: 12); i++) {
InlineLabel hourLabelAM = createInlineLabel(
NumberFormat.getFormat("00").format(i), "timepickr-button");
hourLabelAM.addMouseOverHandler(hourSelectedHandler);
hourLabelAM.addClickHandler(closePopupHandler);
hourLabelAM.addMouseOutHandler(isOkToCloseHandler);
hourLabelAM.getElement().setPropertyInt("hour", i);
pnlHoursAM.add(hourLabelAM);
hourLabels.add(hourLabelAM);
}
// PM hours
for (int i = (startHour < 12 ? 12 : startHour); i < (endHour < 12 ? 12
: endHour); i++) {
InlineLabel hourLabelPM = createInlineLabel(
NumberFormat.getFormat("00").format(
PickerFormat._24_HOUR.equals(format) ? i
: (i > 12 ? i % 12 : i)),
"timepickr-button");
hourLabelPM.addMouseOverHandler(hourSelectedHandler);
hourLabelPM.addClickHandler(closePopupHandler);
hourLabelPM.addMouseOutHandler(isOkToCloseHandler);
hourLabelPM.getElement().setPropertyInt("hour", i);
pnlHoursPM.add(hourLabelPM);
hourLabels.add(hourLabelPM);
}
if (startHour < 12 && endHour > 12) {