(static) addEventListener (eventName, callback, capturePhase)
Registers an event listener to the current element.
Parameters:
Name |
Type |
Description |
eventName |
string
|
Event name. |
callback |
function
|
Event handler. |
capturePhase |
boolean
|
When true, the handler is called only in the capturing phase of the event propagation. Default is false. (optional) |
Throws:
-
Error
:
Exception if callback is not a function.
|
(static) align (alignment)
The alignment style for current element.
Parameters:
Name |
Type |
Description |
alignment |
string
|
Array.<string>
|
Alignment style. |
|
(static) alignChildren (alignment)
The alignment style for children elements.
Parameters:
Name |
Type |
Description |
alignment |
String
|
Array.<string>
|
Alignment style. |
Throws:
-
Error
:
Exception if element doesn't support alignChildren property.
|
Adds new Button element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) checkbox (resourceopt)
Adds new Checkbox element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) closeOnClick (validateopt, resultopt)
Adds onClick event that closes a window with the result code.
If validate is true, it runs a builder validate() method. Window remains open if validation failed.
Parameters:
Name |
Type |
Attributes |
Description |
validate |
boolean
|
<optional>
|
Validate the controls before closing. |
result |
int
|
<optional>
|
Code returned by window. (optional) |
|
(static) column ()
Adds new Group with orientation 'column'. Container component.
|
(static) columnPanel (titleopt)
Adds new Panel with orientation 'column'. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
title |
string
|
<optional>
|
Panel title. (optional) |
|
(static) counter (counter)
Sets builder counter. It helps to identify builder method.
Parameters:
Name |
Type |
Description |
counter |
int
|
Your number. |
|
(static) doubleAmps (propertyopt)
Doubles ampersands.
ScriptUI fields use ampersand to marking a shortcut character.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
property |
string
|
<optional>
|
'text'
|
Property name. (optional) |
|
(static) dropDownList (resourceopt)
Adds new DropDownList element. Specify items as the array parameter or use item() for adding further items. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
Array
|
string
|
<optional>
|
Array of items or resource specification. (optional) |
|
(static) editText (resourceopt)
Adds new EditText element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) end ()
Sets the parent container as the current container.
|
(static) execute (callback)
Immediately executes the callback method.
Parameters:
Name |
Type |
Attributes |
Description |
callback |
function
|
|
Custom method (.execute(callback, par1, par2)). Keyword 'this' references the builder. |
pars, ... |
*
|
<optional>
<repeatable>
|
Additional parameters will be passed to callback method. (optional) |
Throws:
-
Error
:
Exception if callback is not a function.
|
(static) flashPlayer (resourceopt, fileopt)
Adds new FlashPlayer element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
File
|
<optional>
|
Resource string or file path or File to load. (optional) |
file |
string
|
File
|
<optional>
|
File path or File to load. (optional) |
|
(static) group (resourceopt)
Adds new Group element. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Creation properties. (optional) |
|
Adds new IconButton element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
File
|
Array.<string>
|
ScriptUIImage
|
<optional>
|
IconButton resource string or image path or Array|ScriptUIImage of the 4-state button images. (optional) |
|
(static) id (id)
Saves the current element into SuiBuilder's repository.
Parameters:
Name |
Type |
Description |
id |
string
|
ID of this element. |
Throws:
-
Error
:
Exception on error.
|
(static) image (resourceopt)
Adds new Image element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
File
|
ScriptUIImage
|
<optional>
|
Image resource string or image file|path. (optional) |
|
(static) item (text, indexopt)
Adds new item to the ListBox, DropDownList or TreeView. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
text |
string
|
Array.<string>
|
|
Text of this item or array of strings for the columns of multicolumn ListBox row. |
index |
int
|
<optional>
|
The index of this item in the list of items. (optional) |
Throws:
-
Error
:
Exception if element doesn't have 'items' property.
-
Error
:
Exception if ListBox doesn't have enough columns.
|
(static) labelFor (id)
Adds a click event listener that activates a target element.
Parameters:
Name |
Type |
Description |
id |
string
|
ID of target element. |
|
(static) listBox (resourceopt)
Adds new ListBox. Specify lines as the array parameter or use item() for adding further lines. In case of multiline ListBox specify the column titles as the array parameter. Use item() for adding new line. Use subItem() for setting of the item cell. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
Array.<string>
|
<optional>
|
Resource string or array of lines or array of column titles for the multicolumn ListBox. (optional) |
|
(static) nodeItem (text, indexopt)
Adds new node item into the TreeView. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
text |
string
|
|
Text of this item. |
index |
int
|
<optional>
|
The index of this node in the list of items (optional) |
Throws:
-
Error
:
Exception if element doesn't have 'items' property.
|
(static) panel (resourceopt)
Adds new Panel element. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) progressBar (resourceopt)
Adds new Progressbar element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Resource specification. (optional) |
|
Adds new RadioButton element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) row ()
Adds new Group with orientation 'row'. Container component.
|
(static) rowPanel (titleopt)
Adds new Panel with orientation 'row'. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
title |
string
|
<optional>
|
Panel title. (optional) |
|
Adds new Scrollbar element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Resource specification. (optional) |
|
(static) set (property, valueopt)
Sets the property/properties of the current element.
Does not check if this property exists in the element.
Parameters:
Name |
Type |
Attributes |
Description |
property |
string
|
Object
|
|
Property name or Object of the property name-value pairs. |
value |
*
|
<optional>
|
Ignored if property is Object. (optional) |
|
(static) showWindow (positionopt)
Parameters:
Name |
Type |
Attributes |
Description |
position |
string
|
<optional>
|
The window position. Supported only 'center'. (optional) |
Throws:
-
Error
:
Exception if Window doesn't exist.
|
(static) slider (resourceopt)
Adds new Slider element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Resource specification. (optional) |
|
(static) stack ()
Adds new Group with orientation 'stack'. Container component.
|
(static) stackPanel (titleopt)
Adds new Panel with orientation 'stack'. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
title |
string
|
<optional>
|
Panel title. (optional) |
|
(static) staticText (resourceopt)
Adds new StaticText element. Element component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) subItem (index, text, imageopt)
Sets the subitem of the multicolumn ListBox item.
Parameters:
Name |
Type |
Attributes |
Description |
index |
int
|
|
Index of the subitem. Note: subitem[0] is the second item of the ScriptUI ListBox row. |
text |
string
|
|
Text of this subitem. |
image |
string
|
File
|
ScriptUIImage
|
<optional>
|
Image of this subitem. (optional) |
Throws:
-
Error
:
Exception if element doesn't have 'item' property.
|
(static) tab (resourceopt)
Adds new Tab element. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) tabbedPanel (resourceopt)
Adds new TabbedPanel element. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
string
|
<optional>
|
Text property or resource specification. (optional) |
|
(static) treeView (resourceopt)
Adds new TreeView element. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
resource |
Array
|
string
|
<optional>
|
Array of items or resource specification. (optional) |
|
(static) validator (callback)
Sets the validation method on the current element.
Parameters:
Name |
Type |
Attributes |
Description |
callback |
string
|
function
|
|
Validator method. |
args, ... |
*
|
<optional>
<repeatable>
|
Additional arguments will be passed to the callback method. (optional) |
Throws:
-
Error
:
Exception if a validator cannot be set.
|
(static) window (type, titleopt, boundsopt, propertiesopt)
Creates new window with the standard ScriptUI Window parameters.
Window is the base element and it is only a single Window element in each SuiBuilder instance. Container component.
Parameters:
Name |
Type |
Attributes |
Description |
type |
string
|
|
Window type: 'window'|'palette'|'dialog'. |
title |
string
|
<optional>
|
Window title. (optional) |
bounds |
Bounds
|
<optional>
|
Position and size of the window. (optional) |
properties |
Object
|
<optional>
|
Creation-only properties. (optional) |
Throws:
-
Error
:
Exception if Window is not the first element in this builder.
|