h2. Radio

h3(#description). Description

The radio widget can be used to display and edit a mono-valued property which can take one of several existing values. It can thus be used to edit a mono-valued EReference with a couple of potential values or an EEnum. The properties available on this widget are very similar to the ones available on a "select":select.html widget. On top of the common properties of all widgets (identifier, labelExpression, helpExpression, isEnabledExpression, propertyValidationRules), it has the following properties:

* valueExpression: The value expression is used to compute the value to select. This expression must return an object.
* editExpression: This expression will be executed when the user will select a radio button. The selected value will be accessible using the variable @newValue@. The variable @newValue@ will contain a candidate selected from the result of the @candidatesExpression@. This expression does not have to return anything.
* candidatesExpression: This expression is used to compute all the radio buttons to create and the value that will be associated with each of them. This expression must return a collection of objects.
* candidateDisplayExpression: This expression will compute the label of each radio button using the value associated to the button. This value will be accessible using the variable named @candidate@. This expression must return a string.
* numberOfColumns: The number of columns to use to create the radio buttons. If you have twelve candidates and if you want them to be displayed on three lines, you can use the expression @aql:4@ to have your radio buttons created on four columns. 
* style: The style of the radio widget.
* conditionalStyles: All the conditional styles of the radio widget.

h3(#displayeenum). Display an EEnum

In order to display in the user interface some radio buttons with the value of an EAttribute with an eType EEnum (i.e. the visibility of an EObject), you can create a radio widget with the following properties:

* labelExpression: @aql:'Visibility:'@
* valueExpression: @aql:packagename::Visibility.getEEnumLiteralByLiteral(self.visibility.toString())@
* editExpression: @aql:self.eSet('visibility', newValue.instance)@
* candidatesExpression: @aql:packagename::Visibility.eLiterals@
* candidateDisplayExpression: @aql:candidate.name@

In this scenario, we will display a property with the eType "Visibility" coming from a package with the name "packagename". EEF does not provide a default interpreter but you can easily configure EEF to be used with the AQL interpreter. In the integration of EEF with the AQL interpreter, you can register additional services, written in Java, in which you can expose to AQL new operations. The operation @eSet(java.lang.String, java.lang.Object)@ used in the example does not exist in AQL. You would have to create it yourself.