From: Lennart P. <le...@us...> - 2005-02-19 18:38:08
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24763/src/org/redpos/client/ui/plugin/function Modified Files: FindProductUI.java Log Message: Make sure that same select is not performed more than once. Code style. Index: FindProductUI.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/FindProductUI.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FindProductUI.java 17 Jan 2005 10:28:15 -0000 1.4 --- FindProductUI.java 19 Feb 2005 18:37:59 -0000 1.5 *************** *** 86,99 **** private Label productInfoSalesupport; ! private Integer productSearch; - - private ProductTableItemData productTableItemData; /** * Constructor */ public FindProductUI(Composite parent, Language language, ! FindProductUIListener listener, Integer productSearchInput) { super(parent, SWT.NORMAL); --- 86,102 ---- private Label productInfoSalesupport; ! private Integer productSearch; + private ProductTableItemData productTableItemData; + + private String lastFind; + /** * Constructor */ public FindProductUI(Composite parent, Language language, ! FindProductUIListener listener, ! Integer productSearchInput) { super(parent, SWT.NORMAL); *************** *** 145,149 **** inputField.setLayoutData(inputFieldGridData); //inputField.setFont(fontManager.getInputFieldFont()); ! // create input field key listener KeyListener keyListener = new KeyAdapter() --- 148,152 ---- inputField.setLayoutData(inputFieldGridData); //inputField.setFont(fontManager.getInputFieldFont()); ! // create input field key listener KeyListener keyListener = new KeyAdapter() *************** *** 151,155 **** public void keyReleased(KeyEvent event) { ! if(inputField.getText().length() > (productSearch.intValue()-1)) findSelected(); } --- 154,158 ---- public void keyReleased(KeyEvent event) { ! if(inputField.getText().length() > (productSearch.intValue() - 1)) findSelected(); } *************** *** 241,246 **** if(index != -1) { ! inputField.setEditable(false); ! showProduct(index); } } --- 244,249 ---- if(index != -1) { ! inputField.setEditable(false); ! showProduct(index); } } *************** *** 394,398 **** listener.addProductToReceiptSelected(productTableItemData.productData, productTableItemData.priceData); ! } --- 397,401 ---- listener.addProductToReceiptSelected(productTableItemData.productData, productTableItemData.priceData); ! } *************** *** 425,429 **** //inputField.selectAll(); String value = inputField.getText(); ! listener.findSelected(value); } --- 428,437 ---- //inputField.selectAll(); String value = inputField.getText(); ! // Don't use same select ! if(!value.equals(lastFind)) ! { ! listener.findSelected(value); ! lastFind = value; ! } } *************** *** 514,518 **** if(productTableItemData.priceData != null) { ! Amount amount = new Amount(productTableItemData.priceData.getGrossPrice(), productTableItemData.priceData.getCurrency()); priceText = amount.toString(); --- 522,527 ---- if(productTableItemData.priceData != null) { ! Amount amount = new Amount( ! productTableItemData.priceData.getGrossPrice(), productTableItemData.priceData.getCurrency()); priceText = amount.toString(); |