Module: 'brixy.ui.components.base'

Methods

(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.

Source:

(static) align (alignment)

The alignment style for current element.

Parameters:
Name Type Description
alignment string | Array.<string>

Alignment style.

Source:

(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.

Source:

(static) button (resourceopt)

Adds new Button element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(static) checkbox (resourceopt)

Adds new Checkbox element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(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)

Source:

(static) column ()

Adds new Group with orientation 'column'.
Container component.

Source:

(static) columnPanel (titleopt)

Adds new Panel with orientation 'column'.
Container component.

Parameters:
Name Type Attributes Description
title string <optional>

Panel title. (optional)

Source:

(static) counter (counter)

Sets builder counter. It helps to identify builder method.

Parameters:
Name Type Description
counter int

Your number.

Source:

(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)

Source:

(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)

Source:

(static) editText (resourceopt)

Adds new EditText element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(static) end ()

Sets the parent container as the current container.

Source:

(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.

Source:

(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)

Source:

(static) group (resourceopt)

Adds new Group element.
Container component.

Parameters:
Name Type Attributes Description
resource string <optional>

Creation properties. (optional)

Source:

(static) iconButton (resourceopt)

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)

Source:

(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.

Source:

(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)

Source:

(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.

Source:

(static) labelFor (id)

Adds a click event listener that activates a target element.

Parameters:
Name Type Description
id string

ID of target element.

Source:

(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)

Source:

(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.

Source:

(static) panel (resourceopt)

Adds new Panel element.
Container component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(static) progressBar (resourceopt)

Adds new Progressbar element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Resource specification. (optional)

Source:

(static) radioButton (resourceopt)

Adds new RadioButton element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(static) row ()

Adds new Group with orientation 'row'.
Container component.

Source:

(static) rowPanel (titleopt)

Adds new Panel with orientation 'row'.
Container component.

Parameters:
Name Type Attributes Description
title string <optional>

Panel title. (optional)

Source:

(static) scrollbar (resourceopt)

Adds new Scrollbar element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Resource specification. (optional)

Source:

(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)

Source:

(static) showWindow (positionopt)

Shows the window.

Parameters:
Name Type Attributes Description
position string <optional>

The window position. Supported only 'center'. (optional)

Throws:
  • Error :

    Exception if Window doesn't exist.

Source:

(static) slider (resourceopt)

Adds new Slider element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Resource specification. (optional)

Source:

(static) stack ()

Adds new Group with orientation 'stack'.
Container component.

Source:

(static) stackPanel (titleopt)

Adds new Panel with orientation 'stack'.
Container component.

Parameters:
Name Type Attributes Description
title string <optional>

Panel title. (optional)

Source:

(static) staticText (resourceopt)

Adds new StaticText element.
Element component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(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.

Source:

(static) tab (resourceopt)

Adds new Tab element.
Container component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(static) tabbedPanel (resourceopt)

Adds new TabbedPanel element.
Container component.

Parameters:
Name Type Attributes Description
resource string <optional>

Text property or resource specification. (optional)

Source:

(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)

Source:

(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.

Source:

(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.

Source: