The plug-in class

So far, we've been looking at the different extensions that are provided by the JLedger UI plugin. Let's look at the general definition of the JLedger UI plug-in.

Plug-in definition

The JLedger UI plug-in is defined at the top of the plugin.xml file.

<plugin
   id="org.jledger.ui"
   name="JLedger Workbench"
   version="1.0.0"
   provider-name="jledger.org"
   class="org.jledger.ui.internal.JLedgerWorkbenchPlugin">

<!-- Required plugins -->
<requires>
   <import plugin="org.jlense.uiworks" />
   <import plugin="org.jlense.util" />
   <import plugin="org.jlense.zone" />
</requires>

<runtime>
   <library name="lib/org.jledger.ui-1.0.0.jar"><export name="*"/></library>
   <library name="lib/org.jledger.ui.testcase-1.0.0.jar"><export name="*"/></library>
   <library name="./"><export name="*"/></library>
</runtime>
...

The plug-in definition includes the name, id, version, and provider-name of the plug-in. We saw most of these parameters before in our hello world plug-in. JLedger also defines a specialized plug-in class, org.jledger.ui.internal.JLedgerWorkbenchPlugin.

The workbench UI and JLense Utility and the Object INtegration Framework plug-ins are listed as required plug-ins, which informs the platform of the JLedger's dependencies.

Finally, the name of the jar files are provided. File names specified in a plugin.xml file are relative to the plug-in's directory. In JLedger's case two jar files are specified, one jar file contains the classes for the JLedger UI and the other contains test case classes.