Templates
Like a rich client transformation, a rich client template is a Java™ class. It extends from the com.ibm.hats.rcp.ui.templates.RcpTemplate class, which extends from org.eclipse.swt.widgets.Composite. A template can contain SWT widgets, macro controls, and host and application keys. Because a template is an SWT composite, non-ZIETrans widgets can be added to the template.
A template cannot contain host components (ComponentRendering composites), default rendering composites, or global variable controls, while a transformation can contain them.
- Foreground and background colors used for transformations
- Fonts to be used for transformations
- Static labels, such as a logo image
- Links, such as to a corporate home page
Method | Description |
---|---|
getDefaultFont() |
Returns the default font to be used by widgets. |
getDefaultMonospacedFont() |
Allows you to override the default monospaced font at the template level. |
getDefaultBackgroundColor() |
Returns the default background color for the template. |
getDefaultForegroundColor() |
Returns the default foreground color for the template. |
getColorMapper() |
Returns an IColorMapper object that controls how host colors are mapped to colors on the view. |
getTableColorProvider() |
Returns an ITableColorProvider object that controls what colors are used for table controls. |
getContentContainer() |
Returns the composite that will be the parent of transformations or other composites displayed on the template. |
Refer to the ZIETrans Rich Client Platform API reference for more information on these methods.
- Constructs a new instance of the specified template class. This class must be a descendent of RcpTemplate, meaning that it must extend from RcpTemplate or from a class that extends from RcpTemplate.
- Constructs a new instance of the transformation class.
- Calls the
setContent()
method of the template instance, passing it the transformation instance. This method calls theapplyStyleToComposite()
method of the transformation instance - Calls the
setContent()
method of the transformation view instance, passing it the template instance.