Package hudson.plugins.analysis.util

Examples of hudson.plugins.analysis.util.HtmlPrinter


     * @param modules
     *            number of modules
     * @return the summary message
     */
    protected static String createDefaultSummary(final String url, final int warnings, final int modules) {
        HtmlPrinter summary = new HtmlPrinter();

        String message = createWarningsMessage(warnings);
        if (warnings > 0) {
            summary.append(summary.link(url, message));
        }
        else {
            summary.append(message);
        }
        if (modules > 0) {
            summary.append(" ");
            summary.append(createAnalysesMessage(modules));
        }
        else {
            summary.append(".");
        }
        return summary.toString();
    }
View Full Code Here


     * @param fixedWarnings
     *            number of fixed warnings
     * @return the summary message
     */
    protected static String createDefaultDeltaMessage(final String url, final int newWarnings, final int fixedWarnings) {
        HtmlPrinter summary = new HtmlPrinter();
        if (newWarnings > 0) {
            summary.append(summary.item(
                    summary.link(url + "/new", createNewWarningsLinkName(newWarnings))));
        }
        if (fixedWarnings > 0) {
            summary.append(summary.item(
                    summary.link(url + "/fixed", createFixedWarningsLinkName(fixedWarnings))));
        }

        return summary.toString();
    }
View Full Code Here

     * Returns the detail messages for the summary.jelly file.
     *
     * @return the summary message
     */
    public String getDetails() {
        HtmlPrinter printer = new HtmlPrinter();
        printer.append(createDeltaMessage());

        if (getNumberOfAnnotations() == 0 && getDelta() == 0) {
            printer.append(printer.item(Messages.ResultAction_NoWarningsSince(getZeroWarningsSinceBuild())));
            printer.append(printer.item(createHighScoreMessage()));
        }
        else if (isSuccessfulTouched()) {
            printer.append(printer.item(createPluginResultMessage()));
            if (isSuccessful()) {
                printer.append(printer.item(createSuccessfulHighScoreMessage()));
            }
        }
        return printer.toString();
    }
View Full Code Here

    private String createPluginResultMessage() {
        return Messages.ResultAction_Status() + getResultIcon() + " - " + getReason() + getReferenceBuildUrl();
    }

    private String getReferenceBuildUrl() {
        HtmlPrinter printer = new HtmlPrinter();
        if (hasReferenceBuild()) {
            AbstractBuild<?, ?> build = getReferenceBuild();

            printer.append("&nbsp;");
            printer.append("(");
            printer.append(Messages.ReferenceBuild());
            printer.append(": ");
            printer.append(printer.link(Hudson.getInstance().getRootUrl() + "/" + build.getUrl(),
                    build.getDisplayName()));
            printer.append(")");
        }
        return printer.toString();
    }
View Full Code Here

     * @param project
     *            the job to get the warnings for
     * @return the number of warnings, formatted as HTML string
     */
    public String getDetails(final Job<?, ?> project) {
        HtmlPrinter printer = new HtmlPrinter();
        printer.append("<table>");
        T action = getProjectAction(project);
        if (action != null && action.hasValidResults()) {
            BuildResult result = getResult(action);
            if (result.isSuccessfulTouched()) {
                printer.append(printer.line(Messages.ResultAction_Status() + result.getResultIcon()));
            }
            if (result.getNumberOfNewWarnings() > 0) {
                print(printer, Messages.NewWarningsDetail_Name(), result.getNumberOfNewWarnings());
            }

            print(printer, Priority.HIGH, result.getNumberOfHighPriorityWarnings());
            print(printer, Priority.NORMAL, result.getNumberOfNormalPriorityWarnings());
            print(printer, Priority.LOW, result.getNumberOfLowPriorityWarnings());
        }
        else {
            return Messages.Column_NoResults();
        }
        printer.append("</table>");
        return printer.toString();
    }
View Full Code Here

TOP

Related Classes of hudson.plugins.analysis.util.HtmlPrinter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.