Documentation and Screenshots
Here is an overview about what JTemplate is able to do. We use the example of generating
an CLI appication.
Start Screen
After startup, the following window appears:
|
start screen
|
A new CLI program
To create a new program, you click at the appropriate button in the toolbar.
To create for example a CLI application, you just click the CLI button.
Now you can enter the required and optional parameters for your program.

|
screen for CLI program
|
In detail, the options are:
- Name of the package
- If your program is part of a package, you will enter the package name here
(for example: "de.linuksoft.fb")
- Name of the main class
- This argument sets the following properties of your program:
- the name of the main class ("public class FooBar")
- the name of the Java sourcefile ("FooBar.java")
- the name of the class, which will be created in "public static void main"
- if the i18n option will be set, this sets the name of the property files, which
is the class name in lower case (see below)
- Location
- The directory, which is used to store the files
- i18n support
- Determines, if code for i18n and property files will be created
- Create javadoc comments
- Determines, if javadoc comments will be inserted into the file
Example Session
The following example shows the creation of a program with the following settings:

|
Startbildschirm
|
After entering this settings, you may click the "Go" button, to generate the files in
the given location:
- de/linuksoft/fb/FooBar.java
- de/linuksoft/fb/foobar.properties
- de/linuksoft/fb/foobar_de.properties
- de/linuksoft/fb/foobar_en.properties
The contents of the files
FooBar.java
1:package de.linuksoft.fb;
2:
3:import java.util.ResourceBundle;
4:import java.util.MissingResourceException;
5:import java.util.Locale;
6:
7:
8:/**
9: * This is the main class of the program
10: */
11:public class FooBar {
12:
13: /**
14: * This variable stores the ResourceBundle
15: */
16: private ResourceBundle theRes = null;
17:
18: /**
19: * The default constructor of this class FooBar
20: */
21: public FooBar() {
22: try {
23: theRes = ResourceBundle.getBundle("de.linuksoft.fb.foobar", Locale.getDefault());
24: } catch (MissingResourceException exc) {
25: System.err.println("Resource file not found.");
26: exc.printStackTrace();
27: System.exit(1);
28: }
29: System.out.println(theRes.getString("Hello.World"));
30: }
31:
32: /**
33: * The main method of this class
34: */
35: public static void main(String[] args) {
36: FooBar foo = new FooBar();
37: }
38:}
foobar.properties
This file is equivalent either to foobar_en.properties or to foobar_de.properties.
This depends on the current Locale with which JTemplate was started.
foobar_en.properties
property file for FooBar
Hello.World=Hello World
foobar_de.properties
property file for FooBar
Hello.World=Hallo Welt
© by Karsten Schulz, last modified at $Date: 2000/07/30 06:40:11 $ UTC