本文整理汇总了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( ) );
}
示例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( ) );
}
示例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¶m1=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$
}
示例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 );
}
示例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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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( ) );
}
示例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( ) );
}
示例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( ) );
}
示例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( ) );
}
示例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 );
}
示例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 );
}
示例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;
}