Toolbar (RCP-only)

The Toolbar widget enables you to render function key and selection list items as buttons on a toolbar. The items can be rendered either on the main Transformation view toolbar, or on a stand-alone toolbar, which is useful when creating sections on a panel and providing a toolbar for a particular section. When items are rendered on the Transformation view toolbar, the style of button (text, image, or both text and image) is determined by the project-level toolbar settings. For more information about the project-level toolbar settings see Toolbar (RCP-only). When items are rendered on a stand-alone toolbar, you control the style of the toolbar using the settings for this widget.

This widget renders data supplied by the following components:
The following figure shows how a Toolbar widget appears on the Transformation view toolbar using data provided by a function key component as input:
Figure 1. Toolbar widget example
Example of toolbar widget
  1. Contribute items to main toolbar
  2. Display toolbar items as (both text and image)
    Note: This setting (Display toolbar items as) is configured on the main Toolbar setting on the Rendering tab of the Project Settings editor. Its value applies when Contribute items to main toolbar is selected for the Toolbar widget.
  3. Caption type (show description)
The following settings can be configured for this widget:
Contribute items to main toolbar
Select this box to render the items on the main Transformation view toolbar. If selected, toolbar items are rendered based on the project-level Toolbar settings on the Rendering tab of the Project Settings editor. For example, if the Render items under a single toolbar item setting is selected for this widget, its Caption and Image settings apply only if allowed by the project-level Display toolbar items as setting. For more information see Toolbar (RCP-only).

Clear this box to render the items on a stand-alone toolbar. If using this option, you control how the items are rendered using the Display item as settings below.

Display item as
When rendering items on a stand-alone toolbar, use this setting to control how to display each item. Options are to display each item as Text, Image, or Both text and image.
Render items under a single toolbar item
Select this box to specify that all items rendered by this widget are displayed as menu items under a single item on the toolbar.
Caption
Specifies the text caption to use on the single toolbar item. Depending on the Contribute items to main toolbar setting, this setting has no effect if the project-level Display toolbar items as setting or the widget-level Display item as settings is set to Image. For more information see the description of the Contribute items to main toolbar setting above. The default is Actions.
Image
Specifies the image to use on the single toolbar item. Select an image from the drop-down, or use the Import button to import an image. Depending on the Contribute items to main toolbar setting, this setting has no effect if the project-level Display toolbar items as setting or the widget-level Display item as settings is set to Text. For more information see the description of the Contribute items to main toolbar setting above.
Caption type
Use this setting to control what text caption is displayed for each item. This setting has no effect if Display item as is set to Image. Options are Show leading token, Show description, or Show both. For example, if the host text is F3=Exit, then Show leading token displays F3, Show description displays Exit, and Show both displays F3=Exit.
Hover help source
Controls what text is displayed as a tool tip when you hover over a toolbar item. Options are Show leading token, Show description, or Show both. For example, if the host text is F3=Exit, then Show leading token displays F3, Show description displays Exit, and Show both displays F3=Exit.
Use project-level image mappings
Select this box to specify that project-level image mappings are searched for an image to display for a toolbar item. Project-level mappings are searched after first searching component-level or default rendering-level mappings.
Project-level image mappings
When you render images for toolbar items, you can map source text from the function key or selection list to a specific image. For example, for the function key source text, F3=Exit, you can map to an image based on the leading token (F3), the description (Exit), or the full caption (F3=Exit). Unlike with other widget settings, with this setting you can configure project-level image mappings in the Project Settings editor and extend (not just overwrite) these mappings at the component or default rendering level. This allows you to configure generic project-level mappings, and make small changes at the component or default rendering level.
Use the Add button to add a new mapping. The Add Condition dialog appears with the following settings:
Text
Defines which part of the function key or selection list source text to search for the value specified in the Value field. Options are Leading token, Description, or Both. For example, if the source text is F3=Exit, then specifying Leading token searches F3, specifying Description searches Exit, and specifying Both searches F3=Exit to find a match with the value specified in the Value field.
Operator
Defines what is considered a match when searching the text defined by the Text field for the value specified in the Value field. Options are Contains or Equals. Contains means there is a match if the value is found anywhere in the text. In this case the search is not case-sensitive. Equals means there is a match only if the text is equal to the value. In this case the search is case-sensitive.
Value
Defines the value to search for in the text defined by the Text field. Multiple values can be specified using a vertical bar (|) symbol, for example Exit|Quit|Leave.
Image
Defines the image to use if a match is found. Select an image from the drop-down list or click the Import button to import an image.
Preview
Displays a view of the selected image.

Use the Edit, Remove, Up and Down buttons to further define your image mappings.

Note: Text replacement is performed prior to the Toolbar widget's determination of which image to use. Mappings you define must assume that text replacement may have changed the leading token, description, or both for the item.
defaultImage
Use this setting to specify a default image to use when no image is mapped for a specific function key or selection list item.
Note: This setting does not appear in the GUI as a configurable setting. It must be set in the source for the Toolbar widget settings. For example, if you want to use as the default the details.gif image in the Rich Client Content/Images folder in your project, do either of the following:

To specify the default at the project level, in the ZIETrans Projects view double-click the Project Settings file in the project folder to launch the editor for the application.hap file. On the Source tab locate the class, name="com.ibm.hats.rcp.transform.widgets.SwtToolbarWidget", in the <classSettings> tag and change the setting for defaultImage to <setting name="defaultImage" value="images/details.gif"/>.

To set the default image for a ComponentRendering control on a transformation, update the defaultImage string passed to the setWidgetSettings method of the ComponentRendering object. For example change defaultImage: to defaultImage:images/details.gif.

To use an image contained in another plug-in, specify the full path to the image within that plugin. For example change defaultImage: to defaultImage:org.eclipse.ui/icons/full/obj16/delete_obj.gif.