Package org.apache.maven.doxia.sink

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


        sink.head_();

        sink.body();

        SinkEventAttributeSet atts = new SinkEventAttributeSet();
        atts.addAttribute( SinkEventAttributes.TYPE, "text/javascript" );
        sink.unknown( "script", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts );
        sink.unknown( "cdata", new Object[]{ HtmlMarkup.CDATA_TYPE, javascriptToggleDisplayCode() }, null );
        sink.unknown( "script", new Object[]{ HtmlMarkup.TAG_TYPE_END }, null );

        sink.section1();
View Full Code Here


                            {
                                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<String> detail = (List<String>) 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 );

                                    sink.verbatim( null );
                                    for ( String line : detail )
                                    {
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

                 : config.getAttributeSet( "table.body.block" );

        String justif = null;
        if ( attributes == null )
        {
            attributes = new SinkEventAttributeSet( 0 );
        }

        if ( attributes.isDefined( Attribute.ALIGN.toString() ) )
        {
            justif = attributes.getAttribute( Attribute.ALIGN.toString() ).toString();
View Full Code Here

            write( " encoding=\"" + encoding + "\"" );
        }
        write( "?>" );
        writeEOL();

        MutableAttributeSet atts = new SinkEventAttributeSet();
        atts.addAttribute( "xmlns:" + getNameSpace(), FO_NAMESPACE );

        if ( languageId != null )
        {
            atts.addAttribute( "language", languageId );
        }

        writeStartTag( ROOT_TAG, atts );

        writeStartTag( LAYOUT_MASTER_SET_TAG );
View Full Code Here

     * @param name The name (value) of the id.
     */
    protected void writeStartTag( Tag tag, String id, String name )
    {
        writeEOL();
        MutableAttributeSet att = new SinkEventAttributeSet( new String[] {id, name} );

        writeStartTag( tag, att );
    }
View Full Code Here

     * @param id An id to add.
     * @param name The name (value) of the id.
     */
    protected void writeEmptyTag( Tag tag, String id, String name )
    {
        MutableAttributeSet att = new SinkEventAttributeSet( new String[] {id, name} );

        writeEOL();
        writeSimpleTag( tag, att );
    }
View Full Code Here

        writeStartTag( TABLE_ROW_TAG, "height", COVER_HEADER_HEIGHT );
        writeStartTag( TABLE_CELL_TAG );

        if ( StringUtils.isNotEmpty( compLogo ) )
        {
            SinkEventAttributeSet atts = new SinkEventAttributeSet();
            atts.addAttribute( "text-align", "left" );
            atts.addAttribute( "vertical-align", "top" );
            writeStartTag( BLOCK_TAG, atts );
            figureGraphics( compLogo, getGraphicsAttributes( compLogo ) );
            writeEndTag( BLOCK_TAG );
        }

        writeSimpleTag( BLOCK_TAG );
        writeEndTag( TABLE_CELL_TAG );
        writeStartTag( TABLE_CELL_TAG );

        if ( StringUtils.isNotEmpty( projLogo ) )
        {
            SinkEventAttributeSet atts = new SinkEventAttributeSet();
            atts.addAttribute( "text-align", "right" );
            atts.addAttribute( "vertical-align", "top" );
            writeStartTag( BLOCK_TAG, atts );
            figureGraphics( projLogo, getGraphicsAttributes( projLogo ) );
            writeEndTag( BLOCK_TAG );
        }
View Full Code Here

            getLog().debug( e );
        }

        if ( atts == null )
        {
            return new SinkEventAttributeSet( new String[]{ SinkEventAttributes.HEIGHT, COVER_HEADER_HEIGHT } );
        }

        // FOP dpi: 72
        // Max width : 3.125 inch, table cell size, see #coverPage()
        final int maxWidth = 225; // 3.125 * 72

        if ( Integer.parseInt( atts.getAttribute( SinkEventAttributes.WIDTH ).toString() ) > maxWidth )
        {
            atts.addAttribute( "content-width", "3.125in" );
        }

        return new SinkEventAttributeSet( atts );
    }
View Full Code Here

            sink.verbatim( null );
            sink.verbatim_();
            sink.verbatim( SinkEventAttributeSet.BOXED );
            sink.verbatim_();
            sink.verbatim( new SinkEventAttributeSet( new String[] {SinkEventAttributeSet.WIDTH, "20%"} ) );
            sink.verbatim_();
        }
        finally
        {
            sink.close();
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.