protected void sinkHeaderClass(Sink sink, String header, String CssClass) {
   if (header != null && header.length() > 0) {
     sink.rawText("<th class=\"" + CssClass + "\">" + header + "</th>");
   } else {
     sink.rawText("<th class=\"" + CssClass + "\">&#160;</th>");
   }
 }
 protected void sinkCellWithLink(Sink sink, String text, String link) {
   // sink.tableCell();
   sink.rawText("<td NOWRAP>");
   sink.link(link);
   sink.text(text);
   sink.link_();
   sink.tableCell_();
 }
  protected void sinkCellClass(Sink sink, String text, String CssClass) {

    if (text != null && text.length() > 0) {
      sink.rawText("<td class=\"" + CssClass + "\">" + text + "</td>");
    } else {
      sink.rawText("<td class=\"" + CssClass + "\">&#160;</td>");
    }
  }
 //    protected void sinkPercentGraphic( Sink sink, double value )
 //    {
 //        sink.rawText( "<div style=\"border: 1px solid #808080; padding: 0px; background-color:
 // #FF5555; width: 100px; border-collapse: collapse;\">" );
 //        sink.rawText( "<div style=\"padding: 0px; background-color: #77FF77; height: 1.3em;
 // border-collapse: collapse; width: "
 //                        + (int) Math.floor( value * 100 ) + "px;\">" );
 //        sink.rawText( "<span style=\"display:block; position:absolute; text-align:center;
 // width:100px; border-collapse:collapse;\">"
 //                        + getPercentValue( value ) + "</span>" );
 //        sink.rawText( "</div>" );
 //        sink.rawText( "</div>" );
 //    }
 protected void sinkPercentGraphic(Sink sink, double value) {
   sink.rawText("<div class=\"percentOuter\">");
   sink.rawText(
       "<div class=\"percentInner\" style=\"width: " + (int) Math.floor(value * 100) + "px;\">");
   sink.rawText("<span class=\"percentLabel\">" + getPercentValue(value) + "</span>");
   sink.rawText("</div>");
   sink.rawText("</div>");
 }
 protected void sinkHeader(Sink sink, String header) {
   sink.tableHeaderCell();
   if (header != null && header.length() > 0) {
     sink.text(header);
   } else {
     sink.nonBreakingSpace();
   }
   sink.tableHeaderCell_();
 }
 protected void sinkCell(Sink sink, String text) {
   sink.tableCell();
   if (text != null && text.length() > 0) {
     sink.text(text);
   } else {
     sink.nonBreakingSpace();
   }
   sink.tableCell_();
 }
 protected void sinkCellTab(Sink sink, String text, int nbTabulation) {
   sink.tableCell();
   int loop = AbstractDashBoardGenerator.SPACE_NUMBER * nbTabulation;
   for (int i = 0; i < loop; i++) {
     sink.nonBreakingSpace();
   }
   sink.text(text);
   sink.tableCell_();
 }
  public void doGenerateEmptyReport(ResourceBundle bundle, Sink sink) {
    sinkBeginReport(sink, bundle);

    sink.paragraph();

    sink.text(bundle.getString("report.issues.error"));

    sink.paragraph_();

    sinkEndReport(sink);
  }
Example #9
0
 /** @see Block#traverse(org.apache.maven.doxia.sink.Sink) */
 public final void traverse(final Sink sink) {
   String referenceValue;
   if (isExternalLink(reference)) {
     referenceValue = reference;
   } else {
     /* For Wiki Words */
     /*Find index of # first */
     int indexOfHash = reference.indexOf("#");
     if (indexOfHash > 0) {
       referenceValue =
           "./" + reference.substring(0, indexOfHash) + ".html" + reference.substring(indexOfHash);
     } else {
       referenceValue = "./" + reference + ".html";
     }
   }
   sink.link(referenceValue);
   sink.text(text);
   sink.link_();
 }
 protected void linkToHistoricPage(Sink sink, String anchor) {
   sink.bold();
   sink.text("[");
   sink.link("dashboard-report-historic.html#" + anchor);
   sink.text("Go to Historic page");
   sink.link_();
   sink.text("]");
   sink.bold_();
 }
 protected void linkToTopPage(Sink sink) {
   sink.bold();
   sink.text("[");
   sink.link("#top");
   sink.text("Top");
   sink.link_();
   sink.text("]");
   sink.bold_();
 }
 protected void sinkDefaultInvertCellPercentGraphic(
     Sink sink, double value, String CssClass, boolean header, String label) {
   if (value == -1.0) {
     value = 0d;
   }
   if (header) {
     sink.rawText("<th class=\"" + CssClass + "\">");
   } else {
     sink.rawText("<td class=\"" + CssClass + "\">");
   }
   sinkInvertPercentGraphic(sink, value);
   if (label != null && label.length() > 0) {
     sink.rawText(label);
   }
   if (header) {
     sink.rawText("</th>");
   } else {
     sink.rawText("</td>");
   }
 }
 protected void sinkCellTabBoldWithLink(Sink sink, String text, int nbTabulation, String link) {
   // sink.tableCell();
   sink.rawText("<td NOWRAP>");
   int loop = AbstractDashBoardGenerator.SPACE_NUMBER * nbTabulation;
   for (int i = 0; i < loop; i++) {
     sink.nonBreakingSpace();
   }
   sink.bold();
   sink.link(link);
   sink.text(text);
   sink.link_();
   sink.bold_();
   sink.tableCell_();
 }
 protected void iconInfo(Sink sink) {
   sink.figure();
   sink.figureCaption();
   sink.text("info");
   sink.figureCaption_();
   sink.figureGraphics("./images/icon_info_sml.gif");
   sink.figure_();
 }
 protected void iconWarning(Sink sink) {
   sink.figure();
   sink.figureCaption();
   sink.text("warning");
   sink.figureCaption_();
   sink.figureGraphics("./images/icon_warning_sml.gif");
   sink.figure_();
 }
 protected void iconError(Sink sink) {
   sink.figure();
   sink.figureCaption();
   sink.text("error");
   sink.figureCaption_();
   sink.figureGraphics("./images/icon_error_sml.gif");
   sink.figure_();
 }
 protected void addDashboardCss(Sink sink) {
   sink.rawText(
       "<link rel=\"stylesheet\" href=\"./css/print.css\" type=\"text/css\" media=\"print\" />");
   sink.rawText(
       "<link rel=\"stylesheet\" href=\"./css/dashboard.css\" type=\"text/css\" media=\"all\" />");
   sink.rawText(
       "<link rel=\"stylesheet\" href=\"./css/dashboard2.css\" type=\"text/css\" media=\"all\" />");
   sink.rawText("<!--[if IE]>");
   sink.rawText(
       "<link rel=\"stylesheet\" href=\"./css/dashboard2IE.css\" type=\"text/css\" media=\"all\" />");
   sink.rawText("<![endif]-->");
 }
  private void constructDetailRows(
      Sink sink, List issueList, ResourceBundle bundle, Locale locale) {
    if (issueList == null) {
      return;
    }

    for (int idx = 0; idx < issueList.size(); idx++) {
      // Use a DateFormat based on the Locale
      DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);

      Issue issue = (Issue) issueList.get(idx);

      sink.tableRow();

      for (int columnIndex = 0; columnIndex < columns.length; columnIndex++) {
        switch (columns[columnIndex]) {
          case IssuesReportHelper.COLUMN_ASSIGNEE:
            sinkCell(sink, issue.getAssignee());
            break;

          case IssuesReportHelper.COLUMN_COMPONENT:
            sinkCell(sink, IssuesReportHelper.printValues(issue.getComponents()));
            break;

          case IssuesReportHelper.COLUMN_CREATED:
            String created = NOT_AVAILABLE;
            if (issue.getCreated() != null) {
              created = df.format(issue.getCreated());
            }
            sinkCell(sink, created);
            break;

          case IssuesReportHelper.COLUMN_FIX_VERSION:
            sinkCell(sink, IssuesReportHelper.printValues(issue.getFixVersions()));
            break;

          case IssuesReportHelper.COLUMN_ID:
            sink.tableCell();
            sink.link(issue.getLink());
            sink.text(issue.getId());
            sink.link_();
            sink.tableCell_();
            break;

          case IssuesReportHelper.COLUMN_KEY:
            sink.tableCell();
            sink.link(issue.getLink());
            sink.text(issue.getKey());
            sink.link_();
            sink.tableCell_();
            break;

          case IssuesReportHelper.COLUMN_PRIORITY:
            sinkCell(sink, issue.getPriority());
            break;

          case IssuesReportHelper.COLUMN_REPORTER:
            sinkCell(sink, issue.getReporter());
            break;

          case IssuesReportHelper.COLUMN_RESOLUTION:
            sinkCell(sink, issue.getResolution());
            break;

          case IssuesReportHelper.COLUMN_STATUS:
            sinkCell(sink, issue.getStatus());
            break;

          case IssuesReportHelper.COLUMN_SUMMARY:
            sinkCell(sink, issue.getSummary());
            break;

          case IssuesReportHelper.COLUMN_TYPE:
            sinkCell(sink, issue.getType());
            break;

          case IssuesReportHelper.COLUMN_UPDATED:
            String updated = NOT_AVAILABLE;
            if (issue.getUpdated() != null) {
              updated = df.format(issue.getUpdated());
            }
            sinkCell(sink, updated);
            break;

          case IssuesReportHelper.COLUMN_VERSION:
            sinkCell(sink, issue.getVersion());
            break;

          default:
            // Do not add this column
            break;
        }
      }

      sink.tableRow_();
    }

    sink.table_();
  }
  private void constructHeaderRow(Sink sink, List issueList, ResourceBundle bundle) {
    if (issueList == null) {
      return;
    }

    sink.table();

    sink.tableRow();

    for (int columnIndex = 0; columnIndex < columns.length; columnIndex++) {
      switch (columns[columnIndex]) {
        case IssuesReportHelper.COLUMN_ASSIGNEE:
          sinkHeader(sink, bundle.getString("report.issues.label.assignee"));
          break;

        case IssuesReportHelper.COLUMN_COMPONENT:
          sinkHeader(sink, bundle.getString("report.issues.label.component"));
          break;

        case IssuesReportHelper.COLUMN_CREATED:
          sinkHeader(sink, bundle.getString("report.issues.label.created"));
          break;

        case IssuesReportHelper.COLUMN_FIX_VERSION:
          sinkHeader(sink, bundle.getString("report.issues.label.fixVersion"));
          break;

        case IssuesReportHelper.COLUMN_ID:
          sinkHeader(sink, bundle.getString("report.issues.label.id"));
          break;

        case IssuesReportHelper.COLUMN_KEY:
          sinkHeader(sink, bundle.getString("report.issues.label.key"));
          break;

        case IssuesReportHelper.COLUMN_PRIORITY:
          sinkHeader(sink, bundle.getString("report.issues.label.priority"));
          break;

        case IssuesReportHelper.COLUMN_REPORTER:
          sinkHeader(sink, bundle.getString("report.issues.label.reporter"));
          break;

        case IssuesReportHelper.COLUMN_RESOLUTION:
          sinkHeader(sink, bundle.getString("report.issues.label.resolution"));
          break;

        case IssuesReportHelper.COLUMN_STATUS:
          sinkHeader(sink, bundle.getString("report.issues.label.status"));
          break;

        case IssuesReportHelper.COLUMN_SUMMARY:
          sinkHeader(sink, bundle.getString("report.issues.label.summary"));
          break;

        case IssuesReportHelper.COLUMN_TYPE:
          sinkHeader(sink, bundle.getString("report.issues.label.type"));
          break;

        case IssuesReportHelper.COLUMN_UPDATED:
          sinkHeader(sink, bundle.getString("report.issues.label.updated"));
          break;

        case IssuesReportHelper.COLUMN_VERSION:
          sinkHeader(sink, bundle.getString("report.issues.label.version"));
          break;

        default:
          // Do not add a header for this column
          break;
      }
    }

    sink.tableRow_();
  }
 protected void sinkSuperHeaderClass(Sink sink, String header, int colspan, String CssClass) {
   sink.rawText("<th class=\"" + CssClass + "\" colspan=\"" + colspan + "\">" + header + "</th>");
 }
 protected void sinkSuperHeader(Sink sink, String header, int colspan) {
   sink.rawText("<th colspan=\"" + colspan + "\">" + header + "</th>");
 }
 protected void tableHeaderCell_(Sink sink) {
   sink.tableHeaderCell_();
 }
 protected void tableHeaderCellClass(Sink sink, String CssClass) {
   sink.rawText("<th class=\"" + CssClass + "\">");
 }