Search in sources :

Example 36 with Hbox

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

the class ProcessPanel method initComponents.

/**
	 * Initialize components
	 */
@Override
public void initComponents() {
    m_separators = new ArrayList<Label>();
    rows = new Rows();
    //
    mainPanel = new Panel();
    parameterPanel = GridFactory.newGridLayout();
    parameterPanel.setInnerWidth(width);
    //setup columns
    Columns columns = new Columns();
    parameterPanel.appendChild(columns);
    int colN = getColumns() * 2;
    if (colN != 0) {
        int percent = 100 / colN;
        for (int i = 0; i < colN; i++) {
            Column col = new Column();
            col.setWidth((i == 0 ? ((int) percent / 2) : percent) + "%");
            columns.appendChild(col);
        }
    }
    //	Add Rows
    parameterPanel.appendChild(rows);
    //	
    mainLayout = new Borderlayout();
    mainLayout.setStyle("border: none; overflow: auto");
    //	Message Panel
    if (isShowDescription()) {
        messageDiv = new Div();
        message = new Html();
        messageDiv.appendChild(message);
        messageDiv.setStyle(MESSAGE_DIV_STYLE);
        messagePanel = new North();
        messagePanel.appendChild(messageDiv);
        messagePanel.setAutoscroll(true);
        messagePanel.setStyle("border: none;");
        mainLayout.appendChild(messagePanel);
    }
    //	Parameter Panel
    centerPanel = new Center();
    mainLayout.appendChild(centerPanel);
    centerPanel.appendChild(parameterPanel);
    centerPanel.setFlex(false);
    centerPanel.setStyle("border: none");
    //	Buttons Panel
    if (isShowButtons()) {
        Grid southRowPanel = GridFactory.newGridLayout();
        Rows rows = southRowPanel.newRows();
        Row row = rows.newRow();
        Hbox hBox = new Hbox();
        hBox.appendChild(lSaved);
        fSavedName.addEventListener(Events.ON_CHANGE, this);
        hBox.appendChild(fSavedName);
        bSave.setEnabled(false);
        bSave.setImage("/images/Save24.png");
        bSave.setSclass("action-button");
        bSave.addActionListener(this);
        hBox.appendChild(bSave);
        bDelete.setEnabled(false);
        bDelete.setImage("/images/Delete24.png");
        bDelete.setSclass("action-button");
        bDelete.addActionListener(this);
        hBox.appendChild(bDelete);
        row.appendChild(hBox);
        Panel confParaPanel = new Panel();
        confParaPanel.setAlign("right");
        //	BR [ 300 ]
        try {
            //	Set Ok
            WAppsAction action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
            bOK = action.getButton();
            //	Set to Cancel
            action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
            bCancel = action.getButton();
            //	Add Listener
            bOK.addEventListener(Events.ON_CLICK, this);
            bCancel.addEventListener(Events.ON_CLICK, this);
            //	Add to Panel
            confParaPanel.appendChild(bCancel);
            confParaPanel.appendChild(bOK);
        } catch (Exception e) {
            log.severe("Error loading Buttons " + e.getLocalizedMessage());
        }
        //	
        row.appendChild(confParaPanel);
        South south = new South();
        south.appendChild(southRowPanel);
        //	Add to Main panel
        mainLayout.appendChild(south);
    }
    //	Set Text
    if (isShowDescription()) {
        message.setContent(getTextMsg());
    }
    //	
    mainPanel.appendChild(mainLayout);
    mainPanel.setHeight("100%");
    mainPanel.setWidth("100%");
}
Also used : Hbox(org.zkoss.zul.Hbox) Center(org.zkoss.zkex.zul.Center) Grid(org.adempiere.webui.component.Grid) Label(org.adempiere.webui.component.Label) South(org.zkoss.zkex.zul.South) Columns(org.adempiere.webui.component.Columns) Html(org.zkoss.zul.Html) Borderlayout(org.adempiere.webui.component.Borderlayout) WAppsAction(org.adempiere.webui.component.WAppsAction) Div(org.zkoss.zul.Div) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Column(org.adempiere.webui.component.Column) North(org.zkoss.zkex.zul.North) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 37 with Hbox

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

the class WBOMDrop method addDisplay.

//	addBOMLine
/**
	 * 	Add Line to Display
	 *	@param parentM_Product_ID parent product
	 *	@param M_Product_ID product
	 *	@param bomType bom type
	 *	@param name name
	 *	@param lineQty qty
	 */
private void addDisplay(int parentM_Product_ID, int M_Product_ID, String bomType, String name, BigDecimal lineQty) {
    log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty);
    boolean selected = true;
    Hbox boxQty = new Hbox();
    boxQty.setWidth("100%");
    boxQty.setWidths("10%, 40%, 50%");
    if (MProductBOM.BOMTYPE_StandardPart.equals(bomType)) {
        String title = "";
        Checkbox cb = new Checkbox();
        cb.setLabel(title);
        cb.setChecked(true);
        cb.setEnabled(false);
        m_selectionList.add(cb);
        boxQty.appendChild(cb);
    } else if (MProductBOM.BOMTYPE_OptionalPart.equals(bomType)) {
        String title = Msg.getMsg(Env.getCtx(), "Optional");
        Checkbox cb = new Checkbox();
        cb.setLabel(title);
        cb.setChecked(false);
        selected = false;
        cb.addEventListener(Events.ON_CHECK, this);
        m_selectionList.add(cb);
        boxQty.appendChild(cb);
    } else //	Alternative
    {
        String title = Msg.getMsg(Env.getCtx(), "Alternative") + " " + bomType;
        Radio b = new Radio();
        b.setLabel(title);
        String groupName = String.valueOf(parentM_Product_ID) + "_" + bomType;
        Radiogroup group = m_buttonGroups.get(groupName);
        if (group == null) {
            log.fine("ButtonGroup=" + groupName);
            group = new Radiogroup();
            m_buttonGroups.put(groupName, group);
            group.appendChild(b);
            //	select first one
            b.setSelected(true);
        } else {
            group.appendChild(b);
            b.setSelected(false);
            selected = false;
        }
        b.addEventListener(Events.ON_CLICK, this);
        m_selectionList.add(b);
        boxQty.appendChild(b);
    }
    //	Add to List & display
    m_productList.add(new Integer(M_Product_ID));
    Decimalbox qty = new Decimalbox();
    qty.setValue(lineQty);
    qty.setReadonly(!selected);
    m_qtyList.add(qty);
    Label label = new Label(name);
    HtmlBasedComponent c = (HtmlBasedComponent) label.rightAlign();
    c.setStyle(c.getStyle() + ";margin-right: 5px");
    boxQty.appendChild(c);
    boxQty.appendChild(qty);
    grpSelectProd.appendChild(boxQty);
}
Also used : Hbox(org.zkoss.zul.Hbox) Decimalbox(org.zkoss.zul.Decimalbox) Checkbox(org.adempiere.webui.component.Checkbox) Radiogroup(org.zkoss.zul.Radiogroup) Label(org.adempiere.webui.component.Label) Radio(org.zkoss.zul.Radio) HtmlBasedComponent(org.zkoss.zk.ui.HtmlBasedComponent)

Example 38 with Hbox

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

the class UserPanel method init.

private void init() {
    // vbox
    this.setSclass("user-panel");
    this.setAlign("right");
    // Top row
    lblUserNameValue.setValue(getUserName() + "@" + getClientName() + "." + getOrgName() + "/" + getRoleName());
    lblUserNameValue.setId("loginUserAndRole");
    ThemeUtils.addSclass("user-panel-username", lblUserNameValue);
    this.appendChild(lblUserNameValue);
    Hbox hbox = new Hbox();
    ThemeUtils.addSclass("user-panel-buttons", hbox);
    this.appendChild(hbox);
    hbox.setPack("end");
    hbox.setVflex("1");
    // TODO - make configurable
    context.setLabel(Msg.getMsg(Env.getCtx(), "Context"));
    context.setId("context");
    context.addEventListener(Events.ON_CLICK, this);
    ThemeUtils.addSclass("link", context);
    context.setParent(hbox);
    Separator sep = new Separator("vertical");
    sep.setBar(true);
    sep.setParent(hbox);
    preference.setLabel(Msg.getMsg(Env.getCtx(), "Preference"));
    preference.setId("preference");
    preference.addEventListener(Events.ON_CLICK, this);
    ThemeUtils.addSclass("link", preference);
    preference.setParent(hbox);
    sep = new Separator("vertical");
    sep.setBar(true);
    sep.setParent(hbox);
    role.setLabel(this.getRoleName());
    role.setId("role");
    role.addEventListener(Events.ON_CLICK, this);
    ThemeUtils.addSclass("link", role);
    role.setParent(hbox);
    sep = new Separator("vertical");
    sep.setBar(true);
    sep.setParent(hbox);
    logout.setLabel(Msg.getMsg(Env.getCtx(), "Logout"));
    logout.setId("logout");
    logout.addEventListener(Events.ON_CLICK, this);
    ThemeUtils.addSclass("link", logout);
    logout.setParent(hbox);
}
Also used : Hbox(org.zkoss.zul.Hbox) Separator(org.zkoss.zul.Separator)

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