Controls
This class holds the controls associated with an instance of a model. The controls can be accessed via their key names. The following functions are useful when accessing controls.
controlKeys() returns the names of the controls
hasControl(name:String) checks if name is a control
asList() the controls as a list
asListByType(controlType: ControlType) a filtered list of controls by control type
control(controlKey: String) returns the named control or null
controlTypes() the set of control types used by the model
asMap() - all the controls as a map, with the pairs (control name, value)
setControlsFromMap(controlMap: Map
) perhaps the most useful of the functions. Sets the controls by name to the supplied value for each control. setControlsFromJSON(json: String) assumes that the JSON represents a control map and sets the controls as specified.
controlsMapAsJsonString() a JSON string representation of a control map
controlData() a list holding instances of ControlData of all the controls for data transfer purposes
controlDataAsString() a string representation of the control data
Functions
The type should be associated with a valid control type.
Gets a control of the supplied key name or null
Return a List of ControlData providing additional detail on Controls (but without giving direct access to the control)
Returns a map containing the type of model element having controls along with a list of those controls for that type of model element. The type of the model element is the key to the returned map. The values are a list of the controls associated with the type of model element. Recall that the element type is the simple class name associated with the model element. For example ResourceWithQ
Returns a map containing the model element name having controls along with a list of those controls for the model element. The model element name is the key to the returned map. The values are a list of the controls associated with the model element.
A JSON representation of the map of pairs (keyName, value) for the controls
Basic printing of the controls as (name, value) pairs
Sets all the contained control values using the supplied flat map