Skip to content

write a genlab plugin

samthiriot edited this page Mar 6, 2015 · 6 revisions

Table of Contents

Introduction

Genlab is based on Eclipse. It means we do reuse the look&feel, basic components, available plugins from Eclipse. Contributing to Genlab thus requires the understanding of the eclipse plugin structure, and of some other eclipse aspects.

Ideally, you should read first

To read more about eclipse plugins, see some of these articles:

in practice

You do create a plugin in genlab to add what is named algorithms, that is boxes you will connect with other boxes to use them for generating populations (or related topics).

  • define what you are going to add to GenLab:
    • a graphic algorithm ? (it is opening a view in Eclipse, is displaying curves or so on); it means this algorithm will be packaged with the graphical version of genlab, but not with the non graphical one
    • a non-graphic algorithm ? It will be available in the batch mode of genlab.
Everytime you create a graphic plugin, you probably also do have a non graphic one for other algorithms. Also, eveytime you create a non graphic plugin, you will probably create a graphic one for examples (as examples are graphic).

create a non-graphic or graphic plugin

  • in eclipse: file / new / other; select "plugin development / plugin project"
  • an assistant appears. Use it such as:
  • page 1
    • name: name it something meaningfull. If it is supposed to be part of the future genlab core distrib, start with genlab. Else start with you company name or wathever.
    • keep defaults: default location is ok, create src and bin, etc.
  • page 2
    • fill Name, Vendor...
    • "generate an acivator" should be checked
    • if you are creating a GUI pluging, check "this plugin will make contributions to the UI"
  • page 3:
    • uncheck the "create a plugin unsing one template..."
click "finished".

inside the plugin which appeared in eclipse

Eclipse probably opened for you the META-INF/Manifest of the novel plugin ; if it is not the case, open it yourself.

In tab "Overview":

  • "active the plugin when..." should be checked
  • check "this plugin is a singleton"
Tab "dependancies", in "required plugins":
  • for any plugin, add:
    • genlab.core
  • for GUI plugins, add:
    • genlab.examples,
    • genlab.gui

standard modifications to activators

Activators should implement in Genlab:

  • make them implement IGenlabPlugin
  • public static final String getName()
  • public static final String getDescription()
  • in the start() function, add a GLLogger.infoTech("Initializing plugin XXX;, it provides YYY")

declare your plugin so it will be known by genlab

for GUI

in the plugin genlab.gui, open genlab.product;

  • in "dependancies", add you plugin, then click "add required plugins"
  • then in "overview", click "synchronize".
  • then "run as an application"
Your plugin should appear in the log and in the welcome page. Else you are entering in a debugging loop (good luck !).

for batch

TODO