SourceForge.net Logo

JLoom Logo JLoom


Overview

Introduction

Commands

Hello World Examples

Installation / Usage

Eclipse Plugin

Download

Installation / Usage

Eclipse Plugin

Download
There is a plugin for the Eclipse IDE. The Eclipse plugin automatically translates your templates when you save them (similar to the compilation of Java files). Syntax errors are shown in the Eclipse editor.

Installation

The plugin is shipped in the new Eclipse plugin format (a single jar file - requires Eclipse 3.1 or above). This makes install/uninstall/handling very easy.
Just download the plugin (called net.gereon.jloom_x.x.x.jar) and copy it in your eclipse plugin directory, e.g. /eclipse/plugins when /eclipse is your Eclipse installation directory. You have to restart Eclipse.

Activation

To use the plugin in a project you have to activate the JLoom Builder:
In the Package Explorer get the context menu of the project root node (right mouse click), then choose "Add JLoom Builder" (should appear as context menu entry when the plugin is installed):
screen-addbuilder.png
Hint
It is necessary to move the mouse over a project root node, not a child node. Only project nodes have "Add JLoom Builder" in their context menu.


Now a new builder "JLoom Builder" should appear in the project properties:
screen-builders.jpg
Hint
The JLoom Builder has to be on top before the Java Builder, because templates have to be first translated into Java sourcecode and then compiled into class files.


Add Library JAR

To make the JLoom API available, you have to add the JAR library to your project:
Choose Project->Properties, then in "Java Build Path" choose the tab "Libraries", then add the plugin-JAR-file with "Add JARs...".

Hint
You should choose the plugin-JAR - not the binary-JAR, because the plugin-JAR will make the sources and JavaDoc visible in Eclipse.


Usage

There is no special JLoom wizard so far; to create a new JLoom template simply choose New->File in the menu and name it <template-name>.jloom.

Hint
You have to create the JLoom template in a source folder.

When you save a file with extension .jloom in a source folder, the builder will translate it to a file called <template-name>_JLoom.java in the same folder, this is the generation class.
Syntax errors will be shown in the editor and in the problems tab. If syntax errors don't show up, try to adjust the filters of the problems tab.

Syntax Highlighting

So far the plugin doesn't support syntax highlighting itself. But there is a simple workaround, especially useful if you generate HTML content. Because the syntax of JLoom is very similar to JSP, you can just use a JSP editor. For example, I use the Eclipse Web Tools Platform (WTP):
screen-editor.jpg
The editor decorates commands with yellow underlines, because it doesn't know the JLoom command syntax, but fortunately no warnings/errors are shown in the problems tab (except real JLoom syntax errors which are created by the JLoom plugin).

To associate the JSP editor with JLoom templates, you have to edit the JSP content type:
and add a file association for .jloom:


  Generated by JLoom LogoJLoom November 29, 2007   •   You can view the template here: EclipsePage  
SourceForge.net Logo