TreeItemImpl class
Implementation class for {@link TreeItem}.
class TreeItemImpl { TreeItemImpl() { initializeClonableElements(); } void convertToFullNode(TreeItem item) { if (item._imageHolder == null) { // Extract the Elements from the object dart_html.Element itemTable = Dom.clone(TreeItem._BASE_INTERNAL_ELEM, true); item.getElement().append(itemTable); dart_html.Element tr = Dom.getFirstChild(Dom.getFirstChild(itemTable)); dart_html.Element tdImg = Dom.getFirstChild(tr); dart_html.Element tdContent = tdImg.nextElementSibling; // Undoes padding from table element. item.getElement().style.padding = "0px"; tdContent.append(item._contentElem); item._imageHolder = tdImg; } } /** * Setup clonable elements. */ void initializeClonableElements() { // Create the base table element that will be cloned. TreeItem._BASE_INTERNAL_ELEM = new dart_html.TableElement(); dart_html.Element contentElem = new dart_html.DivElement(); dart_html.Element tbody = (TreeItem._BASE_INTERNAL_ELEM as dart_html.TableElement).createTBody(); dart_html.Element tr = new dart_html.TableRowElement(); dart_html.Element tdImg = new dart_html.TableCellElement(), tdContent = new dart_html.TableCellElement(); TreeItem._BASE_INTERNAL_ELEM.append(tbody); tbody.append(tr); tr.append(tdImg); tr.append(tdContent); tdImg.style.verticalAlign = "middle"; tdContent.style.verticalAlign = "middle"; tdContent.append(contentElem); contentElem.style.display = "inline"; UiObject.setElementStyleName(contentElem, "dwt-TreeItem"); TreeItem._BASE_INTERNAL_ELEM.style.whiteSpace = "nowrap"; // Create the base element that will be cloned TreeItem._BASE_BARE_ELEM = new dart_html.DivElement(); // Simulates padding from table element. TreeItem._BASE_BARE_ELEM.style.padding = "3px"; TreeItem._BASE_BARE_ELEM.append(contentElem); // Roles.getTreeitemRole().set(contentElem); } }
Subclasses
Constructors
Methods
void convertToFullNode(TreeItem item) #
void convertToFullNode(TreeItem item) { if (item._imageHolder == null) { // Extract the Elements from the object dart_html.Element itemTable = Dom.clone(TreeItem._BASE_INTERNAL_ELEM, true); item.getElement().append(itemTable); dart_html.Element tr = Dom.getFirstChild(Dom.getFirstChild(itemTable)); dart_html.Element tdImg = Dom.getFirstChild(tr); dart_html.Element tdContent = tdImg.nextElementSibling; // Undoes padding from table element. item.getElement().style.padding = "0px"; tdContent.append(item._contentElem); item._imageHolder = tdImg; } }
void initializeClonableElements() #
Setup clonable elements.
void initializeClonableElements() { // Create the base table element that will be cloned. TreeItem._BASE_INTERNAL_ELEM = new dart_html.TableElement(); dart_html.Element contentElem = new dart_html.DivElement(); dart_html.Element tbody = (TreeItem._BASE_INTERNAL_ELEM as dart_html.TableElement).createTBody(); dart_html.Element tr = new dart_html.TableRowElement(); dart_html.Element tdImg = new dart_html.TableCellElement(), tdContent = new dart_html.TableCellElement(); TreeItem._BASE_INTERNAL_ELEM.append(tbody); tbody.append(tr); tr.append(tdImg); tr.append(tdContent); tdImg.style.verticalAlign = "middle"; tdContent.style.verticalAlign = "middle"; tdContent.append(contentElem); contentElem.style.display = "inline"; UiObject.setElementStyleName(contentElem, "dwt-TreeItem"); TreeItem._BASE_INTERNAL_ELEM.style.whiteSpace = "nowrap"; // Create the base element that will be cloned TreeItem._BASE_BARE_ELEM = new dart_html.DivElement(); // Simulates padding from table element. TreeItem._BASE_BARE_ELEM.style.padding = "3px"; TreeItem._BASE_BARE_ELEM.append(contentElem); // Roles.getTreeitemRole().set(contentElem); }