Class type Goog.​Ui.​component

class type component = object..end

Inherits


method canDecorate : 
'a. (#Dom_html.element as 'a) Js.t -> bool Js.t Js.meth

Determines if a given element can be decorated by this type of component. This method should be overridden by inheriting objects. Returns True if the element can be decorated, false otherwise.

method createDom : unit Js.meth

Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.

method decorate : 'b. (#Dom_html.element as 'b) Js.t -> unit Js.meth

Decorates the element for the component.

method disposeInternal : unit Js.meth

Disposes of the component. Calls exitDocument, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.

method enterDocument : unit Js.meth

Called when the component's element is known to be in the document. Anything using document.getElementById etc. should be done at this stage.

If the component contains child components, this call is propagated to its children.

method exitDocument : unit Js.meth

Called by dispose to clean up the elements and listeners created by a component, or by a parent component/application who has removed the component from the document but wants to reuse it later.

If the component contains child components, this call is propagated to its children.

It should be possible for the component to be rendered again once this method has been called.

method getChild : Js.js_string Js.t -> component Js.t Js.opt Js.meth

Returns the child with the given ID, or null if no such child exists.

method getChildAt : int -> component Js.t Js.opt Js.meth

Returns the child at the given index, or null if the index is out of bounds.

method getChildCount : int Js.meth

Returns the number of children of this component. Returns The number of children.

method getChildIds : Js.js_string Js.t Js.js_array Js.t Js.meth

Returns an array containing the IDs of the children of this component, or an empty array if the component has no children. Returns Child component IDs.

method getContentElement : Dom_html.element Js.t Js.meth

Returns the DOM element into which child components are to be rendered, or null if the component itself hasn't been rendered yet. This default implementation returns the component's root element. Subclasses with complex DOM structures must override this method. Returns Element to contain child elements (null if none).

method getDomHelper : Goog.Gdom.domHelper Js.t Js.meth

Returns the dom helper that is being used on this component. Returns The dom helper used on this component.

method getElement : Dom_html.element Js.t Js.meth

Gets the component's element.

method getElementByFragment : 
Js.js_string Js.t -> Dom_html.element Js.t Js.meth

Helper function for returning an element in the document with a unique id generated using makeId(). Returns The element with the unique id, or null if it cannot be found.

method getFragmentFromId : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Helper function for returning the fragment portion of an id generated using makeId(). Returns Fragment.

method getId : Js.js_string Js.t Js.meth

Gets the unique ID for the instance of this component. If the instance doesn't already have an ID, generates one on the fly. Returns Unique component ID.

method getParent : component Js.t Js.opt Js.meth

Returns the component's parent, if any.

method hasChildren : bool Js.t Js.meth

Returns true if the component has children. Returns True if the component has children.

method indexOfChild : component Js.t Js.opt -> int Js.meth

Returns the 0-based index of the given child component, or -1 if no such child is found. Returns 0-based index of the child component; -1 if not found.

method isInDocument : bool Js.t Js.meth

Determines whether the component has been added to the document. Returns TRUE if rendered. Otherwise, FALSE.

method isRightToLeft : bool Js.t Js.meth

Returns true if the component is rendered right-to-left, false otherwise. The first time this function is invoked, the right-to-left rendering property is set if it has not been already. Returns Whether the control is rendered right-to-left.

method makeId : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Helper function for subclasses that gets a unique id for a given fragment, this can be used by components to generate unique string ids for DOM elements Returns Unique element id.

method removeChildAt : int -> bool Js.t Js.opt -> component Js.t Js.meth

Removes the child at the given index from this component, and returns it. Throws an error if the argument is out of bounds, or if the specified child isn't found in the parent. See goog.ui.Component#removeChild for detailed semantics. Returns The removed component, if any.

method removeChildren : bool Js.t Js.opt -> unit Js.meth

Removes every child component attached to this one.

method render : 'c. (#Dom_html.element as 'c) Js.t Js.opt -> unit Js.meth

Renders the component. If a parent element is supplied, it should already be in the document and then the component's element will be appended to it. If there is no optional parent element and the element doesn't have a parentNode then it will be appended to the document body. Throws an Error if the component is already rendered.

method renderBefore : 'd. (#Dom_html.element as 'd) Js.t -> unit Js.meth

Renders the component before another element. The other element should be in the document already.

Throws an Error if the component is already rendered.

method setId : Js.js_string Js.t -> unit Js.meth

Assigns an ID to this component instance. It is the caller's responsibility to guarantee that the ID is unique. If the component is a child of a parent component, then the parent component's child index is updated to reflect the new ID; this may throw an error if the parent already has a child with an ID that conflicts with the new ID.

method setParent : component Js.t -> unit Js.meth

Sets the parent of this component to use for event bubbling. Throws an error if the component already has a parent or if an attempt is made to add a component to itself as a child. Callers must use removeChild or removeChildAt to remove components from their containers before calling this method.

method setParentEventTarget : 
Goog.Events.eventTarget Js.t Js.opt -> unit Js.meth

Overrides goog.events.EventTarget#setParentEventTarget to throw an error if the parent component is set, and the argument is not the parent.

method setRightToLeft : bool Js.t -> unit Js.meth

Set is right-to-left. This function should be used if the component needs to know the rendering direction during dom creation (i.e. before enterDocument is called and is right-to-left is set).

method wasDecorated : bool Js.t Js.meth

Returns Whether the component was decorated.