Search in sources :

Example 6 with Hbox

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

the class ConfirmPanel method init.

/**
     * initialise components
     */
private void init() {
    pnlBtnLeft = new Hbox();
    // load from the left
    pnlBtnLeft.setPack("start");
    // Shrink to fit the contents
    pnlBtnLeft.setHflex("min");
    pnlBtnLeft.setSizedByContent(false);
    ThemeUtils.addSclass("ad-confirmpanel-left", pnlBtnLeft);
    pnlBtnRight = new Hbox();
    // Load from the right
    pnlBtnRight.setPack("end");
    // Take up the rest of the space in the Confirm Panel
    pnlBtnRight.setHflex("1");
    pnlBtnRight.setSizedByContent(false);
    ThemeUtils.addSclass("ad-confirmpanel-right", pnlBtnRight);
    this.appendChild(pnlBtnLeft);
    this.appendChild(pnlBtnRight);
    ThemeUtils.addSclass("ad-confirmpanel", this);
}
Also used : Hbox(org.zkoss.zul.Hbox)

Example 7 with Hbox

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

the class FindWindow method addSelectionColumn.

// setValues
/**
     *  Add Selection Column to first Tab
     *  @param mField field
    **/
public void addSelectionColumn(GridField mField) {
    log.config(mField.getHeader());
    int displayLength = mField.getDisplayLength();
    if (displayLength <= 0 || displayLength > FIELDLENGTH)
        mField.setDisplayLength(FIELDLENGTH);
    else
        displayLength = 0;
    //  Editor
    WEditor editor = null;
    Label label = null;
    if (mField.isRangeLookup()) {
        Hbox box = new Hbox();
        editor = WebEditorFactory.getEditor(mField, false);
        label = editor.getLabel();
        editor.setMandatory(false);
        editor.setReadWrite(true);
        editor.dynamicDisplay();
        Component fieldLabel = editor.getComponent();
        box.appendChild(editor.getComponent());
        rangeFirstEditor.add(mField.getColumnName());
        // The Editor
        WEditor toRangeEditor = WebEditorFactory.getEditor(mField, false);
        // New Field value to be updated to editor
        toRangeEditor.setMandatory(false);
        toRangeEditor.setReadWrite(true);
        toRangeEditor.dynamicDisplay();
        //
        m_sEditors2.add(toRangeEditor);
        Label separator = new Label(" - ");
        box.appendChild(separator);
        Component fieldLabel1 = toRangeEditor.getComponent();
        box.appendChild(toRangeEditor.getComponent());
        if (//  set it back
        displayLength > 0)
            mField.setDisplayLength(displayLength);
        //
        if (isTwoColumns) {
            if (!isPair)
                panel = new Row();
        } else
            panel = new Row();
        panel.appendChild(LayoutUtils.makeRightAlign(label));
        panel.appendChild(box);
        contentSimpleRows.appendChild(panel);
        fieldLabel.addEventListener(Events.ON_OK, this);
        fieldLabel1.addEventListener(Events.ON_OK, this);
    } else {
        editor = WebEditorFactory.getEditor(mField, false);
        label = editor.getLabel();
        editor.setMandatory(false);
        editor.setReadWrite(true);
        editor.dynamicDisplay();
        Component fieldLabel = editor.getComponent();
        if (//  set it back
        displayLength > 0)
            mField.setDisplayLength(displayLength);
        //
        if (isTwoColumns) {
            if (!isPair)
                panel = new Row();
        } else
            panel = new Row();
        panel.appendChild(LayoutUtils.makeRightAlign(label));
        panel.appendChild(fieldLabel);
        contentSimpleRows.appendChild(panel);
        fieldLabel.addEventListener(Events.ON_OK, this);
        m_sEditors2.add(null);
    }
    m_sEditors.add(editor);
}
Also used : Hbox(org.zkoss.zul.Hbox) Label(org.adempiere.webui.component.Label) WEditor(org.adempiere.webui.editor.WEditor) Row(org.adempiere.webui.component.Row) Component(org.zkoss.zk.ui.Component)

Example 8 with Hbox

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

the class FindWindow method initSimple.

/**
     * initialise lookup record tab
     * @throws IOException 
     *
    **/
private void initSimple() throws IOException {
    lblDocumentNo = new Label();
    lblDocumentNo.setValue(Msg.translate(Env.getCtx(), "DocumentNo").replaceAll("&", ""));
    lblDescription = new Label();
    lblDescription.setValue(Msg.translate(Env.getCtx(), "Description").replaceAll("&", ""));
    lblName = new Label();
    lblName.setValue(Msg.translate(Env.getCtx(), "Name").replaceAll("&", ""));
    lblValue = new Label();
    lblValue.setValue(Msg.translate(Env.getCtx(), "Value").replaceAll("&", ""));
    fieldDocumentNo = new Textbox();
    fieldDocumentNo.setId("fieldDocumentNo");
    fieldDocumentNo.setMaxlength(40);
    fieldDescription = new Textbox();
    fieldDescription.setId("fieldDescription");
    fieldDescription.setMaxlength(40);
    fieldName = new Textbox();
    fieldName.setMaxlength(40);
    fieldValue = new Textbox();
    fieldValue.setMaxlength(40);
    //	Get button from Action
    WAppsAction action = new WAppsAction(ConfirmPanel.A_NEW, null, ConfirmPanel.A_NEW);
    Button btnNew = action.getButton();
    btnNew.setName("btnNew");
    btnNew.addEventListener(Events.ON_CLICK, this);
    //	Get button from Action
    action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
    Button btnOk = action.getButton();
    btnOk.setName("btnOkSimple");
    btnOk.addEventListener(Events.ON_CLICK, this);
    //	Get from action
    action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
    Button btnCancel = action.getButton();
    btnCancel.setName("btnCancel");
    btnCancel.addEventListener(Events.ON_CLICK, this);
    Panel pnlButtonRight = new Panel();
    //	Change to Standard button order
    pnlButtonRight.appendChild(btnCancel);
    pnlButtonRight.appendChild(btnOk);
    pnlButtonRight.setAlign("right");
    pnlButtonRight.setWidth("100%");
    Panel pnlButtonLeft = new Panel();
    pnlButtonLeft.appendChild(btnNew);
    Hbox hboxButton = new Hbox();
    hboxButton.appendChild(pnlButtonLeft);
    hboxButton.appendChild(pnlButtonRight);
    hboxButton.setWidth("100%");
    pnlDocument = new Row();
    pnlDocument.setId("pnlDocument");
    pnlDocument.appendChild(LayoutUtils.makeRightAlign(lblDocumentNo));
    pnlDocument.appendChild(fieldDocumentNo);
    pnlDescription = new Row();
    pnlDescription.appendChild(LayoutUtils.makeRightAlign(lblDescription));
    pnlDescription.appendChild(fieldDescription);
    pnlValue = new Row();
    pnlValue.appendChild(LayoutUtils.makeRightAlign(lblValue));
    pnlValue.appendChild(fieldValue);
    pnlName = new Row();
    pnlName.appendChild(LayoutUtils.makeRightAlign(lblName));
    pnlName.appendChild(fieldName);
    contentSimple = new Grid();
    contentSimple.setId("contentSimple");
    contentSimple.setWidth("100%");
    contentSimple.makeNoStrip();
    contentSimpleRows = new Rows();
    contentSimple.appendChild(contentSimpleRows);
    contentSimpleRows.appendChild(pnlValue);
    contentSimpleRows.appendChild(pnlName);
    contentSimpleRows.appendChild(pnlDocument);
    contentSimpleRows.appendChild(pnlDescription);
    contentSimple.setVflex(true);
    Borderlayout layout = new Borderlayout();
    layout.setStyle("height: 100%; width: 99%; position: relative");
    winLookupRecord.appendChild(layout);
    Center center = new Center();
    layout.appendChild(center);
    center.appendChild(contentSimple);
    center.setFlex(true);
    South south = new South();
    layout.appendChild(south);
    south.appendChild(hboxButton);
    winLookupRecord.setWidth("100%");
    winLookupRecord.setHeight("100%");
    winLookupRecord.addEventListener(Events.ON_OK, this);
}
Also used : Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Hbox(org.zkoss.zul.Hbox) Center(org.zkoss.zkex.zul.Center) Button(org.adempiere.webui.component.Button) ToolBarButton(org.adempiere.webui.component.ToolBarButton) Grid(org.adempiere.webui.component.Grid) Label(org.adempiere.webui.component.Label) Textbox(org.adempiere.webui.component.Textbox) South(org.zkoss.zkex.zul.South) Row(org.adempiere.webui.component.Row) Borderlayout(org.zkoss.zkex.zul.Borderlayout) WAppsAction(org.adempiere.webui.component.WAppsAction) Rows(org.adempiere.webui.component.Rows)

Example 9 with Hbox

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

the class AboutWindow method createCredit.

private Tabpanel createCredit() {
    Tabpanel tabPanel = new Tabpanel();
    Vbox vbox = new Vbox();
    vbox.setParent(tabPanel);
    vbox.setWidth("100%");
    Hbox hbox = new Hbox();
    hbox.setParent(vbox);
    ToolBarButton link = new ToolBarButton();
    link.setImage("images/Posterita.jpg");
    link.setParent(hbox);
    link.setHref("http://www.posterita.org");
    link.setTarget("_blank");
    Label label = new Label("Contributed the initial Zk Web Client code.");
    label.setParent(hbox);
    Separator separator = new Separator();
    separator.setParent(vbox);
    Div div = new Div();
    div.setParent(vbox);
    div.setWidth("100%");
    Label caption = new Label("Sponsors");
    caption.setStyle("font-weight: bold;");
    div.appendChild(caption);
    separator = new Separator();
    separator.setBar(true);
    separator.setParent(div);
    Vbox content = new Vbox();
    content.setWidth("100%");
    content.setParent(div);
    link = new ToolBarButton();
    link = new ToolBarButton();
    link.setLabel("eEvolution");
    link.setHref("http://www.eevolution.com/");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Adaxa");
    link.setHref("http://www.adaxa.com/");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Westfalia IT");
    link.setHref("http://www.westfalia-it.com");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Walkingtree ");
    link.setHref("http://www.walkingtree.in");
    link.setTarget("_blank");
    link.setParent(content);
    link.setLabel("Sysnova");
    link.setHref("http://www.sysnova.com/");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Idalica");
    link.setHref("http://www.idalica.com/");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("ERPCyA");
    link.setHref("http://www.erpcya.com/");
    link.setTarget("_blank");
    link.setParent(content);
    separator = new Separator();
    separator.setParent(vbox);
    div = new Div();
    div.setParent(vbox);
    div.setWidth("100%");
    caption = new Label("Contributors");
    caption.setStyle("font-weight: bold;");
    div.appendChild(caption);
    separator = new Separator();
    separator.setBar(true);
    separator.setParent(div);
    content = new Vbox();
    content.setWidth("100%");
    content.setParent(div);
    link = new ToolBarButton();
    link.setLabel("Victor PĂ©rez");
    link.setHref("http://wiki.adempiere.net/User:vpj-cd");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Paul Bowden");
    link.setHref("http://wiki.adempiere.net/User:Phib");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Michael McKay");
    link.setHref("http://wiki.adempiere.net/User:MJMcKay");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Mario Calderon");
    link.setHref("http://wiki.adempiere.net/User:mar_cal_westf");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Ashley G Ramdass");
    link.setHref("http://wiki.adempiere.net/User:Agramdass");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Low Heng Sin");
    link.setHref("http://wiki.adempiere.net/User:Hengsin");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Carlos Ruiz");
    link.setHref("http://wiki.adempiere.net/User:CarlosRuiz");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Teo Sarca");
    link.setHref("http://wiki.adempiere.net/User:Teo_sarca");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Trifon Trifonov");
    link.setHref("http://wiki.adempiere.net/User:Trifonnt");
    link.setTarget("_blank");
    link.setParent(content);
    link = new ToolBarButton();
    link.setLabel("Yamel Senih");
    link.setHref("http://wiki.adempiere.net/User:Yamel_Senih");
    link.setTarget("_blank");
    link.setParent(content);
    return tabPanel;
}
Also used : Div(org.zkoss.zul.Div) Hbox(org.zkoss.zul.Hbox) ToolBarButton(org.adempiere.webui.component.ToolBarButton) Label(org.adempiere.webui.component.Label) Tabpanel(org.adempiere.webui.component.Tabpanel) Vbox(org.zkoss.zul.Vbox) Separator(org.zkoss.zul.Separator)

Example 10 with Hbox

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

the class InfoCashLinePanel method statInit.

// InfoCashLinePanel
/**
	 *	Static Setup - add fields to parameterPanel
	 *  @throws Exception if Lookups cannot be created
	 */
private void statInit() {
    // 	Format the dates and number boxes
    fDateFrom.setWidth("97px");
    fDateTo.setWidth("97px");
    fAmtFrom.getDecimalbox().setWidth("90px");
    fAmtTo.getDecimalbox().setWidth("90px");
    fDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_DateFrom");
    fDateFrom.addEventListener(Events.ON_CHANGE, this);
    fDateTo.setAttribute("zk_component_ID", "Lookup_Criteria_DateTo");
    fDateTo.addEventListener(Events.ON_CHANGE, this);
    fAmtFrom.setAttribute("zk_component_ID", "Lookup_Criteria_AmtFrom");
    fAmtFrom.addEventListener(Events.ON_CHANGE, this);
    fAmtTo.setAttribute("zk_component_ID", "Lookup_Criteria_AmtTo");
    fAmtTo.addEventListener(Events.ON_CHANGE, this);
    SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
    fDateFrom.setFormat(dateFormat.toPattern());
    fDateTo.setFormat(dateFormat.toPattern());
    DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount, AEnv.getLanguage(Env.getCtx()));
    fAmtFrom.getDecimalbox().setFormat(format.toPattern());
    fAmtFrom.getDecimalbox().setStyle("text-align:right; " + fAmtFrom.getDecimalbox().getStyle());
    fAmtTo.getDecimalbox().setFormat(format.toPattern());
    fAmtTo.getDecimalbox().setStyle("text-align:right; " + fAmtTo.getDecimalbox().getStyle());
    //  Create the main criteria fields
    //  5241 - C_Cash.C_Cash_ID
    fCash_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, p_TabNo, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_Cash_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Cash_ID"), "", false, false, true);
    fCash_ID.addValueChangeListener(this);
    fCash_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Cash_ID");
    // 5249 - C_Cash.C_CashBook_ID
    fCashBook_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_CashBook_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_CashBook_ID"), "", false, false, true);
    fCashBook_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    //fCashBook_ID.addValueChangeListener(this);
    fCashBook_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_CashBook_ID");
    //  Width is set in WTableDirEditor to 200px.  Make it more flexible;
    fCashBook_ID.getComponent().setWidth("100%");
    // 5354 - C_CashLine.C_Invoice_ID
    fInvoice_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Invoice_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_Invoice_ID"), "", false, false, true);
    fInvoice_ID.addValueChangeListener(this);
    fInvoice_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Invoice_ID");
    //	5296 - C_CashLine.C_Charge_ID
    fPayment_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Payment_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Payment_ID"), "", false, false, true);
    fPayment_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Payment_ID");
    //	5295 - C_CashLine.C_BankAccount_ID
    fBankAccount_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_BankAccount_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_BankAccount_ID"), "", false, false, true);
    fBankAccount_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    //fBankAccount_ID.addValueChangeListener(this);
    fBankAccount_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
    //  Width is set in WTableDirEditor to 200px.  Make it more flexible;
    fBankAccount_ID.getComponent().setWidth("100%");
    //	5296 - C_CashLine.C_Charge_ID
    fCharge_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Charge_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Charge_ID"), "", false, false, true);
    fCharge_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    fCharge_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Charge_ID");
    //  Width is set in WTableDirEditor to 200px.  Make it more flexible;
    fCharge_ID.getComponent().setWidth("100%");
    cbAbsolute.setLabel(Msg.translate(Env.getCtx(), "AbsoluteAmt"));
    cbAbsolute.addEventListener(Events.ON_CHECK, this);
    cbAbsolute.setAttribute("zk_component_ID", "Lookup_Criteria_AbsoluteAmt");
    //  Setup the criteria.  The rest of the panel is managed by the info.java class
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(fCashBook_ID.getLabel().rightAlign());
    row.appendChild(fCashBook_ID.getComponent());
    row.appendChild(fCash_ID.getLabel().rightAlign());
    row.appendChild(fCash_ID.getComponent());
    row = new Row();
    rows.appendChild(row);
    row.appendChild(fInvoice_ID.getLabel().rightAlign());
    row.appendChild(fInvoice_ID.getComponent());
    row.appendChild(fPayment_ID.getLabel().rightAlign());
    row.appendChild(fPayment_ID.getComponent());
    row = new Row();
    //row.setSpans("1, 1, 1, 1");
    rows.appendChild(row);
    row.appendChild(fBankAccount_ID.getLabel().rightAlign());
    row.appendChild(fBankAccount_ID.getComponent());
    row.appendChild(lDateFrom.rightAlign());
    Hbox hbox = new Hbox();
    hbox.appendChild(fDateFrom);
    hbox.appendChild(lDateTo);
    hbox.appendChild(fDateTo);
    row.appendChild(hbox);
    row = new Row();
    //row.setSpans("1, 1, 1, 1");
    rows.appendChild(row);
    row.appendChild(fCharge_ID.getLabel().rightAlign());
    row.appendChild(fCharge_ID.getComponent());
    row.appendChild(lAmtFrom.rightAlign());
    hbox = new Hbox();
    hbox.appendChild(fAmtFrom);
    hbox.appendChild(lAmtTo);
    hbox.appendChild(fAmtTo);
    hbox.appendChild(cbAbsolute);
    row.appendChild(hbox);
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) Hbox(org.zkoss.zul.Hbox) DecimalFormat(java.text.DecimalFormat) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Row(org.adempiere.webui.component.Row) SimpleDateFormat(java.text.SimpleDateFormat) 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