public void traverse( Sink sink ) { sink.text( text, new SinkEventAttributeSet( SinkEventAttributes.DECORATION, "line-through" ) ); } }
public void traverse( Sink sink ) { sink.text( text, new SinkEventAttributeSet( SinkEventAttributes.VALIGN, "sup" ) ); } }
public void traverse( Sink sink ) { sink.text( text, new SinkEventAttributeSet( SinkEventAttributes.VALIGN, "sub" ) ); } }
public void traverse( Sink sink ) { sink.text( text, new SinkEventAttributeSet( SinkEventAttributes.DECORATION, "underline" ) ); } }
/** {@inheritDoc} */ public void verbatim( boolean boxed ) { SinkEventAttributeSet att = new SinkEventAttributeSet(); if ( boxed ) { att.addAttribute( SinkEventAttributes.DECORATION, "boxed" ); } verbatim( att ); }
private static void sinkLink( Sink sink, String href ) { // The "'" argument in this JavaScript function would be escaped to "'" // sink.link( "javascript:toggleDisplay('" + toHtmlId( testCase.getFullName() ) + "');" ); sink.unknown( A.toString(), TAG_TYPE_START, new SinkEventAttributeSet( HREF, href ) ); }
/** * Writes a start tag, prepending EOL. * * @param tag The tag. * @param id An id to add. * @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 ); }
/** * Writes an empty tag, prepending EOL. * * @param tag The tag. * @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 ); }
private SinkEventAttributeSet getGraphicsAttributes( String logo ) { MutableAttributeSet atts = null; try { atts = DoxiaUtils.getImageAttributes( logo ); } catch ( IOException e ) { 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 ); } }
/** * The default valign is <code>top</code>. * * {@inheritDoc} * @see javax.swing.text.html.HTML.Tag#TR */ public void tableRow() { MutableAttributeSet att = new SinkEventAttributeSet(); att.addAttribute( Attribute.VALIGN, "top" ); writeStartTag( TR, att ); setCellCount( 0 ); }
private static void sinkAnchor( Sink sink, String anchor ) { // Dollar '$' for nested classes is not valid character in sink.anchor() and therefore it is ignored // https://issues.apache.org/jira/browse/SUREFIRE-1443 sink.unknown( A.toString(), TAG_TYPE_START, new SinkEventAttributeSet( NAME, anchor ) ); sink.unknown( A.toString(), TAG_TYPE_END, null ); }
private void tableHeaderCell( String text, String title ) { if ( title != null ) { sink.tableHeaderCell( new SinkEventAttributeSet( SinkEventAttributes.TITLE, title ) ); } else { sink.tableHeaderCell(); } text( text ); sink.tableHeaderCell_(); }
/** * The default align is <code>center</code>. * * {@inheritDoc} * @see javax.swing.text.html.HTML.Tag#TABLE */ public void tableRows( int[] justification, boolean grid ) { // similar to super.tableRows( justification, grid ) but without class. this.tableRows = true; setCellJustif( justification ); if ( this.tableAttributes == null ) { this.tableAttributes = new SinkEventAttributeSet( 0 ); } MutableAttributeSet att = new SinkEventAttributeSet(); if ( !tableAttributes.isDefined( Attribute.BORDER.toString() ) ) { att.addAttribute( Attribute.BORDER, ( grid ? "1" : "0" ) ); } att.addAttributes( tableAttributes ); tableAttributes.removeAttributes( tableAttributes ); writeStartTag( TABLE, att ); }
/** * Writes a toplink element. * * @param sink The sink to consume the event. */ private void writeTopLink( Sink sink ) { SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( SinkEventAttributeSet.ALIGN, "right" ); sink.paragraph( atts ); sink.link( "#top" ); sink.text( "[top]" ); sink.link_(); sink.paragraph_(); }
/** * Adds a link with an optional target. * * @param name the link name. * @param target the link target, may be null. */ public void link( String name, String target ) { if ( isHeadFlag() ) { return; } MutableAttributeSet att = new SinkEventAttributeSet(); att.addAttribute( Attribute.HREF, HtmlTools.escapeHTML( name ) ); if ( target != null ) { att.addAttribute( Attribute.TARGET, target ); } writeStartTag( A, att ); }
SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( "text-align", "left" ); atts.addAttribute( "vertical-align", "top" ); SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( "text-align", "right" ); atts.addAttribute( "vertical-align", "top" );
/** {@inheritDoc} */ public void verbatim( SinkEventAttributes attributes ) { MutableAttributeSet atts = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_VERBATIM_ATTRIBUTES ); if ( atts == null ) { atts = new SinkEventAttributeSet(); } boolean boxed = false; if ( atts.isDefined( SinkEventAttributes.DECORATION ) ) { boxed = "boxed".equals( atts.getAttribute( SinkEventAttributes.DECORATION ).toString() ); } if ( boxed ) { atts.addAttribute( Attribute.CLASS, "source" ); } atts.removeAttribute( SinkEventAttributes.DECORATION ); String width = (String) atts.getAttribute( Attribute.WIDTH.toString() ); atts.removeAttribute( Attribute.WIDTH.toString() ); writeStartTag( Tag.DIV, atts ); writeEOL( true ); if ( width != null ) { atts.addAttribute( Attribute.WIDTH.toString(), width ); } atts.removeAttribute( Attribute.ALIGN.toString() ); atts.removeAttribute( Attribute.CLASS.toString() ); writeStartTag( VERBATIM_TAG, atts ); }
MutableAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( "xmlns", XDOC_NAMESPACE ); atts.addAttribute( "xmlns:xsi", XML_NAMESPACE );
sink.tableCell( new SinkEventAttributeSet( SinkEventAttributes.WIDTH, "25%" ) ); sink.text( version ); sink.tableCell_();