本文整理汇总了Java中org.eclipse.birt.report.engine.api.HTMLRenderOption.setEnableAgentStyleEngine方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLRenderOption.setEnableAgentStyleEngine方法的具体用法?Java HTMLRenderOption.setEnableAgentStyleEngine怎么用?Java HTMLRenderOption.setEnableAgentStyleEngine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.birt.report.engine.api.HTMLRenderOption
的用法示例。
在下文中一共展示了HTMLRenderOption.setEnableAgentStyleEngine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPerformanceOptimize
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testPerformanceOptimize( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setEnableAgentStyleEngine( true );
options.setEmbeddable( true );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
//options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "text-decoration: underline;";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
regex = "<div style=\" text-decoration: underline;\">";
matcher = Pattern.compile( regex ).matcher( content );
assertEquals( false, matcher.find( ) );
}
示例2: testVisionOptimize
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
public void testVisionOptimize( ) throws EngineException, IOException
{
HTMLRenderOption options = new HTMLRenderOption( );
options.setEnableAgentStyleEngine( false );
options.setEmbeddable( true );
ByteArrayOutputStream output = new ByteArrayOutputStream( );
List instanceIDs = new ArrayList( );
options.setInstanceIDs( instanceIDs );
options.setOutputStream( output );
//options.setEnableMetadata( true );
IRenderTask task = createRenderTask( designFile );
task.setRenderOption( options );
task.render( );
task.close( );
String content = new String( output.toByteArray( ) );
output.close( );
String regex = "<div style=\" text-decoration: underline;";
Matcher matcher = Pattern.compile( regex ).matcher( content );
assertEquals( true, matcher.find( ) );
}
示例3: buildRenderOptions
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
@Override
protected RenderOption buildRenderOptions(HttpServletRequest request, HttpServletResponse response) throws IOException {
HTMLRenderOption opt = new HTMLRenderOption();
opt.setEmitterID("io.github.kewne.spring_birt.htmlPlusEmbeddedSvg");
opt.setOutputFormat(HTMLRenderOption.HTML);
opt.setOutputStream(response.getOutputStream());
opt.setBaseImageURL(null);
opt.setImageDirectory(null);
opt.setEnableAgentStyleEngine(true);
return opt;
}
示例4: createHTMLRenderOption
import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
* Create HTML render option.
*
* @param svgFlag
* @param servletPath
* @param request
* @return HTML render option from the given arguments
* @throws ReportServiceException
*/
private HTMLRenderOption createHTMLRenderOption( boolean svgFlag,
String servletPath, HttpServletRequest request,
IViewingSession session )
{
String baseURL = null;
// try to get base url from config file
if ( !ParameterAccessor.isDesigner( ) )
baseURL = ParameterAccessor.getBaseURL( );
if ( baseURL == null )
{
// if not HTML format, use full URL.
if ( ParameterAccessor.isOpenAsAttachment( request )
|| !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase( ParameterAccessor.getFormat( request ) ) )
{
baseURL = request.getScheme( ) + "://" //$NON-NLS-1$
+ request.getServerName( )
+ ":" //$NON-NLS-1$
+ request.getServerPort( );
}
else
{
baseURL = ""; //$NON-NLS-1$
}
}
// append application context path
baseURL += request.getContextPath( );
HTMLRenderOption renderOption = new HTMLRenderOption( );
renderOption.setImageDirectory( session.getImageTempFolder( ) );
renderOption.setBaseImageURL( createBaseImageUrl( session, baseURL ) );
renderOption.setBaseURL( baseURL );
if ( servletPath == null || servletPath.length( ) == 0 )
{
servletPath = IBirtConstants.SERVLET_PATH_RUN;
}
renderOption.setOption( IBirtConstants.SERVLET_PATH, servletPath );
renderOption.setEnableAgentStyleEngine( ParameterAccessor.isAgentStyle( request ) );
renderOption.setSupportedImageFormats( svgFlag ? "PNG;GIF;JPG;BMP;SWF;SVG" : "PNG;GIF;JPG;BMP;SWF" ); //$NON-NLS-1$ //$NON-NLS-2$
return renderOption;
}