Previous Next

How to create an event handler class and add it to the Java project

This section describes the process for using the Eclipse Java development environment to create an event handler class for a scriptable BIRT element. The steps assume that the Java perspective is open and that a Java project exists in the workspace.

1  
1  
In Navigator, select a Java project and choose FileProperties. In Properties, select Java Build PathLibraries. In Java Build Path, choose Add External JARs.
2  
<ECLIPSE_INSTALL>\eclipse\plugins
3  

Figure 23-1 The report engine JAR file in the build path

Figure 23-1  The report engine JAR file in the build path
2  
3  
1  
2  
3  
4  
5  
*
*

Figure 23-2 Selecting a Superclass

Figure 23-2  Selecting a Superclass
*
4  

Figure 23-3 New Java Class final properties

Figure 23-3  New Java Class final properties
5  

Figure 23-4 The new class in the Java editor

Figure 23-4  The new class in the Java editor
6  
Add the event handler method for the event handler class. Import all required classes. Figure 23-5 shows the addition of an onPrepare( ) method that sets the background color of a label to red.

Figure 23-5 The onPrepare( ) method in the Java editor

Figure 23-5  The onPrepare( ) method in the Java editor
7  
Choose FileSave.

(c) Copyright Actuate Corporation 2013