Search in sources :

Example 1 with JsUListElement

use of elemental.js.html.JsUListElement in project che by eclipse.

the class TreeNodeElement method updateLeafOffset.

public final void updateLeafOffset(Element parent) {
    if (!parent.hasAttribute("___depth")) {
        return;
    }
    try {
        int depth = Integer.parseInt(parent.getAttribute("___depth"));
        Element expandElement = (Element) getNodeBody().getChildren().item(0);
        expandElement.getStyle().setMarginLeft("" + (depth * 8) + "px");
        if (!hasChildNodes()) {
            return;
        }
        final JsUListElement childrenContainer = getChildrenContainer();
        if (childrenContainer != null) {
            getChildrenContainer().setAttribute("___depth", "" + (depth + 1));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : DivElement(elemental.html.DivElement) Element(elemental.dom.Element) JsLIElement(elemental.js.html.JsLIElement) SpanElement(elemental.html.SpanElement) JsUListElement(elemental.js.html.JsUListElement) JsUListElement(elemental.js.html.JsUListElement)

Aggregations

Element (elemental.dom.Element)1 DivElement (elemental.html.DivElement)1 SpanElement (elemental.html.SpanElement)1 JsLIElement (elemental.js.html.JsLIElement)1 JsUListElement (elemental.js.html.JsUListElement)1