Search in sources :

Example 1 with SinkEventAttributeSet

use of org.apache.maven.doxia.sink.SinkEventAttributeSet in project maven-plugins by apache.

the class DependencyConvergenceReport method generateDependencyDetails.

/**
     * Generate the detail table for a given dependency
     *
     * @param sink
     * @param depList
     */
private void generateDependencyDetails(Locale locale, Sink sink, List<ReverseDependencyLink> depList) {
    sink.table();
    Map<String, List<ReverseDependencyLink>> artifactMap = getSortedUniqueArtifactMap(depList);
    sink.tableRow();
    sink.tableCell();
    iconError(locale, sink);
    sink.tableCell_();
    sink.tableCell();
    sink.table();
    for (String version : artifactMap.keySet()) {
        sink.tableRow();
        sink.tableCell(new SinkEventAttributeSet(new String[] { SinkEventAttributes.WIDTH, "25%" }));
        sink.text(version);
        sink.tableCell_();
        sink.tableCell();
        generateVersionDetails(sink, artifactMap, version);
        sink.tableCell_();
        sink.tableRow_();
    }
    sink.table_();
    sink.tableCell_();
    sink.tableRow_();
    sink.table_();
}
Also used : SinkEventAttributeSet(org.apache.maven.doxia.sink.SinkEventAttributeSet) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with SinkEventAttributeSet

use of org.apache.maven.doxia.sink.SinkEventAttributeSet in project maven-plugins by apache.

the class AbstractIssuesReportGenerator method sinkFigure.

protected void sinkFigure(Sink sink, String image, String altText) {
    SinkEventAttributes attributes = new SinkEventAttributeSet();
    attributes.addAttribute("alt", altText);
    attributes.addAttribute("title", altText);
    sink.figureGraphics(image, attributes);
}
Also used : SinkEventAttributes(org.apache.maven.doxia.sink.SinkEventAttributes) SinkEventAttributeSet(org.apache.maven.doxia.sink.SinkEventAttributeSet)

Example 3 with SinkEventAttributeSet

use of org.apache.maven.doxia.sink.SinkEventAttributeSet in project maven-plugins by apache.

the class ChangesReportGenerator method constructRelease.

/**
     * Constructs document section for specified release.
     *
     * @param sink Sink
     * @param bundle Resource bundle
     * @param release Release to create document section for
     */
private void constructRelease(Sink sink, ResourceBundle bundle, Release release) {
    sink.section2();
    final String date = (release.getDateRelease() == null) ? "" : " – " + release.getDateRelease();
    SinkEventAttributes attrs = new SinkEventAttributeSet();
    attrs.addAttribute(SinkEventAttributes.ID, HtmlTools.encodeId(release.getVersion()));
    sink.sectionTitle(Sink.SECTION_LEVEL_2, attrs);
    sink.text(bundle.getString("report.changes.label.release") + " " + release.getVersion() + date);
    sink.sectionTitle_(Sink.SECTION_LEVEL_2);
    if (isReleaseEmpty(release)) {
        sink.paragraph();
        sink.text(bundle.getString("report.changes.text.no.changes"));
        sink.paragraph_();
    } else {
        sink.table();
        sink.tableRow();
        sinkHeader(sink, bundle.getString("report.issues.label.type"));
        sinkHeader(sink, bundle.getString("report.issues.label.summary"));
        sinkHeader(sink, bundle.getString("report.issues.label.assignee"));
        if (this.isAddActionDate()) {
            sinkHeader(sink, bundle.getString("report.issues.label.updated"));
        }
        sink.tableRow_();
        for (Action action : release.getActions()) {
            constructAction(sink, bundle, action);
        }
        for (Object o : release.getComponents()) {
            Component component = (Component) o;
            constructComponent(sink, bundle, component);
        }
        sink.table_();
    }
    sink.section2_();
}
Also used : SinkEventAttributes(org.apache.maven.doxia.sink.SinkEventAttributes) SinkEventAttributeSet(org.apache.maven.doxia.sink.SinkEventAttributeSet) Action(org.apache.maven.plugins.changes.model.Action) Component(org.apache.maven.plugins.changes.model.Component)

Example 4 with SinkEventAttributeSet

use of org.apache.maven.doxia.sink.SinkEventAttributeSet in project maven-plugins by apache.

the class CheckstyleReportGenerator method doDetails.

private void doDetails(CheckstyleResults results) {
    sink.section1();
    sink.sectionTitle1();
    sink.text(bundle.getString("report.checkstyle.details"));
    sink.sectionTitle1_();
    // Sort the files before writing their details to the report
    List<String> fileList = new ArrayList<>(results.getFiles().keySet());
    Collections.sort(fileList);
    for (String file : fileList) {
        List<AuditEvent> violations = results.getFileViolations(file);
        if (violations.isEmpty()) {
            // skip files without violations
            continue;
        }
        sink.section2();
        SinkEventAttributes attrs = new SinkEventAttributeSet();
        attrs.addAttribute(SinkEventAttributes.ID, file.replace('/', '.'));
        sink.sectionTitle(Sink.SECTION_LEVEL_2, attrs);
        sink.text(file);
        sink.sectionTitle_(Sink.SECTION_LEVEL_2);
        sink.table();
        sink.tableRow();
        sink.tableHeaderCell();
        sink.text(bundle.getString("report.checkstyle.column.severity"));
        sink.tableHeaderCell_();
        sink.tableHeaderCell();
        sink.text(bundle.getString("report.checkstyle.rule.category"));
        sink.tableHeaderCell_();
        sink.tableHeaderCell();
        sink.text(bundle.getString("report.checkstyle.rule"));
        sink.tableHeaderCell_();
        sink.tableHeaderCell();
        sink.text(bundle.getString("report.checkstyle.column.message"));
        sink.tableHeaderCell_();
        sink.tableHeaderCell();
        sink.text(bundle.getString("report.checkstyle.column.line"));
        sink.tableHeaderCell_();
        sink.tableRow_();
        doFileEvents(violations, file);
        sink.table_();
        sink.section2_();
    }
    sink.section1_();
}
Also used : SinkEventAttributes(org.apache.maven.doxia.sink.SinkEventAttributes) SinkEventAttributeSet(org.apache.maven.doxia.sink.SinkEventAttributeSet) ArrayList(java.util.ArrayList) AuditEvent(com.puppycrawl.tools.checkstyle.api.AuditEvent)

Example 5 with SinkEventAttributeSet

use of org.apache.maven.doxia.sink.SinkEventAttributeSet in project maven-plugins by apache.

the class DependenciesRenderer method tableHeaderCell.

private void tableHeaderCell(String text, String title) {
    if (title != null) {
        SinkEventAttributes attributes = new SinkEventAttributeSet(SinkEventAttributes.TITLE, title);
        sink.tableHeaderCell(attributes);
    } else {
        sink.tableHeaderCell();
    }
    text(text);
    sink.tableHeaderCell_();
}
Also used : SinkEventAttributes(org.apache.maven.doxia.sink.SinkEventAttributes) SinkEventAttributeSet(org.apache.maven.doxia.sink.SinkEventAttributeSet)

Aggregations

SinkEventAttributeSet (org.apache.maven.doxia.sink.SinkEventAttributeSet)5 SinkEventAttributes (org.apache.maven.doxia.sink.SinkEventAttributes)4 ArrayList (java.util.ArrayList)2 AuditEvent (com.puppycrawl.tools.checkstyle.api.AuditEvent)1 List (java.util.List)1 Action (org.apache.maven.plugins.changes.model.Action)1 Component (org.apache.maven.plugins.changes.model.Component)1