Example #1
0
  private void renderExamsForRowOfDays(
      StringBuilder strBuffer, int week, Integer year1, Integer year2, PageContext pageContext) {
    for (int slot = 0; slot < daysOfWeek.length; slot++) {
      ExamsMapSlot examsMapSlot =
          (ExamsMapSlot) examsMap.getDays().get(week * daysOfWeek.length + slot);

      String classCSS = "exam_cell_content";
      if (examsMapSlot.getDay().get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
        classCSS += "_first";
      }

      if (week == numberOfWeks - 1) {
        classCSS += "_bottom";
      }

      strBuffer.append("<td ").append("class='").append(classCSS).append("'>");
      strBuffer.append(
          examsMapSlotContentRenderer.renderDayContents(
              (ExamsMapSlot) examsMap.getDays().get(week * daysOfWeek.length + slot),
              year1,
              year2,
              user,
              pageContext));
      strBuffer.append("</td>");
    }
  }
  private void renderLabelsForRowOfDays(StringBuilder strBuffer, int week) {
    for (int slot = 0; slot < daysOfWeek.length; slot++) {
      ExamsMapSlot examsMapSlot =
          (ExamsMapSlot) examsMap.getDays().get(week * daysOfWeek.length + slot);

      String classCSS = "exam_cell_day";
      if (examsMapSlot.getDay().get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
        classCSS += "_first";
      }

      strBuffer.append("<td ").append("class='").append(classCSS).append("'>");
      strBuffer.append(examsMapSlotContentRenderer.renderDayLabel(examsMapSlot, examsMap));
      strBuffer.append("</td>");
    }
  }