private HandlerManager textDoubleClickHandlerManager;
public SimpleTree() {
setElement(Document.get().createDivElement());
Style style = getElement().getStyle();
style.setProperty("whiteSpace", "nowrap");
style.setPadding(3, Unit.PX);
style.setPaddingLeft(12, Unit.PX);
// handle styling
style = handle.getStyle();
style.setDisplay(Display.NONE);
style.setTextAlign(TextAlign.CENTER);
style.setWidth(0.5, Unit.EM);
style.setHeight(0.5, Unit.EM);
style.setCursor(Cursor.POINTER);
style.setBackgroundColor("gray");
style.setColor("white");
style.setPadding(4, Unit.PX);
style.setMarginRight(3, Unit.PX);
style.setLineHeight(0.5, Unit.EM);
handle.setInnerHTML("+");
getElement().appendChild(handle);
getElement().appendChild(text);
// children styling
style = children.getStyle();
style.setPaddingLeft(1.5, Unit.EM);
style.setDisplay(Display.NONE);
getElement().appendChild(children);
addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {