Home

# Class goog.ui.tree.BaseNode

An abstract base class for a node in the tree.

extends goog.ui.Component

Instance Method Summary
| `add(?goog.ui.tree.BaseNode child, ?goog.ui.tree.BaseNode= opt_before) ⇒ ?goog.ui.tree.BaseNode` Adds a node as a child to the current node.
| `addChildAt(?goog.ui.Component child, number index, boolean= opt_render)` The method assumes that the child doesn't have parent node yet. The {@code opt_render} argument is not used. If the parent node is expanded, the child node's state will be the same as the parent's. Otherwise the child's DOM tree won't be created.
| `collapse()` Collapses the node.
| `collapseAll()` Collapses the children and the node.
| `collapseChildren()` Collapses the children of the node.
| `computeDepth_() ⇒ number` Computes the depth of the node in the tree. Called only by getDepth, when the depth hasn't already been cached.
| `contains(?goog.ui.tree.BaseNode node) ⇒ boolean` Returns true if the node is a descendant of this node
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `deselect()` Originally it was intended to deselect the node but never worked.
| `disposeInternal()` Disposes of the component. Calls {@code 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.
| `enterDocument()` 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.
| `exitDocument()` 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.
| `expand()` Expands the node.
| `expandAll()` Expands the children and the node.
| `expandChildren()` Expands the children of the node.
| `getAfterLabelElement() ⇒ ?Element`
| `getAfterLabelHtml() ⇒ string` Returns the html that appears after the label. This is useful if you want to put extra UI on the row of the label but not inside the anchor tag.
| `getCalculatedIconClass()` Gets the calculated icon class.
| `getChildren() ⇒ !Array` Returns the children of this node.
| `getChildrenElement() ⇒ ?Element`
| `getConfig() ⇒ ?Object`
| `getDepth() ⇒ number` Returns the depth of the node in the tree. Should not be overridden.
| `getElement() ⇒ ?Element`
| `getExpandIconClass() ⇒ string`
| `getExpandIconElement() ⇒ ?Element`
| `getExpandIconHtml() ⇒ string`
| `getExpanded() ⇒ boolean`
| `getExpandedIconClass() ⇒ string` Gets the icon class for when the node is expanded.
| `getFirstChild() ⇒ ?goog.ui.tree.BaseNode`
| `getHtml() ⇒ string` Returns the html of the label.
| `getIconClass() ⇒ string` Gets the icon class for the node.
| `getIconElement() ⇒ ?Element`
| `getIconHtml() ⇒ string`
| `getLabelElement() ⇒ ?Element`
| `getLabelHtml() ⇒ string`
| `getLastChild() ⇒ ?goog.ui.tree.BaseNode`
| `getLastShownDescendant() ⇒ ?goog.ui.tree.BaseNode`
| `getLineStyle() ⇒ string`
| `getLineStyle2() ⇒ string`
| `getNextShownNode() ⇒ ?goog.ui.tree.BaseNode`
| `getNextSibling() ⇒ ?goog.ui.tree.BaseNode`
| `getPixelIndent_() ⇒ number`
| `getPreviousShownNode() ⇒ ?goog.ui.tree.BaseNode`
| `getPreviousSibling() ⇒ ?goog.ui.tree.BaseNode`
| `getRowClassName() ⇒ string`
| `getRowElement() ⇒ ?Element`
| `getRowHtml() ⇒ string`
| `getText() ⇒ string` Returns the text of the label. If the text was originally set as HTML, the return value is unspecified.
| `getToolTip() ⇒ ?string` Returns the text of the tooltip.
| `getTree()` Returns the tree.
| `initAccessibility()` Adds roles and states.
| `isLastSibling() ⇒ boolean`
| `isSelected() ⇒ boolean`
| `isUserCollapsible() ⇒ boolean`
| `onDoubleClick_(!goog.events.BrowserEvent e)` Handles a double click event.
| `onKeyDown(!goog.events.BrowserEvent e) ⇒ boolean` Handles a key down event.
| `onKeyPress_(!goog.events.BrowserEvent e)` Handles a key down event.
| `onMouseDown(!goog.events.BrowserEvent e)` Handles mouse down event.
| `onTimeoutSelect_()` Handler for setting focus asynchronously.
| `removeChild((goog.ui.Component|null|string) child, boolean= opt_unrender) ⇒ ?goog.ui.Component` Removes a child. The caller is responsible for disposing the node.
| `reveal()` Expands the parent chain of this node so that it is visible.
| `select()` Selects the node.
| `setAfterLabelHtml(string html)` Sets the html that appears after the label. This is useful if you want to put extra UI on the row of the label but not inside the anchor tag.
| `setDepth_(number depth)` Changes the depth of a node (and all its descendants).
| `setExpanded(boolean expanded)` Sets the node to be expanded.
| `setExpandedIconClass(string s)` Sets the icon class for when the node is expanded.
| `setExpandedInternal(boolean expanded)` Sets the node to be expanded internally, without state change events.
| `setHtml(string s)` Sets the html of the label.
| `setIconClass(string s)` Sets the icon class for the node.
| `setIsUserCollapsible(boolean isCollapsible)` Sets whether the node will allow the user to collapse it.
| `setSelectedInternal(boolean selected)` Called from the tree to instruct the node change its selection state.
| `setText(string s)` Sets the text of the label.
| `setToolTip(string s)` Sets the text of the tooltip.
| `setTreeInternal(?goog.ui.tree.TreeControl tree)` Internal method that is used to set the tree control on the node.
| `toHtml(?goog.string.StringBuffer sb)` Returns the html for the node.
| `toggle()` Toggles the expanded state of the node.
| `updateExpandIcon()` Updates the expand icon of the node.
| `updateIcon_()` Updates the icon of the node. Assumes that this.getElement() is created.
| `updateRow()` Updates the row styles.