JinnIde is the Jinni Prolog IDE Plugin for JEdit. From the Cassandra release onwards,
Jinni Prolog code development is supported by automated creation of Jinni Prolog entities
such as classes and modules. The following explains how to create a Jinni Prolog class
or module automatically.
To generate a Jinni Prolog class or a module JinnIde offers a GUI dialogue that allows
creating a JinniDoc-based template. This might sound complicated but - with
JinnIde - it's a trivial and simple thing to accomplish:
- Create a new Jinni Prolog file by selecting File/New or pressing CTRL-N.
- Open up the template viewer or pull down the templates menu and click on Create
object
- The GUI dialogue comes up:
- Fill out the entries:
- Objective: Describe briefly in natural language what this object - class
or module - is supposed to be good for
- Name: this is the name of the object - a Prolog term constant so it must
begin with a minuscule letter e.g. 'scheduler'; you might prefer using a
short name but Jinni Prolog object names are not so restrictive and one may choose
a
longer name for a class like 'mailMessageSchedulingManager'
- Details: Describe the objective giving full details including possible
warnings and other sorts of detailed information
Note that these entries can be modifed any time later and so one may be
less careful knowing that it may be improved later.
- After pressing OK all these indications are written out to the buffer you
just created in step (1) and you may correct anything now at any time. Anyway,
the result is something like
So one can see that, apart from the above developer's descriptions (objective,
name and details), JinnIde also produces
- a full JinniDoc header including the
author's name
- a license description including a copyright indication
- HTML tags for the later nice browser
display of the JinniDoc-umented version of this file
- the date when this object has been created
- all entries are indented in a way so a proper collapsing works when
JEdit's folding in indent mode is activated, see the following screenshot
Internally all this is accomplished by applying the velocity template engine
which comes along with the templates plugin available for JEdit (which is thus
one of the required plugins for JinnIde). There are a couple of sub templates
used to get the author name and the license which one may easily modify to
include another license description and author name. See the templates 'Do
copyright contents' and
'Set author'. You may modify them by right-clicking on the corresponding
entry in the templates viewer and selecting 'Edit template'. Take a look at
the documentation
of the templates plugin for the details.