Skip to content.
MouseBIRN > CreatingPlugins

Adding Plugins to the MBAT source code

These instructions are for adding and creating a new plugin in the MBAT source code. General instructions and Eclipse specific directions are given below.


If you follow the source code plugin file structure, you can run the included ant builds to automatically build and copy your plugin .zip to the correct folder. The following examples assume a new plugin MyPlugin is being added to the mbRegistrationPlugins project.

  1. Create file structure for plugin:
    1. Create a plugin folder in the project (mbRegistrationPlugins/plugins/net.nbirn.mbat.plugins.registration.MyPlugin). For Eclipse, in the "Navigator" view, choose "File->New->Folder".
    2. Create a source folder "src" in the plugin folder (mbRegistrationPlugins/plugins/net.nbirn.mbat.plugins.registration.MyPlugin/src. For Eclipse, in the "Navigator" view, choose "File->New->Folder".
    3. Create and place the plugin manifest file plugin.xml in the source folder (mbRegistrationPlugins/plugins/net.nbirn.mbat.plugins.registration.MyPlugin/src/plugin.xml)
    4. For Eclipse, add the source folder to the project: Right click on the project (mbRegistrationPlugins). Choose "New"->"Src Folder". Select the folder name by clicking "Browse" and navigate to the above source folder.
    5. For Eclipse, set the output folder for the plugin. Right-click the newly added source folder and select "Build Path->Configure Build Path". In the "Source" tab, enable "Allow output folders for source folders" by clicking the checkbox. "Output folder" will then appear under the source folders. Double click the "Output folder" item and choose "Specific output folder". Browse for the root source folder and create a classes folder ( mbRegistrationPlugins/plugins/net.nbirn.mbat.plugins.registration.MyPlugin/classes).
  2. Add the source directory to the mbRegistrationPlugins/build.xml to automatically create the .zip archive and copy it to the plugin directory:

  3. Run the ant build:
    1. For Eclipse, in the "Package Explorer" view, right-click on the build.xml file under the !mbRegistrationPlugins project
    2. Select "Run As.." --> "Ant Build"