Search in sources :

Example 26 with Hbox

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

the class WLocatorDialog method initComponents.

// WLocatorDialog
private void initComponents() {
    lblLocator.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    lblWarehouse.setValue(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
    lblAisleX.setValue(Msg.getElement(Env.getCtx(), "X"));
    lblBinY.setValue(Msg.getElement(Env.getCtx(), "Y"));
    lblLevelZ.setValue(Msg.getElement(Env.getCtx(), "Z"));
    lblKey.setValue(Msg.translate(Env.getCtx(), "Value"));
    Hbox boxLocator = new Hbox();
    boxLocator.setWidth("100%");
    boxLocator.setWidths("30%, 70%");
    // Elaine 2009/02/02 - fixed the locator width
    lstLocator.setWidth("150px");
    lstLocator.setMold("select");
    lstLocator.setRows(0);
    boxLocator.appendChild(lblLocator);
    boxLocator.appendChild(lstLocator);
    Hbox boxCheckbox = new Hbox();
    boxCheckbox.setWidth("100%");
    boxCheckbox.setWidths("30%, 70%");
    boxCheckbox.setStyle("text-align:left");
    chkCreateNew.setLabel(Msg.getMsg(Env.getCtx(), "CreateNew"));
    boxCheckbox.appendChild(new Label());
    boxCheckbox.appendChild(chkCreateNew);
    Hbox boxWarehouse = new Hbox();
    boxWarehouse.setWidth("100%");
    boxWarehouse.setWidths("30%, 70%");
    lstWarehouse.setWidth("100px");
    lstWarehouse.setMold("select");
    lstWarehouse.setRows(0);
    boxWarehouse.appendChild(lblWarehouse);
    boxWarehouse.appendChild(lstWarehouse);
    boxWarehouse.appendChild(txtWarehouse);
    Hbox boxAisle = new Hbox();
    boxAisle.setWidth("100%");
    boxAisle.setWidths("30%, 70%");
    boxAisle.appendChild(lblAisleX);
    boxAisle.appendChild(txtAisleX);
    Hbox boxBin = new Hbox();
    boxBin.setWidth("100%");
    boxBin.setWidths("30%, 70%");
    boxBin.appendChild(lblBinY);
    boxBin.appendChild(txtBinY);
    Hbox boxLevel = new Hbox();
    boxLevel.setWidth("100%");
    boxLevel.setWidths("30%, 70%");
    boxLevel.appendChild(lblLevelZ);
    boxLevel.appendChild(txtLevelZ);
    Hbox boxKey = new Hbox();
    boxKey.setWidth("100%");
    boxKey.setWidths("30%, 70%");
    boxKey.appendChild(lblKey);
    boxKey.appendChild(txtKey);
    Hbox boxButtons = new Hbox();
    boxButtons.setWidth("100%");
    boxButtons.setWidths("80%, 10%, 10%");
    boxButtons.setStyle("text-align:right");
    btnCancel.setImage(ServletFns.resolveThemeURL("~./images/Cancel16.png"));
    btnCancel.addEventListener(Events.ON_CLICK, this);
    btnOk.setImage(ServletFns.resolveThemeURL("~./images/Ok16.png"));
    btnOk.addEventListener(Events.ON_CLICK, this);
    boxButtons.appendChild(new Label());
    boxButtons.appendChild(btnCancel);
    boxButtons.appendChild(btnOk);
    mainBox.setWidth("250px");
    mainBox.setStyle("text-align:right");
    mainBox.appendChild(boxLocator);
    mainBox.appendChild(new Separator());
    mainBox.appendChild(boxCheckbox);
    mainBox.appendChild(new Separator());
    mainBox.appendChild(boxWarehouse);
    mainBox.appendChild(boxAisle);
    mainBox.appendChild(boxBin);
    mainBox.appendChild(boxLevel);
    mainBox.appendChild(boxKey);
    mainBox.appendChild(new Separator());
    mainBox.appendChild(boxButtons);
    this.appendChild(mainBox);
    this.setTitle(title);
    this.setClosable(true);
    this.setBorder("normal");
    this.setWidth("260Px");
    this.setAttribute("mode", "modal");
    // Elaine 2009/02/02 - window set to resizable
    this.setSizable(true);
}
Also used : Hbox(org.zkoss.zul.Hbox) Label(org.adempiere.webui.component.Label) Separator(org.zkoss.zul.Separator)

Example 27 with Hbox

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

the class WAcctViewer method init.

// AcctViewer
/**
	 *  Static Init.
	 *  <pre>
	 *  - mainPanel
	 *      - tabbedPane
	 *          - query
	 *          - result
	 *          - graphPanel
	 *  </pre>
	 *  @throws Exception
	 */
private void init() throws Exception {
    ThemeUtils.addSclass("ad-wacctviewer", this);
    // Modal or non-modal
    if (isLookup()) {
        ThemeUtils.addSclass("modal", this);
        setTitle(Msg.getMsg(Env.getCtx(), "Posting"));
        setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
        setClosable(true);
        setSizable(true);
        setMaximizable(true);
    // Move to theme
    //setBorder("normal");
    //int height = SessionManager.getAppDesktop().getClientInfo().desktopHeight * 85 / 100;
    //int width = SessionManager.getAppDesktop().getClientInfo().desktopWidth * 80 / 100;
    //setWidth(width + "px");
    //setHeight(height + "px");
    //setContentStyle("overflow: auto");
    } else {
        ThemeUtils.addSclass("embedded", this);
        setTitle(Msg.getMsg(Env.getCtx(), "InfoAccount"));
        setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
    // Move to theme
    //setBorder("none");
    //setWidth("100%");
    //setHeight("100%");
    //setStyle("position: absolute");
    }
    // Selection Panel
    // Accounting Schema
    Hbox boxAcctSchema = new Hbox();
    ThemeUtils.addSclass("selection-box", boxAcctSchema);
    ThemeUtils.addSclass("acct-schema", boxAcctSchema);
    boxAcctSchema.setHflex("1");
    // boxAcctSchema.setWidths("30%, 70%");
    lacctSchema.setValue(Msg.translate(Env.getCtx(), "C_AcctSchema_ID"));
    lacctSchema.setAttribute("zk_component_ID", "Lookup_Criteria_Label_C_AcctSchema_ID");
    selAcctSchema.setMold("select");
    selAcctSchema.setRows(1);
    selAcctSchema.setAttribute("zk_component_ID", "Lookup_Criteria_C_AcctSchema_ID");
    Cell cell = new Cell();
    cell.appendChild(lacctSchema);
    ThemeUtils.addSclass("label-cell", cell);
    boxAcctSchema.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selAcctSchema);
    ThemeUtils.addSclass("field-cell", cell);
    boxAcctSchema.appendChild(cell);
    Hbox boxSelDoc = new Hbox();
    ThemeUtils.addSclass("selection-box", boxSelDoc);
    ThemeUtils.addSclass("select-document", boxSelDoc);
    boxSelDoc.setHflex("1");
    //boxSelDoc.setWidths("30%, 50%, 20%");
    selDocument.setLabel(Msg.getMsg(Env.getCtx(), "SelectDocument"));
    selDocument.setAttribute("zk_component_ID", "Lookup_Criteria_selDocument");
    selDocument.addEventListener(Events.ON_CHECK, this);
    selTable.setMold("select");
    selTable.setRows(1);
    selTable.setAttribute("zk_component_ID", "Lookup_Criteria_selTable");
    selRecord.setAttribute("zk_component_ID", "Lookup_Criteria_selRecord");
    cell = new Cell();
    cell.appendChild(selDocument);
    ThemeUtils.addSclass("doc-cell", cell);
    boxSelDoc.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selTable);
    ThemeUtils.addSclass("table-cell", cell);
    boxSelDoc.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selRecord);
    ThemeUtils.addSclass("record-cell", cell);
    boxSelDoc.appendChild(cell);
    // Posting Type
    Hbox boxPostingType = new Hbox();
    ThemeUtils.addSclass("selection-box", boxPostingType);
    ThemeUtils.addSclass("select-posting", boxPostingType);
    boxPostingType.setHflex("1");
    //boxPostingType.setWidths("30%, 70%");
    lpostingType.setValue(Msg.translate(Env.getCtx(), "PostingType"));
    selPostingType.setMold("select");
    selPostingType.setRows(1);
    selPostingType.addEventListener(Events.ON_CLICK, this);
    selPostingType.setAttribute("zk_component_ID", "Lookup_Criteria_selPostingType");
    cell = new Cell();
    cell.appendChild(lpostingType);
    ThemeUtils.addSclass("label-cell", cell);
    boxPostingType.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selPostingType);
    ThemeUtils.addSclass("field-cell", cell);
    boxPostingType.appendChild(cell);
    // Date
    Hbox boxDate = new Hbox();
    ThemeUtils.addSclass("selection-box", boxDate);
    ThemeUtils.addSclass("select-date", boxDate);
    boxDate.setHflex("1");
    //boxDate.setWidths("30%, 35%, 35%");
    lDate.setValue(Msg.translate(Env.getCtx(), "DateAcct"));
    lDate.setAttribute("zk_component_ID", "Lookup_Criteria_Label_Date");
    selDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_selDateFrom");
    selDateTo.setAttribute("zk_component_ID", "Lookup_Criteria_selDateTo");
    cell = new Cell();
    cell.appendChild(lDate);
    ThemeUtils.addSclass("label-cell", cell);
    boxDate.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selDateFrom);
    ThemeUtils.addSclass("date-from-cell", cell);
    boxDate.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selDateTo);
    ThemeUtils.addSclass("date-to-cell", cell);
    boxDate.appendChild(cell);
    // Organization
    Hbox boxOrg = new Hbox();
    ThemeUtils.addSclass("selection-box", boxOrg);
    ThemeUtils.addSclass("select-org", boxOrg);
    boxOrg.setHflex("1");
    //boxOrg.setWidths("30%, 70%");
    lOrg.setValue(Msg.translate(Env.getCtx(), "AD_Org_ID"));
    selOrg.setMold("select");
    selOrg.setRows(1);
    selOrg.addEventListener(Events.ON_SELECT, this);
    lOrg.setAttribute("zk_component_ID", "Lookup_Criteria_Label_Org");
    selOrg.setAttribute("zk_component_ID", "Lookup_Criteria_selOrg");
    cell = new Cell();
    cell.appendChild(lOrg);
    ThemeUtils.addSclass("label-cell", cell);
    boxOrg.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selOrg);
    ThemeUtils.addSclass("field-cell", cell);
    boxOrg.appendChild(cell);
    // Account
    Hbox boxAcct = new Hbox();
    ThemeUtils.addSclass("selection-box", boxAcct);
    ThemeUtils.addSclass("select-acct", boxAcct);
    boxAcct.setHflex("1");
    //boxAcct.setWidths("30%, 70%");
    lAcct.setValue(Msg.translate(Env.getCtx(), "Account_ID"));
    lAcct.setAttribute("zk_component_ID", "Lookup_Criteria_Label_Acct");
    selAcct.setAttribute("zk_component_ID", "Lookup_Criteria_selAcct");
    cell = new Cell();
    cell.appendChild(lAcct);
    ThemeUtils.addSclass("label-cell", cell);
    boxAcct.appendChild(cell);
    cell = new Cell();
    cell.appendChild(selAcct);
    ThemeUtils.addSclass("field-cell", cell);
    boxAcct.appendChild(cell);
    Hbox boxSel1 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel1);
    boxSel1.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel1);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel1.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel1);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel1.appendChild(cell);
    Hbox boxSel2 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel2);
    boxSel2.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel2);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel2.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel2);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel2.appendChild(cell);
    Hbox boxSel3 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel3);
    boxSel3.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel3);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel3.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel3);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel3.appendChild(cell);
    Hbox boxSel4 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel4);
    boxSel4.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel4);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel4.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel4);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel4.appendChild(cell);
    Hbox boxSel5 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel5);
    boxSel5.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel5);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel5.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel5);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel5.appendChild(cell);
    Hbox boxSel6 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel6);
    boxSel6.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel6);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel6.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel6);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel6.appendChild(cell);
    Hbox boxSel7 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel7);
    boxSel7.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel7);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel7.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel7);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel7.appendChild(cell);
    Hbox boxSel8 = new Hbox();
    ThemeUtils.addSclass("button-box", boxSel8);
    boxSel8.setHflex("1");
    cell = new Cell();
    cell.appendChild(lsel8);
    ThemeUtils.addSclass("label-cell", cell);
    boxSel8.appendChild(cell);
    cell = new Cell();
    cell.appendChild(sel8);
    ThemeUtils.addSclass("field-cell", cell);
    boxSel8.appendChild(cell);
    //selectionPanel.setWidth("100%");
    selectionPanel.setHflex("1");
    selectionPanel.appendChild(boxAcctSchema);
    selectionPanel.appendChild(boxSelDoc);
    selectionPanel.appendChild(boxPostingType);
    selectionPanel.appendChild(boxDate);
    selectionPanel.appendChild(boxOrg);
    selectionPanel.appendChild(boxAcct);
    selectionPanel.appendChild(boxSel1);
    selectionPanel.appendChild(boxSel2);
    selectionPanel.appendChild(boxSel3);
    selectionPanel.appendChild(boxSel4);
    selectionPanel.appendChild(boxSel5);
    selectionPanel.appendChild(boxSel6);
    selectionPanel.appendChild(boxSel7);
    selectionPanel.appendChild(boxSel8);
    //Display Panel
    // Display Document Info
    displayDocumentInfo.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "DisplayDocumentInfo")));
    displayDocumentInfo.addEventListener(Events.ON_CLICK, this);
    // Display Source Info
    displaySourceAmt.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "DisplaySourceInfo")));
    displaySourceAmt.addEventListener(Events.ON_CHECK, this);
    // Display Quantity
    displayQty.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "DisplayQty")));
    displayQty.addEventListener(Events.ON_CHECK, this);
    Hbox boxSortDisplay = new Hbox();
    boxSortDisplay.setWidth("100%");
    boxSortDisplay.setWidths("70%, 30%");
    lSort.setValue(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "SortBy")));
    lGroup.setValue(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "GroupBy")));
    boxSortDisplay.appendChild(lSort);
    boxSortDisplay.appendChild(lGroup);
    Hbox boxSort1 = new Hbox();
    boxSort1.setWidth("100%");
    boxSort1.setWidths("70%, 30%");
    sortBy1.setMold("select");
    sortBy1.setRows(1);
    boxSort1.appendChild(sortBy1);
    boxSort1.appendChild(group1);
    Hbox boxSort2 = new Hbox();
    boxSort2.setWidth("100%");
    boxSort2.setWidths("70%, 30%");
    sortBy2.setMold("select");
    sortBy2.setRows(1);
    boxSort2.appendChild(sortBy2);
    boxSort2.appendChild(group2);
    Hbox boxSort3 = new Hbox();
    boxSort3.setWidth("100%");
    boxSort3.setWidths("70%, 30%");
    sortBy3.setMold("select");
    sortBy3.setRows(1);
    boxSort3.appendChild(sortBy3);
    boxSort3.appendChild(group3);
    Hbox boxSort4 = new Hbox();
    boxSort4.setWidth("100%");
    boxSort4.setWidths("70%, 30%");
    sortBy4.setMold("select");
    sortBy4.setRows(1);
    boxSort4.appendChild(sortBy4);
    boxSort4.appendChild(group4);
    displayPanel.setWidth("100%");
    displayPanel.appendChild(displayDocumentInfo);
    displayPanel.appendChild(displaySourceAmt);
    displayPanel.appendChild(displayQty);
    displayPanel.appendChild(boxSortDisplay);
    displayPanel.appendChild(boxSort1);
    displayPanel.appendChild(boxSort2);
    displayPanel.appendChild(boxSort3);
    displayPanel.appendChild(boxSort4);
    //"images/InfoAccount16.png"
    Groupbox groupDisplay = new Groupbox();
    Caption capDisplay = new Caption("Display");
    groupDisplay.appendChild(capDisplay);
    groupDisplay.appendChild(displayPanel);
    Groupbox groupSelection = new Groupbox();
    Caption capSelection = new Caption("Selection");
    groupSelection.appendChild(capSelection);
    groupSelection.appendChild(selectionPanel);
    Hbox boxQueryPanel = new Hbox();
    boxQueryPanel.setWidth("98%");
    boxQueryPanel.setWidths("63%,1%,36%");
    boxQueryPanel.appendChild(groupSelection);
    Separator separator = new Separator();
    separator.setOrient("vertical");
    boxQueryPanel.appendChild(separator);
    boxQueryPanel.appendChild(groupDisplay);
    //  South Panel
    bRePost.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "RePost")));
    bRePost.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "RePostInfo")));
    bRePost.addEventListener(Events.ON_CLICK, this);
    bRePost.setVisible(false);
    forcePost.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Force")));
    forcePost.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ForceInfo")));
    forcePost.setVisible(false);
    bQuery.setImage(ServletFns.resolveThemeURL("~./images/Refresh16.png"));
    bQuery.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
    bQuery.addEventListener(Events.ON_CLICK, this);
    //FR[3435028]
    bExport.setImage(ServletFns.resolveThemeURL("~./images/Export16.png"));
    bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export")));
    bExport.addEventListener(Events.ON_CLICK, this);
    bPrint.setImage(ServletFns.resolveThemeURL("~./images/Print16.png"));
    bPrint.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Print")));
    bPrint.addEventListener(Events.ON_CLICK, this);
    southPanel.setWidth("100%");
    southPanel.setWidths("2%, 12%, 82%, 2%, 2%");
    southPanel.appendChild(bRePost);
    southPanel.appendChild(forcePost);
    southPanel.appendChild(statusLine);
    //FR[3435028]
    southPanel.appendChild(bExport);
    southPanel.appendChild(bPrint);
    southPanel.appendChild(bQuery);
    // Result Tab
    resultPanel = new Borderlayout();
    resultPanel.setStyle("position: absolute");
    resultPanel.setWidth("99%");
    resultPanel.setHeight("99%");
    result.appendChild(resultPanel);
    Center resultCenter = new Center();
    resultCenter.setHflex("true");
    resultCenter.setVflex("true");
    resultPanel.appendChild(resultCenter);
    table.setWidth("96%");
    //table.setHeight("98%");
    table.setVflex(true);
    table.setStyle("overflow: auto; position: absolute;");
    resultCenter.appendChild(table);
    pagingPanel = new South();
    resultPanel.appendChild(pagingPanel);
    pagingPanel.appendChild(paging);
    result.setWidth("100%");
    result.setHeight("100%");
    result.setStyle("position: relative");
    paging.addEventListener("onPaging", this);
    paging.setAutohide(true);
    paging.setDetailed(true);
    // Query Tab
    query.setWidth("100%");
    query.appendChild(boxQueryPanel);
    // Tabbox
    tabQuery.addEventListener(Events.ON_SELECT, this);
    tabQuery.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ViewerQuery")));
    tabResult.addEventListener(Events.ON_SELECT, this);
    tabResult.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ViewerResult")));
    tabs.appendChild(tabQuery);
    tabs.appendChild(tabResult);
    tabpanels.setWidth("100%");
    tabpanels.appendChild(query);
    tabpanels.appendChild(result);
    tabbedPane.setWidth("100%");
    tabbedPane.setHeight("100%");
    tabbedPane.appendChild(tabs);
    tabbedPane.appendChild(tabpanels);
    Borderlayout layout = new Borderlayout();
    layout.setParent(this);
    //		layout.setHeight("100%");
    //		layout.setWidth("100%");
    //		layout.setStyle("background-color: transparent");
    Center center = new Center();
    center.setParent(layout);
    center.setHflex("true");
    center.setVflex("true");
    center.setStyle("background-color: transparent");
    tabbedPane.setParent(center);
    South south = new South();
    south.setParent(layout);
    south.setHflex("true");
    south.setVflex("true");
    south.setStyle("background-color: transparent");
    southPanel.setParent(south);
//tabbedPane.addEventListener(Events.ON_SELECT, this);
}
Also used : Hbox(org.zkoss.zul.Hbox) Center(org.zkoss.zul.Center) Groupbox(org.zkoss.zul.Groupbox) South(org.zkoss.zul.South) Borderlayout(org.zkoss.zul.Borderlayout) Cell(org.zkoss.zul.Cell) Caption(org.zkoss.zul.Caption) Separator(org.zkoss.zul.Separator)

Example 28 with Hbox

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

the class Messagebox method init.

private void init() {
    lblMsg.setValue(msg);
    WAppsAction action;
    try {
        //	For Cancel
        action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
        btnCancel = action.getButton();
        btnCancel.addEventListener(Events.ON_CLICK, this);
        //	For Ok
        action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
        btnOk = action.getButton();
        btnOk.addEventListener(Events.ON_CLICK, this);
        //	For Yes
        action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
        btnYes = action.getButton();
        btnYes.addEventListener(Events.ON_CLICK, this);
        btnYes.setName("btnYes");
        btnYes.setId("btnYes");
        //	For No
        action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
        btnNo = action.getButton();
        btnNo.addEventListener(Events.ON_CLICK, this);
        btnYes.setName("btnNo");
        btnYes.setId("btnNo");
        //	For Abort
        action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
        btnAbort = action.getButton();
        btnAbort.addEventListener(Events.ON_CLICK, this);
        btnAbort.setLabel("Abort");
        btnAbort.setName("btnAbort");
        btnAbort.setId("btnAbort");
        //	For Retry
        action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
        btnRetry = action.getButton();
        btnRetry.addEventListener(Events.ON_CLICK, this);
        btnRetry.setLabel("Retry");
        btnRetry.setName("btnRetry");
        btnRetry.setId("btnRetry");
        //	For Ignore
        action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
        btnIgnore = action.getButton();
        btnIgnore.addEventListener(Events.ON_CLICK, this);
        btnIgnore.setLabel("Ignore");
        btnIgnore.setName("btnIgnore");
        btnIgnore.setId("btnIgnore");
    } catch (IOException e) {
        log.warning("Error loading buttons " + e.getLocalizedMessage());
    }
    Panel pnlMessage = new Panel();
    pnlMessage.setStyle(MESSAGE_PANEL_STYLE);
    pnlMessage.appendChild(lblMsg);
    Hbox pnlImage = new Hbox();
    img.setSrc(imgSrc);
    pnlImage.setWidth("72px");
    pnlImage.setAlign("center");
    pnlImage.setPack("center");
    pnlImage.appendChild(img);
    Hbox north = new Hbox();
    north.setAlign("center");
    //trbl
    north.setStyle("margin: 20pt 10pt 20pt 10pt;");
    this.appendChild(north);
    north.appendChild(pnlImage);
    north.appendChild(pnlMessage);
    Hbox pnlButtons = new Hbox();
    pnlButtons.setHeight("52px");
    pnlButtons.setAlign("center");
    pnlButtons.setPack("end");
    pnlButtons.appendChild(btnCancel);
    pnlButtons.appendChild(btnOk);
    pnlButtons.appendChild(btnYes);
    pnlButtons.appendChild(btnNo);
    pnlButtons.appendChild(btnAbort);
    pnlButtons.appendChild(btnRetry);
    pnlButtons.appendChild(btnIgnore);
    Separator separator = new Separator();
    separator.setWidth("100%");
    separator.setBar(true);
    this.appendChild(separator);
    Hbox south = new Hbox();
    south.setPack("end");
    south.setWidth("100%");
    this.appendChild(south);
    south.appendChild(pnlButtons);
    this.setBorder("normal");
    this.setContentStyle("background-color:#ffffff;");
    this.setPosition("left, top");
}
Also used : Hbox(org.zkoss.zul.Hbox) IOException(java.io.IOException) Separator(org.zkoss.zul.Separator)

Example 29 with Hbox

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

the class NumberBox method getCalculatorPopup.

private Popup getCalculatorPopup() {
    Popup popup = new Popup();
    Vbox vbox = new Vbox();
    char separatorChar = DisplayType.getNumberFormat(DisplayType.Number, Env.getLanguage(Env.getCtx())).getDecimalFormatSymbols().getDecimalSeparator();
    String separator = Character.toString(separatorChar);
    txtCalc = new Textbox();
    txtCalc.setAction("onKeyPress : return calc.validate('" + decimalBox.getId() + "','" + txtCalc.getId() + "'," + integral + "," + (int) separatorChar + ", event);");
    txtCalc.setMaxlength(250);
    txtCalc.setCols(30);
    String txtCalcId = txtCalc.getId();
    vbox.appendChild(txtCalc);
    Hbox row1 = new Hbox();
    Button btnAC = new Button();
    btnAC.setWidth("40px");
    btnAC.setLabel("AC");
    btnAC.setAction("onClick : calc.clearAll('" + txtCalcId + "')");
    Button btn7 = new Button();
    btn7.setWidth("30px");
    btn7.setLabel("7");
    btn7.setAction("onClick : calc.append('" + txtCalcId + "', '7')");
    Button btn8 = new Button();
    btn8.setWidth("30px");
    btn8.setLabel("8");
    btn8.setAction("onClick : calc.append('" + txtCalcId + "', '8')");
    Button btn9 = new Button();
    btn9.setWidth("30px");
    btn9.setLabel("9");
    btn9.setAction("onClick : calc.append('" + txtCalcId + "', '9')");
    Button btnMultiply = new Button();
    btnMultiply.setWidth("30px");
    btnMultiply.setLabel("*");
    btnMultiply.setAction("onClick : calc.append('" + txtCalcId + "', ' * ')");
    row1.appendChild(btnAC);
    row1.appendChild(btn7);
    row1.appendChild(btn8);
    row1.appendChild(btn9);
    row1.appendChild(btnMultiply);
    Hbox row2 = new Hbox();
    Button btnC = new Button();
    btnC.setWidth("40px");
    btnC.setLabel("C");
    btnC.setAction("onClick : calc.clear('" + txtCalcId + "')");
    Button btn4 = new Button();
    btn4.setWidth("30px");
    btn4.setLabel("4");
    btn4.setAction("onClick : calc.append('" + txtCalcId + "', '4')");
    Button btn5 = new Button();
    btn5.setWidth("30px");
    btn5.setLabel("5");
    btn5.setAction("onClick : calc.append('" + txtCalcId + "', '5')");
    Button btn6 = new Button();
    btn6.setWidth("30px");
    btn6.setLabel("6");
    btn6.setAction("onClick : calc.append('" + txtCalcId + "', '6')");
    Button btnDivide = new Button();
    btnDivide.setWidth("30px");
    btnDivide.setLabel("/");
    btnDivide.setAction("onClick : calc.append('" + txtCalcId + "', ' / ')");
    row2.appendChild(btnC);
    row2.appendChild(btn4);
    row2.appendChild(btn5);
    row2.appendChild(btn6);
    row2.appendChild(btnDivide);
    Hbox row3 = new Hbox();
    Button btnModulo = new Button();
    btnModulo.setWidth("40px");
    btnModulo.setLabel("%");
    btnModulo.setAction("onClick : calc.percentage('" + decimalBox.getId() + "','" + txtCalcId + "','" + separator + "')");
    Button btn1 = new Button();
    btn1.setWidth("30px");
    btn1.setLabel("1");
    btn1.setAction("onClick : calc.append('" + txtCalcId + "', '1')");
    Button btn2 = new Button();
    btn2.setWidth("30px");
    btn2.setLabel("2");
    btn2.setAction("onClick : calc.append('" + txtCalcId + "', '2')");
    Button btn3 = new Button();
    btn3.setWidth("30px");
    btn3.setLabel("3");
    btn3.setAction("onClick : calc.append('" + txtCalcId + "', '3')");
    Button btnSubstract = new Button();
    btnSubstract.setWidth("30px");
    btnSubstract.setLabel("-");
    btnSubstract.setAction("onClick : calc.append('" + txtCalcId + "', ' - ')");
    row3.appendChild(btnModulo);
    row3.appendChild(btn1);
    row3.appendChild(btn2);
    row3.appendChild(btn3);
    row3.appendChild(btnSubstract);
    Hbox row4 = new Hbox();
    Button btnCurrency = new Button();
    btnCurrency.setWidth("40px");
    btnCurrency.setLabel("$");
    btnCurrency.setDisabled(true);
    Button btn0 = new Button();
    btn0.setWidth("30px");
    btn0.setLabel("0");
    btn0.setAction("onClick : calc.append('" + txtCalcId + "', '0')");
    Button btnDot = new Button();
    btnDot.setWidth("30px");
    btnDot.setLabel(separator);
    btnDot.setDisabled(integral);
    btnDot.setAction("onClick : calc.append('" + txtCalcId + "', '" + separator + "')");
    Button btnEqual = new Button();
    btnEqual.setWidth("30px");
    btnEqual.setLabel("=");
    btnEqual.setAction("onClick : calc.evaluate('" + decimalBox.getId() + "','" + txtCalcId + "','" + separator + "')");
    Button btnAdd = new Button();
    btnAdd.setWidth("30px");
    btnAdd.setLabel("+");
    btnAdd.setAction("onClick : calc.append('" + txtCalcId + "', ' + ')");
    row4.appendChild(btnCurrency);
    row4.appendChild(btnDot);
    row4.appendChild(btn0);
    row4.appendChild(btnEqual);
    row4.appendChild(btnAdd);
    vbox.appendChild(row1);
    vbox.appendChild(row2);
    vbox.appendChild(row3);
    vbox.appendChild(row4);
    popup.appendChild(vbox);
    return popup;
}
Also used : Hbox(org.zkoss.zul.Hbox) Popup(org.zkoss.zul.Popup) Vbox(org.zkoss.zul.Vbox)

Example 30 with Hbox

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

the class InfoInvoicePanel method statInit.

private void statInit() {
    initComponents();
    fDocumentNo.setWidth("100%");
    fDescription.setWidth("100%");
    fDateFrom.setWidth("165px");
    fDateTo.setWidth("165px");
    fAmtFrom.getDecimalbox().setWidth("155px");
    fAmtTo.getDecimalbox().setWidth("155px");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendCellChild(lblDocumentNo.rightAlign());
    row.appendCellChild(fDocumentNo);
    row.appendCellChild(fBPartner_ID.getLabel().rightAlign());
    row.appendCellChild(fBPartner_ID.getComponent());
    row.appendCellChild(fIsSOTrx);
    row.appendCellChild(fIsPaid);
    row = new Row();
    rows.appendChild(row);
    row.appendCellChild(lblDescription.rightAlign());
    row.appendCellChild(fDescription);
    row.appendCellChild(lblDateInvoiced.rightAlign());
    Hbox hbox = new Hbox();
    hbox.appendChild(fDateFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(fDateTo);
    row.appendCellChild(hbox, 3);
    row = new Row();
    rows.appendChild(row);
    row.appendCellChild(fOrder_ID.getLabel().rightAlign());
    row.appendCellChild(fOrder_ID.getComponent());
    row.appendCellChild(lblGrandTotal.rightAlign());
    hbox = new Hbox();
    hbox.appendChild(fAmtFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(fAmtTo);
    row.appendCellChild(hbox, 3);
    p_criteriaGrid.appendChild(rows);
    scheduleTbl = new WListbox();
    m_sqlSchedule = scheduleTbl.prepareTable(s_subLayout, s_subFrom, s_subWhere, false, "i");
    scheduleTbl.setMultiSelection(false);
    scheduleTbl.autoSize();
    scheduleTbl.setAttribute("zk_component_ID", "Lookup_Data_Schedule");
    scheduleTbl.setShowTotals(true);
    p_centerSouth.appendChild(scheduleTbl);
    p_centerSouth.setTitle(Msg.translate(Env.getCtx(), "C_InvoicePaySchedule_ID"));
    p_centerSouth.setTooltiptext(Msg.translate(Env.getCtx(), "C_InvoicePaySchedule_ID"));
    super.setSizes();
}
Also used : Hbox(org.zkoss.zul.Hbox) WListbox(org.adempiere.webui.component.WListbox) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Aggregations

Hbox (org.zkoss.zul.Hbox)38 Label (org.adempiere.webui.component.Label)17 Row (org.adempiere.webui.component.Row)15 Rows (org.adempiere.webui.component.Rows)13 Div (org.zkoss.zul.Div)10 Separator (org.zkoss.zul.Separator)8 Vbox (org.zkoss.zul.Vbox)8 Center (org.zkoss.zul.Center)7 Button (org.adempiere.webui.component.Button)6 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)6 Panel (org.adempiere.webui.component.Panel)6 Grid (org.adempiere.webui.component.Grid)5 Tabpanel (org.adempiere.webui.component.Tabpanel)5 ToolBarButton (org.adempiere.webui.component.ToolBarButton)5 Textbox (org.adempiere.webui.component.Textbox)4 Center (org.zkoss.zkex.zul.Center)4 South (org.zkoss.zkex.zul.South)4 SimpleDateFormat (java.text.SimpleDateFormat)3 Tab (org.adempiere.webui.component.Tab)3 WAppsAction (org.adempiere.webui.component.WAppsAction)3