Package nl.lxtreme.ols.util.ExportUtils

Examples of nl.lxtreme.ols.util.ExportUtils.HtmlExporter


   *
   * @return an empty HTML page string, never <code>null</code>.
   */
  private String getEmptyHtmlPage()
  {
    final HtmlExporter exporter = createHtmlTemplate( ExportUtils.createHtmlExporter() );
    return exporter.toString( new MacroResolver()
    {
      @Override
      @SuppressWarnings( "boxing" )
      public Object resolve( final String aMacro, final Element aParent )
      {
View Full Code Here


      }
    };

    if ( aFile == null )
    {
      final HtmlExporter exporter = createHtmlTemplate( ExportUtils.createHtmlExporter() );
      return exporter.toString( macroResolver );
    }
    else
    {
      final HtmlFileExporter exporter = ( HtmlFileExporter )createHtmlTemplate( ExportUtils.createHtmlExporter( aFile ) );
      exporter.write( macroResolver );
      exporter.close();
    }

    return null;
  }
View Full Code Here

   *          if this is true an empty output is generated
   * @return String with HTML data
   */
  private String getEmptyHtmlPage()
  {
    final HtmlExporter exporter = createHtmlTemplate( ExportUtils.createHtmlExporter() );
    return exporter.toString( new MacroResolver()
    {
      @Override
      public Object resolve( final String aMacro, final Element aParent )
      {
        if ( "date-now".equals( aMacro ) )
View Full Code Here

      }
    };

    if ( aFile == null )
    {
      final HtmlExporter exporter = createHtmlTemplate( ExportUtils.createHtmlExporter() );
      return exporter.toString( macroResolver );
    }
    else
    {
      final HtmlFileExporter exporter = ( HtmlFileExporter )createHtmlTemplate( ExportUtils.createHtmlExporter( aFile ) );
      exporter.write( macroResolver );
      exporter.close();
    }

    return null;
  }
View Full Code Here

   *          if this is true an empty output is generated
   * @return String with HTML data
   */
  private String getEmptyHtmlPage()
  {
    final HtmlExporter exporter = createHtmlTemplate( ExportUtils.createHtmlExporter() );
    return exporter.toString( new MacroResolver()
    {
      @Override
      public Object resolve( final String aMacro, final Element aParent )
      {
        if ( "date-now".equals( aMacro ) )
View Full Code Here

      }
    };

    if ( aFile == null )
    {
      final HtmlExporter exporter = createHtmlTemplate( ExportUtils.createHtmlExporter() );
      return exporter.toString( macroResolver );
    }
    else
    {
      final HtmlFileExporter exporter = ( HtmlFileExporter )createHtmlTemplate( ExportUtils.createHtmlExporter( aFile ) );
      exporter.write( macroResolver );
      exporter.close();
    }

    return null;
  }
View Full Code Here

   * @
   */
  @Test
  public void testHtmlDoc()
  {
    final HtmlExporter exporter = ExportUtils.createHtmlExporter();

    exporter
        .addCssStyle( "th { text-align:left;font-style:italic;font-weight:bold;font-size:medium;background-color:#C0C0FF; }" );

    final Element body = exporter.getBody();
    body.addChild( HtmlExporter.H2 ).addContent( "I2C Analysis results" );
    body.addChild( HtmlExporter.HR );
    body.addChild( HtmlExporter.DIV ).addAttribute( "style", "text-align: right; font-size: x-small;" ).addContent(
        "today" );
    body.addChild( HtmlExporter.P );

    final Element table = body.addChild( "table" ).addAttribute( "style", "width: 100%" );
    Element tr;

    tr = table.addChild( "tr" );
    tr.addChild( "td" ).addAttribute( "colspan", "2" ).addContent( "Bus configuration" );
    tr = table.addChild( "tr" );
    tr.addChild( "td" ).addAttribute( "style", "width:30%" ).addContent( "SDA" );
    tr.addChild( "td" ).addContent( "&lt;auto detect&gt;" );
    tr = table.addChild( "tr" );
    tr.addChild( "td" ).addAttribute( "style", "width:30%" ).addContent( "SCL" );
    tr.addChild( "td" ).addContent( "&lt;auto detect&gt;" );

    body.addChild( HtmlExporter.P ).addContent( "&nbsp;" );

    assertEquals(
        "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
            + "<html><head><title></title><style type='text/css'>th { text-align:left;font-style:italic;font-weight:bold;font-size:medium;background-color:#C0C0FF; }</style></head><body><h2>I2C Analysis results</h2><hr><div style='text-align: right; font-size: x-small;'>today</div><p></p><table style='width: 100%'><tr><td colspan='2'>Bus configuration</td></tr><tr><td style='width:30%'>SDA</td><td>&lt;auto detect&gt;</td></tr><tr><td style='width:30%'>SCL</td><td>&lt;auto detect&gt;</td></tr></table><p>&nbsp;</p></body></html>",
        exporter.toString() );
  }
View Full Code Here

TOP

Related Classes of nl.lxtreme.ols.util.ExportUtils.HtmlExporter

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.