Using templates
Templates enable you to further control the appearance of your HATS application by customizing a template to match the style of your corporate Web site or applications, or other guidelines. A template is a JSP file in HATS Web projects or a Java™ SWT composite class in HATS rich client projects. Templates have an area reserved for the host screen that is rendered by a HATS transformation. They can contain company logos and information and, in the case of HATS Web templates, links to other Web pages. A template also defines the background color, image, or both, for the area where the transformed host screen appears.
Launching the HATS Template wizard enables you to create a blank template or a template based on one of those shipped with HATS. For HATS Web projects you can also base a template on a Web page (URL or file). You may want to import an existing Web page as a template based on your company's Web site. For HATS rich client projects you can import a template as a Java™ source file from another project by copying the source file into the project or by using the Eclipse import wizard.
- Default background colors
- Default foreground colors
- Default color mappings to map host colors to GUI colors
- Default fonts
- An area for the host screen rendered with a transformation
- For Web templates
- Style attributes for widgets
- Image definitions created using the .gif, .jpg, and .png files located in the Web Content/Common/Images folder
- The HATS default application keypad
- Newly supplied templates are marked with an asterisk on the Template tab of the Project Settings editor.
- When you create a HATS project and select Optimize options for mobile devices, only templates that are optimized for mobile devices are provided for use in the project.
When you create your project in HATS Toolkit, you select a template to use as the default template for your project. This template is shown in the HATS Projects view with a different icon and the word default next to it. You can change the default template by going to the HATS Projects view and right-clicking on a template located in Web Content/Templates (Web-only), or Rich Client Content/Template (RCP-only), and select Set as Default Template. Another way is by double-clicking on the Project Settings of your HATS project in the HATS Projects view. Go to the Template tab and make your selection for the list.
When you create screen customizations, and the action is to apply a transformation or show URL, you can select the template to use when the transformation is applied. To make your host application consistent across all screens, you can use the same template for your transformation that you selected for your project default template. To do this, select the template that you want to use as the default template for this project.