From: Lennart P. <le...@us...> - 2005-02-19 08:35:48
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22015/src/org/redpos/client/ui/plugin/function Modified Files: FindProduct.java Log Message: Added dispose of SWT composite. Use of findProductByTextOrBarcode Index: FindProduct.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/FindProduct.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FindProduct.java 18 Jan 2005 15:31:56 -0000 1.4 --- FindProduct.java 19 Feb 2005 08:35:39 -0000 1.5 *************** *** 60,64 **** private String defaultPricelistId; ! private Integer productSearchInput; --- 60,64 ---- private String defaultPricelistId; ! private Integer productSearchInput; *************** *** 78,81 **** --- 78,89 ---- * ui.clearTable(); ui.setFocusInInput(); } */ + // Ok, but at least we should call dispose on the old UI ! + try + { + ui.dispose(); + } + catch(NullPointerException e) + { + } ui = null; ui = new FindProductUI(parent, language, this, productSearchInput); *************** *** 94,104 **** "RedPOS.client:service=ProductStorage"); ! Object[] params = {value, value, value, Boolean.TRUE}; String[] signature = {"java.lang.String", "java.lang.String", ! "java.lang.String", "java.lang.Boolean"}; // call pos core method Vector response = (Vector)getServer().invoke(posCore, ! "findProductByTextOrProductIdOrBarcode", params, signature); if(response.isEmpty()) --- 102,112 ---- "RedPOS.client:service=ProductStorage"); ! Object[] params = {value, value, Boolean.TRUE}; String[] signature = {"java.lang.String", "java.lang.String", ! "java.lang.Boolean"}; // call pos core method Vector response = (Vector)getServer().invoke(posCore, ! "findProductByTextOrBarcode", params, signature); if(response.isEmpty()) *************** *** 182,190 **** defaultPricelistId = (String)po.getProperty("pos", "defaultpricelist"); ! productSearchInput = (Integer)po.getProperty("pos", "productsearchinput"); } ! ! /** * Invoked by the FindProductUI * --- 190,198 ---- defaultPricelistId = (String)po.getProperty("pos", "defaultpricelist"); ! productSearchInput = (Integer)po.getProperty("pos", "productsearchinput"); } ! ! /** * Invoked by the FindProductUI * *************** *** 240,244 **** { dAmount = Double.valueOf(input); ! if(dAmount.doubleValue() >= 10000) { --- 248,252 ---- { dAmount = Double.valueOf(input); ! if(dAmount.doubleValue() >= 10000) { *************** *** 246,250 **** String message = language.getString( "ui.main.message.editreceiptrow4.text", ! "You have to enter a valid price"); sendUIMessage(message); --- 254,258 ---- String message = language.getString( "ui.main.message.editreceiptrow4.text", ! "You have to enter a valid price"); sendUIMessage(message); *************** *** 257,266 **** addProductToReceipt(selectedProduct, amount); } ! catch (NumberFormatException e) { // send message to ui String message = language.getString( "ui.main.message.editreceiptrow4.text", ! "You have to enter a valid price"); sendUIMessage(message); userInput.setFocus(); --- 265,274 ---- addProductToReceipt(selectedProduct, amount); } ! catch(NumberFormatException e) { // send message to ui String message = language.getString( "ui.main.message.editreceiptrow4.text", ! "You have to enter a valid price"); sendUIMessage(message); userInput.setFocus(); *************** *** 270,273 **** --- 278,289 ---- else userInput.setFocus(); + try + { + userInput.dispose(); + userInput = null; + } + catch(NullPointerException e) + { + } } *************** *** 280,283 **** --- 296,307 ---- PluginFunctionConstants.NOTIFICATION_FUNCTION_FINISHED, null); + try + { + userInput.dispose(); + userInput = null; + } + catch(NullPointerException e) + { + } } *************** *** 314,321 **** Object parameters[] = {product.getProductId(), Boolean.TRUE, new Double(1), price}; ! String signature[] = {"java.lang.String", "java.lang.Boolean", "java.lang.Double", "org.redpos.amount.Amount"}; ! // TODO: the used method in the POS service will redo the search of // this product, add a new method for just adding product? --- 338,345 ---- Object parameters[] = {product.getProductId(), Boolean.TRUE, new Double(1), price}; ! String signature[] = {"java.lang.String", "java.lang.Boolean", "java.lang.Double", "org.redpos.amount.Amount"}; ! // TODO: the used method in the POS service will redo the search of // this product, add a new method for just adding product? |