Search in sources :

Example 1 with ListModel

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

the class WTreeMaintenance method action_treeDeleteAll.

//	action_treeAddAll
/**
	 * 	Action: Delete All Nodes from Tree
	 */
private void action_treeDeleteAll() {
    log.info("");
    //TODO: translation
    if (FDialog.ask(m_WindowNo, null, "Remove all item(s) from tree?")) {
        ListModel model = centerList.getModel();
        int size = model.getSize();
        int index = -1;
        for (index = 0; index < size; index++) {
            ListItem item = (ListItem) model.getElementAt(index);
            action_treeDelete(item);
        }
    }
}
Also used : ListModel(org.zkoss.zul.ListModel) SimpleListModel(org.adempiere.webui.component.SimpleListModel)

Example 2 with ListModel

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

the class WTreeMaintenance method onTreeSelection.

//	valueChanged
/**
	 * 	Tree selection
	 *	@param e event
	 */
private void onTreeSelection(Event e) {
    Treeitem ti = centerTree.getSelectedItem();
    DefaultTreeNode stn = (DefaultTreeNode) ti.getValue();
    MTreeNode tn = (MTreeNode) stn.getData();
    log.info(tn.toString());
    if (tn == null)
        return;
    ListModel model = centerList.getModel();
    int size = model.getSize();
    int index = -1;
    for (index = 0; index < size; index++) {
        ListItem item = (ListItem) model.getElementAt(index);
        if (item.id == tn.getNode_ID())
            break;
    }
    centerList.setSelectedIndex(index);
}
Also used : MTreeNode(org.compiere.model.MTreeNode) Treeitem(org.zkoss.zul.Treeitem) DefaultTreeNode(org.zkoss.zul.DefaultTreeNode) ListModel(org.zkoss.zul.ListModel) SimpleListModel(org.adempiere.webui.component.SimpleListModel)

Example 3 with ListModel

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

the class WTreeMaintenance method action_treeAddAll.

//	action_treeDelete
/**
	 * 	Action: Add All Nodes to Tree
	 */
private void action_treeAddAll() {
    log.info("");
    ListModel model = centerList.getModel();
    int size = model.getSize();
    int index = -1;
    for (index = 0; index < size; index++) {
        ListItem item = (ListItem) model.getElementAt(index);
        action_treeAdd(item);
    }
}
Also used : ListModel(org.zkoss.zul.ListModel) SimpleListModel(org.adempiere.webui.component.SimpleListModel)

Aggregations

SimpleListModel (org.adempiere.webui.component.SimpleListModel)3 ListModel (org.zkoss.zul.ListModel)3 MTreeNode (org.compiere.model.MTreeNode)1 DefaultTreeNode (org.zkoss.zul.DefaultTreeNode)1 Treeitem (org.zkoss.zul.Treeitem)1