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