Getting Started
To create a new plugin tab, you must:
- Get a working Comparator development environment
- Design the plugin tab
- Write the plugin tab
- Add the plugin tab to the Comparator
After completing these steps, you will be able to use your plugin tab in the Comparator.
Designing a New Plugin Tab
Start by deciding what your plugin tab does. You need to consider whether your plugin tab will be operational all of the time or installed on demand. Also, you should plan how your plugin tab will handle being installed multiple times or detect and handle that during initialization.
Pick a name for your plugin tab. A recommended name is a concise description of what your plugin tab does followed by the word Tab. Prevailing style is to use names that are mixed case, start with a capital letter, and capitalize the first letter of each interior word. The name must be a valid class identifier in Java and must not be the same as any of the existing class names in the Comparator. TAB will indicate the name of your plugin tab for the rest of this document.
Writing a New Plugin Tab
There are two ways to start writing a plugin tab. A plugin tab can be
written from scratch by implementing the ITab
interface directly.
Alternatively, an existing plugin tab can be extended. There are many complete
tabs and helper implementations in the ui
, views
and
cellcycle
packages to start with. In increasing order of
complexity, good tab implementations to start with are PanelTab
and DataEditorPanelTab
in the ui
package, and
BasicTableView
, SeriesView
, and
EditableSeriesView
in the views
package.
Plugin tabs touch nearly every aspect of the Comparator so you should thoroughly review the API documentation and study existing plugin tabs before starting a significant new project.
The ITab
interface is extremely simple. It requires you to
provide a name for your tab, a description of your tab, and a configuration
editor. If your tab does not have a description or need configuration, you can
simply return null
from those methods. Finally, the
readConfiguration
method signals that the configuration of your
plugin tab has been made available or changed. Several timing event states for
the configuration are described in ITab
, and additional states can
be defined. You should avoid doing any configuration work if you do not
recognize the state you are in.
Adding a Plugin Tab to JigCell
- Save TAB.java.
- Compile your plugin tab by running make in BASE. If make reports errors, correct them in the source code and run make again. You cannot proceed until all of the errors in your plugin tab have been fixed.
- Open BASE/www/installer/shared/compare.config in a text editor.
- Configuration values for a tab are drawn from three sections in this file.
Values in the configuration section marked @ are available to all tabs, called the universal configuration section. Each value is indicated by a
setValue
pair. The first parameter tosetValue
is a string that is the name of the value, which must be unique. The second parameter is a string that is the value.Values in the configuration section marked @CLASS=jigcell.compare.contrib.TAB are available to all tabs of your type. Use
setValue
to add values the same way as the universal section.Each instance of a plugin tab that is operational all the time can be configured individually. Tabs that are started by default have an entry in the configuration section marked @CLASS=jigcell.compare.cellcycle.CellCycleFrontEnd. The entry is itself a configuration section, marked with any unique name. Use
setValue
to add values to your configuration section the same way as the universal section. Finally, add the name of your configuration section to the list in the value named CompareFrontEnd.tabs in the @CLASS=jigcell.compare.cellcycle.CellCycleFrontEnd configuration section. Tabs are loaded into the Comparator in the order specified by the tab list in CompareFrontEnd.tabs. - Save compare.config.
- Run make distro in BASE to generate installers containing your plugin tab. The installers will be located in BASE/www. This installer is used the same way as the normal JigCell installer.