Search in sources :

Example 1 with Treecell

use of org.zkoss.zul.Treecell in project spatial-portal by AtlasOfLivingAustralia.

the class PortalEvent method getTarget.

/**
     * Get the treeItem marked as target in the event
     *
     * @param event
     * @return
     */
protected Treeitem getTarget(Event event) {
    Treecell treecell = (Treecell) event.getTarget();
    Treerow treerow;
    Treeitem target = null;
    if (treecell != null) {
        treerow = (Treerow) treecell.getParent();
        if (treerow != null) {
            target = (Treeitem) treerow.getParent();
        }
    }
    return target;
}
Also used : Treecell(org.zkoss.zul.Treecell) Treeitem(org.zkoss.zul.Treeitem) Treerow(org.zkoss.zul.Treerow)

Example 2 with Treecell

use of org.zkoss.zul.Treecell in project adempiere by adempiere.

the class SimpleTreeModel method render.

/**
	 * @param ti
	 * @param node
	 */
public void render(Treeitem ti, Object node, int index) {
    Treecell tc = new Treecell(Objects.toString(node));
    Treerow tr = null;
    if (ti.getTreerow() == null) {
        tr = new Treerow();
        tr.setParent(ti);
        if (isItemDraggable()) {
            tr.setDraggable("true");
        }
        if (!onDropListners.isEmpty()) {
            tr.setDroppable("true");
            tr.addEventListener(Events.ON_DROP, this);
        }
    } else {
        tr = ti.getTreerow();
        tr.getChildren().clear();
    }
    tc.setParent(tr);
    ti.setValue(node);
}
Also used : Treecell(org.zkoss.zul.Treecell) Treerow(org.zkoss.zul.Treerow)

Aggregations

Treecell (org.zkoss.zul.Treecell)2 Treerow (org.zkoss.zul.Treerow)2 Treeitem (org.zkoss.zul.Treeitem)1