: (100 / schedule.getModel().size());
int startHour = getRenderedStartHour(schedule);
int endHour = getRenderedEndHour(schedule);
ScheduleDay day = null;
for (Iterator dayIterator = schedule.getModel().iterator(); dayIterator.hasNext();)
{
writer.startElement(HTML.TD_ELEM, schedule);
writer.writeAttribute(HTML.STYLE_ATTR, "width: " + String.valueOf(columnWidth)+ "%", null);
day = (ScheduleDay) dayIterator.next();
writer.startElement(HTML.TABLE_ELEM, schedule);
writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%; height: 100%",
null);
writer.startElement(HTML.TBODY_ELEM, schedule);
writer.startElement(HTML.TR_ELEM, schedule);
// the header
final String dayHeaderId = clientId + "_header_" + ScheduleUtil.getDateId(day.getDate(), schedule.getModel().getTimeZone());
writer.startElement(HTML.TH_ELEM, schedule);
writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
"header"), null);
writer
.writeAttribute(
HTML.STYLE_ATTR,
"height: " + headerHeight + "px; vertical-align: top; border-style: none; border-width: 0px; overflow: hidden;",
null);
boolean isToday = ScheduleUtil.isSameDay(day.getDate(), new Date(), schedule.getModel().getTimeZone());
// write the date
writer.startElement(HTML.ANCHOR_ELEM, schedule);
writer.writeAttribute(HTML.ID_ATTR, dayHeaderId, null);
writer.writeAttribute(HTML.HREF_ATTR, "#", null);
writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "date")
+ (isToday ? " today" : ""), null);
writer
.writeAttribute(
HTML.STYLE_ATTR,
"display: block; height: 50%; width: 100%; overflow: hidden; white-space: nowrap;",
null);
//register an onclick event listener to a column header which will
//be used to determine the date
if (!schedule.isReadonly() && schedule.isSubmitOnClick()) {
writer.writeAttribute(
HTML.ONCLICK_ATTR,
"fireScheduleDateClicked(this, event, '"
+ formId + "', '"
+ clientId
+ "');",
null);
}
writer.writeText(getDateString(context, schedule, day.getDate()),
null);
writer.endElement(HTML.ANCHOR_ELEM);
// write the name of the holiday, if there is one
if ((day.getSpecialDayName() != null)
&& (day.getSpecialDayName().length() > 0))
{
writer.startElement(HTML.SPAN_ELEM, schedule);
writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
"holiday"), null);
writer
.writeAttribute(
HTML.STYLE_ATTR,
"height: 50%; width: 100%; overflow: hidden; white-space: nowrap;",
null);
writer.writeText(day.getSpecialDayName(), null);
writer.endElement(HTML.SPAN_ELEM);
}
writer.endElement(HTML.TH_ELEM);
writer.endElement(HTML.TR_ELEM);
// the intervals
Iterator intervalIt = day.getIntervals(startHour, endHour).iterator();
boolean even = false;
while (intervalIt.hasNext())
{
Interval interval = (Interval) intervalIt.next();