Search in sources :

Example 1 with Timer

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

the class WPOS method init.

/**
	 *	zk Initialize Panel
	 *  @param WindowNo window
	 *  @param frame parent frame
	 */
public void init() {
    log.info("init - SalesRep_ID=" + Env.getAD_User_ID(getCtx()));
    windowNo = form.getWindowNo();
    isCorrectUserPin = null;
    //
    try {
        dynInit();
    } catch (AdempierePOSException exception) {
        FDialog.error(getWindowNo(), frame, exception.getLocalizedMessage());
        dispose();
        return;
    }
    if (getAutoLogoutDelay() > 0 && logoutTimer == null) {
        logoutTimer = new Timer(1000);
        logoutTimer.start();
    }
    startServerSocket();
}
Also used : Timer(org.zkoss.zul.Timer)

Example 2 with Timer

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

the class WPOSActionPanel method init.

@Override
public void init() {
    Grid LayoutButton = GridFactory.newGridLayout();
    Row row = null;
    Rows rows = null;
    isKeyboard = false;
    LayoutButton.setStyle("border: none; width:400px; height:95%;");
    appendChild(LayoutButton);
    rows = LayoutButton.newRows();
    LayoutButton.setStyle("border:none");
    row = rows.newRow();
    row.setHeight("55px");
    // NEW
    buttonNew = createButtonAction(ACTION_NEW, "F2");
    buttonNew.addActionListener(this);
    row.appendChild(buttonNew);
    // PRINT
    buttonPrint = createButtonAction(ACTION_PRINT, "F12");
    buttonPrint.addActionListener(this);
    row.appendChild(buttonPrint);
    // DocType 
    buttonDocType = createButtonAction(ACTION_DOCTYPE, "F10");
    buttonDocType.addActionListener(this);
    buttonDocType.setTooltiptext("F10-" + Msg.translate(ctx, "C_DocType_ID"));
    row.appendChild(buttonDocType);
    // PRODUCT
    buttonProduct = createButtonAction(ACTION_PRODUCT, "Alt+I");
    buttonProduct.addActionListener(this);
    buttonProduct.setTooltiptext("Alt+I-" + Msg.translate(ctx, "InfoProduct"));
    row.appendChild(buttonProduct);
    // BPartner Search
    buttonBPartner = createButtonAction(ACTION_BPARTNER, "Alt+B");
    buttonBPartner.addActionListener(this);
    buttonBPartner.setTooltiptext("Alt+B-" + Msg.translate(ctx, "IsCustomer"));
    row.appendChild(buttonBPartner);
    buttonProcess = createButtonAction(ACTION_PROCESS, "Alt+P");
    buttonProcess.addActionListener(this);
    buttonProcess.setTooltiptext("ALT+P-" + Msg.translate(ctx, "Process"));
    row.appendChild(buttonProcess);
    // HISTORY
    buttonHistory = createButtonAction(ACTION_HISTORY, "F9");
    buttonHistory.addActionListener(this);
    row.appendChild(buttonHistory);
    buttonBack = createButtonAction(ACTION_BACK, "Alt+Left");
    buttonBack.setTooltiptext("Alt+Left-" + Msg.translate(ctx, "Previous"));
    row.appendChild(buttonBack);
    buttonNext = createButtonAction(ACTION_NEXT, "Alt+Right");
    buttonNext.setTooltiptext("Alt+Right" + Msg.translate(ctx, "Next"));
    row.appendChild(buttonNext);
    // PAYMENT
    buttonCollect = createButtonAction(ACTION_PAYMENT, "F4");
    buttonCollect.addActionListener(this);
    row.appendChild(buttonCollect);
    buttonCollect.setEnabled(false);
    // Cancel
    buttonCancel = createButtonAction(ACTION_CANCEL, "F3");
    buttonCancel.addActionListener(this);
    buttonCancel.setTooltiptext("F3-" + Msg.translate(ctx, "POS.IsCancel"));
    row.appendChild(buttonCancel);
    buttonCancel.setEnabled(false);
    // LOGOUT
    buttonLogout = createButtonAction(ACTION_LOGOUT, "Alt+L");
    buttonLogout.addActionListener(this);
    buttonLogout.setTooltiptext("Alt+L-" + Msg.translate(ctx, "End"));
    row.appendChild(buttonLogout);
    row.setHeight("55px");
    fieldProductName = new WPOSTextField(Msg.translate(Env.getCtx(), "M_Product_ID"), posPanel.getKeyboard());
    fieldProductName.setWidth("98%");
    fieldProductName.setHeight("35px");
    Keylistener keyListener = new Keylistener();
    keyListener.setCtrlKeys("#f2#f3#f4#f9#f10@b@#left@#right^l@i@p");
    keyListener.addEventListener(Events.ON_CTRL_KEY, posPanel);
    keyListener.addEventListener(Events.ON_CTRL_KEY, this);
    keyListener.setAutoBlur(false);
    fieldProductName.setStyle("Font-size:medium; font-weight:bold");
    fieldProductName.setValue(Msg.translate(Env.getCtx(), "M_Product_ID"));
    fieldProductName.addEventListener(this);
    row = rows.newRow();
    row.setSpans("12");
    if (posPanel.isEnableProductLookup() && !posPanel.isVirtualKeyboard()) {
        lookupProduct = new WPOSLookupProduct(this, fieldProductName, new Long("1"));
        lookupProduct.setPriceListId(posPanel.getM_PriceList_ID());
        lookupProduct.setPartnerId(posPanel.getC_BPartner_ID());
        lookupProduct.setWarehouseId(posPanel.getM_Warehouse_ID());
        // , lookupProduct);
        findProductTimer = new Timer(500);
        lookupProduct.setWidth("100%");
        lookupProduct.setStyle(WPOS.FONTSTYLE + WPOS.FONTSIZELARGE);
        fieldProductName.appendChild(keyListener);
        fieldProductName.setVisible(false);
        fieldProductName.setWidth("0%");
        findProductTimer.start();
        lookupProduct.addEventListener(Events.ON_CHANGE, this);
        row.appendChild(lookupProduct);
        row.appendChild(fieldProductName);
    } else {
        row.appendChild(fieldProductName);
        fieldProductName.appendChild(keyListener);
        fieldProductName.setWidth("100%");
    }
    enableButton();
    actionProcessMenu = new WPOSActionMenu(posPanel);
    //	List Orders
    posPanel.listOrder();
    getMainFocus();
}
Also used : Timer(org.zkoss.zul.Timer) Grid(org.adempiere.webui.component.Grid) Row(org.adempiere.webui.component.Row) Keylistener(org.zkforge.keylistener.Keylistener) Rows(org.adempiere.webui.component.Rows)

Example 3 with Timer

use of org.zkoss.zul.Timer 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

Timer (org.zkoss.zul.Timer)3 Borderlayout (org.adempiere.webui.component.Borderlayout)1 Grid (org.adempiere.webui.component.Grid)1 Row (org.adempiere.webui.component.Row)1 Rows (org.adempiere.webui.component.Rows)1 Keylistener (org.zkforge.keylistener.Keylistener)1 Center (org.zkoss.zkex.zul.Center)1 East (org.zkoss.zkex.zul.East)1 South (org.zkoss.zkex.zul.South)1 West (org.zkoss.zkex.zul.West)1