Creating the plug-in extension content
The XML schema specifies a grammar to use when creating an extension in the Eclipse PDE. Selecting an extension element in the Extensions page, Eclipse uses the XML schema to populate the Extension Element Details section with a list of valid attributes and values for the element.
In Extensions, as shown in Figure 22‑14, if you choose Find declaring extension point, the PDE searches for the extension point currently selected in All Extensions. If you choose Open extension point schema, the PDE opens the .exsd file that contains the XML schema definitions. If you choose Show extension point description, the PDE generates an HTML page containing the information documented in the XML schema and displays the page in a viewer.
Figure 22‑14 Using Search to find a declaring extension point
This section discusses the following tasks:
*Searching for and viewing extension point information
*Specifying plug-in extension content
*Specifying a build configuration
How to search for and view extension point information
1 In the Eclipse PDE, select a plug-in extension in All Extensions, such as org.eclipse.birt.report.designer.ui.reportitemUI.
2 In Extension Details, choose Find declaring extension point. Search appears. As shown in Figure 22‑14, Search lists one match, org.eclipse.birt.report
.designer.ui.reportitemUI.
3 Double-click the match. In PDE Manifest Editor, the contents of org.eclipse.birt
.report.designer.ui/plugin.xml appear, as shown in Figure 22‑15.
Figure 22‑15 Plugin.xml showing extension points
Plugin.xml describes the extension points, odadatasource, reportItemUI, menuBuilders, elementAdapters, reportItemEditpart, and DNDServices.
4 In PDE Manifest Editor, close the window displaying contents of the plugin.xml file.
5 Choose Extensions. In Extension Details, choose Open extension point schema. PDE Manifest Editor opens the Report Item UI Extension Point schema, as shown in Figure 22‑16.
Figure 22‑16 Viewing the extension point schema
The schema displays an abstract of the general information, schema inclusions, and documentation.
6 In Extension Details, choose Show extension point description. A viewer opens, displaying the HTML document for the extension point, as shown in Figure 22‑17.
Figure 22‑17 Viewing the extension point description
In the HTML document, Configuration Markup displays the attribute list for the extension point. Scroll down to view all the contents of the HTML document, including the optional set of user interface elements for the report item extension, such as builder, palette, editor, outline, and description.
How to specify plug-in extension content
1 In PDE Manifest Editor, choose Extensions.
2 In All Extensions, right-click an extension point, such as org.eclipse.birt.report.designer.ui.reportItemUI. Then, choose New<extension point element>. The example in Figure 22‑18 shows how to select the extension point element, reportItemLabelUI.
Figure 22‑18 Selecting an extension point element
Extensions appears, displaying the extension element and its details, as shown in Figure 22‑19.
Figure 22‑19 Viewing the extension and extension element details
In this example, All Extensions lists the extension, org.eclipse.birt
.sample.reportitem.rotatedlabel.RotatedLabelUI (rotatedItemLabelUI), and Extension Element Details lists rotatedItemLabelUI properties. In Extension Element Details, the label for a required attribute, such as class, contains an asterisk.
3 To view the annotation for a property listed in Extension Element Details, place the cursor over the property label.
A tooltip appears, displaying the annotation for the property from the XML schema. Figure 22‑20 shows the annotation for the class property for the example extension element, rotatedItemLabelUI.
Figure 22‑20 Viewing the annotation for an extension element
4 To specify the class attributes for an extension element, choose class in Extension Element Details. If the class file exists, the class file opens in PDE Manifest Editor. If no class file exists, New Java Class appears, as shown in Figure 22‑21.
Figure 22‑21 Specifying a class in New Java Class
In New Java Class, you can modify or add to the settings for the following class properties:
*Source folder
*Package
*Enclosing type
*Class name
*Modifiers, such as public, default, private, protected, abstract, final, and static
*Superclass
*Interfaces
*Method stubs, such as main, constructors, and inherited abstract methods
*Comments
After modifying setting, choose Finish. To add more elements and attributes to a selected extension point, repeat steps 1 and 2.
Figure 22‑22 shows the full list of extension points required for the sample report item extension, org.eclipse.birt.sample.reportitem.rotatedlabel.
Figure 22‑22 Viewing all required extension points for an extension