use of org.zkoss.zul.Treecol in project adempiere by adempiere.
the class WDelete method zkInit.
private void zkInit() throws Exception {
//Form Init()
form.appendChild(mainLayout);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
clientLabel.setText(Msg.translate(Env.getCtx(), "AD_Client_ID"));
tableLabel.setText(Msg.translate(Env.getCtx(), "AD_Table_ID"));
dryRun = new Checkbox("Dry Run");
dryRun.setChecked(true);
parameterPanel.appendChild(parameterLayout);
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(parameterPanel);
Rows rows = null;
Row row = null;
parameterLayout.setWidth("100%");
rows = parameterLayout.newRows();
row = rows.newRow();
row.appendChild(clientLabel.rightAlign());
row.appendChild(clientPick);
row.appendChild(tableLabel.rightAlign());
row.appendChild(tablePick.getComponent());
row.appendChild(dryRun);
centerPanel.appendChild(centerLayout);
centerLayout.setWidth("100%");
Center center = new Center();
mainLayout.appendChild(center);
center.setStyle("border: none");
center.appendChild(centerPanel);
tree = new Tree();
treeCols = new Treecols();
treeCol = new Treecol("");
treeCol2 = new Treecol();
centerPanel.appendChild(tree);
treeCols.appendChild(treeCol);
treeCols.appendChild(treeCol2);
tree.appendChild(treeCols);
center.setFlex(true);
center.setAutoscroll(true);
South south = new South();
south.appendChild(southPanel);
southPanel.appendChild(southLayout);
southPanel.setWidth("100%");
mainLayout.appendChild(south);
Rows rows2 = southLayout.newRows();
Row south_row = rows2.newRow();
south_row.appendChild(confirmPanel);
confirmPanel.addActionListener(this);
clientPick.addEventListener(Events.ON_SELECT, this);
}
use of org.zkoss.zul.Treecol in project adempiere by adempiere.
the class WDeleteEntity method zkInit.
private void zkInit() throws Exception {
//Form Init()
form.appendChild(mainLayout);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
clientLabel.setText(Msg.getElement(Env.getCtx(), "AD_Client_ID"));
tableLabel.setText(Msg.getElement(Env.getCtx(), "AD_Table_ID"));
dryRun = new Checkbox(Msg.getMsg(Env.getCtx(), "DryRun"));
dryRun.setChecked(true);
ConfirmPanel panel = new ConfirmPanel(false, false, false, false, false, false, false);
bRefresh = panel.createButton(ConfirmPanel.A_REFRESH);
bRefresh.addActionListener(this);
//
parameterPanel.appendChild(parameterLayout);
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(parameterPanel);
Rows rows = null;
Row row = null;
parameterLayout.setWidth("100%");
rows = parameterLayout.newRows();
row = rows.newRow();
row.appendChild(clientLabel.rightAlign());
row.appendChild(clientPick);
row.appendChild(tableLabel.rightAlign());
row.appendChild(tablePick);
// For Button
row = rows.newRow();
row.appendChild(new Hbox());
row.appendChild(dryRun);
row.appendChild(new Hbox());
row.appendChild(bRefresh);
//
centerPanel.appendChild(centerLayout);
centerLayout.setWidth("100%");
Center center = new Center();
mainLayout.appendChild(center);
center.setStyle("border: none");
center.appendChild(centerPanel);
tree = new Tree();
treeCols = new Treecols();
treeCol = new Treecol("");
treeCol2 = new Treecol();
centerPanel.appendChild(tree);
treeCols.appendChild(treeCol);
treeCols.appendChild(treeCol2);
tree.appendChild(treeCols);
center.setFlex(true);
center.setAutoscroll(true);
South south = new South();
south.appendChild(southPanel);
southPanel.appendChild(southLayout);
southPanel.setWidth("100%");
mainLayout.appendChild(south);
Rows rows2 = southLayout.newRows();
Row south_row = rows2.newRow();
south_row.appendChild(confirmPanel);
confirmPanel.addActionListener(this);
}
use of org.zkoss.zul.Treecol in project adempiere by adempiere.
the class WTreeBOM method action_loadBOM.
private void action_loadBOM() {
int M_Product_ID = getM_Product_ID();
if (M_Product_ID == 0)
return;
MProduct product = MProduct.get(getCtx(), M_Product_ID);
DefaultTreeNode parent = new DefaultTreeNode(productSummary(product, false), new ArrayList());
dataBOM.clear();
if (isImplosion()) {
try {
m_tree.setModel(null);
} catch (Exception e) {
}
if (m_tree.getTreecols() != null)
m_tree.getTreecols().detach();
if (m_tree.getTreefoot() != null)
m_tree.getTreefoot().detach();
if (m_tree.getTreechildren() != null)
m_tree.getTreechildren().detach();
for (MPPProductBOMLine bomline : MPPProductBOMLine.getByProduct(product)) {
parent.getChildren().add(parent(bomline));
}
Treecols treeCols = new Treecols();
m_tree.appendChild(treeCols);
Treecol treeCol = new Treecol();
treeCols.appendChild(treeCol);
SimpleTreeModel model = new SimpleTreeModel(parent);
m_tree.setPageSize(-1);
m_tree.setTreeitemRenderer(model);
m_tree.setModel(model);
} else {
try {
m_tree.setModel(null);
} catch (Exception e) {
}
if (m_tree.getTreecols() != null)
m_tree.getTreecols().detach();
if (m_tree.getTreefoot() != null)
m_tree.getTreefoot().detach();
if (m_tree.getTreechildren() != null)
m_tree.getTreechildren().detach();
for (MPPProductBOM bom : MPPProductBOM.getProductBOMs(product)) {
parent.getChildren().add(parent(bom));
}
Treecols treeCols = new Treecols();
m_tree.appendChild(treeCols);
Treecol treeCol = new Treecol();
treeCols.appendChild(treeCol);
SimpleTreeModel model = new SimpleTreeModel(parent);
m_tree.setPageSize(-1);
m_tree.setTreeitemRenderer(model);
m_tree.setModel(model);
}
m_tree.addEventListener(Events.ON_SELECTION, this);
loadTableBOM();
}
use of org.zkoss.zul.Treecol in project adempiere by adempiere.
the class SimpleTreeModel method initADTree.
/**
* @param tree
* @param AD_Tree_ID
* @param windowNo
* @param editable
* @param whereClause
* @param trxName
* @return SimpleTreeModel
*/
public static SimpleTreeModel initADTree(Tree tree, int AD_Tree_ID, int windowNo, boolean editable, String whereClause, String trxName) {
// Change to where clause
MTree vTree = new MTree(Env.getCtx(), AD_Tree_ID, editable, true, false, whereClause, trxName);
MTreeNode root = vTree.getRoot();
SimpleTreeModel treeModel = SimpleTreeModel.createFrom(root);
treeModel.setItemDraggable(true);
treeModel.addOnDropEventListener(new ADTreeOnDropListener(tree, treeModel, vTree, windowNo));
Treecols treeCols = new Treecols();
tree.appendChild(treeCols);
Treecol treeCol = new Treecol();
treeCols.appendChild(treeCol);
tree.setPageSize(-1);
try {
tree.setItemRenderer(treeModel);
tree.setModel(treeModel);
} catch (Exception e) {
logger.log(Level.SEVERE, "Failed to setup tree");
}
return treeModel;
}
use of org.zkoss.zul.Treecol in project adempiere by adempiere.
the class WCRPDetail method getTree.
private Tree getTree() {
Tree tree = new Tree();
List<String> nodes = model.getDataset().getColumnKeys();
DefaultTreeNode root = new DefaultTreeNode(getResource(resource.getValue()).getName(), new ArrayList());
for (String node : nodes) {
root.getChildren().add(new DefaultTreeNode(node, new ArrayList()));
}
Treecols treeCols = new Treecols();
tree.appendChild(treeCols);
Treecol treeCol = new Treecol();
treeCols.appendChild(treeCol);
SimpleTreeModel model = new SimpleTreeModel(root);
tree.setPageSize(-1);
tree.setTreeitemRenderer(model);
tree.setModel(model);
return tree;
}
Aggregations