Package org.wicketstuff.closurecompiler

Examples of org.wicketstuff.closurecompiler.ClosureCompilerJavaScriptCompressor


    return choice;
  }

  private String compress(String source) throws Exception
  {
    ClosureCompilerJavaScriptCompressor compressor = new ClosureCompilerJavaScriptCompressor();
    compressor.setLevel(level);

    final String compressed = compressor.compressSource(source);
    final float ratio = (float)compressed.length() / (float)source.length() * 100.0f;

    success(String.format("original=%d bytes, compressed=%d bytes (%.2f%%)", source.length(),
      compressed.length(), ratio));

View Full Code Here


  }

  @Override
  protected void init()
  {
    ClosureCompilerJavaScriptCompressor compressor = new ClosureCompilerJavaScriptCompressor();
    // currently something goes wrong when using advanced and optimization is too aggressive
    // compressor.setLevel(CompilationLevel.ADVANCED_OPTIMIZATIONS);
    getResourceSettings().setJavaScriptCompressor(compressor);
  }
View Full Code Here

TOP

Related Classes of org.wicketstuff.closurecompiler.ClosureCompilerJavaScriptCompressor

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.