Defining a List Value

The format of a List type is a value, optionally followed by a separator and a description; for example, 12 - No Drop. All JADE List values have the following format.

value [separator] [description]

The separator value is space, en dash symbol (-), space; that is, - .

When a property is changed in the Properties dialog, the value portion is saved in the database. When the combo box is displayed in the Properties dialog, the saved value is also used to select the line from the value list.

The value is detached from the combo box list by using the getNextToken method of the String primitive type and then casting to match the property type; that is, the value is the list text up to the first getNextToken delimiter (for details, see "getNextToken", in Chapter 1 of the JADE Encyclopaedia of Primitive Types), followed by casting to the correct type. For example, for a new control with an input type Character property and a Properties dialog List type with list entries Casual and Permanent, the getNextToken method gets a value of Casual or Permanent, which is then cast to a C or P character that is stored in the database.