当前位置: 首页>>代码示例>>Java>>正文


Java HTMLRenderOption.setEnableAgentStyleEngine方法代码示例

本文整理汇总了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( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:HTMLEmitterOptimizeTest.java

示例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( ) );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:HTMLEmitterOptimizeTest.java

示例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;
}
 
开发者ID:kewne,项目名称:spring-birt,代码行数:12,代码来源:HtmlBirtReportView.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:53,代码来源:ReportEngineService.java


注:本文中的org.eclipse.birt.report.engine.api.HTMLRenderOption.setEnableAgentStyleEngine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。