Search in sources :

Example 1 with Treecol

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);
}
Also used : Treecol(org.zkoss.zul.Treecol) Treecols(org.zkoss.zul.Treecols) Center(org.zkoss.zul.Center) Checkbox(org.zkoss.zul.Checkbox) South(org.zkoss.zul.South) Tree(org.zkoss.zul.Tree) North(org.zkoss.zul.North) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 2 with Treecol

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);
}
Also used : Treecol(org.zkoss.zul.Treecol) Hbox(org.zkoss.zul.Hbox) Treecols(org.zkoss.zul.Treecols) Center(org.zkoss.zkex.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Checkbox(org.zkoss.zul.Checkbox) South(org.zkoss.zkex.zul.South) Tree(org.zkoss.zul.Tree) North(org.zkoss.zkex.zul.North) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 3 with Treecol

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();
}
Also used : Treecol(org.zkoss.zul.Treecol) Treecols(org.zkoss.zul.Treecols) MProduct(org.compiere.model.MProduct) SimpleTreeModel(org.adempiere.webui.component.SimpleTreeModel) DefaultTreeNode(org.zkoss.zul.DefaultTreeNode) ArrayList(java.util.ArrayList) MPPProductBOMLine(org.eevolution.model.MPPProductBOMLine) MPPProductBOM(org.eevolution.model.MPPProductBOM)

Example 4 with Treecol

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;
}
Also used : Treecol(org.zkoss.zul.Treecol) MTreeNode(org.compiere.model.MTreeNode) Treecols(org.zkoss.zul.Treecols) MTree(org.compiere.model.MTree)

Example 5 with Treecol

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;
}
Also used : Treecol(org.zkoss.zul.Treecol) Treecols(org.zkoss.zul.Treecols) SimpleTreeModel(org.adempiere.webui.component.SimpleTreeModel) DefaultTreeNode(org.zkoss.zul.DefaultTreeNode) ArrayList(java.util.ArrayList) Tree(org.zkoss.zul.Tree)

Aggregations

Treecol (org.zkoss.zul.Treecol)6 Treecols (org.zkoss.zul.Treecols)6 Tree (org.zkoss.zul.Tree)3 ArrayList (java.util.ArrayList)2 Row (org.adempiere.webui.component.Row)2 Rows (org.adempiere.webui.component.Rows)2 SimpleTreeModel (org.adempiere.webui.component.SimpleTreeModel)2 Checkbox (org.zkoss.zul.Checkbox)2 DefaultTreeNode (org.zkoss.zul.DefaultTreeNode)2 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)1 MProduct (org.compiere.model.MProduct)1 MTree (org.compiere.model.MTree)1 MTreeNode (org.compiere.model.MTreeNode)1 MPPProductBOM (org.eevolution.model.MPPProductBOM)1 MPPProductBOMLine (org.eevolution.model.MPPProductBOMLine)1 Center (org.zkoss.zkex.zul.Center)1 North (org.zkoss.zkex.zul.North)1 South (org.zkoss.zkex.zul.South)1 Center (org.zkoss.zul.Center)1 Hbox (org.zkoss.zul.Hbox)1