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();
}
}
Aggregations