The Settings class in the com.ibm.btt.rcp.visualbean.core package contains properties common to many of the visual beans. These are defined as static properties in the class, and can be obtained using the getValueAt(String property) method. The getValueAt method returns an object for each property. This object may be a Color object if you ask for a color property, and an Integer object if you ask for a key property. For example, you can obtain the errorBackgroundColor property by using the name of the property as a parameter of the getValueAt method, as follows:
A file named settings.properties in com.ibm.btt.rcp.visualbean.core package is distributed as part of the toolkit. It contains an entry for each of the color and key settings (these are listed in the table below) and its default value. You can customize any value as necessary. This file is used during development and at runtime. If it is not found, the toolkit default values are used.
In plugin development, an extension is provided to customize these properties. The values set in the extension will overwrite the value in settings.properties file:
Each of the following settings applies to all visual beans unless otherwise specified:
Setting | Description |
---|---|
backTabKeyCode | Defines the code for the key which, when clicked, acts as the Back Tab key in any component of the view. The default value is VK_TAB (the TAB key). |
backTabMask | Defines the mask (such as ALT or CTRL) that must be taken into account for the Back Tab key. The default value is SWT.SHIFT. |
errorBackgroundColor | Defines the background color for the BTTText and BTTTable bean when data is not valid. The default value is white. |
errorForegroundColor | Defines the foreground color for theBTTText and BTTTable bean when data is not valid. The default value is red. |
helpKeyCode | Defines the code for the key to activate the help system. The default value is F1 (the F1 key). |
helpMask | Defines the mask (such as ALT or CTRL) that must be taken into account for the Help key. The default value is NO_MASK. |
labelForeground. | Defines the color for the BTTLabel text. However, if it is necessary to have one or more beans with a different foreground color, the color can be specified in the foreground property of each bean. The default value is black. |
mandatoryBackgroundColor | Defines the background color for the BTTText, BTTCombo, BTTList, and BTTTable mandatory beans. The default value is yellow. |
mandatoryForegroundColor | Defines the foreground color for the BTTText, BTTCombo, BTTList, and BTTTable mandatory beans. The default value is black. |
nonEditableBackgroundColor | Defines the background color for non-editable BTTText, BTTCombo, and BTTTable beans. The default value is lightGray. |
nonEditableForegroundColor | Defines the foreground color for non-editable BTTText, BTTCombo, and BTTTable beans. The default value is black. |
nonEnabledBackgroundColor | Defines the background color for non-enabled BTTText, BTTCombo, BTTList, and BTTTable beans. The default value is gray. |
nonEnabledForegroundColor | Defines the foreground color for non-enabled BTTText, BTTCombo, BTTList, and BTTTable beans. The default value is black. |
okKeyCode | Defines the code for the key which, when clicked in any component of the view (except for BTTButtons), executes the operation (if the OK button is enabled). The default value is the ENTER key(SWT.CR) |
okMask | Defines the mask (ALT, CTRL, etc.) that must be taken into account for the OK key. The default value is NO_MASK. |
optionalBackgroundColor | Defines the background color for the BTTText, BTTCombo, BTTList, and BTTTable beans. The default value is white. |
optionalForegroundColor | Defines the foreground color for the BTTText, BTTCombo, BTTList, and BTTTable beans. The default value is black. |
selectionBackgroundColor | Defines the background color in the selected text in BTTText, BTTCombo, BTTList, and BTTTable beans. The default RGB value is (204, 204, 255). |
selectionForegroundColor | Defines the foreground color in the selected text in BTTText, BTTCombo, BTTList, and BTTTable beans. The default value is black. |
settingClass | Indicates the class name (with path) that will retrieve the information needed by the visual beans at design and runtime. These values are the default values for the properties, types information, and externalized data. If this class is com.ibm.btt.rcp.visualbean.core.DefaultSettings, the default values will be in the path pointed to in the settings.properties file that is distributed as part of the toolkit. |
standardFont | Defines the font to be used by all the visual beans. However, if it is necessary to have one or more beans with a different font, the font can be specified in the font property of each bean. The default value is the system font. |
tabKeyCode | Defines the code for the key which, when clicked in any component of the view, acts as the Tab key. The default value is VK_TAB (the Tab key). |
tabMask | Defines the mask (such as ALT, CTRL, or SHIFT) that must be taken into account for the Tab key. The default value is NO_MASK. |
The BTTText, BTTCombo, and BTTList beans can be in a state where more than one color is appropriate, but only one color can be displayed. Each of these components has its own algorithm to determine which color takes priority. The following tables show the priority of the colors for each of the components. The state and color pair of the highest priority appear at the top of the table, and the remaining state and color pairs are listed in decreasing priority.
State | Color |
---|---|
Not enabled | nonEnabledxxxColor |
Not editable | nonEditablexxxColor |
In error | errorxxxColor |
Mandatory and empty | mandatoryxxxColor |
All other states | optionalxxxColor |
State | Color |
---|---|
Not enabled | nonEnabledxxxColor |
Mandatory and empty | mandatoryxxxColor |
Not editable | nonEditablexxxColor |
All other states | optionalxxxColor |
State | Color |
---|---|
Selected | selectionxxxColor |
Not enabled | nonEnabledxxxColor |
Mandatory and empty | mandatoryxxxColor |
Not editable | nonEditablexxxColor |
All other states | optionalxxxColor |