Constraint Tab of the Edit Parameter Window
The Constraint tab of the Edit Parameter window allows you to specify a parameter constraint that restricts the values that can be specified for the parameter. For example, if the Range constraint is defined as greater than 0 and less than 5 for the type Integer, the only possible values for this parameter can be 1, 2, 3, or 4.
The following constraint types are supported:
Field
Description
None
Indicates that there are no constraints for this parameter.
Range
Specifies a range of valid values for the parameter. If this option is selected, you are asked to specify a minimum and maximum value. A range can be used for any primitive type (excluding Boolean).
* 
This constraint type is not available for the following parameter types:
URL
Real with Units
Reference
List
Indicates that there is a list of possible values for the parameter. This option is available for all primitive types except Boolean.
Dynamic List
Allows you to specify a Java class and a static method that returns the list of allowed values based on the values of other parameters of the part. For this option, you are asked to enter a class name and method name that is used to return a java.util.SortedMap between the allowed values and its image URLs. This option is available for all primitive types except Boolean, URL, Reference, Real Number with Units.
Using Dynamic Lists
To specify a constraint using a dynamic list:
1. Select Dynamic List on the Constraint tab.
2. Specify the class name, for example, com.ext.CustomDynamicList. This custom class must be included in the codebase. Once it is added, you can browse the codebase to select the class.
3. Specify the method name that is introduced in the custom class, for example, getAllowedValues.
4. The constraint is added to the constraint list.
Consider this information on configuring dynamic lists:
The static method must take one argument, Vector, and return SortedMap. For example, the method signature may be as follows: public static SortedMap getAllowedValues(Vector parameters).
The SortedMap consists of Key/Value pairs, where the Key is the allowed value (for example, Red), and the Value is the name of an image (for example, red.gif) to be displayed with the allowed value. The image must be available in the WT_HOME/codebase/wt/clients/images directory.
The Value is optional and must be an empty String (“ ”) if no image is available.
You can optionally specify some parameters to be passed to the method to generate the allowed values. In the code, the parameters are passed as ExternalAppData objects.
Was this helpful?