HomeUser GuideDevelopmentDownloadLegal

Development: Eclipse Primer

Eclipse IDE

This document gives a short introduction to the IDE Eclipse.

To use the Eclipse IDE several preferences should be set correctly. If you are using a different editor or IDE you should try to set this programs preferences similar to the guidelines described on this page.

Eclipse Version

Basically the version of the Eclipse IDE you use does not matter. However versions 2.x contain several bugs that make it worth to switch to version 3.x.

The project files in the repository as well as the code templates and the coding style are built for Eclipse 3.x.

Preferences

Default Runtime Environment

The project relies on a J2SE 1.4.1 or higher.

As we currently do not use symbolic Java Runtime Environment names make sure the default JRE configured in Eclipse is at least version 1.4.1!

File Encodings

Please try to stick to "ISO-8859-1" (also known as "ISO-Latin-1") file encodings. The default file encoding may be set in the preferences on the tab Workbench -> Editors -> Text file encoding.

Line Endings

Even though there shouldn't be any problems with mixed Unix and DOS line endings I noticed that problems may arise (esp. when dealing with Makefiles).

Therefore please use Unix style line endings for all text files in the project. For Eclipse there is a special starter called xEclipse that launches Eclipse in a mode with Unix style line endings. Please use it!

Coding Style

There is currently no explicit coding styleguide for this project, however looking at the sources in the repository should make the style obvious. Please try to stick to the style.

Release 3.0 of Eclipse introduced a new code formatter that will help stick to a given coding style. There is a coding style included that may be imported on the Java -> Code Style -> Code Formatter preference pane.

For Eclipse you might want to install the code templates on the preference pane Java -> Code Style -> Code Templates.

Please note that imports in Java classes should be sorted alphabetically and not grouped at all (i.e. there shouln't be any separating lines between them). We also try to avoid .* imports to express a classes colaborators by the classes import list. To get Eclipse to do this kind of import organisation go to the preference tab Java -> Code Style -> Organize Imports and remove all groups from the list. Then set the number of imports needed for .* imports to 99.

CVS Preferences

File Content

Eclipse has its own table to figure out whether a file should be treated by CVS as text or binary file. In this table three file extension that are important in our project are missing: dtd, xslt, xsd are among them (there are probably others...).

To configure Eclipse for these file extensions go to the preferences tab Team -> File Content and add the following manually:

Extension Content Description
cmd ASCII Windows command
sh ASCII Unix shell script
css ASCII Cascading stylesheet
js ASCII Java script
xslt ASCII XML stylesheet
mm ASCII Mind map (XML file)
Ignored Resources

The following changes have been made to the ignored resources known by Eclipse (see preferences tab under Team -> Ignored Resources):

Extension Change Description
*.so Removed from list Unix shared objects (our shared libraries are part of the master)
*.jbf Added to list Thumbnail database used by various paint programs
.xvpics Added to list Thumbnail database used by various paint programs

Built-in Ant Support

Eclipse features a nice built-in Ant support (see Window -> Show View -> Other... -> Ant -> Ant) that allows to execute builds directly from within Ant.

Run ant builds with an external JRE to prevent problems.

This is the default settings as of Eclipse 3.0.0.

Earlier releases of Eclipse featured a problem with a Xerces implementations that caused problems when reparsing the same file during and XSLT run from the workspace JRE.

Another problem that occurs when running Ant in the workspace VM is that you will eventually run out of memory as there are still some memory leaks in Ant. This tool has been designed to run from the command line, and that's the way we are using it...