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 getter/setters.
The following explains how to create Jinni Prolog getter/setters automatically.
To generate a Jinni Prolog rule JinnIde offers a GUI dialogue that allows
creating a JinniDoc-based template. With
JinnIde this is a trivial and simple thing to accomplish:
- Create a new Jinni Prolog file by selecting File/New or pressing CTRL-N. Of course,
alternatively one may take an existing file.
- Open up the template viewer or pull down the templates menu and click on Create
getter-setter
- The GUI dialogue comes up:
- Fill out the entries:
- Variable Name: Type in the name of the variable that is to be used to as
instance or class variable. In the example, there will be two variables,
Var1 - an instance variable, and Var2 - a class variable (see below); press
return to enter each variable in the variable list so in the end the list
is filled as shown below
- Class variable: Indicate the type of the variable, by ticking the box (class
variable) or leaving it unticked (instance variable, which is the default);
the * is used to denote the class variable type, which one may also type
in directly as a prefix
For the given example, the filled dialogue
may look as follows:
The result
After pressing OK all these variables are written out to the buffer
created in step (1) or inserted at the cursor position of JEdit's
buffer for the existing file. For above input the following output is generated:
So one can see that, apart from the above developer's descriptions, JinnIde
also produces
- a JinniDoc header for each method (getter and setter)
- 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). Take a look at
the documentation of the templates plugin for the details.