- Add org.eclipse.birt.report.engine_Version.jar to your Java project, as outlined in the following steps:
- Select your Java project and choose File->Properties->Java Build Path->Libraries. Java Build Path appears, as shown in Figure 23-1.
- Choose Add External JARs. JAR Selection appears.
- Navigate to Eclipse /plugins directory. In a default Eclipse installation, this directory is in the following location:
- Select org.eclipse.birt.report.engine_Version.jar. Choose Add. Java Build Path appears.
- Choose OK.
- Select your Java project and choose File->New->Other. Select a wizard appears.
Choose Next. Java Class appears, as shown in
Figure 23-3.
- Navigate to the folder where you want the Java source file to reside by choosing the Browse button beside Source Folder.
- If your new Java class is a part of a package, type the fully-qualified package name in Package.
- In Name, type a name for your class.
- In Modifiers, choose Public.
- Choose the Browse button beside Superclass. Superclass Selection appears, as shown in Figure 23-4.
- In Choose a type, type the name of the adapter class for the ROM element. For example, enter Label EventAdapter for the Label element. Choose OK. New Java Class reappears.
- Select Generate comments. Choose Finish. A Java editor view appears, similar to the one shown in Figure 23-5.
- Add the event handler method for your new event handler class. Figure 23-6 shows the addition of an onPrepare( ) method that sets the background color of the label to red.