Search in sources :

Example 1 with Tab

use of org.adempiere.webui.component.Tab in project adempiere by adempiere.

the class ADTabPanel method setTabPanels.

private Tabbox setTabPanels(HorizontalEmbeddedPanel ep, Panel panel) {
    // For One Tab We created only one TabBox
    if (null == tabBox && null == tabPanels) {
        tabBox = new Tabbox();
        tabBox.setHeight("100%");
        //tabBox.setStyle("height: 100%; width: 100%; position: relative;");
        tabPanels = new Tabpanels();
        tabPanels.setHeight("600px");
        tabBox.appendChild(tabPanels);
        tabs = new Tabs();
        tabBox.appendChild(tabs);
    }
    // Setting Name For Tab
    Tab tab = new Tab(ep.gridWindow.getTab(ep.tabIndex).getName());
    tab.addEventListener(Events.ON_CLICK, this);
    tab.addEventListener(Events.ON_FOCUS, this);
    // Appending Tab to Tabs
    tabs.appendChild(tab);
    //Creating a TabPanel For every Tab
    Tabpanel tabPanel = new Tabpanel();
    embeddedTabPanel.put(ep.adTabId, tabPanel);
    tabPanel.setStyle("margin:0; padding:0; border: none; height:600px;");
    //Setting Embedded Panel to tabPanel
    tabPanel.appendChild(panel);
    //Appending Tab Panel To TabPanels
    tabPanels.appendChild(tabPanel);
    //By Default first Tab should populated
    tabBox.setSelectedIndex(0);
    // Returning the tabbox
    return tabBox;
}
Also used : Tab(org.adempiere.webui.component.Tab) Tabpanels(org.adempiere.webui.component.Tabpanels) Tabs(org.adempiere.webui.component.Tabs) Tabbox(org.adempiere.webui.component.Tabbox) Tabpanel(org.adempiere.webui.component.Tabpanel)

Example 2 with Tab

use of org.adempiere.webui.component.Tab in project adempiere by adempiere.

the class ADTabPanel method onEvent.

/**
     * @param event
     * @see EventListener#onEvent(Event)
     */
public void onEvent(Event event) {
    if (event.getTarget() instanceof Tab) {
        Tab tab = (Tab) event.getTarget();
        for (HorizontalEmbeddedPanel embedded : horizontalIncludedPanel) {
            if (embedded.gridWindow.getTab(embedded.tabIndex).getName().equals(tab.getLabel())) {
                if (!getGlobalToolbar().getCurrentPanel().equals(embedded.tabPanel)) {
                    getGlobalToolbar().getCurrentPanel().activate(false);
                    getGlobalToolbar().getCurrentPanel().setUnselected(getGlobalToolbar().getCurrentPanel());
                    getGlobalToolbar().getCurrentPanel().setSelected(embedded.tabPanel);
                    embedded.tabPanel.activate(true);
                    if (gridTab.getAD_Tab_ID() != getGlobalToolbar().getCurrentPanel().getGridTab().getAD_Tab_ID()) {
                        DataStatusEvent m_DataStatusEvent = new DataStatusEvent(this, gridTab.getRowCount(), false, false, false);
                        windowPanel.dataStatusChanged(m_DataStatusEvent);
                    }
                }
                return;
            }
        }
    }
    if (event.getTarget() instanceof IADTabPanel) {
        IADTabPanel panel = (IADTabPanel) event.getTarget();
        if (panel == panel.getGlobalToolbar().getCurrentPanel())
            return;
        IADTabPanel last = panel.getGlobalToolbar().getCurrentPanel();
        last.setUnselected(last);
        last.activate(false);
        panel.setSelected(panel);
        panel.activate(true);
        autoResize();
        if (gridTab.getAD_Tab_ID() != panel.getGridTab().getAD_Tab_ID()) {
            DataStatusEvent m_DataStatusEvent = new DataStatusEvent(this, gridTab.getRowCount(), false, false, false);
            windowPanel.dataStatusChanged(m_DataStatusEvent);
        }
    } else if (event.getTarget() == listPanel.getListbox()) {
        this.switchRowPresentation();
    } else if (event.getTarget() == treePanel.getTree()) {
        Treeitem item = treePanel.getTree().getSelectedItem();
        navigateTo((SimpleTreeNode) item.getValue());
    }
}
Also used : Tab(org.adempiere.webui.component.Tab)

Example 3 with Tab

use of org.adempiere.webui.component.Tab in project adempiere by adempiere.

the class WGenForm method zkInit.

//	init
/**
	 *	Static Init.
	 *  <pre>
	 *  selPanel (tabbed)
	 *      fOrg, fBPartner
	 *      scrollPane & miniTable
	 *  genPanel
	 *      info
	 *  </pre>
	 *  @throws Exception
	 */
void zkInit() throws Exception {
    //
    selPanel.setWidth("99%");
    selPanel.setHeight("90%");
    selPanel.setStyle("border: none; position: absolute");
    DesktopTabpanel tabpanel = new DesktopTabpanel();
    tabpanel.appendChild(selPanel);
    Tabpanels tabPanels = new Tabpanels();
    tabPanels.appendChild(tabpanel);
    tabbedPane.appendChild(tabPanels);
    Tabs tabs = new Tabs();
    tabbedPane.appendChild(tabs);
    Tab tab = new Tab(Msg.getMsg(Env.getCtx(), "Select"));
    tabs.appendChild(tab);
    North north = new North();
    selPanel.appendChild(north);
    north.appendChild(selNorthPanel);
    South south = new South();
    selPanel.appendChild(south);
    south.appendChild(confirmPanelSel);
    Center center = new Center();
    selPanel.appendChild(center);
    center.appendChild(miniTable);
    center.setHflex("true");
    center.setVflex("true");
    miniTable.setHeight("99%");
    confirmPanelSel.addActionListener(this);
    //
    tabpanel = new DesktopTabpanel();
    tabPanels.appendChild(tabpanel);
    tabpanel.appendChild(genPanel);
    tab = new Tab(Msg.getMsg(Env.getCtx(), "Generate"));
    tabs.appendChild(tab);
    genPanel.setWidth("99%");
    genPanel.setHeight("90%");
    genPanel.setStyle("border: none; position: absolute");
    center = new Center();
    genPanel.appendChild(center);
    Div div = new Div();
    div.appendChild(info);
    center.appendChild(div);
    south = new South();
    genPanel.appendChild(south);
    south.appendChild(confirmPanelGen);
    confirmPanelGen.addActionListener(this);
}
Also used : Div(org.zkoss.zul.Div) Center(org.zkoss.zul.Center) Tab(org.adempiere.webui.component.Tab) Tabpanels(org.adempiere.webui.component.Tabpanels) South(org.zkoss.zul.South) Tabs(org.adempiere.webui.component.Tabs) North(org.zkoss.zul.North) DesktopTabpanel(org.adempiere.webui.component.DesktopTabpanel)

Example 4 with Tab

use of org.adempiere.webui.component.Tab in project adempiere by adempiere.

the class InfoBPartnerPanel method onEvent.

public void onEvent(Event e) {
    if (!p_loadedOK)
        return;
    Component component = e.getTarget();
    if (component != null) {
        if (// a tab in the subordinate panel is selected
        component instanceof Tab) {
            refresh();
            return;
        }
    }
    super.onEvent(e);
}
Also used : Tab(org.adempiere.webui.component.Tab) Component(org.zkoss.zk.ui.Component)

Example 5 with Tab

use of org.adempiere.webui.component.Tab in project adempiere by adempiere.

the class InfoBPartnerPanel method statInit.

private void statInit() {
    initComponents();
    fieldValue.setWidth("100%");
    fieldContact.setWidth("100%");
    fieldPhone.setWidth("100%");
    fieldName.setWidth("100%");
    fieldEMail.setWidth("100%");
    fieldPostal.setWidth("100%");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(labelValue.rightAlign());
    row.appendChild(fieldValue);
    row.appendChild(labelContact.rightAlign());
    row.appendChild(fieldContact);
    row.appendChild(labelPhone.rightAlign());
    row.appendChild(fieldPhone);
    row.appendChild(checkCustomer);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(labelName.rightAlign());
    row.appendChild(fieldName);
    row.appendChild(labelEMail.rightAlign());
    row.appendChild(fieldEMail);
    row.appendChild(labelPostal.rightAlign());
    row.appendChild(fieldPostal);
    row.appendChild(checkAND);
    statusBar.setEastVisibility(false);
    //  Contact Tab
    ColumnInfo[] s_layoutContact = new ColumnInfo[] { new ColumnInfo(" ", "AD_User_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_Greeting_ID"), "(SELECT g.Greeting from C_Greeting g WHERE g.C_Greeting_ID = AD_User.C_Greeting_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Title"), "Title", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_Location_ID"), "(SELECT a.Name from C_BPartner_Location a WHERE AD_User.C_BPartner_Location_ID=a.C_BPartner_Location_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone"), "Phone", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone2"), "Phone2", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Fax"), "Fax", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "EMail"), "EMail", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "LastContact"), "LastContact", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "LastResult"), "LastResult", String.class) };
    //  From Clause
    String s_sqlFrom = "AD_User";
    //  Where Clause					
    String s_sqlWhere = "C_BPartner_ID = ?  and IsActive = 'Y'";
    m_sqlContact = contactTbl.prepareTable(s_layoutContact, s_sqlFrom, s_sqlWhere, false, "AD_User");
    contactTbl.setMultiSelection(false);
    contactTbl.autoSize();
    contactTbl.getModel().addTableModelListener(this);
    contactTbl.setAttribute("zk_component_ID", "Lookup_Data_Contact");
    //  Location Tab
    ColumnInfo[] s_layoutAddress = new ColumnInfo[] { new ColumnInfo(" ", "l.C_BPartner_Location_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "l.Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone"), "l.Phone", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone2"), "l.Phone2", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Fax"), "l.Fax", String.class), // Replaced with parsed value
    new ColumnInfo(Msg.translate(Env.getCtx(), "Address"), "a.Address1", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsShipTo"), "l.IsShipTo", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsBillTo"), "l.IsBillTo", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsRemitTo"), "l.IsRemitTo", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsPayFrom"), "l.IsPayFrom", Boolean.class) };
    ADDRESS_INDEX = 5;
    /**	From Clause							*/
    String s_locationFrom = "C_BPartner_Location l" + " LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID)";
    /** Where Clause						*/
    String s_locationWhere = "l.C_BPartner_ID = ? and l.IsActive = 'Y'";
    m_sqlAddress = addressTbl.prepareTable(s_layoutAddress, s_locationFrom, s_locationWhere, false, "l");
    addressTbl.setMultiSelection(false);
    addressTbl.autoSize();
    addressTbl.getModel().addTableModelListener(this);
    addressTbl.setAttribute("zk_component_ID", "Lookup_Data_Address");
    //
    detailTabBox.setHeight("100%");
    Tabpanels tabPanels = new Tabpanels();
    detailTabBox.appendChild(tabPanels);
    Tabs tabs = new Tabs();
    detailTabBox.appendChild(tabs);
    Tab tab = new Tab(Util.cleanAmp(Msg.translate(Env.getCtx(), "Contact")));
    tab.addEventListener(Events.ON_SELECT, this);
    tabs.appendChild(tab);
    Tabpanel desktopTabPanel = new Tabpanel();
    desktopTabPanel.setHeight("100%");
    desktopTabPanel.appendChild(contactTbl);
    tabPanels.appendChild(desktopTabPanel);
    tab = new Tab(Msg.translate(Env.getCtx(), "Location"));
    tab.addEventListener(Events.ON_SELECT, this);
    tabs.appendChild(tab);
    desktopTabPanel = new Tabpanel();
    desktopTabPanel.setHeight("100%");
    desktopTabPanel.appendChild(addressTbl);
    tabPanels.appendChild(desktopTabPanel);
    tabs.setAttribute("zk_component_ID", "Subordinate_Tabs");
    Borderlayout southSP = new Borderlayout();
    Center center = new Center();
    North north = new North();
    center.appendChild(detailTabBox);
    southSP.appendChild(north);
    southSP.appendChild(center);
    p_centerSouth.setTitle(Msg.translate(Env.getCtx(), "ContactAndAddress"));
    p_centerSouth.setTooltiptext(Msg.translate(Env.getCtx(), "ContactAndAddress"));
    p_centerSouth.appendChild(southSP);
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
    contactTbl.addActionListener(new EventListener<Event>() {

        public void onEvent(Event event) throws Exception {
            int leadRowKey = 0;
            if (contactTbl != null || contactTbl.getRowCount() > 0)
                leadRowKey = contactTbl.getLeadRowKey();
            if (m_AD_User_ID != leadRowKey) {
                //  From the contact table
                m_AD_User_ID = leadRowKey;
            }
        }
    });
    addressTbl.addActionListener(new EventListener<Event>() {

        public void onEvent(Event event) throws Exception {
            int leadRowKey = 0;
            if (addressTbl != null || addressTbl.getRowCount() > 0)
                leadRowKey = addressTbl.getLeadRowKey();
            if (m_C_BPartner_Location_ID != leadRowKey) {
                //  From the main table
                m_C_BPartner_Location_ID = leadRowKey;
            }
        }
    });
}
Also used : Center(org.zkoss.zul.Center) ColumnInfo(org.compiere.minigrid.ColumnInfo) Borderlayout(org.zkoss.zul.Borderlayout) SQLException(java.sql.SQLException) Tab(org.adempiere.webui.component.Tab) Tabpanels(org.adempiere.webui.component.Tabpanels) Tabs(org.adempiere.webui.component.Tabs) Event(org.zkoss.zk.ui.event.Event) North(org.zkoss.zul.North) Row(org.adempiere.webui.component.Row) Tabpanel(org.adempiere.webui.component.Tabpanel) Rows(org.adempiere.webui.component.Rows)

Aggregations

Tab (org.adempiere.webui.component.Tab)19 Tabpanel (org.adempiere.webui.component.Tabpanel)10 Tabs (org.adempiere.webui.component.Tabs)9 Tabpanels (org.adempiere.webui.component.Tabpanels)8 Center (org.zkoss.zul.Center)7 North (org.zkoss.zul.North)7 Rows (org.adempiere.webui.component.Rows)5 Tabbox (org.adempiere.webui.component.Tabbox)5 Div (org.zkoss.zul.Div)5 Row (org.adempiere.webui.component.Row)4 Event (org.zkoss.zk.ui.event.Event)4 South (org.zkoss.zul.South)4 Component (org.zkoss.zk.ui.Component)3 Borderlayout (org.zkoss.zul.Borderlayout)3 Hbox (org.zkoss.zul.Hbox)3 Vbox (org.zkoss.zul.Vbox)3 SQLException (java.sql.SQLException)2 Borderlayout (org.adempiere.webui.component.Borderlayout)2 Button (org.adempiere.webui.component.Button)2 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)2