Search in sources :

Example 26 with Borderlayout

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

the class WCreateFromInvoiceUI method zkInit.

//  dynInit
/**
	 * Init ZK
	 * @throws Exception
	 */
protected void zkInit() throws Exception {
    bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
    orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));
    shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", false));
    rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));
    Borderlayout parameterLayout = new Borderlayout();
    parameterLayout.setHeight("110px");
    parameterLayout.setWidth("100%");
    Panel parameterPanel = v_CreateFromPanel.getParameterPanel();
    parameterPanel.appendChild(parameterLayout);
    Grid parameterStdLayout = GridFactory.newGridLayout();
    Panel parameterStdPanel = new Panel();
    parameterStdPanel.appendChild(parameterStdLayout);
    Center center = new Center();
    parameterLayout.appendChild(center);
    center.appendChild(parameterStdPanel);
    Rows rows = (Rows) parameterStdLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(bPartnerLabel.rightAlign());
    if (bPartnerField != null)
        row.appendChild(bPartnerField.getComponent());
    row.appendChild(orderLabel.rightAlign());
    row.appendChild(orderField);
    row = rows.newRow();
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(shipmentLabel.rightAlign());
    row.appendChild(shipmentField);
    // Add RMA document selection to panel
    row = rows.newRow();
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(rmaLabel.rightAlign());
    row.appendChild(rmaField);
    //	Add to Main
    v_CreateFromPanel.setWidth("100%");
    v_CreateFromPanel.setHeight("100%");
    v_Container.appendChild(v_CreateFromPanel);
}
Also used : Space(org.zkoss.zul.Space) Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zul.Center) Grid(org.adempiere.webui.component.Grid) Borderlayout(org.zkoss.zul.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 27 with Borderlayout

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

the class WCreateFromShipmentUI method zkInit.

//  dynInit
/**
	 * Instance Data
	 * @throws Exception
	 */
protected void zkInit() throws Exception {
    boolean isRMAWindow = isRMA();
    bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
    orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));
    invoiceLabel.setText(Msg.getElement(Env.getCtx(), "C_Invoice_ID", false));
    rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));
    locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    sameWarehouseCb.setText(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", true));
    sameWarehouseCb.setTooltiptext(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", false));
    upcLabel.setText(Msg.getElement(Env.getCtx(), "UPC", false));
    Borderlayout parameterLayout = new Borderlayout();
    parameterLayout.setHeight("120px");
    parameterLayout.setWidth("100%");
    Panel parameterPanel = v_CreateFromPanel.getParameterPanel();
    parameterPanel.appendChild(parameterLayout);
    Grid parameterStdLayout = GridFactory.newGridLayout();
    Panel parameterStdPanel = new Panel();
    parameterStdPanel.appendChild(parameterStdLayout);
    Center center = new Center();
    parameterLayout.appendChild(center);
    center.appendChild(parameterStdPanel);
    parameterStdPanel.appendChild(parameterStdLayout);
    Rows rows = (Rows) parameterStdLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(bPartnerLabel.rightAlign());
    if (bPartnerField != null)
        row.appendChild(bPartnerField.getComponent());
    if (!isRMAWindow) {
        row.appendChild(orderLabel.rightAlign());
        row.appendChild(orderField);
    }
    row = rows.newRow();
    row.appendChild(locatorLabel.rightAlign());
    row.appendChild(locatorField.getComponent());
    if (!isRMAWindow) {
        row.appendChild(invoiceLabel.rightAlign());
        row.appendChild(invoiceField);
    }
    row = rows.newRow();
    row.appendChild(new Space());
    row.appendChild(sameWarehouseCb);
    row = rows.newRow();
    row.appendChild(upcLabel.rightAlign());
    row.appendChild(upcField.getComponent());
    if (isRMAWindow) {
        // Add RMA document selection to panel
        row.appendChild(rmaLabel.rightAlign());
        row.appendChild(rmaField);
    }
    //	Add to Main
    v_CreateFromPanel.setWidth("100%");
    v_CreateFromPanel.setHeight("100%");
    v_Container.appendChild(v_CreateFromPanel);
}
Also used : Space(org.zkoss.zul.Space) Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zul.Center) Grid(org.adempiere.webui.component.Grid) Borderlayout(org.zkoss.zul.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 28 with Borderlayout

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

the class WCharge method createAccountPanel.

/**
     * Creates the account panel.
     *
     * The account panel contains:
     * <li>a table detailing all accounts
     * <li>a button for creating charges for selected accounts
     */
private void createAccountPanel() {
    Borderlayout borderlayout = new Borderlayout();
    borderlayout.setStyle("position: absolute");
    borderlayout.setWidth("100%");
    borderlayout.setHeight("100%");
    m_pnlAccount.appendChild(borderlayout);
    North north = new North();
    north.setBorder("none");
    borderlayout.appendChild(north);
    Label label = new Label(Msg.getMsg(Env.getCtx(), "ChargeFromAccount"));
    label.setStyle("font-weight: bold;");
    north.appendChild(label);
    Center center = new Center();
    center.setBorder("none");
    center.setHflex("true");
    center.setVflex("true");
    center.setAutoscroll(true);
    borderlayout.appendChild(center);
    center.appendChild(m_tblData);
    South south = new South();
    south.setBorder("none");
    borderlayout.appendChild(south);
    Panel southPanel = new Panel();
    southPanel.setAlign("right");
    south.appendChild(southPanel);
    m_btnAccount.setLabel(Msg.getMsg(Env.getCtx(), AD_MESSAGE_CREATE) + " " + Msg.getMsg(Env.getCtx(), "From") + " " + Msg.getElement(Env.getCtx(), "Account_ID"));
    m_btnAccount.addEventListener(Events.ON_CLICK, this);
    southPanel.appendChild(m_btnAccount);
    return;
}
Also used : Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Center(org.zkoss.zul.Center) Label(org.adempiere.webui.component.Label) South(org.zkoss.zul.South) North(org.zkoss.zul.North) Borderlayout(org.zkoss.zul.Borderlayout)

Example 29 with Borderlayout

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

the class NavBarDesktop method doCreatePart.

protected Component doCreatePart(Component parent) {
    SidePanel pnlSide = new SidePanel();
    HeaderPanel pnlHead = new HeaderPanel();
    pnlSide.getMenuPanel().addMenuListener(this);
    layout = new Borderlayout();
    if (parent != null) {
        layout.setParent(parent);
        layout.setWidth("100%");
        layout.setHeight("100%");
        layout.setStyle("position: absolute");
    } else
        layout.setPage(page);
    dashboardRunnable = new DashboardRunnable(layout.getDesktop(), this);
    North n = new North();
    n.setSplittable(true);
    n.setCollapsible(false);
    layout.appendChild(n);
    pnlHead.setParent(n);
    leftRegion = new West();
    layout.appendChild(leftRegion);
    leftRegion.setWidth("300px");
    leftRegion.setCollapsible(true);
    leftRegion.setSplittable(true);
    leftRegion.setTitle("Navigation");
    //leftRegion.setHflex("true");
    leftRegion.setVflex("true");
    leftRegion.addEventListener(Events.ON_OPEN, new EventListener() {

        @Override
        public void onEvent(Event event) throws Exception {
            OpenEvent oe = (OpenEvent) event;
            UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
            pref.setProperty(UserPreference.P_MENU_COLLAPSED, !oe.isOpen());
            pref.savePreference();
        }
    });
    UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
    boolean menuCollapsed = pref.isPropertyBool(UserPreference.P_MENU_COLLAPSED);
    leftRegion.setOpen(!menuCollapsed);
    navigationPanel = new Accordion();
    navigationPanel.setParent(leftRegion);
    navigationPanel.setWidth("100%");
    navigationPanel.setHeight("100%");
    navigationPanel.add(pnlSide, "Application Menu");
    Div div = new Div();
    favPanel = (DPFavourites) Executions.createComponents(FAVOURITES_PATH, div, null);
    navigationPanel.add(div, "Favourites");
    //setup drag and drop for favourites
    div = navigationPanel.getHeader(1);
    div.setDroppable(DPFavourites.FAVOURITE_DROPPABLE);
    div.addEventListener(Events.ON_DROP, this);
    div = new Div();
    Component component = Executions.createComponents(ACTIVITIES_PATH, div, null);
    if (component instanceof DashboardPanel) {
        DashboardPanel dashboardPanel = (DashboardPanel) component;
        dashboardRunnable.add(dashboardPanel);
    }
    navigationPanel.add(div, "Activities");
    div = new Div();
    Executions.createComponents(VIEWS_PATH, div, null);
    navigationPanel.add(div, Msg.getMsg(Env.getCtx(), "View").replaceAll("&", ""));
    navigationPanel.setSelectedIndex(0);
    windowArea = new Center();
    windowArea.setParent(layout);
    windowArea.setHflex("true");
    windowArea.setVflex("true");
    windowContainer.createPart(windowArea);
    createHomeTab();
    return layout;
}
Also used : Center(org.zkoss.zul.Center) SidePanel(org.adempiere.webui.panel.SidePanel) West(org.zkoss.zul.West) Borderlayout(org.zkoss.zul.Borderlayout) DashboardRunnable(org.adempiere.webui.dashboard.DashboardRunnable) IOException(java.io.IOException) Div(org.zkoss.zul.Div) DashboardPanel(org.adempiere.webui.dashboard.DashboardPanel) Accordion(org.adempiere.webui.component.Accordion) HeaderPanel(org.adempiere.webui.panel.HeaderPanel) Event(org.zkoss.zk.ui.event.Event) OpenEvent(org.zkoss.zk.ui.event.OpenEvent) DropEvent(org.zkoss.zk.ui.event.DropEvent) North(org.zkoss.zul.North) UserPreference(org.adempiere.webui.util.UserPreference) EventListener(org.zkoss.zk.ui.event.EventListener) Component(org.zkoss.zk.ui.Component) OpenEvent(org.zkoss.zk.ui.event.OpenEvent)

Example 30 with Borderlayout

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

the class NavBar2Desktop method doCreatePart.

protected Component doCreatePart(Component parent) {
    SidePanel pnlSide = new SidePanel();
    HeaderPanel pnlHead = new HeaderPanel();
    pnlSide.getMenuPanel().addMenuListener(this);
    layout = new Borderlayout();
    if (parent != null) {
        layout.setParent(parent);
        layout.setWidth("100%");
        layout.setHeight("100%");
        layout.setStyle("position: absolute");
    } else
        layout.setPage(page);
    dashboardRunnable = new DashboardRunnable(layout.getDesktop(), this);
    North n = new North();
    n.setSplittable(true);
    n.setCollapsible(false);
    layout.appendChild(n);
    pnlHead.setParent(n);
    West w = new West();
    layout.appendChild(w);
    w.setWidth("300px");
    w.setCollapsible(true);
    w.setSplittable(true);
    w.setTitle(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Menu")));
    //w.setHflex("true");
    w.setVflex("true");
    w.addEventListener(Events.ON_OPEN, new EventListener() {

        @Override
        public void onEvent(Event event) throws Exception {
            OpenEvent oe = (OpenEvent) event;
            UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
            pref.setProperty(UserPreference.P_MENU_COLLAPSED, !oe.isOpen());
            pref.savePreference();
        }
    });
    UserPreference pref = SessionManager.getSessionApplication().getUserPreference();
    boolean menuCollapsed = pref.isPropertyBool(UserPreference.P_MENU_COLLAPSED);
    w.setOpen(!menuCollapsed);
    pnlSide.setParent(w);
    Center center = new Center();
    center.setParent(layout);
    center.setHflex("true");
    center.setVflex("true");
    Borderlayout innerLayout = new Borderlayout();
    innerLayout.setHeight("100%");
    innerLayout.setWidth("100%");
    innerLayout.setParent(center);
    West innerW = new West();
    innerW.setWidth("200px");
    innerW.setCollapsible(true);
    innerW.setTitle("Navigation");
    innerW.setSplittable(true);
    innerW.setCollapsible(true);
    innerW.setParent(innerLayout);
    shortcutPanel = new Accordion();
    shortcutPanel.setWidth("100%");
    shortcutPanel.setHeight("100%");
    innerW.appendChild(shortcutPanel);
    Div div = new Div();
    Executions.createComponents(FAVOURITES_PATH, div, null);
    shortcutPanel.add(div, "Favourites");
    div = new Div();
    Component component = Executions.createComponents(ACTIVITIES_PATH, div, null);
    if (component instanceof DashboardPanel) {
        DashboardPanel dashboardPanel = (DashboardPanel) component;
        dashboardRunnable.add(dashboardPanel);
    }
    shortcutPanel.add(div, "Activities");
    shortcutPanel.setSelectedIndex(0);
    windowArea = new Center();
    windowArea.setParent(innerLayout);
    windowArea.setHflex("true");
    windowArea.setVflex("true");
    windowContainer.createPart(windowArea);
    createHomeTab();
    return layout;
}
Also used : Center(org.zkoss.zul.Center) SidePanel(org.adempiere.webui.panel.SidePanel) West(org.zkoss.zul.West) Borderlayout(org.zkoss.zul.Borderlayout) DashboardRunnable(org.adempiere.webui.dashboard.DashboardRunnable) IOException(java.io.IOException) Div(org.zkoss.zul.Div) DashboardPanel(org.adempiere.webui.dashboard.DashboardPanel) Accordion(org.adempiere.webui.component.Accordion) HeaderPanel(org.adempiere.webui.panel.HeaderPanel) Event(org.zkoss.zk.ui.event.Event) OpenEvent(org.zkoss.zk.ui.event.OpenEvent) North(org.zkoss.zul.North) UserPreference(org.adempiere.webui.util.UserPreference) EventListener(org.zkoss.zk.ui.event.EventListener) Component(org.zkoss.zk.ui.Component) OpenEvent(org.zkoss.zk.ui.event.OpenEvent)

Aggregations

Borderlayout (org.zkoss.zul.Borderlayout)30 Center (org.zkoss.zul.Center)30 South (org.zkoss.zul.South)19 North (org.zkoss.zul.North)18 Rows (org.adempiere.webui.component.Rows)10 Row (org.adempiere.webui.component.Row)9 Div (org.zkoss.zul.Div)9 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)8 Grid (org.adempiere.webui.component.Grid)8 Panel (org.adempiere.webui.component.Panel)7 Separator (org.zkoss.zul.Separator)7 Event (org.zkoss.zk.ui.event.Event)5 SQLException (java.sql.SQLException)4 Label (org.adempiere.webui.component.Label)4 West (org.zkoss.zul.West)4 Tab (org.adempiere.webui.component.Tab)3 Tabpanels (org.adempiere.webui.component.Tabpanels)3 Tabs (org.adempiere.webui.component.Tabs)3 EventListener (org.zkoss.zk.ui.event.EventListener)3 IOException (java.io.IOException)2