Constructor

TreeSeparator

new TreeSeparator(config)

A blank separator node in the tree.

Parameter

config

Blockly.tree.BaseNode.Config

The configuration for the tree.

Value must not be null.

Extends
Blockly.tree.TreeNode

Properties

getChildAt

protected

This is re-defined here to indicate to the closure compiler the correct child return type.

Parameter

index

0-based index.

Inherited from
Blockly.tree.BaseNode#getChildAt
Returns

The child at the given index; null if none.

tree

protected

unknown

Inherited from
Blockly.tree.BaseNode#tree

Methods

add

package

add(child)

Appends a node as a child to the current node.

Parameter

child

The child to add.

Inherited from
Blockly.tree.BaseNode#add

addChild

package

addChild(child, opt_render)

Adds the specified component as the last child of this component. See Blockly.Component#addChildAt for detailed semantics.

Parameter

child

The new child component.

opt_render

Optional

If true, the child component will be rendered into the parent.

Inherited from
Blockly.Component#addChild
See also
Blockly.Component#addChildAt

contains

protected

contains(node) returns boolean

Returns true if the node is a descendant of this node

Parameter

node

The node to check.

Inherited from
Blockly.tree.BaseNode#contains
Returns

True if the node is a descendant of this node, false otherwise.

dispose

protected

dispose()

Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal.

Inherited from
Blockly.Component#dispose

forEachChild

protected

forEachChild(f, opt_obj)

Calls the given function on each of this component's children in order. If opt_obj is provided, it will be used as the 'this' object in the function when called. The function should take two arguments: the child component and its 0-based index. The return value is ignored.

Parameter

f

The function to call for every child component; should take 2 arguments (the child and its index).

opt_obj

Optional

Used as the 'this' object in f when called.

Inherited from
Blockly.Component#forEachChild

getBackgroundPosition

protected

getBackgroundPosition() returns string

Inherited from
Blockly.tree.BaseNode#getBackgroundPosition
Returns

The background position style value.

getChild

protected

getChild(id) returns Blockly.Component

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

Parameter

id

Child component ID.

Inherited from
Blockly.Component#getChild
Returns

The child with the given ID; null if none.

getChildCount

protected

getChildCount() returns number

Returns the number of children of this component.

Inherited from
Blockly.Component#getChildCount
Returns

The number of children.

getChildren

package

getChildren() returns Array of non-null Blockly.tree.BaseNode

Returns the children of this node.

Inherited from
Blockly.tree.BaseNode#getChildren
Returns

The children.

getChildrenElement

protected

getChildrenElement() returns Element

Inherited from
Blockly.tree.BaseNode#getChildrenElement
Returns

The div containing the children.

getConfig

protected

getConfig() returns Blockly.tree.BaseNode.Config

Inherited from
Blockly.tree.BaseNode#getConfig
Returns

The configuration for the tree.

getContentElement

protected

getContentElement() returns Element

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.

Inherited from
Blockly.Component#getContentElement
Returns

Element to contain child elements (null if none).

getDepth

protected

getDepth() returns number

Returns the depth of the node in the tree. Should not be overridden.

Inherited from
Blockly.tree.BaseNode#getDepth
Returns

The non-negative depth of this node (the root is zero).

getExpanded

protected

getExpanded() returns boolean

Inherited from
Blockly.tree.BaseNode#getExpanded
Returns

Whether the node is expanded.

getExpandedIconClass

protected

getExpandedIconClass() returns string

Gets the icon class for when the node is expanded.

Inherited from
Blockly.tree.BaseNode#getExpandedIconClass
Returns

The class.

getFirstChild

protected

getFirstChild() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getFirstChild
Returns

The first child of this node.

getIconClass

protected

getIconClass() returns string

Gets the icon class for the node.

Inherited from
Blockly.tree.BaseNode#getIconClass
Returns

s The icon source.

getIconDom

protected

getIconDom() returns Element

Inherited from
Blockly.tree.BaseNode#getIconDom
Returns

The HTML for the icon.

getIconElement

protected

getIconElement() returns Element

Inherited from
Blockly.tree.BaseNode#getIconElement
Returns

The icon element.

getId

package

getId() returns string

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

Inherited from
Blockly.Component#getId
Returns

Unique component ID.

getLabelDom

protected

getLabelDom() returns Element

Inherited from
Blockly.tree.BaseNode#getLabelDom
Returns

The HTML element for the label.

getLabelElement

protected

getLabelElement() returns Element

Inherited from
Blockly.tree.BaseNode#getLabelElement
Returns

The label element.

getLastChild

protected

getLastChild() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getLastChild
Returns

The last child of this node.

getLastShownDescendant

protected

getLastShownDescendant() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getLastShownDescendant
Returns

The last shown descendant.

getNextShownNode

protected

getNextShownNode() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getNextShownNode
Returns

The next node to show or null if there isn't a next node to show.

getNextSibling

protected

getNextSibling() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getNextSibling
Returns

The next sibling of this node.

getParent

protected

getParent() returns Blockly.Component

Returns the component's parent, if any.

Inherited from
Blockly.Component#getParent
Returns

The parent component.

getPreviousShownNode

protected

getPreviousShownNode() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getPreviousShownNode
Returns

The previous node to show.

getPreviousSibling

protected

getPreviousSibling() returns Blockly.tree.BaseNode

Inherited from
Blockly.tree.BaseNode#getPreviousSibling
Returns

The previous sibling of this node.

getRowClassName

protected

getRowClassName() returns string

Inherited from
Blockly.tree.BaseNode#getRowClassName
Returns

The class name for the row.

getRowDom

protected

getRowDom() returns Element

Inherited from
Blockly.tree.BaseNode#getRowDom
Returns

The HTML element for the row.

getRowElement

package

getRowElement() returns Element

Inherited from
Blockly.tree.BaseNode#getRowElement
Returns

The row is the div that is used to draw the node without the children.

getText

package

getText() returns string

Returns the text of the label. If the text was originally set as HTML, the return value is unspecified.

Inherited from
Blockly.tree.BaseNode#getText
Returns

The plain text of the label.

hasChildren

protected

hasChildren() returns boolean

Returns true if the component has children.

Inherited from
Blockly.Component#hasChildren
Returns

True if the component has children.

indexOfChild

protected

indexOfChild(child) returns number

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

Parameter

child

The child component.

Value may be null.

Inherited from
Blockly.Component#indexOfChild
Returns

0-based index of the child component; -1 if not found.

initAccessibility

protected

initAccessibility()

Adds roles and states.

Inherited from
Blockly.tree.BaseNode#initAccessibility

isInDocument

protected

isInDocument() returns boolean

Determines whether the component has been added to the document.

Inherited from
Blockly.Component#isInDocument
Returns

TRUE if rendered. Otherwise, FALSE.

isLastSibling

protected

isLastSibling() returns boolean

Inherited from
Blockly.tree.BaseNode#isLastSibling
Returns

Whether the node is the last sibling.

isRightToLeft

protected

isRightToLeft() returns boolean

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.

Inherited from
Blockly.Component#isRightToLeft
Returns

Whether the control is rendered right-to-left.

isSelected

protected

isSelected() returns boolean

Inherited from
Blockly.tree.BaseNode#isSelected
Returns

Whether the node is selected.

isUserCollapsible

protected

isUserCollapsible() returns boolean

Inherited from
Blockly.tree.BaseNode#isUserCollapsible
Returns

Whether the node is collapsible by user actions.

onSizeChanged

package

onSizeChanged(fn)

Set the handler that's triggered when the size of node has changed.

Parameter

fn

The handler

Inherited from
Blockly.tree.TreeNode#onSizeChanged

render

package

render(opt_parentElement)

Renders the component. If a parent element is supplied, 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.

If this component has a parent component, and the parent component is not in the document already, then this will not call enterDocument on this component.

Throws an Error if the component is already rendered.

Parameter

opt_parentElement

Optional

Optional parent element to render the component into.

Inherited from
Blockly.Component#render

renderBefore

protected

renderBefore(sibling)

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

Throws an Error if the component is already rendered.

Parameter

sibling

Node to render the component before.

Inherited from
Blockly.Component#renderBefore

select

protected

select()

Selects the node.

Inherited from
Blockly.tree.BaseNode#select

selectChild

package

selectChild() returns boolean

Expand the current node if it's not already expanded, or select the child node.

Inherited from
Blockly.tree.BaseNode#selectChild
Returns

True if the action has been handled, false otherwise.

selectFirst

protected

selectFirst()

Selects the first node.

Inherited from
Blockly.tree.BaseNode#selectFirst

selectNext

package

selectNext() returns boolean

Select the next node.

Inherited from
Blockly.tree.BaseNode#selectNext
Returns

True if the action has been handled, false otherwise.

selectParent

package

selectParent() returns boolean

Select the parent node or collapse the current node.

Inherited from
Blockly.tree.BaseNode#selectParent
Returns

True if the action has been handled, false otherwise.

selectPrevious

package

selectPrevious() returns boolean

Select the previous node.

Inherited from
Blockly.tree.BaseNode#selectPrevious
Returns

True if the action has been handled, false otherwise.

setElementInternal

protected

setElementInternal(element)

Sets the component's root element to the given element. Considered protected and final.

This should generally only be called during createDom. Setting the element does not actually change which element is rendered, only the element that is associated with this UI component.

This should only be used by subclasses and its associated renderers.

Parameter

element

Root element for the component.

Inherited from
Blockly.Component#setElementInternal

setExpanded

package

setExpanded(expanded)

Sets the node to be expanded.

Parameter

expanded

Whether to expand or close the node.

Inherited from
Blockly.tree.BaseNode#setExpanded

setExpandedInternal

protected

setExpandedInternal(expanded)

Sets the node to be expanded internally, without state change events.

Parameter

expanded

Whether to expand or close the node.

Inherited from
Blockly.tree.BaseNode#setExpandedInternal

setParent

protected

setParent(parent)

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.

Parameter

parent

The parent component.

Inherited from
Blockly.Component#setParent

setRightToLeft

package

setRightToLeft(rightToLeft)

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

Parameter

rightToLeft

Whether the component is rendered right-to-left.

Inherited from
Blockly.Component#setRightToLeft

setSelectedInternal

protected

setSelectedInternal(selected)

Called from the tree to instruct the node change its selection state.

Parameter

selected

The new selection state.

Inherited from
Blockly.tree.BaseNode#setSelectedInternal

setText

protected

setText(s)

Sets the text of the label.

Parameter

s

The plain text of the label.

Inherited from
Blockly.tree.BaseNode#setText

setTreeInternal

protected

setTreeInternal(tree)

Internal method that is used to set the tree control on the node.

Parameter

tree

The tree control.

Inherited from
Blockly.tree.BaseNode#setTreeInternal

toDom

protected

toDom() returns Element

Creates HTML Element for the node.

Inherited from
Blockly.tree.BaseNode#toDom
Returns

HTML element

toggle

protected

toggle()

Toggles the expanded state of the node.

Inherited from
Blockly.tree.BaseNode#toggle

updateExpandIcon

protected

updateExpandIcon()

Updates the expand icon of the node.

Inherited from
Blockly.tree.BaseNode#updateExpandIcon

updateRow

protected

updateRow()

Updates the row styles.

Inherited from
Blockly.tree.BaseNode#updateRow