Home Reference Source
public class | source

UIComponent

Extends:

react~React.ComponentEventDispatcher → UIComponent

A Utility class that contains generic functions needed in multiple places.

Static Method Summary

Static Public Methods
public static
public static

Constructor Summary

Public Constructor
public

constructor(propsOrTagName: *, tagName: *, shouldInit: *)

Member Summary

Public Members
public
public

children: *[]

public
public

data: *

This is a getter/setter for the data property.

public

domElement: HTMLElement

The dom element associated with this UIComponent.

public

A list of event listeners that are added to the domElement (these create html dom event listeners as opposed to js only event listeners)

public

Whether or not this control is enabled.

public
public
public
public
public
public
public
public

A flag to store if this object has been marked for invalidation.

public
public

parent: *

public
public

props: *

public

reactElement: ReactElement

The react element associated with this UIComponent.

public

state: *

public

tagName: *

public

toolTip: *

public
public

Whether or not this control is enabled.

public
public

x: *

public

y: *

Method Summary

Public Methods
public

addChild(child: *)

This methods takes another UIComponent object, and adds it to the dom as a child of the domElement of this UIComponent.

public

addChildAt(child: *, idx: *)

This methods takes another UIComponent object, and adds it to the dom as a child of the domElement of this UIComponent.

public

addDomEventListener(evt: *, f: *)

When you call addEventListener on a UIComponent, certain events, defined by the domEvents array are also associated with the corresponding domElement.

public

addEventListener(context: *, type: *, listener: *)

Calls super.addEventListener, and for dom based events, also adds a HTML Event listener

public

attachClass(newClass: *)

public
public
public
public
public
public

detachClass(newClass: *)

public

domEventFired(event: *)

The event handler that gets triggered from the HTML DOM.

public

focus()

public
public

getAttribute(attr: *): *

public
public

getChildAt(idx: *): *

Returns the child of the domElement at the specified index.

public
public
public

getData(): *

This is a getter/setter for the data property.

public

getElementByTagName(tag: *): *

public

getEnabled(): *

Sets the enabled flag

public

getErrorString(val: *): *

public
public
public

getHeight(): *

public
public
public

getIncludeInLayout(val: *): *

public

Getter for the innerHTML property

public
public

getStyleAttribute(attr: *): *

public

getText(): *

Getter for the text property

public
public
public

getVisible(val: *): *

Sets the visible flag

public

getWidth(): *

public

getX(): *

Gets the X co ordinate

public

getY(): *

Gets the Y co ordinate

public

globalToLocal(ptIn: *): flexiciousNmsp.Point

Converts the given global Point to local co-ordinates.

public

initFromProps(props: *)

public

Any initialization code is supposed to go in this method.

public

This method will queue the component so the display list will render it once the current frame of execution is over.

public

kill()

First, calls super.kill(), which takes out all event listeners.

public

localToGlobal(ptIn: *): flexiciousNmsp.Point

Converts the given local Point to global co-ordinates.

public

measureText(textToMeasure: *): {"width": *}

Returns the width of the given text.

public

mergeObjects(obj1: *, obj2: *): *

public

move(x: *, y: *)

Sets the X and Y co ordinates of the current dom element

public

Gets the number of children of the dom element associated with this UIComponent.

public

owns(elem: *): Boolean

Recursively iterates through the parent hierarchy of the given element to check to see if the current node is in its parent hierarchy.

public

ownsPoint(pt: *): boolean

public

removeAllChildren(child: *)

public

removeChild(child: *)

This methods takes another UIComponent object, and removes it from the dom.

public

removeChildAt(idx: *)

This methods takes another UIComponent object, and removes it from the dom.

public
public

removeDomEventListener(evt: *, f: *)

Removes a previously attached DOM event listener.

public

removeEventListener(type: *, listener: *)

Calls super.addEventListener, and for dom based events, also removes the previously added HTML Event listener

public

removeEventListenerKeepDomListener(type: *, listener: *)

Calls super.addEventListener, and for dom based events, also removes the previously added HTML Event listener

public

render(): *

public

setActualSize(w: *, h: *)

public
public

setAttribute(attr: *, val: *)

public
public

setChildIndex(child: *, index: *)

Sets the visible flag

public

setComponentStyleAttribute(attr: *, val: *)

public

setData(val: *)

This is important, because the grid looks for a "setData" method on the renderer.

public

setDomElement(elem: *)

Sets the domElement of this UIComponent to the specified element, and creates a property on the dom element called component to this.

public

setEnabled(val: *)

Sets the enabled flag

public

setErrorString(val: *)

public

setHandCursor(val: *)

public

setHeight(val: *): *

public
public
public
public

setInnerHTML(val: *)

Setter for the innerHTML property

public

setState(newState: *)

public

setStateIfDomPresent(state: *, db: *)

public

setStateInternal(newState: *)

public

setStyleAttribute(attr: *, val: *)

public

setText(val: *)

Setter for the text property

public

setToolTip(val: *)

public
public
public

setVisible(val: *)

Sets the visible flag

public

setWidth(val: *): *

public

setX(val: *): *

Sets the X co ordinate

public

setY(val: *): *

Sets the Y co ordinate

public

updateDisplayList(w: *, h: *)

Called as a part of render phase.

public
public

Inherited Summary

From class EventDispatcher
public

[prop]: *

public
public

A list of event listeners for this event dispatcher object.

public

typeCache: {}

public

addEventListener(context: *, type: *, listener: *)

Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.

public
public

dispatchEvent(event: *): boolean

Dispatches an event into the event flow.

public
public

getStyle(prop: *): *

Gets the value of the prop property on this object

public

Returns true if an event listener exists

public

Returns true if the class name to check is in the list of class names defined for this class.

public

kill()

Removes all event listeners

public

killArray(arr: *)

Given an array of event dispatchers, calls the kill method on each of them.

public

removeEventListener(type: *, listener: *)

Removes a listener from the EventDispatcher object.

public

setStyle(prop: *, val: *)

Sets the value of the prop property on this object

Static Public Methods

public static clearPendingUpdates() source

public static flushPendingUpdates() source

Public Constructors

public constructor(propsOrTagName: *, tagName: *, shouldInit: *) source

Override:

EventDispatcher#constructor

Params:

NameTypeAttributeDescription
propsOrTagName *
tagName *
shouldInit *

Public Members

public childIndex: number source

public children: *[] source

public childrenWithProps: *[] source

public data: * source

This is a getter/setter for the data property. When the cell is created, it belongs to a row The data property points to the item in the grids dataprovider that is being rendered by this cell.

public domElement: HTMLElement source

The dom element associated with this UIComponent.

public domListeners: Array source

A list of event listeners that are added to the domElement (these create html dom event listeners as opposed to js only event listeners)

public enabled: boolean source

Whether or not this control is enabled.

public errorString: * source

public handCursor: * source

public height: number source

public horizontalScrollPolicy: * source

public includeInLayout: boolean source

public initialized: boolean source

public innerHTML: string source

public invalid: Boolean source

A flag to store if this object has been marked for invalidation.

public oldDisplay: * source

public parent: * source

public propertyBag: {} source

public props: * source

public reactElement: ReactElement source

The react element associated with this UIComponent. It will only be initialized in the render method?

public state: * source

public tagName: * source

public toolTip: * source

public verticalScrollPolicy: * source

public visible: boolean source

Whether or not this control is enabled.

public width: number source

public x: * source

public y: * source

Public Methods

public addChild(child: *) source

This methods takes another UIComponent object, and adds it to the dom as a child of the domElement of this UIComponent.

Params:

NameTypeAttributeDescription
child *

Can be either another UIComponent or a DomElement.

public addChildAt(child: *, idx: *) source

This methods takes another UIComponent object, and adds it to the dom as a child of the domElement of this UIComponent.

Params:

NameTypeAttributeDescription
child *

Can be either another UIComponent or a DomElement.

idx *

to add the child at

public addDomEventListener(evt: *, f: *) source

When you call addEventListener on a UIComponent, certain events, defined by the domEvents array are also associated with the corresponding domElement. This method is used to add such event listeners.

Params:

NameTypeAttributeDescription
evt *

Event to add

f *

Event listener to add.

public addEventListener(context: *, type: *, listener: *) source

Calls super.addEventListener, and for dom based events, also adds a HTML Event listener

Override:

EventDispatcher#addEventListener

Params:

NameTypeAttributeDescription
context *
type *
listener *

public attachClass(newClass: *) source

Params:

NameTypeAttributeDescription
newClass *

public componentDidMount() source

public componentWillMount() source

public componentWillReceiveProps(nextProps: *) source

Params:

NameTypeAttributeDescription
nextProps *

public componentWillUnmount() source

public componentWillUpdate() source

public detachClass(newClass: *) source

Params:

NameTypeAttributeDescription
newClass *

public domEventFired(event: *) source

The event handler that gets triggered from the HTML DOM.

Params:

NameTypeAttributeDescription
event *

Event from the HTML DOM.

public focus() source

public getAllChildren(): * source

Return:

*

public getAttribute(attr: *): * source

Params:

NameTypeAttributeDescription
attr *

Return:

*

public getAutomationName(): * source

Return:

*

public getChildAt(idx: *): * source

Returns the child of the domElement at the specified index.

Params:

NameTypeAttributeDescription
idx *

Return:

*

public getClassNames(): string[] source

Override:

EventDispatcher#getClassNames

Return:

string[]

public getComponentStyleAttribute(attr: *): * source

Params:

NameTypeAttributeDescription
attr *

Return:

*

public getData(): * source

This is a getter/setter for the data property. When the cell is created, it belongs to a row The data property points to the item in the grids dataprovider that is being rendered by this cell.

Return:

*

public getElementByTagName(tag: *): * source

Params:

NameTypeAttributeDescription
tag *

Return:

*

public getEnabled(): * source

Sets the enabled flag

Return:

*

public getErrorString(val: *): * source

Params:

NameTypeAttributeDescription
val *

Return:

*

public getHandCursor(): * source

Return:

*

public getHandCursor(): * source

Return:

*

public getHeight(): * source

Return:

*

public getHorizontalScrollPolicy(): * source

Return:

*

public getHorizontalScrollPosition(): * source

Return:

*

public getIncludeInLayout(val: *): * source

Params:

NameTypeAttributeDescription
val *

Return:

*

public getInnerHTML(): * source

Getter for the innerHTML property

Return:

*

public getPixelHeight(): * source

Return:

*

public getStyleAttribute(attr: *): * source

Params:

NameTypeAttributeDescription
attr *

Return:

*

public getText(): * source

Getter for the text property

Return:

*

public getVerticalScrollPolicy(): * source

Return:

*

public getVerticalScrollPosition(): * source

Return:

*

public getVisible(val: *): * source

Sets the visible flag

Params:

NameTypeAttributeDescription
val *

Return:

*

public getWidth(): * source

Return:

*

public getX(): * source

Gets the X co ordinate

Return:

*

public getY(): * source

Gets the Y co ordinate

Return:

*

public globalToLocal(ptIn: *): flexiciousNmsp.Point source

Converts the given global Point to local co-ordinates.

Params:

NameTypeAttributeDescription
ptIn *

{flexiciousNmsp.Point}

Return:

flexiciousNmsp.Point

public initFromProps(props: *) source

Params:

NameTypeAttributeDescription
props *

public initialize() source

Any initialization code is supposed to go in this method.

public invalidateDisplayList() source

This method will queue the component so the display list will render it once the current frame of execution is over.

public kill() source

First, calls super.kill(), which takes out all event listeners. Then, removes all the dom event listeners that we add. Then, wipes out the reference on the domElement. Then, wipes out the domElement reference. Finally, removes itself from the display list if its pending validation.

Override:

EventDispatcher#kill

public localToGlobal(ptIn: *): flexiciousNmsp.Point source

Converts the given local Point to global co-ordinates.

Params:

NameTypeAttributeDescription
ptIn *

{flexiciousNmsp.Point}

Return:

flexiciousNmsp.Point

public measureText(textToMeasure: *): {"width": *} source

Returns the width of the given text.

Params:

NameTypeAttributeDescription
textToMeasure *

Return:

{"width": *}

public mergeObjects(obj1: *, obj2: *): * source

Params:

NameTypeAttributeDescription
obj1 *
obj2 *

Return:

*

public move(x: *, y: *) source

Sets the X and Y co ordinates of the current dom element

Params:

NameTypeAttributeDescription
x *
y *

public numChildren(): * source

Gets the number of children of the dom element associated with this UIComponent.

Return:

*

public owns(elem: *): Boolean source

Recursively iterates through the parent hierarchy of the given element to check to see if the current node is in its parent hierarchy.

Params:

NameTypeAttributeDescription
elem *

The element to check

Return:

Boolean

If the current node is in the hierarchy of the given element

public ownsPoint(pt: *): boolean source

Params:

NameTypeAttributeDescription
pt *

Return:

boolean

public removeAllChildren(child: *) source

Params:

NameTypeAttributeDescription
child *

public removeChild(child: *) source

This methods takes another UIComponent object, and removes it from the dom.

Params:

NameTypeAttributeDescription
child *

Can be either another UIComponent or a DomElement.

public removeChildAt(idx: *) source

This methods takes another UIComponent object, and removes it from the dom.

Params:

NameTypeAttributeDescription
idx *

public removeComponentAttribute(attr: *) source

Params:

NameTypeAttributeDescription
attr *

public removeDomEventListener(evt: *, f: *) source

Removes a previously attached DOM event listener.

Params:

NameTypeAttributeDescription
evt *

Event to add

f *

Event listener to add.

public removeEventListener(type: *, listener: *) source

Calls super.addEventListener, and for dom based events, also removes the previously added HTML Event listener

Override:

EventDispatcher#removeEventListener

Params:

NameTypeAttributeDescription
type *
listener *

public removeEventListenerKeepDomListener(type: *, listener: *) source

Calls super.addEventListener, and for dom based events, also removes the previously added HTML Event listener

Params:

NameTypeAttributeDescription
type *
listener *

public render(): * source

Return:

*

public setActualSize(w: *, h: *) source

Params:

NameTypeAttributeDescription
w *
h *

public setActualSizeFromDomElement() source

public setAttribute(attr: *, val: *) source

Params:

NameTypeAttributeDescription
attr *
val *

public setAutomationName(val: *) source

Params:

NameTypeAttributeDescription
val *

public setChildIndex(child: *, index: *) source

Sets the visible flag

Params:

NameTypeAttributeDescription
child *
index *

public setComponentStyleAttribute(attr: *, val: *) source

Params:

NameTypeAttributeDescription
attr *
val *

public setData(val: *) source

This is important, because the grid looks for a "setData" method on the renderer.

Params:

NameTypeAttributeDescription
val *

public setDomElement(elem: *) source

Sets the domElement of this UIComponent to the specified element, and creates a property on the dom element called component to this.

Params:

NameTypeAttributeDescription
elem *

The domElement to associate with the current UIComponent.

public setEnabled(val: *) source

Sets the enabled flag

Params:

NameTypeAttributeDescription
val *

public setErrorString(val: *) source

Params:

NameTypeAttributeDescription
val *

public setHandCursor(val: *) source

Params:

NameTypeAttributeDescription
val *

public setHeight(val: *): * source

Params:

NameTypeAttributeDescription
val *

Return:

*

public setHorizontalScrollPolicy(policy: *) source

Params:

NameTypeAttributeDescription
policy *

public setHorizontalScrollPosition(val: *): * source

Params:

NameTypeAttributeDescription
val *

Return:

*

public setIncludeInLayout(val: *) source

Params:

NameTypeAttributeDescription
val *

public setInnerHTML(val: *) source

Setter for the innerHTML property

Params:

NameTypeAttributeDescription
val *

public setState(newState: *) source

Params:

NameTypeAttributeDescription
newState *

public setStateIfDomPresent(state: *, db: *) source

Params:

NameTypeAttributeDescription
state *
db *

public setStateInternal(newState: *) source

Params:

NameTypeAttributeDescription
newState *

public setStyleAttribute(attr: *, val: *) source

Params:

NameTypeAttributeDescription
attr *
val *

public setText(val: *) source

Setter for the text property

Params:

NameTypeAttributeDescription
val *

public setToolTip(val: *) source

Params:

NameTypeAttributeDescription
val *

public setVerticalScrollPolicy(policy: *) source

Params:

NameTypeAttributeDescription
policy *

public setVerticalScrollPosition(val: *): * source

Params:

NameTypeAttributeDescription
val *

Return:

*

public setVisible(val: *) source

Sets the visible flag

Params:

NameTypeAttributeDescription
val *

public setWidth(val: *): * source

Params:

NameTypeAttributeDescription
val *

Return:

*

public setX(val: *): * source

Sets the X co ordinate

Params:

NameTypeAttributeDescription
val *

Return:

*

public setY(val: *): * source

Sets the Y co ordinate

Params:

NameTypeAttributeDescription
val *

Return:

*

public updateDisplayList(w: *, h: *) source

Called as a part of render phase.

Params:

NameTypeAttributeDescription
w *
h *

public validateNow() source

public validateNowIfValid() source