Return to index

PlugIn Modules

 

Introduction

PlugIn modules add functionality to the IDE and also provide a powerful means of customisation - you choose what additional functionality you wish to have and can choose between the available solutions.

The API for constructing plugins and the source code for various examples is now public (in beta release). This enables existing plugins to be customised, improved or extended - and new functionality added by you or others as a plugin development community builds around TJI.

 

How to use a PlugIn Module

Some PlugIn Modules are available from www.kinabaloo.com.

Download plugin jar files to - or later place in - the 'modules' sub-directory of your IDE installation. The plugin will be automatically loaded when the IDE is next started.

Some 'core' plugin modules are distributed inside ide.jar and installed automatically. One of these is the 'ShortCuts' module that allows you to define custom shortcuts when editing source files.

 

How to write a PlugIn

A plugin module must implement interface TJIModule. This interface defines the behavior that the IDE expects a plugin module to possess.

Interface TJI provides access to some of the IDE's functionality. Interface TJI is implemented by the IDE and represents those aspects of the IDE that are accessible to a plugin. The IDE's implementation of interface TJI is passed to a plugin when the plugin's start method is called by the IDE; method start(TJI tji) is defined by interface TJIModule.

Both the source files and class files for these two interfaces are included in ide.jar.

There are two basic types of plugin module - those that require their own GUI tab within the IDE, and those that don't (but may still add menu items to the IDE's GUI). Both types are created in the same way but those that require their own GUI tab should extend JPanel.

To see visual plugins, select 'Show Plugin Modules' from the 'Options' menu.

TJI can create a skeleton plugin module to form the basis of a new plugin - select project type 'PlugIn' when creating a new project ('Project' menu).

Many of the available plugins are 'open source'. The easiest way to experiment with existing plugin source code is to download it in the form of a TJI project - download the project zip file and then select 'Import Project' from the 'Project' menu. Alternatively, you can download source code files which should be placed within the 'modules' subdirectory, with appropriate package to directory stucture (if required), and then added to a new empty project; and don't forget to set the Project Type ('Project' menu) to type 'PlugIn'.

After compilation, the plugin module will be automatically reloaded. Class files are loaded in preference to same-name class files within jar files - so you can edit and run a plugin without worrying about a jar'ed version of the same classes.

On our web site there is also a 'Chess' plugin example where the chess program itself was originally a separate Java program (though also developed by Kinabaloo Software). We took the top-level panel out of it's parent JFrame and assigned that panel as the GUI of a new plugin module. This was a simple process that illustrates one way to proceed when developing a new plugin module.

Though not required for the chess plugin, the next step would be for the plugin to make use of the IDE's functionality through the methods defined in interface TJI.

 

Notes for PlugIn developers

If you require functionality not currently provided, let us know by email and we will endeavour to add it quickly.

When creating a jar file for a plugin ('Project' menu, 'Jar Project'), remember to specify the 'main' file first; this is done automatically if you start by creating a new plugin project with skeleton code.

Be careful not to create endless loops in your plugin code - or you may need to restart the IDE.

 

JavaDoc API Documentation

com.kinabaloo.TJIModule

com.kinabaloo.TJI

 

Return to index