-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide API to GUI to judge whether a ReportItemHandle binds to a linked
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.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...t.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/LinkedDataSetUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |