Search in sources :

Example 11 with Separator

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

the class InfoPanel method init.

protected void init() {
    ThemeUtils.addSclass("ad-infopanel", this);
    if (isModal()) {
        setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
        setBorder("normal");
        setClosable(true);
        setWidth(p_width + "px");
        setHeight(p_height + "px");
        setContentStyle("overflow: auto");
        setSizable(true);
        setMaximizable(true);
        ThemeUtils.addSclass("ad-infopanel-modal", this);
    } else {
        setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
        //			setBorder("none");
        //			setWidth("100%");
        //			setHeight("100%");
        //			setStyle("position: absolute");
        ThemeUtils.addSclass("ad-infopanel-embedded", this);
    }
    // Elaine 2008/12/16
    confirmPanel = new ConfirmPanel(true, true, false, true, true, true);
    confirmPanel.addActionListener(Events.ON_CLICK, this);
    // Elaine 2008/12/16
    confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setVisible(hasCustomize());
    confirmPanel.getButton(ConfirmPanel.A_HISTORY).setVisible(hasHistory());
    confirmPanel.getButton(ConfirmPanel.A_ZOOM).setVisible(hasZoom());
    confirmPanel.getButton(ConfirmPanel.A_OK).setVisible(p_saveResults);
    checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
    checkAutoQuery.setTooltip(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
    checkAutoQuery.setName("AutoQuery");
    checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
    checkAutoQuery.setAttribute("zk_component_ID", "Lookup_Confirm_checkAutoQuery");
    checkAutoQuery.addActionListener(this);
    confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(checkAutoQuery, confirmPanel.getButton(ConfirmPanel.A_REFRESH));
    confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(new Separator("vertical"), confirmPanel.getButton(ConfirmPanel.A_REFRESH));
    //
    statusBar.setEastVisibility(false);
    statusBar.setAttribute("zk_component_ID", "info_statusBar");
    //
    p_southLayout.setVflex("min");
    Center center = new Center();
    center.appendChild(confirmPanel);
    p_southLayout.appendChild(center);
    South south = new South();
    south.appendChild(statusBar);
    p_southLayout.appendChild(south);
    //
    // Reset button
    bReset = confirmPanel.createButton(ConfirmPanel.A_RESET);
    bReset.addActionListener(this);
    lblReset = new Label();
    lblReset.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Reset")));
    p_table.setOddRowSclass(null);
    p_table.setAttribute("zk_component_ID", "Lookup_Data_SearchResults");
    p_table.setVflex(true);
    // Sizes
    p_centerNorth.setVflex("min");
    p_centerCenter.setVflex("1");
    p_centerSouth.setHeight("25%");
    //
    ThemeUtils.addSclass("info-panel-center", p_centerLayout);
    // May be empty
    p_centerLayout.appendChild(p_centerNorth);
    // the table
    p_centerLayout.appendChild(p_centerCenter);
    // detail tabs or other
    p_centerLayout.appendChild(p_centerSouth);
    //
    // Need to use a container for p_table so we can insert paging if required.
    Div div = new Div();
    div.appendChild(p_table);
    div.setVflex("1");
    div.setHflex("1");
    p_centerCenter.appendChild(div);
    p_centerCenter.setAutoscroll(false);
    p_centerCenter.setHflex("1");
    //
    p_centerSouth.setCollapsible(true);
    p_centerSouth.setSplittable(true);
    p_centerSouth.setHflex("1");
    //  Setup the north reset button and criteria grid
    West spWest = new West();
    spWest.setHflex("min");
    ThemeUtils.addSclass("criteria", spWest);
    Center spCenter = new Center();
    //spCenter.setWidth("100%");
    spCenter.setHflex("1");
    spCenter.setVflex("min");
    ThemeUtils.addSclass("criteria", spCenter);
    p_northLayout.setHflex("min");
    p_northLayout.setVflex("min");
    p_northLayout.appendChild(spWest);
    p_northLayout.appendChild(spCenter);
    // spWest - the reset button
    Grid bGrid = GridFactory.newGridLayout();
    bGrid.setSizedByContent(true);
    Columns bColumns = new Columns();
    Column col = new Column();
    col.setHflex("min");
    bColumns.appendChild(col);
    bGrid.appendChild(bColumns);
    Rows bRows = new Rows();
    Row bRow = new Row();
    bGrid.appendChild(bRows);
    bRows.appendChild(bRow);
    bRow.appendChild(bReset);
    bRow = new Row();
    bRows.appendChild(bRow);
    bRow.appendChild(lblReset);
    spWest.appendChild(bGrid);
    // The criteria table
    //p_criteriaGrid.setSizedByContent(true);
    spCenter.appendChild(p_criteriaGrid);
    Borderlayout mainPanel = new Borderlayout();
    mainPanel.setWidth("100%");
    mainPanel.setHeight("100%");
    //
    North north = new North();
    mainPanel.appendChild(north);
    north.appendChild(p_northLayout);
    //
    center = new Center();
    mainPanel.appendChild(center);
    center.appendChild(p_centerLayout);
    //
    south = new South();
    mainPanel.appendChild(south);
    south.appendChild(p_southLayout);
    //
    if (!isModal()) {
        mainPanel.setStyle("position: absolute");
    }
    this.appendChild(mainPanel);
    this.addEventListener(Events.ON_OK, this);
    this.setVisible(true);
}
Also used : Center(org.zkoss.zul.Center) West(org.zkoss.zul.West) Grid(org.adempiere.webui.component.Grid) South(org.zkoss.zul.South) Label(org.adempiere.webui.component.Label) Columns(org.adempiere.webui.component.Columns) Borderlayout(org.zkoss.zul.Borderlayout) Div(org.zkoss.zul.Div) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) IDColumn(org.compiere.minigrid.IDColumn) Column(org.adempiere.webui.component.Column) North(org.zkoss.zul.North) Row(org.adempiere.webui.component.Row) Separator(org.zkoss.zul.Separator) Rows(org.adempiere.webui.component.Rows)

Example 12 with Separator

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

the class InfoPAttributePanel method addAttributes.

//	dynInit
/**
	 * 	Add Attributes
	 *	@return rows
	 */
private int addAttributes() {
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String whereAttributeSet;
    if (p_M_AttributeSet_ID > 0)
        whereAttributeSet = "AND M_Attribute_ID IN (SELECT M_Attribute_ID FROM M_AttributeUse WHERE M_AttributeSet_ID=" + p_M_AttributeSet_ID + ")";
    else
        whereAttributeSet = "";
    String sql = MRole.getDefault().addAccessSQL("SELECT M_Attribute_ID, Name, Description, AttributeValueType, IsInstanceAttribute " + "FROM M_Attribute " + "WHERE IsActive='Y' " + whereAttributeSet + " ORDER BY IsInstanceAttribute, Name", "M_Attribute", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
    boolean instanceLine = false;
    boolean productLine = false;
    try {
        pstmt = DB.prepareStatement(sql, null);
        rs = pstmt.executeQuery();
        while (rs.next()) {
            int attribute_ID = rs.getInt(1);
            String name = rs.getString(2);
            String description = rs.getString(3);
            String attributeValueType = rs.getString(4);
            boolean isInstanceAttribute = "Y".equals(rs.getString(5));
            // Add label for product attributes if there are any
            if (!productLine && !isInstanceAttribute) {
                Row row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Label group = new Label(Msg.translate(Env.getCtx(), "IsProductAttribute"));
                row.appendChild(group);
                rows.appendChild(row);
                row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Separator separator = new Separator();
                separator.setBar(true);
                row.appendChild(separator);
                rows.appendChild(row);
                productLine = true;
            }
            //	Add label for Instances attributes
            if (!instanceLine && isInstanceAttribute) {
                Row row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Label group = new Label(Msg.translate(Env.getCtx(), "IsInstanceAttribute"));
                row.appendChild(group);
                rows.appendChild(row);
                row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Separator separator = new Separator();
                separator.setBar(true);
                row.appendChild(separator);
                rows.appendChild(row);
                instanceLine = true;
            }
            //
            Row row = new Row();
            rows.appendChild(row);
            Label label = new Label(name);
            if (description != null && description.length() > 0)
                label.setTooltiptext(description);
            Div div = new Div();
            div.setAlign("right");
            div.appendChild(label);
            row.appendChild(div);
            Component field = null;
            if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributeValueType)) {
                field = new Listbox();
                ((Listbox) field).setRows(0);
                ((Listbox) field).setMultiple(false);
                ((Listbox) field).setMold("select");
                ((Listbox) field).setWidth("150px");
                KeyNamePair[] knp = getAttributeList(attribute_ID);
                for (int i = 0; i < knp.length; i++) ((Listbox) field).appendItem(knp[i].getName(), knp[i]);
            } else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) {
                field = new WNumberEditor(name, false, false, true, DisplayType.Number, name).getComponent();
                ((NumberBox) field).setWidth("150px");
            } else {
                field = new WStringEditor(name, false, false, true, 10, 40, null, null).getComponent();
                ((Textbox) field).setWidth("150px");
            }
            row.appendChild(field);
            //
            field.setId(String.valueOf(attribute_ID));
            // If name is null, replace it with "_"
            if (name.equals("")) {
                name = "_";
            }
            field.setAttribute("zk_component_ID", "InfoPAttributePanel_field_" + name.replaceAll("[^a-zA-Z0-9_]", "_"));
            //
            if (isInstanceAttribute)
                m_instanceEditors.add(field);
            else
                m_productEditors.add(field);
            //	To (numbers)
            Component fieldTo = null;
            if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) {
                fieldTo = new WNumberEditor(name, false, false, true, DisplayType.Number, name).getComponent();
                ((NumberBox) fieldTo).setWidth("150px");
                row = new Row();
                rows.appendChild(row);
                div = new Div();
                div.setAlign("right");
                div.appendChild(new Label("-"));
                row.appendChild(div);
                row.appendChild(fieldTo);
            }
            if (fieldTo != null)
                fieldTo.setAttribute("zk_component_ID", "InfoPAttributePanel_fieldTo_" + name);
            if (isInstanceAttribute)
                m_instanceEditorsTo.add(fieldTo);
            else
                m_productEditorsTo.add(fieldTo);
        }
    } catch (Exception e) {
        log.log(Level.SEVERE, sql, e);
    } finally {
        DB.close(rs, pstmt);
        rs = null;
        pstmt = null;
    }
    // print instance line if not printed
    if (!instanceLine) {
        boolean isGuarantee = true;
        boolean isSerial = true;
        boolean isLot = true;
        if (p_M_AttributeSet_ID > 0) {
            MAttributeSet as = new MAttributeSet(Env.getCtx(), p_M_AttributeSet_ID, null);
            isGuarantee = as.isGuaranteeDate();
            isSerial = as.isSerNo();
            isLot = as.isLot();
        }
        if (isGuarantee || isSerial || isLot) {
            Row row = new Row();
            rows.appendChild(row);
            row.setSpans("2");
            Label group = new Label(Msg.translate(Env.getCtx(), "IsInstanceAttribute"));
            row.appendChild(group);
            rows.appendChild(row);
            row = new Row();
            rows.appendChild(row);
            row.setSpans("2");
            Separator separator = new Separator();
            separator.setBar(true);
            row.appendChild(separator);
            rows.appendChild(row);
            instanceLine = true;
        }
    }
    return 0;
}
Also used : Label(org.adempiere.webui.component.Label) PreparedStatement(java.sql.PreparedStatement) NumberBox(org.adempiere.webui.component.NumberBox) WStringEditor(org.adempiere.webui.editor.WStringEditor) MAttributeSet(org.compiere.model.MAttributeSet) Div(org.zkoss.zul.Div) ResultSet(java.sql.ResultSet) Row(org.adempiere.webui.component.Row) KeyNamePair(org.compiere.util.KeyNamePair) Component(org.zkoss.zk.ui.Component) Listbox(org.adempiere.webui.component.Listbox) Separator(org.zkoss.zul.Separator) WNumberEditor(org.adempiere.webui.editor.WNumberEditor)

Example 13 with Separator

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

the class WBOMDrop method createMainPanel.

//	getInvoices
/**************************************************************************
	 * 	Create Main Panel.
	 * 	Called when changing Product
	 */
private void createMainPanel() {
    log.config(": " + m_product);
    this.getChildren().clear();
    //this.invalidate();
    //this.setBorder(null);
    m_selectionList.clear();
    m_productList.clear();
    m_qtyList.clear();
    m_buttonGroups.clear();
    this.appendChild(new Separator());
    this.appendChild(grpSelectionPanel);
    this.appendChild(new Separator());
    this.appendChild(grpSelectProd);
    this.appendChild(new Separator());
    this.appendChild(confirmPanel);
    this.appendChild(new Separator());
    this.setBorder("normal");
    Caption title = new Caption(Msg.getMsg(Env.getCtx(), "SelectProduct"));
    grpSelectProd.getChildren().clear();
    grpSelectProd.appendChild(title);
    if (m_product != null && m_product.get_ID() > 0) {
        title.setLabel(m_product.getName());
        if (m_product.getDescription() != null && m_product.getDescription().length() > 0)
            //this.setsetToolTipText(m_product.getDescription());
            ;
        m_bomLine = 0;
        addBOMLines(m_product, m_qty);
    }
}
Also used : Separator(org.zkoss.zul.Separator) Caption(org.zkoss.zul.Caption)

Example 14 with Separator

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

the class WBOMDrop method addBOMLines.

//	createMainPanel
/**
	 * 	Add BOM Lines to this.
	 * 	Called recursively
	 * 	@param product product
	 * 	@param qty quantity
	 */
private void addBOMLines(MProduct product, BigDecimal qty) {
    MProductBOM[] bomLines = MProductBOM.getBOMLines(product);
    for (int i = 0; i < bomLines.length; i++) {
        grpSelectProd.appendChild(new Separator());
        addBOMLine(bomLines[i], qty);
        grpSelectProd.appendChild(new Separator());
    }
    log.fine("#" + bomLines.length);
}
Also used : MProductBOM(org.compiere.model.MProductBOM) Separator(org.zkoss.zul.Separator)

Example 15 with Separator

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

the class WCharge method createNewChargePanel.

/**
     * Creates the New Charge panel.
     *
     * The New Charge panel is used to specify the name and key of an account
     * and whether or not the account is a charge account.
     */
private void createNewChargePanel() {
    final int nameFieldColumns = 20;
    final int valueFieldColumns = 10;
    // top row
    m_lblValue.setValue(Msg.translate(Env.getCtx(), EColumn.VALUE.title()));
    m_txbValueField.setCols(valueFieldColumns);
    m_chbIsExpense.setChecked(true);
    m_chbIsExpense.setLabel(Msg.getMsg(Env.getCtx(), EColumn.EXPENSE.title()));
    // bottom row
    m_lblName.setValue(Msg.translate(Env.getCtx(), EColumn.NAME.title()));
    m_txbNameField.setCols(nameFieldColumns);
    m_btnNew.setLabel(Msg.getMsg(Env.getCtx(), AD_MESSAGE_CREATE) + " " + Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
    m_btnNew.addEventListener(Events.ON_CLICK, this);
    Rows rows = new Rows();
    m_grdNew.appendChild(rows);
    Row row = new Row();
    rows.appendChild(row);
    row.setSpans("3");
    Label label = new Label(Msg.getMsg(Env.getCtx(), "ChargeNewAccount"));
    label.setStyle("font-weight: bold;");
    row.appendChild(label);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(m_lblValue);
    row.appendChild(m_txbValueField);
    row.appendChild(m_chbIsExpense);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(m_lblName);
    row.appendChild(m_txbNameField);
    row.appendChild(m_btnNew);
    row = new Row();
    rows.appendChild(row);
    row.setSpans("3");
    row.appendChild(new Separator());
    return;
}
Also used : Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Separator(org.zkoss.zul.Separator) Rows(org.adempiere.webui.component.Rows)

Aggregations

Separator (org.zkoss.zul.Separator)38 Row (org.adempiere.webui.component.Row)11 Center (org.zkoss.zul.Center)11 Label (org.adempiere.webui.component.Label)10 Rows (org.adempiere.webui.component.Rows)10 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)9 Div (org.zkoss.zul.Div)9 North (org.zkoss.zul.North)9 Hbox (org.zkoss.zul.Hbox)8 South (org.zkoss.zul.South)8 Panel (org.adempiere.webui.component.Panel)7 Borderlayout (org.zkoss.zul.Borderlayout)7 North (org.zkoss.zkex.zul.North)6 South (org.zkoss.zkex.zul.South)5 Vbox (org.zkoss.zul.Vbox)5 Button (org.adempiere.webui.component.Button)4 Tabpanel (org.adempiere.webui.component.Tabpanel)4 Borderlayout (org.zkoss.zkex.zul.Borderlayout)4 Center (org.zkoss.zkex.zul.Center)4 Space (org.zkoss.zul.Space)4