Search in sources :

Example 1 with East

use of org.zkoss.zkex.zul.East in project adempiere by adempiere.

the class ADWindowPanel method doCreatePart.

protected Component doCreatePart(Component parent) {
    layout = new Borderlayout();
    if (parent != null) {
        layout.setParent(parent);
        layout.setStyle("position:absolute");
        layout.setHeight("100%");
        layout.setWidth("100%");
    } else {
        layout.setPage(page);
    }
    if (!isEmbedded()) {
        North n = new North();
        n.setParent(layout);
        n.setCollapsible(false);
        n.setFlex(true);
        Vbox box = new Vbox();
        box.setWidth("100%");
        toolbar.setParent(box);
        box.setParent(n);
        toolbar.setWindowNo(getWindowNo());
        //	FR [ 588 ]
        South s = new South();
        layout.appendChild(s);
        s.setCollapsible(false);
        statusBar.setParent(s);
    } else {
        South s = new South();
        layout.appendChild(s);
        s.setCollapsible(false);
        statusBar.setParent(s);
    }
    LayoutUtils.addSclass("adwindow-status", statusBar);
    if (!isEmbedded() && adTab.isUseExternalSelection()) {
        String tabPlacement = SessionManager.getSessionApplication().getUserPreference().getProperty(UserPreference.P_WINDOW_TAB_PLACEMENT);
        if (tabPlacement == null || "left".equalsIgnoreCase(tabPlacement)) {
            west = new West();
            layout.appendChild(west);
            west.setSplittable(false);
            west.setAutoscroll(true);
            west.setFlex(true);
            LayoutUtils.addSclass("adwindow-nav adwindow-left-nav", west);
            adTab.setTabplacement(IADTab.LEFT);
            adTab.getTabSelectionComponent().setParent(west);
            if (SessionManager.getSessionApplication().getUserPreference().isPropertyBool(UserPreference.P_WINDOW_TAB_COLLAPSIBLE)) {
                west.setTitle(Msg.getElement(Env.getCtx(), "AD_Tab_ID"));
                west.setCollapsible(true);
            }
        } else {
            east = new East();
            layout.appendChild(east);
            east.setSplittable(false);
            east.setAutoscroll(true);
            east.setFlex(true);
            LayoutUtils.addSclass("adwindow-nav adwindow-right-nav", east);
            adTab.setTabplacement(IADTab.RIGHT);
            adTab.getTabSelectionComponent().setParent(east);
            if (SessionManager.getSessionApplication().getUserPreference().isPropertyBool(UserPreference.P_WINDOW_TAB_COLLAPSIBLE)) {
                east.setTitle(Msg.getElement(Env.getCtx(), "AD_Tab_ID"));
                east.setCollapsible(true);
            }
        }
        LayoutUtils.addSclass("adwindow-nav-content", (HtmlBasedComponent) adTab.getTabSelectionComponent());
    }
    contentArea = new Center();
    contentArea.setParent(layout);
    contentArea.setAutoscroll(true);
    contentArea.setFlex(true);
    adTab.createPart(contentArea);
    if (parent instanceof Tabpanel) {
        TabOnCloseHanlder handler = new TabOnCloseHanlder();
        ((Tabpanel) parent).setOnCloseHandler(handler);
    }
    if (!isEmbedded()) {
        if (keyListener != null)
            keyListener.detach();
        keyListener = new Keylistener();
        statusBar.appendChild(keyListener);
        keyListener.setCtrlKeys("#f1#f2#f3#f4#f5#f6#f7#f8#f9#f10#f11#f12^f^i^n^s^d@#left@#right@#up@#down@#pgup@#pgdn@p^p@z@x#enter");
        keyListener.addEventListener(Events.ON_CTRL_KEY, toolbar);
        keyListener.addEventListener(Events.ON_CTRL_KEY, this);
        keyListener.setAutoBlur(false);
    }
    layout.setAttribute(ITabOnSelectHandler.ATTRIBUTE_KEY, new ITabOnSelectHandler() {

        public void onSelect() {
            IADTab adTab = getADTab();
            if (adTab != null) {
                IADTabPanel iadTabpanel = adTab.getSelectedTabpanel();
                if (iadTabpanel != null && iadTabpanel instanceof ADTabPanel) {
                    ADTabPanel adTabpanel = (ADTabPanel) iadTabpanel;
                    if (adTabpanel.isGridView()) {
                        adTabpanel.getGridView().scrollToCurrentRow();
                    }
                }
            }
        }
    });
    return layout;
}
Also used : Center(org.zkoss.zkex.zul.Center) West(org.zkoss.zkex.zul.West) South(org.zkoss.zkex.zul.South) Borderlayout(org.zkoss.zkex.zul.Borderlayout) IADTab(org.adempiere.webui.component.IADTab) ITabOnSelectHandler(org.adempiere.webui.part.ITabOnSelectHandler) North(org.zkoss.zkex.zul.North) Keylistener(org.zkforge.keylistener.Keylistener) Vbox(org.zkoss.zul.Vbox) East(org.zkoss.zkex.zul.East) Tabpanel(org.adempiere.webui.component.Tabpanel)

Example 2 with East

use of org.zkoss.zkex.zul.East in project adempiere by adempiere.

the class WPOS method dynInit.

//	init
/**************************************************************************
	 * 	Dynamic Init.
	 * 	PosPanel has a GridBagLayout.
	 * 	The Sub Panels return their position
	 */
private boolean dynInit() {
    setMPOS();
    userPinListener = new WPOSUserPinListener(this);
    //Delay 5 seconds by default
    userPinTimer = new Timer((getPINEntryTimeout() + 5) * 1000);
    userPinTimer.addEventListener(Events.ON_TIMER, userPinListener);
    userPinListener.setTimer(userPinTimer);
    userPinTimer.setRunning(false);
    Borderlayout mainLayout = new Borderlayout();
    actionPanel = new WPOSActionPanel(this);
    documentPanel = new WPOSDocumentPanel(this);
    orderLinePanel = new WPOSOrderLinePanel(this);
    infoProductPanel = new WPOSInfoProduct(this);
    quantityPanel = new WPOSQuantityPanel(this);
    East east = new East();
    Center center = new Center();
    West westPanel = new West();
    South southPanel = new South();
    Borderlayout fullPanel = new Borderlayout();
    Borderlayout mediumPanel = new Borderlayout();
    statusBar.appendChild(userPinTimer);
    southPanel.appendChild(statusBar);
    center.setStyle("border: none; width:40%");
    center.appendChild(fullPanel);
    mainLayout.appendChild(center);
    center.setStyle("border: none; height:auto%;");
    fullPanel.setWidth("100%");
    fullPanel.setHeight("auto");
    fullPanel.setStyle("overflow:hidden;height:auto;");
    westPanel.appendChild(this.actionPanel);
    east.appendChild(documentPanel);
    this.actionPanel.appendChild(infoProductPanel.getPanel());
    if (IsShowLineControl())
        this.actionPanel.appendChild(quantityPanel.getPanel());
    this.actionPanel.appendChild(orderLinePanel);
    east.setSplittable(true);
    east.setStyle("border: none; min-width:44%; width:44%");
    fullPanel.appendChild(westPanel);
    Center centerPanel = new Center();
    fullPanel.appendChild(centerPanel);
    centerPanel.appendChild(mediumPanel);
    //	FR [ 44 ] Change Button location
    westPanel.setStyle("display:inline-block;border: none; width:100%; height:auto;float:left;overflow:hidden;");
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.appendChild(east);
    mainLayout.appendChild(southPanel);
    form.appendChild(mainLayout);
    //	Seek to last
    if (hasRecord()) {
        lastRecord();
    }
    refreshPanel();
    form.setHeight("100%");
    return true;
}
Also used : Center(org.zkoss.zkex.zul.Center) Timer(org.zkoss.zul.Timer) West(org.zkoss.zkex.zul.West) South(org.zkoss.zkex.zul.South) Borderlayout(org.adempiere.webui.component.Borderlayout) East(org.zkoss.zkex.zul.East)

Aggregations

Center (org.zkoss.zkex.zul.Center)2 East (org.zkoss.zkex.zul.East)2 South (org.zkoss.zkex.zul.South)2 West (org.zkoss.zkex.zul.West)2 Borderlayout (org.adempiere.webui.component.Borderlayout)1 IADTab (org.adempiere.webui.component.IADTab)1 Tabpanel (org.adempiere.webui.component.Tabpanel)1 ITabOnSelectHandler (org.adempiere.webui.part.ITabOnSelectHandler)1 Keylistener (org.zkforge.keylistener.Keylistener)1 Borderlayout (org.zkoss.zkex.zul.Borderlayout)1 North (org.zkoss.zkex.zul.North)1 Timer (org.zkoss.zul.Timer)1 Vbox (org.zkoss.zul.Vbox)1