Or have resource defined in a static class that all these other classes
reference: output.print(UtilProperties.getMessage(PosSettings.resource, "Validating", defaultLocale)); -Adrian [hidden email] wrote: > Author: jleroux > Date: Tue Jul 8 07:04:16 2008 > New Revision: 674829 > > URL: http://svn.apache.org/viewvc?rev=674829&view=rev > Log: > Stick to usage : use resource in UtilProperties.getMessage in place of file name hardcoded (though this does not make a big difference) > > Modified: > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java > ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Tue Jul 8 07:04:16 2008 > @@ -68,6 +68,7 @@ > > public class PosTransaction implements Serializable { > > + private static final String resource = "PosUiLabels"; > public static final String module = PosTransaction.class.getName(); > public static final int NO_PAYMENT = 0; > public static final int INTERNAL_PAYMENT = 1; > @@ -776,14 +777,14 @@ > cart.setOrderPartyId(partyId); > > // validate payment methods > - output.print(UtilProperties.getMessage("PosUiLabels","Validating",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"Validating",defaultLocale)); > Map valRes = ch.validatePaymentMethods(); > if (valRes != null && ServiceUtil.isError(valRes)) { > throw new GeneralException(ServiceUtil.getErrorMessage(valRes)); > } > > // store the "order" > - output.print(UtilProperties.getMessage("PosUiLabels","Saving",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"Saving",defaultLocale)); > Map orderRes = ch.createOrder(session.getUserLogin()); > //Debug.log("Create Order Resp : " + orderRes, module); > > @@ -794,7 +795,7 @@ > } > > // process the payment(s) > - output.print(UtilProperties.getMessage("PosUiLabels","Processing",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"Processing",defaultLocale)); > Map payRes = null; > try { > payRes = ch.processPayment(ProductStoreWorker.getProductStore(productStoreId, session.getDelegator()), session.getUserLogin(), true); > @@ -811,7 +812,7 @@ > double change = (grandTotal - paymentAmt); > > // notify the change due > - output.print(UtilProperties.getMessage("PosUiLabels","CHANGE",defaultLocale) + " " + UtilFormatOut.formatPrice(this.getTotalDue() * -1)); > + output.print(UtilProperties.getMessage(resource,"CHANGE",defaultLocale) + " " + UtilFormatOut.formatPrice(this.getTotalDue() * -1)); > > // threaded drawer/receipt printing > final PosTransaction currentTrans = this; > @@ -921,7 +922,7 @@ > // append the promo info > XModel promo = Journal.appendNode(model, "tr", "itemadjustment", ""); > Journal.appendNode(promo, "td", "sku", ""); > - Journal.appendNode(promo, "td", "desc", UtilProperties.getMessage("PosUiLabels","(ItemDiscount)",defaultLocale)); > + Journal.appendNode(promo, "td", "desc", UtilProperties.getMessage(resource,"(ItemDiscount)",defaultLocale)); > Journal.appendNode(promo, "td", "qty", ""); > Journal.appendNode(promo, "td", "price", UtilFormatOut.formatPrice(adjustment)); > } > @@ -960,7 +961,7 @@ > XModel adjustmentLine = Journal.appendNode(model, "tr", "adjustment", ""); > Journal.appendNode(adjustmentLine, "td", "sku", ""); > Journal.appendNode(adjustmentLine, "td", "desc", > - UtilProperties.getMessage("PosUiLabels", "(SalesDiscount)",defaultLocale)); > + UtilProperties.getMessage(resource, "(SalesDiscount)",defaultLocale)); > if (UtilValidate.isNotEmpty(amount)) { > Journal.appendNode(adjustmentLine, "td", "qty", ""); > Journal.appendNode(adjustmentLine, "td", "price", UtilFormatOut.formatPrice(amount)); > @@ -977,14 +978,14 @@ > XModel taxLine = Journal.appendNode(model, "tr", "tax", ""); > Journal.appendNode(taxLine, "td", "sku", ""); > > - Journal.appendNode(taxLine, "td", "desc", UtilProperties.getMessage("PosUiLabels","Sales_Tax",defaultLocale)); > + Journal.appendNode(taxLine, "td", "desc", UtilProperties.getMessage(resource,"Sales_Tax",defaultLocale)); > Journal.appendNode(taxLine, "td", "qty", ""); > Journal.appendNode(taxLine, "td", "price", UtilFormatOut.formatPrice(taxAmount)); > Journal.appendNode(taxLine, "td", "index", "-1"); > > XModel totalLine = Journal.appendNode(model, "tr", "total", ""); > Journal.appendNode(totalLine, "td", "sku", ""); > - Journal.appendNode(totalLine, "td", "desc", UtilProperties.getMessage("PosUiLabels","Grand_Total",defaultLocale)); > + Journal.appendNode(totalLine, "td", "desc", UtilProperties.getMessage(resource,"Grand_Total",defaultLocale)); > Journal.appendNode(totalLine, "td", "qty", ""); > Journal.appendNode(totalLine, "td", "price", UtilFormatOut.formatPrice(total)); > Journal.appendNode(totalLine, "td", "index", "-1"); > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java Tue Jul 8 07:04:16 2008 > @@ -40,6 +40,7 @@ > > public class Journal { > > + private static final String resource = "PosUiLabels"; > public static final String module = Journal.class.getName(); > protected XProject currentProject = (XProject)XProjectManager.getCurrentProject(); > > @@ -176,7 +177,7 @@ > // create the header > XModel headerNode = appendNode(jmodel, "th", "header", ""); > for (int i = 0 ; i < field.length; i++) { > - appendNode(headerNode, "td", field[i],UtilProperties.getMessage("PosUiLabels",name[i],defaultLocale)); > + appendNode(headerNode, "td", field[i],UtilProperties.getMessage(resource,name[i],defaultLocale)); > } > > return jmodel; > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java Tue Jul 8 07:04:16 2008 > @@ -40,6 +40,7 @@ > > public class Operator { > > + private static final String resource = "PosUiLabels"; > public static final String module = Operator.class.getName(); > public static final String style = "operTitle"; > > @@ -49,7 +50,7 @@ > public static final String[] OPER_TXID = { "oper_txid", "TXID" }; > public static final String[] OPER_DRWR = { "oper_drwr", "DRAWER" }; > > - public static SimpleDateFormat sdf = new SimpleDateFormat(UtilProperties.getMessage("PosUiLabels","DateFormat",Locale.getDefault())); > + public static SimpleDateFormat sdf = new SimpleDateFormat(UtilProperties.getMessage(resource,"DateFormat",Locale.getDefault())); > protected Component[] operatorField = null; > protected XStyle titleStyle = null; > protected XPanel operPanel = null; > @@ -131,15 +132,15 @@ > > protected String getFieldTitle(String fieldName) { > if (OPER_TOTAL[0].equals(fieldName)) { > - return UtilProperties.getMessage("PosUiLabels","TOTAL",defaultLocale); > + return UtilProperties.getMessage(resource,"TOTAL",defaultLocale); > } else if (OPER_DATE[0].equals(fieldName)) { > - return UtilProperties.getMessage("PosUiLabels","DATE",defaultLocale); > + return UtilProperties.getMessage(resource,"DATE",defaultLocale); > } else if (OPER_EMPL[0].equals(fieldName)) { > - return UtilProperties.getMessage("PosUiLabels","EMPL",defaultLocale); > + return UtilProperties.getMessage(resource,"EMPL",defaultLocale); > } else if (OPER_TXID[0].equals(fieldName)) { > - return UtilProperties.getMessage("PosUiLabels","TXID",defaultLocale); > + return UtilProperties.getMessage(resource,"TXID",defaultLocale); > } else if (OPER_DRWR[0].equals(fieldName)) { > - return UtilProperties.getMessage("PosUiLabels","DRWR",defaultLocale); > + return UtilProperties.getMessage(resource,"DRWR",defaultLocale); > } > return ""; > } > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java Tue Jul 8 07:04:16 2008 > @@ -28,6 +28,7 @@ > > public class Output { > > + private static final String resource = "PosUiLabels"; > public static final String module = Output.class.getName(); > > // login labels > @@ -45,12 +46,12 @@ > > public void setLock(boolean lock) { > if (lock) { > - this.print(UtilProperties.getMessage("PosUiLabels","ULOGIN",defaultLocale)); > + this.print(UtilProperties.getMessage(resource,"ULOGIN",defaultLocale)); > } else { > if (PosTransaction.getCurrentTx(session).isOpen()) { > - this.print(UtilProperties.getMessage("PosUiLabels","ISOPEN",defaultLocale)); > + this.print(UtilProperties.getMessage(resource,"ISOPEN",defaultLocale)); > } else { > - this.print(UtilProperties.getMessage("PosUiLabels","ISCLOSED",defaultLocale)); > + this.print(UtilProperties.getMessage(resource,"ISCLOSED",defaultLocale)); > } > } > } > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java Tue Jul 8 07:04:16 2008 > @@ -57,6 +57,7 @@ > > public class ManagerEvents { > > + private static final String resource = "PosUiLabels"; > public static final String module = ManagerEvents.class.getName(); > public static boolean mgrLoggedIn = false; > static DecimalFormat priceDecimalFormat = new DecimalFormat("#,##0.00"); > @@ -70,7 +71,7 @@ > } > > if (sku == null) { > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","Invalid_Selection",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"Invalid_Selection",Locale.getDefault())); > pos.getJournal().refresh(pos); > pos.getInput().clear(); > } > @@ -144,7 +145,7 @@ > } else { > input.clear(); > input.setFunction("OPEN"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","OPDRAM",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"OPDRAM",Locale.getDefault())); > return; > } > } else { > @@ -190,19 +191,19 @@ > } > switch (closeInfo.length) { > case 0: > - output.print(UtilProperties.getMessage("PosUiLabels","ENTCAS",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTCAS",Locale.getDefault())); > break; > case 1: > - output.print(UtilProperties.getMessage("PosUiLabels","ENTCHK",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTCHK",Locale.getDefault())); > break; > case 2: > - output.print(UtilProperties.getMessage("PosUiLabels","ENTCRC",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTCRC",Locale.getDefault())); > break; > case 3: > - output.print(UtilProperties.getMessage("PosUiLabels","ENTGFC",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTGFC",Locale.getDefault())); > break; > case 4: > - output.print(UtilProperties.getMessage("PosUiLabels","ENTOTH",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTOTH",Locale.getDefault())); > break; > case 5: > GenericValue state = trans.getTerminalState(); > @@ -231,7 +232,7 @@ > } > > // print the totals report > - output.print(UtilProperties.getMessage("PosUiLabels","WaitingFinalSales",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"WaitingFinalSales",Locale.getDefault())); > //pos.showDialog("dialog/error/terminalclosed"); JLR 14/11/06 : Pb with that don't know why, useless => commented out > printTotals(pos, state, true); > > @@ -266,7 +267,7 @@ > trans.popDrawer(); > input.clear(); > input.setFunction("CLOSE"); > - output.print(UtilProperties.getMessage("PosUiLabels","ENTCAS",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTCAS",Locale.getDefault())); > } > } > > @@ -342,7 +343,7 @@ > } > } else { > input.setFunction("VOID"); > - output.print(UtilProperties.getMessage("PosUiLabels","VOID",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"VOID",Locale.getDefault())); > } > } > > @@ -387,7 +388,7 @@ > if (!mgrLoggedIn) { > pos.showDialog("dialog/error/mgrnotloggedin"); > } else { > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","Shutting_down",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"Shutting_down",Locale.getDefault())); > PosTransaction.getCurrentTx(pos.getSession()).closeTx(); > System.exit(0); > } > @@ -525,18 +526,18 @@ > String reportTemplate = "totals.txt"; > > // miscellaneous > - reportMap.put("term", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","term",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("draw", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","draw",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("clerk", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","clerk",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("total_report", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","total_report",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("term", UtilFormatOut.padString(UtilProperties.getMessage(resource,"term",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("draw", UtilFormatOut.padString(UtilProperties.getMessage(resource,"draw",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("clerk", UtilFormatOut.padString(UtilProperties.getMessage(resource,"clerk",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("total_report", UtilFormatOut.padString(UtilProperties.getMessage(resource,"total_report",Locale.getDefault()), 20, false, ' ')); > > // titles > - reportMap.put("cashTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","CASH",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("checkTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","CHECK",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("giftCardTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","GIFT_CARD",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("creditCardTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","CREDIT_CARD",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("otherTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","OTHER",Locale.getDefault()), 20, false, ' ')); > - reportMap.put("grossSalesTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","GROSS_SALES",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("cashTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"CASH",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("checkTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"CHECK",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("giftCardTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"GIFT_CARD",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("creditCardTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"CREDIT_CARD",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("otherTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"OTHER",Locale.getDefault()), 20, false, ' ')); > + reportMap.put("grossSalesTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"GROSS_SALES",Locale.getDefault()), 20, false, ' ')); > reportMap.put("+/-", UtilFormatOut.padString("+/-", 20, false, ' ')); > reportMap.put("spacer", UtilFormatOut.padString("", 20, false, ' ')); > > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java Tue Jul 8 07:04:16 2008 > @@ -31,6 +31,7 @@ > > public class PaymentEvents { > > + private static final String resource = "PosUiLabels"; > public static final String module = PaymentEvents.class.getName(); > > public static synchronized void payCash(PosScreen pos) { > @@ -65,7 +66,7 @@ > } else if (paymentCheck == PosTransaction.EXTERNAL_PAYMENT) { > if (ckInfo == null) { > input.setFunction("CHECK"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); > return; > } else { > processExternalPayment(pos, "PERSONAL_CHECK", ckInfo[1]); > @@ -90,7 +91,7 @@ > } else if (paymentCheck == PosTransaction.EXTERNAL_PAYMENT) { > if (gcInfo == null) { > input.setFunction("GIFTCARD"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); > clearInputPaymentFunctions(pos); > return; > } else { > @@ -122,7 +123,7 @@ > } else if (paymentCheck == PosTransaction.EXTERNAL_PAYMENT) { > if (crtInfo == null) { > input.setFunction("CREDIT"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); > return; > } else { > processExternalPayment(pos, "CREDIT_CARD", crtInfo[1]); > @@ -136,7 +137,7 @@ > input.clearLastFunction(); > input.setFunction("TOTAL"); > input.setFunction("CREDIT"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDNO",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDNO",Locale.getDefault())); > } else { > Debug.log("Credit Func Info : " + crtInfo[1], module); > if (msrInfo == null && (creditExpirationInfo == null)) { > @@ -145,7 +146,7 @@ > input.clearLastFunction(); > input.setFunction("CREDIT"); > input.setFunction("CREDITEXP"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDEX",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDEX",Locale.getDefault())); > } else { > Debug.log("Invalid card number - " + input.value(), module); > clearInputPaymentFunctions(pos); > @@ -159,7 +160,7 @@ > input.clearLastFunction(); > input.setFunction("CREDITEXP"); > input.setFunction("SECURITYCODE"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","SECURITYCODE",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"SECURITYCODE",Locale.getDefault())); > } else { > Debug.log("Invalid expiration date", module); > clearInputPaymentFunctions(pos); > @@ -174,7 +175,7 @@ > input.clearLastFunction(); > input.setFunction("SECURITYCODE"); > input.setFunction("POSTALCODE"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","POSTALCODE",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"POSTALCODE",Locale.getDefault())); > } else { > clearInputPaymentFunctions(pos); > input.clearInput(); > @@ -242,12 +243,12 @@ > pos.refresh(); > break; > case 1: // card number only found > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDEX",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDEX",Locale.getDefault())); > break; > default: > Debug.log("Hit the default switch case [" + allInfo + "] refreshing.", module); > input.clearFunction("MSRINFO"); > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDNO",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDNO",Locale.getDefault())); > break; > } > } > @@ -275,7 +276,7 @@ > Input input = pos.getInput(); > String refNum = input.value(); > if (refNum == null) { > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); > return; > } > input.clearInput(); > @@ -328,7 +329,7 @@ > if (UtilValidate.isNotEmpty(idx) && UtilValidate.isEmpty(sku)) { > String refNum = pos.getInput().value(); > if (UtilValidate.isEmpty(refNum)) { > - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); > + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); > pos.getInput().setFunction("REFNUM"); > } else { > int index = -1; > @@ -350,7 +351,7 @@ > public static synchronized void processSale(PosScreen pos) { > pos.setWaitCursor(); > PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); > - PosScreen.currentScreen.getOutput().print(UtilProperties.getMessage("PosUiLabels","Processing",Locale.getDefault())); > + PosScreen.currentScreen.getOutput().print(UtilProperties.getMessage(resource,"Processing",Locale.getDefault())); > > if (trans.isEmpty()) { > PosScreen newPos = pos.showPage("pospanel"); > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java Tue Jul 8 07:04:16 2008 > @@ -29,6 +29,7 @@ > > public class PromoEvents { > > + private static final String resource = "PosUiLabels"; > public static final String module = PromoEvents.class.getName(); > > public static synchronized void addPromoCode(PosScreen pos) { > @@ -42,7 +43,7 @@ > if (lastFunc == null || !"PROMOCODE".equals(lastFunc[0])) { > Output output = pos.getOutput(); > input.setFunction("PROMOCODE"); > - output.print(UtilProperties.getMessage("PosUiLabels","ENTPROMOCODE",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ENTPROMOCODE",Locale.getDefault())); > } else if ("PROMOCODE".equals(lastFunc[0])) { > String promoCode = input.value(); > if (UtilValidate.isNotEmpty(promoCode)) { > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java Tue Jul 8 07:04:16 2008 > @@ -32,6 +32,7 @@ > > public class SecurityEvents { > > + private static final String resource = "PosUiLabels"; > public static final String module = SecurityEvents.class.getName(); > > public static synchronized void login(PosScreen pos) { > @@ -86,11 +87,11 @@ > String text = input.value(); > if (func != null && func[0].equals(loginFunc)) { > if (UtilValidate.isEmpty(func[1]) && UtilValidate.isEmpty(text)) { > - output.print(UtilProperties.getMessage("PosUiLabels","ULOGIN",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"ULOGIN",Locale.getDefault())); > input.setFunction(loginFunc); > input.setPasswordInput( false); > } else if (UtilValidate.isEmpty(func[1])) { > - output.print(UtilProperties.getMessage("PosUiLabels","UPASSW",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"UPASSW",Locale.getDefault())); > input.setFunction(loginFunc); > input.setPasswordInput( true); > } else { > @@ -105,7 +106,7 @@ > } catch (XuiSession.UserLoginFailure e) { > input.clear(); > input.setFunction(loginFunc); > - output.print(e.getMessage() + " " + UtilProperties.getMessage("PosUiLabels","ULOGIN",Locale.getDefault())); > + output.print(e.getMessage() + " " + UtilProperties.getMessage(resource,"ULOGIN",Locale.getDefault())); > } > if (passed) { > input.clear(); > @@ -124,7 +125,7 @@ > if (mgrUl != null) { > boolean isMgr = session.hasRole(mgrUl, "MANAGER"); > if (!isMgr) { > - output.print(UtilProperties.getMessage("PosUiLabels","UserNotmanager",Locale.getDefault())); > + output.print(UtilProperties.getMessage(resource,"UserNotmanager",Locale.getDefault())); > input.clear(); > } else { > ManagerEvents.mgrLoggedIn = true; > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java Tue Jul 8 07:04:16 2008 > @@ -51,6 +51,7 @@ > /** > * To create or configure a configurable item > */ > + private static final String resource = "PosUiLabels"; > public static final String module = ConfigureItem.class.getName(); > protected PosScreen m_pos = null; > protected ConfigureItem m_configureItem = null; > @@ -82,7 +83,7 @@ > // cache must be set to false because there's no method to remove actionhandlers > m_dialog = (XDialog) pageMgr.loadPage( > m_pos.getScreenLocation() + "/dialog/ConfigureItem", false); > - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "ConfigureItem", Locale.getDefault())); > + m_dialog.setCaption(UtilProperties.getMessage(resource, "ConfigureItem", Locale.getDefault())); > > m_optionListPane = (XScrollPane) m_dialog.findComponent("optionListPane"); > m_configList = (XList) m_dialog.findComponent("configList"); > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java Tue Jul 8 07:04:16 2008 > @@ -42,6 +42,7 @@ > /** > * To load a sale from a shopping list. 2 modes : add to or replace the current sale. Also a button to delete a sale (aka shopping list) > */ > + private static final String resource = "PosUiLabels"; > public static final String module = LoadSale.class.getName(); > protected static PosScreen m_pos = null; > protected XDialog m_dialog = null; > @@ -65,7 +66,7 @@ > > public void openDlg() { > m_dialog = (XDialog) pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/loadsale"); > - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "LoadASale", Locale.getDefault())); > + m_dialog.setCaption(UtilProperties.getMessage(resource, "LoadASale", Locale.getDefault())); > m_salesList = (XList) m_dialog.findComponent("salesList"); > XEventHelper.addMouseHandler(this, m_salesList, "saleDoubleClick"); > > @@ -91,7 +92,7 @@ > m_salesList.setVisibleRowCount(-1); > m_salesList.ensureIndexIsVisible(m_salesList.getItemCount()); > m_salesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); > - m_salesList.setToolTipText(UtilProperties.getMessage("PosUiLabels", "LoadSaleListDblClickTip", Locale.getDefault())); > + m_salesList.setToolTipText(UtilProperties.getMessage(resource, "LoadSaleListDblClickTip", Locale.getDefault())); > > m_dialog.pack(); > m_salesList.requestFocusInWindow(); > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java Tue Jul 8 07:04:16 2008 > @@ -46,6 +46,7 @@ > /** > * To allow creating or choising a reason for a PAID IN or OUT > */ > + private static final String resource = "PosUiLabels"; > public static final String module = PaidInOut.class.getName(); > protected static PosScreen m_pos = null; > protected XDialog m_dialog = null; > @@ -89,12 +90,12 @@ > Enumeration reasonsKeys = null; > > if (m_type.equals("IN")) { > - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "PaidInTitle", Locale.getDefault())); > + m_dialog.setCaption(UtilProperties.getMessage(resource, "PaidInTitle", Locale.getDefault())); > reasons = ResourceBundle.getBundle(m_pos.getScreenLocation() + "/dialog/PaidIn", Locale.getDefault()); > reasonsKeys = reasons.getKeys(); > } > else { // OUT > - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "PaidOutTitle", Locale.getDefault())); > + m_dialog.setCaption(UtilProperties.getMessage(resource, "PaidOutTitle", Locale.getDefault())); > reasons = ResourceBundle.getBundle(m_pos.getScreenLocation() + "/dialog/PaidOut", Locale.getDefault()); > reasonsKeys = reasons.getKeys(); > } > @@ -105,7 +106,7 @@ > m_comboModel.addElement(val); > } > m_reasonsCombo.setModel(m_comboModel); > - m_reasonsCombo.setToolTipText(UtilProperties.getMessage("PosUiLabels", "CreateOrChooseReasonInOut", Locale.getDefault())); > + m_reasonsCombo.setToolTipText(UtilProperties.getMessage(resource, "CreateOrChooseReasonInOut", Locale.getDefault())); > > m_dialog.pack(); > m_reasonsCombo.requestFocusInWindow(); > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java Tue Jul 8 07:04:16 2008 > @@ -48,6 +48,7 @@ > > public class PosScreen extends XPage implements Runnable, DialogCallback, FocusListener { > > + private static final String resource = "PosUiLabels"; > public static final String module = PosScreen.class.getName(); > public static final Frame appFrame = XProjectManager.getCurrentProject().getAppFrame(); > public static final Window appWin = XProjectManager.getCurrentProject().getAppWindow(); > @@ -214,25 +215,25 @@ > operator.refresh(); > if (updateOutput) { > if (input.isFunctionSet("PAID")) { > - output.print(UtilProperties.getMessage("PosUiLabels","CHANGE",defaultLocale) > + output.print(UtilProperties.getMessage(resource,"CHANGE",defaultLocale) > + UtilFormatOut.formatPrice(trans.getTotalDue() * -1)); > } else if (input.isFunctionSet("TOTAL")) { > if (trans.getTotalDue() > 0) { > - output.print(UtilProperties.getMessage("PosUiLabels","TOTALD",defaultLocale) + " " + UtilFormatOut.formatPrice(trans.getTotalDue())); > + output.print(UtilProperties.getMessage(resource,"TOTALD",defaultLocale) + " " + UtilFormatOut.formatPrice(trans.getTotalDue())); > } else { > - output.print(UtilProperties.getMessage("PosUiLabels","PAYFIN",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"PAYFIN",defaultLocale)); > } > } else { > if (PosTransaction.getCurrentTx(session).isOpen()) { > - output.print(UtilProperties.getMessage("PosUiLabels","ISOPEN",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"ISOPEN",defaultLocale)); > } else { > - output.print(UtilProperties.getMessage("PosUiLabels","ISCLOSED",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"ISCLOSED",defaultLocale)); > } > } > } > //journal.focus(); > } else { > - output.print(UtilProperties.getMessage("PosUiLabels","ULOGIN",defaultLocale)); > + output.print(UtilProperties.getMessage(resource,"ULOGIN",defaultLocale)); > //input.focus(); > } > > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java Tue Jul 8 07:04:16 2008 > @@ -41,6 +41,7 @@ > /** > * To save a sale. 2 modes : save and keep the current sale or save and clear the current sale. > */ > + private static final String resource = "PosUiLabels"; > public static final String module = SaveSale.class.getName(); > protected static PosScreen m_pos = null; > protected XDialog m_dialog = null; > @@ -51,7 +52,7 @@ > // New button for Save and Print funtion > protected XButton m_saveAndPrint = null; > protected static PosTransaction m_trans = null; > - public static SimpleDateFormat sdf = new SimpleDateFormat(UtilProperties.getMessage("PosUiLabels","DateTimeFormat",Locale.getDefault())); > + public static SimpleDateFormat sdf = new SimpleDateFormat(UtilProperties.getMessage(resource,"DateTimeFormat",Locale.getDefault())); > private static boolean ShowKeyboardInSaveSale = UtilProperties.propertyValueEqualsIgnoreCase("parameters", "ShowKeyboardInSaveSale", "Y"); > > //TODO : make getter and setter for members (ie m_*) if needed (extern calls). For that in Eclipse use Source/Generate Getters and setters > @@ -66,7 +67,7 @@ > m_saleName = (XEdit) m_dialog.findComponent("saleName"); > //m_dialog.setM_focused(m_saleName); > m_saleName.setText(m_pos.session.getUserId() + " " + sdf.format(new Date())); > - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "SaveASale", Locale.getDefault())); > + m_dialog.setCaption(UtilProperties.getMessage(resource, "SaveASale", Locale.getDefault())); > > m_cancel = (XButton) m_dialog.findComponent("BtnCancel"); > m_save = (XButton) m_dialog.findComponent("BtnSave"); > > Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java?rev=674829&r1=674828&r2=674829&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java (original) > +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java Tue Jul 8 07:04:16 2008 > @@ -41,6 +41,7 @@ > /** > * To choose a product in a list of products whith the same bar code > */ > + private static final String resource = "PosUiLabels"; > public static final String module = SelectProduct.class.getName(); > protected static PosScreen m_pos = null; > protected XDialog m_dialog = null; > @@ -63,7 +64,7 @@ > public String openDlg() { > XDialog dlg = (XDialog) pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/SelectProduct"); > m_dialog = dlg; > - dlg.setCaption(UtilProperties.getMessage("PosUiLabels", "SelectAProduct", Locale.getDefault())); > + dlg.setCaption(UtilProperties.getMessage(resource, "SelectAProduct", Locale.getDefault())); > //dlg.setModal(true); > m_productsList = (XList) dlg.findComponent("productsList"); > XEventHelper.addMouseHandler(this, m_productsList, "DoubleClick"); > @@ -85,7 +86,7 @@ > m_productsList.setVisibleRowCount(-1); > m_productsList.ensureIndexIsVisible(m_productsList.getItemCount()); > m_productsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); > - m_productsList.setToolTipText(UtilProperties.getMessage("PosUiLabels", "SelectProductListDblClickTip", Locale.getDefault())); > + m_productsList.setToolTipText(UtilProperties.getMessage(resource, "SelectProductListDblClickTip", Locale.getDefault())); > > dlg.pack(); > dlg.showDialog(this); > > > |
Administrator
|
Hi Adrian,
Good idea, done in revision 675275. (not using a static inner class PosSettings but a static variable in PosTransation) Jacques From: "Adrian Crum" <[hidden email]> > Or have resource defined in a static class that all these other classes reference: > > output.print(UtilProperties.getMessage(PosSettings.resource, "Validating", defaultLocale)); > > -Adrian > > [hidden email] wrote: >> Author: jleroux >> Date: Tue Jul 8 07:04:16 2008 >> New Revision: 674829 >> >> URL: http://svn.apache.org/viewvc?rev=674829&view=rev >> Log: >> Stick to usage : use resource in UtilProperties.getMessage in place of file name hardcoded (though this does not make a big >> difference) >> >> Modified: >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java >> ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Tue Jul 8 07:04:16 2008 >> @@ -68,6 +68,7 @@ >> public class PosTransaction implements Serializable { >> + private static final String resource = "PosUiLabels"; >> public static final String module = PosTransaction.class.getName(); >> public static final int NO_PAYMENT = 0; >> public static final int INTERNAL_PAYMENT = 1; >> @@ -776,14 +777,14 @@ >> cart.setOrderPartyId(partyId); >> // validate payment methods >> - output.print(UtilProperties.getMessage("PosUiLabels","Validating",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"Validating",defaultLocale)); >> Map valRes = ch.validatePaymentMethods(); >> if (valRes != null && ServiceUtil.isError(valRes)) { >> throw new GeneralException(ServiceUtil.getErrorMessage(valRes)); >> } >> // store the "order" >> - output.print(UtilProperties.getMessage("PosUiLabels","Saving",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"Saving",defaultLocale)); >> Map orderRes = ch.createOrder(session.getUserLogin()); >> //Debug.log("Create Order Resp : " + orderRes, module); >> @@ -794,7 +795,7 @@ >> } >> // process the payment(s) >> - output.print(UtilProperties.getMessage("PosUiLabels","Processing",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"Processing",defaultLocale)); >> Map payRes = null; >> try { >> payRes = ch.processPayment(ProductStoreWorker.getProductStore(productStoreId, session.getDelegator()), >> session.getUserLogin(), true); >> @@ -811,7 +812,7 @@ >> double change = (grandTotal - paymentAmt); >> // notify the change due >> - output.print(UtilProperties.getMessage("PosUiLabels","CHANGE",defaultLocale) + " " + >> UtilFormatOut.formatPrice(this.getTotalDue() * -1)); >> + output.print(UtilProperties.getMessage(resource,"CHANGE",defaultLocale) + " " + >> UtilFormatOut.formatPrice(this.getTotalDue() * -1)); >> // threaded drawer/receipt printing >> final PosTransaction currentTrans = this; >> @@ -921,7 +922,7 @@ >> // append the promo info >> XModel promo = Journal.appendNode(model, "tr", "itemadjustment", ""); >> Journal.appendNode(promo, "td", "sku", ""); >> - Journal.appendNode(promo, "td", "desc", >> UtilProperties.getMessage("PosUiLabels","(ItemDiscount)",defaultLocale)); >> + Journal.appendNode(promo, "td", "desc", UtilProperties.getMessage(resource,"(ItemDiscount)",defaultLocale)); >> Journal.appendNode(promo, "td", "qty", ""); >> Journal.appendNode(promo, "td", "price", UtilFormatOut.formatPrice(adjustment)); >> } >> @@ -960,7 +961,7 @@ >> XModel adjustmentLine = Journal.appendNode(model, "tr", "adjustment", ""); >> Journal.appendNode(adjustmentLine, "td", "sku", ""); >> Journal.appendNode(adjustmentLine, "td", "desc", - >> UtilProperties.getMessage("PosUiLabels", "(SalesDiscount)",defaultLocale)); >> + UtilProperties.getMessage(resource, "(SalesDiscount)",defaultLocale)); >> if (UtilValidate.isNotEmpty(amount)) { >> Journal.appendNode(adjustmentLine, "td", "qty", ""); >> Journal.appendNode(adjustmentLine, "td", "price", UtilFormatOut.formatPrice(amount)); >> @@ -977,14 +978,14 @@ >> XModel taxLine = Journal.appendNode(model, "tr", "tax", ""); >> Journal.appendNode(taxLine, "td", "sku", ""); >> - Journal.appendNode(taxLine, "td", "desc", UtilProperties.getMessage("PosUiLabels","Sales_Tax",defaultLocale)); >> + Journal.appendNode(taxLine, "td", "desc", UtilProperties.getMessage(resource,"Sales_Tax",defaultLocale)); >> Journal.appendNode(taxLine, "td", "qty", ""); >> Journal.appendNode(taxLine, "td", "price", UtilFormatOut.formatPrice(taxAmount)); >> Journal.appendNode(taxLine, "td", "index", "-1"); >> XModel totalLine = Journal.appendNode(model, "tr", "total", ""); >> Journal.appendNode(totalLine, "td", "sku", ""); >> - Journal.appendNode(totalLine, "td", "desc", UtilProperties.getMessage("PosUiLabels","Grand_Total",defaultLocale)); >> + Journal.appendNode(totalLine, "td", "desc", UtilProperties.getMessage(resource,"Grand_Total",defaultLocale)); >> Journal.appendNode(totalLine, "td", "qty", ""); >> Journal.appendNode(totalLine, "td", "price", UtilFormatOut.formatPrice(total)); >> Journal.appendNode(totalLine, "td", "index", "-1"); >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Journal.java Tue Jul 8 07:04:16 2008 >> @@ -40,6 +40,7 @@ >> public class Journal { >> + private static final String resource = "PosUiLabels"; >> public static final String module = Journal.class.getName(); >> protected XProject currentProject = (XProject)XProjectManager.getCurrentProject(); >> @@ -176,7 +177,7 @@ >> // create the header >> XModel headerNode = appendNode(jmodel, "th", "header", ""); >> for (int i = 0 ; i < field.length; i++) { >> - appendNode(headerNode, "td", field[i],UtilProperties.getMessage("PosUiLabels",name[i],defaultLocale)); >> + appendNode(headerNode, "td", field[i],UtilProperties.getMessage(resource,name[i],defaultLocale)); >> } >> return jmodel; >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Operator.java Tue Jul 8 07:04:16 2008 >> @@ -40,6 +40,7 @@ >> public class Operator { >> + private static final String resource = "PosUiLabels"; >> public static final String module = Operator.class.getName(); >> public static final String style = "operTitle"; >> @@ -49,7 +50,7 @@ >> public static final String[] OPER_TXID = { "oper_txid", "TXID" }; >> public static final String[] OPER_DRWR = { "oper_drwr", "DRAWER" }; - public static SimpleDateFormat sdf = new >> SimpleDateFormat(UtilProperties.getMessage("PosUiLabels","DateFormat",Locale.getDefault())); >> + public static SimpleDateFormat sdf = new >> SimpleDateFormat(UtilProperties.getMessage(resource,"DateFormat",Locale.getDefault())); >> protected Component[] operatorField = null; >> protected XStyle titleStyle = null; >> protected XPanel operPanel = null; >> @@ -131,15 +132,15 @@ >> protected String getFieldTitle(String fieldName) { >> if (OPER_TOTAL[0].equals(fieldName)) { >> - return UtilProperties.getMessage("PosUiLabels","TOTAL",defaultLocale); + return >> UtilProperties.getMessage(resource,"TOTAL",defaultLocale); } else if (OPER_DATE[0].equals(fieldName)) { >> - return UtilProperties.getMessage("PosUiLabels","DATE",defaultLocale); >> + return UtilProperties.getMessage(resource,"DATE",defaultLocale); >> } else if (OPER_EMPL[0].equals(fieldName)) { >> - return UtilProperties.getMessage("PosUiLabels","EMPL",defaultLocale); >> + return UtilProperties.getMessage(resource,"EMPL",defaultLocale); >> } else if (OPER_TXID[0].equals(fieldName)) { >> - return UtilProperties.getMessage("PosUiLabels","TXID",defaultLocale); >> + return UtilProperties.getMessage(resource,"TXID",defaultLocale); >> } else if (OPER_DRWR[0].equals(fieldName)) { >> - return UtilProperties.getMessage("PosUiLabels","DRWR",defaultLocale); >> + return UtilProperties.getMessage(resource,"DRWR",defaultLocale); >> } >> return ""; >> } >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/component/Output.java Tue Jul 8 07:04:16 2008 >> @@ -28,6 +28,7 @@ >> public class Output { >> + private static final String resource = "PosUiLabels"; >> public static final String module = Output.class.getName(); >> // login labels >> @@ -45,12 +46,12 @@ >> public void setLock(boolean lock) { >> if (lock) { >> - this.print(UtilProperties.getMessage("PosUiLabels","ULOGIN",defaultLocale)); >> + this.print(UtilProperties.getMessage(resource,"ULOGIN",defaultLocale)); >> } else { >> if (PosTransaction.getCurrentTx(session).isOpen()) { >> - this.print(UtilProperties.getMessage("PosUiLabels","ISOPEN",defaultLocale)); >> + this.print(UtilProperties.getMessage(resource,"ISOPEN",defaultLocale)); >> } else { >> - this.print(UtilProperties.getMessage("PosUiLabels","ISCLOSED",defaultLocale)); >> + this.print(UtilProperties.getMessage(resource,"ISCLOSED",defaultLocale)); >> } >> } >> } >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java Tue Jul 8 07:04:16 2008 >> @@ -57,6 +57,7 @@ >> public class ManagerEvents { >> + private static final String resource = "PosUiLabels"; >> public static final String module = ManagerEvents.class.getName(); >> public static boolean mgrLoggedIn = false; >> static DecimalFormat priceDecimalFormat = new DecimalFormat("#,##0.00"); >> @@ -70,7 +71,7 @@ >> } >> if (sku == null) { >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","Invalid_Selection",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"Invalid_Selection",Locale.getDefault())); >> pos.getJournal().refresh(pos); >> pos.getInput().clear(); >> } >> @@ -144,7 +145,7 @@ >> } else { >> input.clear(); >> input.setFunction("OPEN"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","OPDRAM",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"OPDRAM",Locale.getDefault())); >> return; >> } >> } else { >> @@ -190,19 +191,19 @@ >> } >> switch (closeInfo.length) { >> case 0: >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTCAS",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTCAS",Locale.getDefault())); >> break; >> case 1: >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTCHK",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTCHK",Locale.getDefault())); >> break; >> case 2: >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTCRC",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTCRC",Locale.getDefault())); >> break; >> case 3: >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTGFC",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTGFC",Locale.getDefault())); >> break; >> case 4: >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTOTH",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTOTH",Locale.getDefault())); >> break; >> case 5: >> GenericValue state = trans.getTerminalState(); >> @@ -231,7 +232,7 @@ >> } >> // print the totals report >> - output.print(UtilProperties.getMessage("PosUiLabels","WaitingFinalSales",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"WaitingFinalSales",Locale.getDefault())); >> //pos.showDialog("dialog/error/terminalclosed"); JLR 14/11/06 : Pb with that don't know why, useless => >> commented out >> printTotals(pos, state, true); >> @@ -266,7 +267,7 @@ >> trans.popDrawer(); >> input.clear(); >> input.setFunction("CLOSE"); >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTCAS",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTCAS",Locale.getDefault())); >> } >> } >> @@ -342,7 +343,7 @@ >> } >> } else { >> input.setFunction("VOID"); >> - output.print(UtilProperties.getMessage("PosUiLabels","VOID",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"VOID",Locale.getDefault())); >> } >> } >> @@ -387,7 +388,7 @@ >> if (!mgrLoggedIn) { >> pos.showDialog("dialog/error/mgrnotloggedin"); >> } else { >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","Shutting_down",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"Shutting_down",Locale.getDefault())); >> PosTransaction.getCurrentTx(pos.getSession()).closeTx(); >> System.exit(0); >> } >> @@ -525,18 +526,18 @@ >> String reportTemplate = "totals.txt"; >> // miscellaneous >> - reportMap.put("term", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","term",Locale.getDefault()), 20, >> false, ' ')); >> - reportMap.put("draw", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","draw",Locale.getDefault()), 20, >> false, ' ')); >> - reportMap.put("clerk", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","clerk",Locale.getDefault()), 20, >> false, ' ')); >> - reportMap.put("total_report", >> UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","total_report",Locale.getDefault()), 20, false, ' ')); >> + reportMap.put("term", UtilFormatOut.padString(UtilProperties.getMessage(resource,"term",Locale.getDefault()), 20, false, >> ' ')); >> + reportMap.put("draw", UtilFormatOut.padString(UtilProperties.getMessage(resource,"draw",Locale.getDefault()), 20, false, >> ' ')); >> + reportMap.put("clerk", UtilFormatOut.padString(UtilProperties.getMessage(resource,"clerk",Locale.getDefault()), 20, >> false, ' ')); >> + reportMap.put("total_report", >> UtilFormatOut.padString(UtilProperties.getMessage(resource,"total_report",Locale.getDefault()), 20, false, ' ')); >> // titles >> - reportMap.put("cashTitle", UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","CASH",Locale.getDefault()), >> 20, false, ' ')); >> - reportMap.put("checkTitle", >> UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","CHECK",Locale.getDefault()), 20, false, ' ')); >> - reportMap.put("giftCardTitle", >> UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","GIFT_CARD",Locale.getDefault()), 20, false, ' ')); >> - reportMap.put("creditCardTitle", >> UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","CREDIT_CARD",Locale.getDefault()), 20, false, ' ')); >> - reportMap.put("otherTitle", >> UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","OTHER",Locale.getDefault()), 20, false, ' ')); >> - reportMap.put("grossSalesTitle", >> UtilFormatOut.padString(UtilProperties.getMessage("PosUiLabels","GROSS_SALES",Locale.getDefault()), 20, false, ' ')); >> + reportMap.put("cashTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"CASH",Locale.getDefault()), 20, >> false, ' ')); >> + reportMap.put("checkTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"CHECK",Locale.getDefault()), 20, >> false, ' ')); >> + reportMap.put("giftCardTitle", >> UtilFormatOut.padString(UtilProperties.getMessage(resource,"GIFT_CARD",Locale.getDefault()), 20, false, ' ')); >> + reportMap.put("creditCardTitle", >> UtilFormatOut.padString(UtilProperties.getMessage(resource,"CREDIT_CARD",Locale.getDefault()), 20, false, ' ')); >> + reportMap.put("otherTitle", UtilFormatOut.padString(UtilProperties.getMessage(resource,"OTHER",Locale.getDefault()), 20, >> false, ' ')); >> + reportMap.put("grossSalesTitle", >> UtilFormatOut.padString(UtilProperties.getMessage(resource,"GROSS_SALES",Locale.getDefault()), 20, false, ' ')); >> reportMap.put("+/-", UtilFormatOut.padString("+/-", 20, false, ' ')); >> reportMap.put("spacer", UtilFormatOut.padString("", 20, false, ' ')); >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PaymentEvents.java Tue Jul 8 07:04:16 2008 >> @@ -31,6 +31,7 @@ >> public class PaymentEvents { >> + private static final String resource = "PosUiLabels"; >> public static final String module = PaymentEvents.class.getName(); >> public static synchronized void payCash(PosScreen pos) { >> @@ -65,7 +66,7 @@ >> } else if (paymentCheck == PosTransaction.EXTERNAL_PAYMENT) { >> if (ckInfo == null) { >> input.setFunction("CHECK"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); >> return; >> } else { >> processExternalPayment(pos, "PERSONAL_CHECK", ckInfo[1]); >> @@ -90,7 +91,7 @@ >> } else if (paymentCheck == PosTransaction.EXTERNAL_PAYMENT) { >> if (gcInfo == null) { >> input.setFunction("GIFTCARD"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); >> clearInputPaymentFunctions(pos); >> return; >> } else { >> @@ -122,7 +123,7 @@ >> } else if (paymentCheck == PosTransaction.EXTERNAL_PAYMENT) { >> if (crtInfo == null) { >> input.setFunction("CREDIT"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); >> return; >> } else { >> processExternalPayment(pos, "CREDIT_CARD", crtInfo[1]); >> @@ -136,7 +137,7 @@ >> input.clearLastFunction(); >> input.setFunction("TOTAL"); >> input.setFunction("CREDIT"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDNO",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDNO",Locale.getDefault())); >> } else { >> Debug.log("Credit Func Info : " + crtInfo[1], module); >> if (msrInfo == null && (creditExpirationInfo == null)) { >> @@ -145,7 +146,7 @@ >> input.clearLastFunction(); >> input.setFunction("CREDIT"); >> input.setFunction("CREDITEXP"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDEX",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDEX",Locale.getDefault())); >> } else { >> Debug.log("Invalid card number - " + input.value(), module); >> clearInputPaymentFunctions(pos); >> @@ -159,7 +160,7 @@ >> input.clearLastFunction(); >> input.setFunction("CREDITEXP"); >> input.setFunction("SECURITYCODE"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","SECURITYCODE",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"SECURITYCODE",Locale.getDefault())); >> } else { >> Debug.log("Invalid expiration date", module); >> clearInputPaymentFunctions(pos); >> @@ -174,7 +175,7 @@ >> input.clearLastFunction(); >> input.setFunction("SECURITYCODE"); >> input.setFunction("POSTALCODE"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","POSTALCODE",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"POSTALCODE",Locale.getDefault())); >> } else { >> clearInputPaymentFunctions(pos); >> input.clearInput(); >> @@ -242,12 +243,12 @@ >> pos.refresh(); >> break; >> case 1: // card number only found >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDEX",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDEX",Locale.getDefault())); >> break; >> default: >> Debug.log("Hit the default switch case [" + allInfo + "] refreshing.", module); >> input.clearFunction("MSRINFO"); >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","CREDNO",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"CREDNO",Locale.getDefault())); >> break; >> } >> } >> @@ -275,7 +276,7 @@ >> Input input = pos.getInput(); >> String refNum = input.value(); >> if (refNum == null) { >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); >> return; >> } >> input.clearInput(); >> @@ -328,7 +329,7 @@ >> if (UtilValidate.isNotEmpty(idx) && UtilValidate.isEmpty(sku)) { >> String refNum = pos.getInput().value(); >> if (UtilValidate.isEmpty(refNum)) { >> - pos.getOutput().print(UtilProperties.getMessage("PosUiLabels","REFNUM",Locale.getDefault())); >> + pos.getOutput().print(UtilProperties.getMessage(resource,"REFNUM",Locale.getDefault())); >> pos.getInput().setFunction("REFNUM"); >> } else { >> int index = -1; >> @@ -350,7 +351,7 @@ >> public static synchronized void processSale(PosScreen pos) { >> pos.setWaitCursor(); >> PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); >> - PosScreen.currentScreen.getOutput().print(UtilProperties.getMessage("PosUiLabels","Processing",Locale.getDefault())); >> + PosScreen.currentScreen.getOutput().print(UtilProperties.getMessage(resource,"Processing",Locale.getDefault())); >> if (trans.isEmpty()) { >> PosScreen newPos = pos.showPage("pospanel"); >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java Tue Jul 8 07:04:16 2008 >> @@ -29,6 +29,7 @@ >> public class PromoEvents { >> + private static final String resource = "PosUiLabels"; >> public static final String module = PromoEvents.class.getName(); >> public static synchronized void addPromoCode(PosScreen pos) { >> @@ -42,7 +43,7 @@ >> if (lastFunc == null || !"PROMOCODE".equals(lastFunc[0])) { >> Output output = pos.getOutput(); >> input.setFunction("PROMOCODE"); >> - output.print(UtilProperties.getMessage("PosUiLabels","ENTPROMOCODE",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ENTPROMOCODE",Locale.getDefault())); >> } else if ("PROMOCODE".equals(lastFunc[0])) { >> String promoCode = input.value(); >> if (UtilValidate.isNotEmpty(promoCode)) { >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/SecurityEvents.java Tue Jul 8 07:04:16 2008 >> @@ -32,6 +32,7 @@ >> public class SecurityEvents { >> + private static final String resource = "PosUiLabels"; >> public static final String module = SecurityEvents.class.getName(); >> public static synchronized void login(PosScreen pos) { >> @@ -86,11 +87,11 @@ >> String text = input.value(); >> if (func != null && func[0].equals(loginFunc)) { >> if (UtilValidate.isEmpty(func[1]) && UtilValidate.isEmpty(text)) { >> - output.print(UtilProperties.getMessage("PosUiLabels","ULOGIN",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"ULOGIN",Locale.getDefault())); >> input.setFunction(loginFunc); >> input.setPasswordInput( false); >> } else if (UtilValidate.isEmpty(func[1])) { >> - output.print(UtilProperties.getMessage("PosUiLabels","UPASSW",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"UPASSW",Locale.getDefault())); >> input.setFunction(loginFunc); >> input.setPasswordInput( true); >> } else { >> @@ -105,7 +106,7 @@ >> } catch (XuiSession.UserLoginFailure e) { >> input.clear(); >> input.setFunction(loginFunc); >> - output.print(e.getMessage() + " " + >> UtilProperties.getMessage("PosUiLabels","ULOGIN",Locale.getDefault())); >> + output.print(e.getMessage() + " " + UtilProperties.getMessage(resource,"ULOGIN",Locale.getDefault())); >> } >> if (passed) { >> input.clear(); >> @@ -124,7 +125,7 @@ >> if (mgrUl != null) { >> boolean isMgr = session.hasRole(mgrUl, "MANAGER"); >> if (!isMgr) { >> - output.print(UtilProperties.getMessage("PosUiLabels","UserNotmanager",Locale.getDefault())); >> + output.print(UtilProperties.getMessage(resource,"UserNotmanager",Locale.getDefault())); >> input.clear(); >> } else { >> ManagerEvents.mgrLoggedIn = true; >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java Tue Jul 8 07:04:16 2008 >> @@ -51,6 +51,7 @@ >> /** >> * To create or configure a configurable item */ >> + private static final String resource = "PosUiLabels"; >> public static final String module = ConfigureItem.class.getName(); >> protected PosScreen m_pos = null; >> protected ConfigureItem m_configureItem = null; >> @@ -82,7 +83,7 @@ >> // cache must be set to false because there's no method to remove actionhandlers >> m_dialog = (XDialog) pageMgr.loadPage( >> m_pos.getScreenLocation() + "/dialog/ConfigureItem", false); >> - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "ConfigureItem", Locale.getDefault())); >> + m_dialog.setCaption(UtilProperties.getMessage(resource, "ConfigureItem", Locale.getDefault())); >> m_optionListPane = (XScrollPane) m_dialog.findComponent("optionListPane"); >> m_configList = (XList) m_dialog.findComponent("configList"); >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/LoadSale.java Tue Jul 8 07:04:16 2008 >> @@ -42,6 +42,7 @@ >> /** >> * To load a sale from a shopping list. 2 modes : add to or replace the current sale. Also a button to delete a sale (aka >> shopping list) */ >> + private static final String resource = "PosUiLabels"; >> public static final String module = LoadSale.class.getName(); >> protected static PosScreen m_pos = null; >> protected XDialog m_dialog = null; >> @@ -65,7 +66,7 @@ >> public void openDlg() { >> m_dialog = (XDialog) pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/loadsale"); >> - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "LoadASale", Locale.getDefault())); >> + m_dialog.setCaption(UtilProperties.getMessage(resource, "LoadASale", Locale.getDefault())); >> m_salesList = (XList) m_dialog.findComponent("salesList"); >> XEventHelper.addMouseHandler(this, m_salesList, "saleDoubleClick"); >> @@ -91,7 +92,7 @@ >> m_salesList.setVisibleRowCount(-1); >> m_salesList.ensureIndexIsVisible(m_salesList.getItemCount()); >> m_salesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); >> - m_salesList.setToolTipText(UtilProperties.getMessage("PosUiLabels", "LoadSaleListDblClickTip", Locale.getDefault())); >> + m_salesList.setToolTipText(UtilProperties.getMessage(resource, "LoadSaleListDblClickTip", Locale.getDefault())); >> m_dialog.pack(); >> m_salesList.requestFocusInWindow(); >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PaidInOut.java Tue Jul 8 07:04:16 2008 >> @@ -46,6 +46,7 @@ >> /** >> * To allow creating or choising a reason for a PAID IN or OUT >> */ >> + private static final String resource = "PosUiLabels"; >> public static final String module = PaidInOut.class.getName(); >> protected static PosScreen m_pos = null; >> protected XDialog m_dialog = null; >> @@ -89,12 +90,12 @@ >> Enumeration reasonsKeys = null; >> if (m_type.equals("IN")) { >> - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "PaidInTitle", Locale.getDefault())); >> + m_dialog.setCaption(UtilProperties.getMessage(resource, "PaidInTitle", Locale.getDefault())); >> reasons = ResourceBundle.getBundle(m_pos.getScreenLocation() + "/dialog/PaidIn", Locale.getDefault()); >> reasonsKeys = reasons.getKeys(); >> } >> else { // OUT >> - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "PaidOutTitle", Locale.getDefault())); >> + m_dialog.setCaption(UtilProperties.getMessage(resource, "PaidOutTitle", Locale.getDefault())); >> reasons = ResourceBundle.getBundle(m_pos.getScreenLocation() + "/dialog/PaidOut", Locale.getDefault()); >> reasonsKeys = reasons.getKeys(); >> } >> @@ -105,7 +106,7 @@ >> m_comboModel.addElement(val); >> } >> m_reasonsCombo.setModel(m_comboModel); >> - m_reasonsCombo.setToolTipText(UtilProperties.getMessage("PosUiLabels", "CreateOrChooseReasonInOut", >> Locale.getDefault())); >> + m_reasonsCombo.setToolTipText(UtilProperties.getMessage(resource, "CreateOrChooseReasonInOut", Locale.getDefault())); >> m_dialog.pack(); >> m_reasonsCombo.requestFocusInWindow(); >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java Tue Jul 8 07:04:16 2008 >> @@ -48,6 +48,7 @@ >> public class PosScreen extends XPage implements Runnable, DialogCallback, FocusListener { >> + private static final String resource = "PosUiLabels"; >> public static final String module = PosScreen.class.getName(); >> public static final Frame appFrame = XProjectManager.getCurrentProject().getAppFrame(); >> public static final Window appWin = XProjectManager.getCurrentProject().getAppWindow(); >> @@ -214,25 +215,25 @@ >> operator.refresh(); >> if (updateOutput) { >> if (input.isFunctionSet("PAID")) { >> - output.print(UtilProperties.getMessage("PosUiLabels","CHANGE",defaultLocale) >> + output.print(UtilProperties.getMessage(resource,"CHANGE",defaultLocale) >> + UtilFormatOut.formatPrice(trans.getTotalDue() * -1)); >> } else if (input.isFunctionSet("TOTAL")) { >> if (trans.getTotalDue() > 0) { >> - output.print(UtilProperties.getMessage("PosUiLabels","TOTALD",defaultLocale) + " " + >> UtilFormatOut.formatPrice(trans.getTotalDue())); >> + output.print(UtilProperties.getMessage(resource,"TOTALD",defaultLocale) + " " + >> UtilFormatOut.formatPrice(trans.getTotalDue())); >> } else { >> - output.print(UtilProperties.getMessage("PosUiLabels","PAYFIN",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"PAYFIN",defaultLocale)); >> } >> } else { >> if (PosTransaction.getCurrentTx(session).isOpen()) { >> - output.print(UtilProperties.getMessage("PosUiLabels","ISOPEN",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"ISOPEN",defaultLocale)); >> } else { >> - output.print(UtilProperties.getMessage("PosUiLabels","ISCLOSED",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"ISCLOSED",defaultLocale)); >> } >> } >> } >> //journal.focus(); >> } else { >> - output.print(UtilProperties.getMessage("PosUiLabels","ULOGIN",defaultLocale)); >> + output.print(UtilProperties.getMessage(resource,"ULOGIN",defaultLocale)); >> //input.focus(); >> } >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java Tue Jul 8 07:04:16 2008 >> @@ -41,6 +41,7 @@ >> /** >> * To save a sale. 2 modes : save and keep the current sale or save and clear the current sale. */ >> + private static final String resource = "PosUiLabels"; >> public static final String module = SaveSale.class.getName(); >> protected static PosScreen m_pos = null; >> protected XDialog m_dialog = null; >> @@ -51,7 +52,7 @@ >> // New button for Save and Print funtion >> protected XButton m_saveAndPrint = null; >> protected static PosTransaction m_trans = null; >> - public static SimpleDateFormat sdf = new >> SimpleDateFormat(UtilProperties.getMessage("PosUiLabels","DateTimeFormat",Locale.getDefault())); >> + public static SimpleDateFormat sdf = new >> SimpleDateFormat(UtilProperties.getMessage(resource,"DateTimeFormat",Locale.getDefault())); >> private static boolean ShowKeyboardInSaveSale = UtilProperties.propertyValueEqualsIgnoreCase("parameters", >> "ShowKeyboardInSaveSale", "Y"); >> //TODO : make getter and setter for members (ie m_*) if needed (extern calls). For that in Eclipse use Source/Generate Getters >> and setters >> @@ -66,7 +67,7 @@ >> m_saleName = (XEdit) m_dialog.findComponent("saleName"); //m_dialog.setM_focused(m_saleName); >> m_saleName.setText(m_pos.session.getUserId() + " " + sdf.format(new Date())); >> - m_dialog.setCaption(UtilProperties.getMessage("PosUiLabels", "SaveASale", Locale.getDefault())); >> + m_dialog.setCaption(UtilProperties.getMessage(resource, "SaveASale", Locale.getDefault())); >> m_cancel = (XButton) m_dialog.findComponent("BtnCancel"); >> m_save = (XButton) m_dialog.findComponent("BtnSave"); >> >> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java?rev=674829&r1=674828&r2=674829&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java (original) >> +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SelectProduct.java Tue Jul 8 07:04:16 2008 >> @@ -41,6 +41,7 @@ >> /** >> * To choose a product in a list of products whith the same bar code >> */ >> + private static final String resource = "PosUiLabels"; >> public static final String module = SelectProduct.class.getName(); >> protected static PosScreen m_pos = null; >> protected XDialog m_dialog = null; >> @@ -63,7 +64,7 @@ >> public String openDlg() { >> XDialog dlg = (XDialog) pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/SelectProduct"); >> m_dialog = dlg; >> - dlg.setCaption(UtilProperties.getMessage("PosUiLabels", "SelectAProduct", Locale.getDefault())); >> + dlg.setCaption(UtilProperties.getMessage(resource, "SelectAProduct", Locale.getDefault())); >> //dlg.setModal(true); >> m_productsList = (XList) dlg.findComponent("productsList"); >> XEventHelper.addMouseHandler(this, m_productsList, "DoubleClick"); >> @@ -85,7 +86,7 @@ >> m_productsList.setVisibleRowCount(-1); >> m_productsList.ensureIndexIsVisible(m_productsList.getItemCount()); >> m_productsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); >> - m_productsList.setToolTipText(UtilProperties.getMessage("PosUiLabels", "SelectProductListDblClickTip", >> Locale.getDefault())); >> + m_productsList.setToolTipText(UtilProperties.getMessage(resource, "SelectProductListDblClickTip", Locale.getDefault())); >> dlg.pack(); >> dlg.showDialog(this); >> >> >> > |
Free forum by Nabble | Edit this page |