Editing templates for rich client projects

A ZIETrans rich client template is a specialized Java™ SWT composite class that implements a specific Java interface. This interface allows ZIETrans to detect and use Java source files that are to be used as ZIETrans templates in the rich client environment. ZIETrans rich client templates are very basic with a simple header or sidebar and no footer. This is because it is assumed that the runtime environment (for example, Eclipse RCP) will provide for the overall common appearance as well as areas for common buttons, links, and so on.

A template cannot contain host components (ComponentRendering composites), default rendering composites, or global variable controls, while a transformation can contain them.

You can see all of the templates, those supplied by zietrans and any that you have created, by expanding the Templates folder under Rich Client Content in the ZIETrans Projects view.

To edit a template using the default editor, double-click on the name of the template. To see the available editors, right-click on the name of the template and select Open With.

Two areas of the Visual Editor include the design view, typically displayed as the upper area, and the source view, typically displayed as the lower area. An item, such as an image, is added to the template by using controls available on the Palette view.

For example, to add an image to your template follow these steps:
  1. From the Eclipse menu bar select File > Import > General > File System to open the Import wizard.
  2. Use the Browse button next to the From directory field to locate and select an image to import into your project.
  3. Use the Browse button next to the Into folder field, to select the \src\images folder in your project.
  4. Click Finish.
  5. In the ZIETrans Projects view, right-click your project and select Refresh.
  6. Open your template in the Visual Editor and from the Palette view under SWT Controls click Label.
  7. Point the mouse to where you want to place the image in the design view for the template and click.
  8. In the Name dialog provide a name or take the supplied default and click OK.
  9. Select the label you just added to the template and in the Properties view, typically displayed below the source view of the Visual Editor, select the text property and clear the label caption.
  10. In the Properties view select the image property and click the button displayed at the right margin of the Value column.
  11. In the Select an Image File dialog, under Browse in select Project, under Location expand your src folder and click the images folder, under Files select the image you imported, click OK.
    Note: In this step, be sure that under Browse in you select Project, and then select a location in your project. If instead you select File system, and then select a location on your file system, your project will not run properly when deployed to another system.

If you use the Visual Editor to manually add font, image, or color resources to ZIETrans transformations or templates, you must also manually add code to clean up these resources. For more information, see ZIETrans rich client considerations and limitations.