Package org.apache.maven.doxia.sink

Examples of org.apache.maven.doxia.sink.SinkEventAttributeSet


                        {
                            sink.tableCell();

                            sinkLink( sink, testCase.getName(), "#" + testCase.getFullName() );

                            SinkEventAttributeSet atts = new SinkEventAttributeSet();
                            atts.addAttribute( SinkEventAttributes.CLASS, "detailToggle" );
                            atts.addAttribute( SinkEventAttributes.STYLE, "display:inline" );
                            sink.unknown( "div", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts );

                            sink.link( "javascript:toggleDisplay('" + toHtmlId( testCase.getFullName() ) + "');" );

                            atts = new SinkEventAttributeSet();
                            atts.addAttribute( SinkEventAttributes.STYLE, "display:inline;" );
                            atts.addAttribute( SinkEventAttributes.ID, toHtmlId( testCase.getFullName() ) + "off" );
                            sink.unknown( "span", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts );
                            sink.text( " + " );
                            sink.unknown( "span", new Object[]{ HtmlMarkup.TAG_TYPE_END }, null );

                            atts = new SinkEventAttributeSet();
                            atts.addAttribute( SinkEventAttributes.STYLE, "display:none;" );
                            atts.addAttribute( SinkEventAttributes.ID, toHtmlId( testCase.getFullName() ) + "on" );
                            sink.unknown( "span", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts );
                            sink.text( " - " );
                            sink.unknown( "span", new Object[]{ HtmlMarkup.TAG_TYPE_END }, null );

                            sink.text( "[ Detail ]" );
                            sink.link_();

                            sink.unknown( "div", new Object[]{ HtmlMarkup.TAG_TYPE_END }, null );

                            sink.tableCell_();
                        }
                        else
                        {
                            sinkCell( sink, testCase.getName() );
                        }

                        sinkCell( sink, numberFormat.format( testCase.getTime() ) );

                        sink.tableRow_();

                        if ( failure != null )
                        {
                            sink.tableRow();

                            sinkCell( sink, "" );
                            sinkCell( sink, (String) failure.get( "message" ) );
                            sinkCell( sink, "" );
                            sink.tableRow_();

                            List detail = (List) failure.get( "detail" );
                            if ( detail != null )
                            {

                                sink.tableRow();
                                sinkCell( sink, "" );

                                sink.tableCell();
                                SinkEventAttributeSet atts = new SinkEventAttributeSet();
                                atts.addAttribute( SinkEventAttributes.ID,
                                                   toHtmlId( testCase.getFullName() ) + "error" );
                                atts.addAttribute( SinkEventAttributes.STYLE, "display:none;" );
                                sink.unknown( "div", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts );

                                Iterator it = detail.iterator();

                                sink.verbatim( null );
View Full Code Here


                    sink.tableRow();

                    sinkCell( sink, "" );

                    sink.tableCell();
                    SinkEventAttributeSet atts = new SinkEventAttributeSet();
                    atts.addAttribute( SinkEventAttributes.ID, tCase.getName() + "error" );
                    sink.unknown( "div", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts );

                    if ( xrefLocation != null )
                    {
                        String path = tCase.getFullClassName().replace( '.', '/' );
View Full Code Here

    createParser().parse(new StringReader(document), sink);

    Iterator<SinkEventElement> it = sink.getEventList().iterator();
    assertEquals(it, "head", "head_", "body", "paragraph");
    assertEquals(it.next(), "text", "Linethrough",
        new SinkEventAttributeSet("decoration", "line-through"));
    assertEquals(it, "paragraph_", "body_");
    assertFalse(it.hasNext());
  }
View Full Code Here

    SinkEventTestingSink sink = new SinkEventTestingSink();
    createParser().parse(new StringReader(document), sink);

    Iterator<SinkEventElement> it = sink.getEventList().iterator();
    assertEquals(it, "head", "head_", "body", "paragraph");
    assertEquals(it.next(), "text", "Underline", new SinkEventAttributeSet(
        "decoration", "underline"));
    assertEquals(it, "paragraph_", "body_");
    assertFalse(it.hasNext());
  }
View Full Code Here

    SinkEventTestingSink sink = new SinkEventTestingSink();
    createParser().parse(new StringReader(document), sink);

    Iterator<SinkEventElement> it = sink.getEventList().iterator();
    assertEquals(it, "head", "head_", "body", "paragraph");
    assertEquals(it.next(), "text", "Sub", new SinkEventAttributeSet(
        "valign", "sub"));
    assertEquals(it, "paragraph_", "body_");
    assertFalse(it.hasNext());
  }
View Full Code Here

    SinkEventTestingSink sink = new SinkEventTestingSink();
    createParser().parse(new StringReader(document), sink);

    Iterator<SinkEventElement> it = sink.getEventList().iterator();
    assertEquals(it, "head", "head_", "body", "paragraph");
    assertEquals(it.next(), "text", "Sup", new SinkEventAttributeSet(
        "valign", "sup"));
    assertEquals(it, "paragraph_", "body_");
    assertFalse(it.hasNext());
  }
View Full Code Here

    }

    protected void assertAttributeEquals( SinkEventElement element, String name, String attr, String value )
    {
        assertEquals( name, element.getName() );
        SinkEventAttributeSet atts = (SinkEventAttributeSet) element.getArgs()[0];
        assertEquals( value, atts.getAttribute( attr ) );
    }
View Full Code Here

        sink.close();
    }

    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 );
    }
View Full Code Here

                // 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();
View Full Code Here

            }
        }
    }

    private void addTitleLink(final String title, final Sink sink) {
        final SinkEventAttributes attributes = new SinkEventAttributeSet();
        attributes.addAttribute(SinkEventAttributes.HREF, "#" + title.replace(" ", "_"));
        sink.link("#" + title.replace(" ", "_"), attributes);
        sink.text(title);
        sink.link_();
        sink.lineBreak();
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.sink.SinkEventAttributeSet

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.