Skip to content

Commit

Permalink
Provide API to GUI to judge whether a ReportItemHandle binds to a linked
Browse files Browse the repository at this point in the history
data set.
  • Loading branch information
lzhang authored and mwu committed Mar 6, 2013
1 parent a483571 commit 62ad87b
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.eclipse.birt.report.data.adapter.api;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import org.eclipse.birt.report.model.api.ReportItemHandle;


public class LinkedDataSetUtil
{

private static String GET_LINKED_DATA_MODEL_METHOD = "getLinkedDataModel";

public static boolean bindToLinkedDataSet( ReportItemHandle reportItemHandle )
throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException
{
Method[] methods = reportItemHandle.getClass( ).getMethods( );
for ( int i = 0; i < methods.length; i++ )
{
String name = methods[i].getName( );
if ( name.equals( GET_LINKED_DATA_MODEL_METHOD ) )
{
Object result = methods[i].invoke( reportItemHandle );
if ( result != null )
return true;
}
}
return false;
}
}

0 comments on commit 62ad87b

Please sign in to comment.