Search in sources :

Example 26 with Treeitem

use of org.zkoss.zul.Treeitem in project collect by openforis.

the class SchemaVM method getTreeItem.

// TODO move it to tree model class
private Treeitem getTreeItem(SurveyObject item) {
    for (Treeitem treeItem : nodesTree.getItems()) {
        SchemaTreeNode node = treeItem.getValue();
        SchemaNodeData data = node.getData();
        SurveyObject itemSO = data.getSurveyObject();
        if (itemSO == item) {
            return treeItem;
        }
    }
    return null;
}
Also used : Treeitem(org.zkoss.zul.Treeitem) SchemaTreeNode(org.openforis.collect.designer.component.SchemaTreeModel.SchemaTreeNode) SurveyObject(org.openforis.idm.metamodel.SurveyObject) SchemaNodeData(org.openforis.collect.designer.component.SchemaTreeModel.SchemaNodeData)

Example 27 with Treeitem

use of org.zkoss.zul.Treeitem in project collect by openforis.

the class SchemaVM method refreshSelectedTreeNode.

protected void refreshSelectedTreeNode(Component view) {
    Treeitem selectedItem = nodesTree.getSelectedItem();
    SchemaTreeNode treeNode = selectedItem.getValue();
    SchemaNodeData data = treeNode.getData();
    // update context menu
    Menupopup popupMenu = getPopupMenu(data);
    selectedItem.setContext(popupMenu);
}
Also used : Treeitem(org.zkoss.zul.Treeitem) SchemaTreeNode(org.openforis.collect.designer.component.SchemaTreeModel.SchemaTreeNode) Menupopup(org.zkoss.zul.Menupopup) SchemaNodeData(org.openforis.collect.designer.component.SchemaTreeModel.SchemaNodeData)

Aggregations

Treeitem (org.zkoss.zul.Treeitem)27 DefaultTreeNode (org.zkoss.zul.DefaultTreeNode)8 MTreeNode (org.compiere.model.MTreeNode)7 Treechildren (org.zkoss.zul.Treechildren)7 DeleteEntitiesModel (org.adempiere.util.DeleteEntitiesModel)5 DropEvent (org.zkoss.zk.ui.event.DropEvent)5 Component (org.zkoss.zk.ui.Component)4 Treerow (org.zkoss.zul.Treerow)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 SimpleTreeModel (org.adempiere.webui.component.SimpleTreeModel)3 SchemaNodeData (org.openforis.collect.designer.component.SchemaTreeModel.SchemaNodeData)3 SQLException (java.sql.SQLException)2 Collection (java.util.Collection)2 AdempiereException (org.adempiere.exceptions.AdempiereException)2 SimpleListModel (org.adempiere.webui.component.SimpleListModel)2 SchemaTreeNode (org.openforis.collect.designer.component.SchemaTreeModel.SchemaTreeNode)2 Event (org.zkoss.zk.ui.event.Event)2 Menupopup (org.zkoss.zul.Menupopup)2 IOException (java.io.IOException)1