Appendix A. Reference

Types of properties/Modifiers

At some places in this introduction we have talked about properties of GUI elements or otherwise. In fact there are several different types of properties. Usually you do not need to worry about this, as you can use common sense to connect any property to any other property. However, internally, there are different types of properties. What this matters for, is when fetching some special values in the JS-template. In getString ("id")/getBoolean ("id")/getList ("id") statements you can also specify some so called modifiers like this: getString ("id.modifier"). This modifier will affect, in which way the value is printed. Read on for the list of properties, and the modifiers they each make available:

String properties

The most simple type of property, used to simply hold a piece of text. Modifiers:

No modifier ("")

The string as defined / set.

quoted

The string in quoted form (suitable for passing to R as character).

Boolean properties

Properties that can either be on or off, true or false. For instance the properties created by <convert>-tags, also the property accompanying a <checkbox> (see below). The following values will be returned according to the given modifier:

No modifier ("")

By default the property will return 1 if it is true, and 0 otherwise. The recommended way to fetch boolean values is using getBoolean(). Note that for getString(), the string "0" will be returned when the property is false. This string would evaluate to true, not to false in JS.

"labeled"

Returns the string "true" when true, "false", when false, or whichever custom strings have been specified (typically in a <checkbox>).

"true"

Return the string as if the property was true, even if it is false

"false"

Return the string as if the property was false, even if it is true

"not"

This actually returns another Boolean property, which is the reverse of the current (i.e. false if true, true if false)

"numeric"

Obsolete, provided for backwards compatibility. Same as no modifier "". Return "1" if the property is true, or "0" if it is false.

Integer properties

A property designed to hold an integer value (but of course it still returns a numeric character string to the JS-template). It does not accept any modifiers. Used in <spinbox>es (see below)

Real number properties

A property designed to hold a real number value (but of course it still returns a numeric character string to the JS-template). Used in <spinbox>es (see below)

No modifier ("")

For getValue() / getString(), this returns the same as "formatted". In future versions, it will be possible to obtain a numeric representation, instead.

"formatted"

Returns the formatted number (as a string).

RObject properties

A property designed a selection of one or more R objects. Used most prominently in varselectors and varslots. The following values will be returned according to the given modifier:

No modifier ("")

By default the property will return the full name of the selected object. If more than one object is selected, the object names will be separated by line breaks ("\n").

"shortname"

Like above, but returns only short name(s) for the object(s). For instance an object inside a list would only be given the name it has inside the list, without the name of the list.

"label"

Like above, but returns the RKWard label(s) of the object(s) (if no label available, this is the same as shortname)

String list properties

This property holds a list of strings.

No modifier ("")

For getValue()/getString(), this returns all strings separated by "\n". Any "\n" characters in each item are escaped as literal "\n". However, the recommended usage is to fetch the value with getList(), instead, which will return an array of strings.

"joined"

Returns the list as a single string, with items joined by "\n". In contrast to no modifier (""), the individual strings are _not_ escaped.

Code properties

A property held by plugins that generated code. This is important for embedding plugins, in order to embed the code generated by the embedded plugin into the code generated by the embedding (top-level) plugin. The following values will be returned according to the given modifier:

No modifier ("")

Returns the full code, i.e. the sections "preprocess", "calculate", "printout", and (but not "preview") concatenated to one string.

"preprocess"

Returns only the preprocess section of the code

"calculate"

Returns only the calculate section of the code

"printout"

Returns only the printout section of the code

"preview"

Returns the preview section of the code