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


Java IAction类代码示例

本文整理汇总了Java中org.eclipse.birt.report.engine.api.IAction的典型用法代码示例。如果您正苦于以下问题:Java IAction类的具体用法?Java IAction怎么用?Java IAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IAction类属于org.eclipse.birt.report.engine.api包,在下文中一共展示了IAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testBookmarkAction

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
/**
 * Test bookmark action
 */
public void testBookmarkAction( )
{
	IHyperlinkAction hyperAction = new ActionContent( );
	hyperAction.setBookmark( "bk" );
	IAction action = new Action( hyperAction );
	assertEquals( "bk", action.getBookmark( ) );
	assertEquals( "bk", action.getActionString( ) );
	assertEquals( IHyperlinkAction.ACTION_BOOKMARK, action.getType( ) );
	assertFalse( action.isBookmark( ) );
	assertNull( action.getFormat( ) );
	assertNull( action.getParameterBindings( ) );
	assertNull( action.getSearchCriteria( ) );
	assertNull( action.getReportName( ) );
	assertNull( action.getSystemId( ) );
	assertNull( action.getTargetWindow( ) );

	hyperAction.setBookmark( "" );
	assertEquals( "", action.getBookmark( ) );

	String bookmark = "longbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmarklongbookmark";
	hyperAction.setBookmark( bookmark );
	assertEquals( 276, action.getBookmark( ).length( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:IActionTest.java

示例2: startImage

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void startImage( IImageContent image )
{
	IAction action = new Action( image.getHyperlinkAction( ) );
	assertEquals( IHyperlinkAction.ACTION_DRILLTHROUGH, action.getType( ) );
	assertEquals( reportName, action.getReportName( ) );
	assertTrue( action.getParameterBindings( ).size( ) > 0 );
	Object value = action.getParameterBindings( ).get( "p1" );
	assertTrue( value instanceof List );
	List<String> valueList = (List<String>)value;
	assertTrue( valueList.size() > 0 );
	assertEquals( "target value", valueList.get(0) );
	assertEquals( "html", action.getFormat( ) );
	assertEquals( "_self", action.getTargetWindow( ) );
	assertEquals( "labelbk", action.getBookmark( ) );
	assertTrue( action.isBookmark( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:IActionTest.java

示例3: testDrillThrough

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
public void testDrillThrough( )
{
	String bookmark = "bookmark";//$NON-NLS-1$
	String reportName = "report";//$NON-NLS-1$
	HashMap params = new HashMap( );
	params.put( "param1", "string" );
	String goldenUrl = "http://localhost/birt/servlet?__report=report&__format=html&param1=string&__overwrite=true&__bookmark=bookmark";

	IHyperlinkAction action = new ActionContent( );
	action.setDrillThrough( bookmark, true, reportName, params, null,
			"_blank", "html", null );//$NON-NLS-1$
	IAction act = new Action( action );
	String url = processor.getURL( act, context );

	assertEquals( goldenUrl, url );//$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:EmbeddedHyperlinkProcessorTest.java

示例4: configEngine

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
protected void configEngine( )
{
	HTMLRenderOption emitterConfig = new HTMLRenderOption( );

	emitterConfig.setActionHandler( new HTMLActionHandler( ) {

		public String getURL( IAction actionDefn, Object context )
		{
			if ( actionDefn.getType( ) == IAction.ACTION_DRILLTHROUGH )
				return "birt://" //$NON-NLS-1$
						+ URLEncoder.encode( super.getURL( actionDefn,
								context ) );
			return super.getURL( actionDefn, context );
		}

	} );
	// emitterConfig.setImageHandler( new HTMLCompleteImageHandler( ) );
	// emitterConfig.setImageHandler( new HTMLImageHandler( ) );
	engineConfig.getEmitterConfigs( ).put( RenderOption.OUTPUT_FORMAT_HTML,
			emitterConfig );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:StaticHTMLViewer.java

示例5: configEngine

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
private void configEngine( )
{
	HTMLRenderOption emitterConfig = new HTMLRenderOption( );

	emitterConfig.setActionHandler( new HTMLActionHandler( ) {

		public String getURL( IAction actionDefn, Object context )
		{
			if ( actionDefn.getType( ) == IAction.ACTION_DRILLTHROUGH )
				return "birt://" //$NON-NLS-1$
						+ URLEncoder.encode( super.getURL( actionDefn,
								context ) );
			return super.getURL( actionDefn, context );
		}

	} );

	engineConfig.getEmitterConfigs( ).put( RenderOption.OUTPUT_FORMAT_HTML,
			emitterConfig );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:ReportDocumentEditor.java

示例6: buildHyperlink

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
/**
 * Build URI
 * 
 * @param action
 * @param context
 * @return
 */
private String buildHyperlink( IAction action, IReportContext context )
{
	IReportRunnable runnable = context.getReportRunnable( );
	String actionURL = action.getActionString( );
	if ( runnable != null )
	{
		ModuleHandle moduleHandle = runnable.getDesignHandle( )
				.getModuleHandle( );
		URL url = moduleHandle.findResource( actionURL, -1 );
		if ( url != null )
			actionURL = url.toString( );
	}

	return actionURL;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:ViewerHTMLActionHandler.java

示例7: getURL

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
@Override
public String getURL(IAction action, IReportContext context)
{
	if( action == null )
	{
		return null;
	}
	String url = null;
	switch( action.getType() )
	{
		case IAction.ACTION_BOOKMARK:
			if( action.getActionString() != null )
			{
				url = "#" + action.getActionString();
			}
			break;
		case IAction.ACTION_HYPERLINK:
			url = action.getActionString();
			break;
		case IAction.ACTION_DRILLTHROUGH:
			url = buildDrillAction(action);
			break;
		default:
			assert false;
	}
	return url;
}
 
开发者ID:equella,项目名称:Equella,代码行数:28,代码来源:GenerateReportsAction.java

示例8: getType

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
protected int getType( ActionHandle handle )
{
	if ( DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals( handle.getLinkType( ) ) )
		return IAction.ACTION_HYPERLINK;
	if ( DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals( handle.getLinkType( ) ) )
		return IAction.ACTION_BOOKMARK;
	if ( DesignChoiceConstants.ACTION_LINK_TYPE_DRILL_THROUGH.equals( handle.getLinkType( ) ) )
		return IAction.ACTION_DRILLTHROUGH;
	return 0;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:11,代码来源:BIRTActionRenderer.java

示例9: testHyperlinkAction

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
/**
 * Test hyperlink action
 */
public void testHyperlinkAction( )
{
	IHyperlinkAction hyperAction = new ActionContent( );
	hyperAction.setHyperlink( "http://test", "_blank" );
	IAction action = new Action( hyperAction );
	assertEquals( "http://test", action.getActionString( ) );
	assertEquals( "_blank", action.getTargetWindow( ) );
	assertEquals( IHyperlinkAction.ACTION_HYPERLINK, action.getType( ) );
	assertNull( action.getBookmark( ) );
	assertFalse( action.isBookmark( ) );
	assertNull( action.getFormat( ) );
	assertNull( action.getParameterBindings( ) );
	assertNull( action.getSearchCriteria( ) );
	assertNull( action.getReportName( ) );
	assertNull( action.getSystemId( ) );

	hyperAction.setHyperlink( "", "target" );
	assertEquals( "", action.getActionString( ) );

	hyperAction.setHyperlink( null, "_blank" );
	assertNull( action.getActionString( ) );

	hyperAction.setHyperlink( "http://test", null );
	assertNull( action.getTargetWindow( ) );

	hyperAction.setHyperlink( null, null );
	assertNull( action.getActionString( ) );
	assertNull( action.getTargetWindow( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:33,代码来源:IActionTest.java

示例10: testDrillthroughAction

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
/**
 * Test Drillthrough action
 */
public void testDrillthroughAction( )
{
	IHyperlinkAction hyperAction = new ActionContent( );
	String bk = "bookmark", name = "report1", target = "_blank", format = "html";
	boolean isBk = true;
	Map paramBindings = new HashMap( ), searchCriteria = new HashMap( );
	hyperAction.setDrillThrough(
			bk,
			isBk,
			name,
			paramBindings,
			searchCriteria,
			target,
			format );
	IAction action = new Action( hyperAction );
	assertEquals( IHyperlinkAction.ACTION_DRILLTHROUGH, action.getType( ) );
	assertEquals( isBk, action.isBookmark( ) );
	assertEquals( paramBindings, action.getParameterBindings( ) );
	assertEquals( searchCriteria, action.getSearchCriteria( ) );
	assertEquals( target, action.getTargetWindow( ) );
	assertEquals( format, action.getFormat( ) );

	hyperAction.setDrillThrough( null, true, null, null, null, null, null );
	assertEquals( IHyperlinkAction.ACTION_DRILLTHROUGH, action.getType( ) );
	assertTrue( action.isBookmark( ) );
	assertNull( action.getParameterBindings( ) );
	assertNull( action.getSearchCriteria( ) );
	assertNull( action.getTargetWindow( ) );
	assertNull( action.getFormat( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:34,代码来源:IActionTest.java

示例11: testSystemID

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
/**
 * Test getSystemId() method
 */
public void testSystemID( )
{
	IAction action = new Action( "id", null );
	assertEquals( "id", action.getSystemId( ) );

	action = new Action( null, null );
	assertNull( action.getSystemId( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:IActionTest.java

示例12: startData

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
public void startData( IDataContent data )
{
	IAction action = new Action( data.getHyperlinkAction( ) );
	assertEquals( IHyperlinkAction.ACTION_BOOKMARK, action.getType( ) );
	assertEquals( "labelbk", action.getBookmark( ) );
	assertEquals( "labelbk", action.getActionString( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:IActionTest.java

示例13: testBookmark

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
public void testBookmark( )
{
	String bookmark = "bookmark";//$NON-NLS-1$
	IHyperlinkAction action = new ActionContent( );
	action.setBookmark( bookmark );
	IAction act = new Action( action );
	String url = processor.getURL( act, context );

	assertEquals( url, "#" + bookmark );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:11,代码来源:EmbeddedHyperlinkProcessorTest.java

示例14: testHyperlink

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
public void testHyperlink( )
{
	String hyperlink = "hyperlink";//$NON-NLS-1$
	String target = "target";//$NON-NLS-1$
	IHyperlinkAction action = new ActionContent( );
	action.setHyperlink( hyperlink, target );
	IAction act = new Action( action );
	String url = processor.getURL( act, context );

	assertEquals( url, hyperlink );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:EmbeddedHyperlinkProcessorTest.java

示例15: getURL

import org.eclipse.birt.report.engine.api.IAction; //导入依赖的package包/类
public String getURL( IAction actionDefn, IReportContext context )
{
	if ( actionDefn == null )
		return null;

	switch ( actionDefn.getType( ) )
	{
		case IAction.ACTION_BOOKMARK :
		{
			return buildBookmarkAction( actionDefn, context );
		}
		case IAction.ACTION_HYPERLINK :
		{
			return buildHyperlink( actionDefn, context );
		}
		case IAction.ACTION_DRILLTHROUGH :
		{
			return buildDrillAction( actionDefn, context );
		}
		case IDataAction.ACTION_DATA :
		{
			return buildDataAction( (IDataAction) actionDefn, context );
		}
	}

	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:28,代码来源:ViewerHTMLActionHandler.java


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