class WidgetBase view source

Base class for widgets.

Constructor

new WidgetBase(opts : Object)

Parameters

opts Object instantiation options
opts.appHash number internal app hash
opts.appWidget ApplicationWidget early ApplicationWidget link
opts.auiTag number internal aui tag id
opts.inTable boolean internal is in table
opts.inMatrix boolean internal is in matrix
opts.inFirstTableRow boolean internal
opts.inScrollGrid boolean internal is in a scroll grid
opts.ignoreLayout boolean ignore layout char measurer
Instance members

addClass(className : string)

Add the given class to element

Parameters

className string class to add

detach()

Detach the widget from the dom

emit(type : string, arguments… : any)
[inherits from EventListener]

Emit an event

Parameters

type string event type to emit
arguments any arguments (excluding type) will be set in event.data

getApplicationIdentifier() : (string)

Get the unique identifier of the application

Returns

(string) the unique identifier of the application

getApplicationWidget() : (ApplicationWidget)

Get Application Widget related to the widget

Returns

(ApplicationWidget) ApplicationWidget

getBuildParameters() : (Object)

Returns build parameters

Returns

(Object) build parameters

getClassName() : (string)

Get the main class name of the widget

Returns

(string) the main class name

getDialogType() : (string)

return widget current dialog type

Returns

(string) values can be : Input, InputArray, Display, DisplayArray or Construct

getElement() : (HTMLElement)

Get the root element of the widget

Returns

(HTMLElement) the root element of the widget

getEnd() : (string)

Get end (for reversed mode)

Returns

(string) end keyword for rtl

getFormWidget() : (FormWidget)

Get the Form Widget related to the widget

Returns

(FormWidget) FormWidget

getLayoutEngine() : (LayoutEngineBase)

Get the widget's layout engine

Returns

(LayoutEngineBase) the widget's layout engine

getLayoutInformation() : (LayoutInformation)

Get the widget's layout information

Returns

(LayoutInformation) the widget's layout information

getName() : (string)

Get the name of the widget class

Returns

(string) the widget class name

getParentWidget(type : any) : (WidgetGroupBase)

Get the parent widget

Parameters

type any class name to look for

Returns

(WidgetGroupBase) the parent widget

getStart() : (string)

Get start (for reversed mode)

Returns

(string) start keyword for rtl

getStretchableScrollGridWidgetBase() : (StretchableScrollGridWidgetBase)

Get the stretchable scrollgrid Widget base class related to the widget

Returns

(StretchableScrollGridWidgetBase) StretchableScrollGridWidgetBase

getStyle(selector : string, property : string, appliesOnRoot : boolean) : (any)

Get widget style property value

Parameters

selector string additional sub selector
property string property name
appliesOnRoot boolean true if the returned selector should match the root too.

Returns

(any) property value if set, undefined otherwise

getTableWidgetBase() : (TableWidgetBase)

Get the table Widget base class related to the widget

Returns

(TableWidgetBase) TableWidgetBase

getTitle() : (string)

Get the title of the widget

Returns

(string) the tooltip text

getUniqueIdentifier() : (string)

Get the unique identifier of the widget

Returns

(string) the unique identifier of the widget

getUserInterfaceWidget() : (UserInterfaceWidget)

Get the UI widget related to the widget

Returns

(UserInterfaceWidget) UserInterfaceWidget

getWindowWidget() : (WindowWidget)

Get the Window Widget related to the widget

Returns

(WindowWidget) WindowWidget

hasClass(className : string)

Checks if the widget element has the given class

Parameters

className string class to check

hasFocus() : (boolean)

Check if widget node has focus (class gbc_Focus)

Returns

(boolean) true if widget node has focus

hasVMFocus() : (boolean)

Check if widget node has VM focus

Returns

(boolean) true if widget node has VM focus

ignoreLayout() : (boolean)

Does the widget ignore layouting

Returns

(boolean) true if the widget ignore all layout.

isChildOf(parent : WidgetBase) : (boolean)

Check if this widget is a child of a given one

Parameters

parent WidgetBase the reference parent widget

Returns

(boolean) true if is a child, false otherwise

isDestroyed() : (boolean)
[inherits from EventListener]

Returns if the node is destroyed

Returns

(boolean) true if node is destroyed

isEnabled() : (boolean)

Check if widget is enabled

Returns

(boolean) true if the widget allows user interaction, false otherwise.

isFocusable() : (boolean)

Returns if the widget is focusable

Returns

(boolean) State of focusable

isHidden() : (boolean)

Check if the widget is hidden

Returns

(boolean) true if the widget is hidden, false otherwise

isInMatrix() : (boolean)

Check if the widget is in a matrix

Returns

(boolean) true if the widget is in a matrix, false otherwise.

isInScrollGrid(scrollGrid : StretchableScrollGridWidgetBase) : (boolean)

Check if the widget is in a scrollGrid

Parameters

scrollGrid StretchableScrollGridWidgetBase specific scrollGrid, if null just return if widget is in any scrollGrid

Returns

(boolean) true if the widget is in a table, false otherwise.

isInTable(table : TableWidgetBase) : (boolean)

Check if the widget is in a table

Parameters

table TableWidgetBase specific table, if null just return if widget is in any table

Returns

(boolean) true if the widget is in a table, false otherwise.

isNoBorder() : (boolean)

Check if the widget is displayed without border

Returns

(boolean) true if the widget has no border class, false otherwise

isReversed() : (boolean)

Check if arabic mode is enabled

Returns

(boolean) true if enabled

isVisible() : (boolean)

Check if the widget is visible

Returns

(boolean) true if visible, false otherwise

loseFocus()

Called before setFocus to notify previous focused widget

loseVMFocus(vmNewFocusedWidget : WidgetBase)

Called before setting VM focus to notify previous VM focused widget

Parameters

vmNewFocusedWidget WidgetBase new widget which get the focus

removeClass(className : string)

Remove the given class from element

Parameters

className string class to delete

replaceWith(widget : WidgetBase)

Replace the current widget with a given one

Parameters

widget WidgetBase the new widget

setDialogType(dialogType : string)

Set widget current dialog type. Can be Input, Input Array, Display, Display Array or Construct

Parameters

dialogType string Dialog type

setEnabled(enabled : boolean)

Defines the enabled status of the widget

Parameters

enabled boolean true if the widget allows user interaction, false otherwise.

setFocus(fromMouse : boolean, stayOnSameWidget : boolean)

Called when widget obtains the focus

Parameters

fromMouse boolean true if focus comes from mouse event
stayOnSameWidget boolean true if we want to set the focus to the current focused widget

setFocusable(focusable : boolean)

Defines if the widget is focusable

Parameters

focusable boolean State of focusable

setHidden(hidden : boolean)

Defines if the widget should be hidden or not

Parameters

hidden boolean true if the widget is hidden, false otherwise

setNoBorder(noBorder : boolean)

Remove or add borders to the widget

Parameters

noBorder boolean true if the widget has no border class, false otherwise

setParentWidget(widget : WidgetGroupBase, options : Object)

Defines the parent widget

Parameters

widget WidgetGroupBase the widget to use as parent
options Object possible options
options.noLayoutInvalidation boolean won't affect parent layout

setReverse(rtl : boolean)

Set Arabic mode

Parameters

rtl boolean true if widget is right to left

setStyle(selector : string|Object, style : Object)

Updates widget style with new rules

Parameters

selector string|Object additional sub selector
style Object style properties to set

setTitle(title : string)

Set the title of the widget

Parameters

title string the tooltip text

toggleClass(className : string, className2 : string|boolean, switcher : boolean)

Toggle the given class to element

Parameters

className string class to toggle
className2 string|boolean class added if switcher is false
switcher boolean forced new state

translate()

Translate the widget

when(type : string, handler : Hook, once : boolean) : (HandleRegistration)
[inherits from EventListener]

Registers a handler for this event type

Parameters

type string event type (e.g. "attribute changed")
handler Hook handler to trigger when the event type is emitted
once boolean if true, will only fire once

Returns

(HandleRegistration) a registration handle (for unbind purpose)