incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r489052 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main: java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java javascript/META-INF/adf/jsLibs/DateFormat.js
Date Wed, 20 Dec 2006 11:26:13 GMT
Author: matzew
Date: Wed Dec 20 03:26:11 2006
New Revision: 489052

URL: http://svn.apache.org/viewvc?view=rev&rev=489052
Log:
tuning the TrDateTimeConverter to not send down the summary, only the custom details; using
StringBuilder instead of StrungBiffer

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?view=diff&rev=489052&r1=489051&r2=489052
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
Wed Dec 20 03:26:11 2006
@@ -224,21 +224,19 @@
 
       FacesMessage msg = null;
       String detailMessage = null;
-      String summaryMessage = null;
       int customMessages = 0;
       if (msgPattern != null)
       {
         msg = MessageFactory.getMessage(context, key, msgPattern, params,
             component);
         detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
-        summaryMessage = XhtmlLafUtils.escapeJS(msg.getSummary());
-        customMessages = 6 + detailMessage.length() + summaryMessage.length();
+        customMessages = 6 + detailMessage.length();
 
       }
       String exampleString = XhtmlLafUtils.escapeJS(getExample(context));
       String escapedType = XhtmlLafUtils.escapeJS(getType().toUpperCase());
 
-      StringBuffer outBuffer = new StringBuffer(36 + jsPattern.length()
+      StringBuilder outBuffer = new StringBuilder(33 + jsPattern.length()
           + exampleString.length() + escapedType.length() + customMessages);
       outBuffer.append("new TrDateTimeConverter("); // 21
       outBuffer.append(jsPattern); // jsPattern.length
@@ -249,8 +247,6 @@
 
       if (msgPattern != null)
       {
-        outBuffer.append("','"); // 3
-        outBuffer.append(summaryMessage); // summary message.length
         outBuffer.append("','"); // 3
         outBuffer.append(detailMessage); // detail message.length/
       }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?view=diff&rev=489052&r1=489051&r2=489052
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
Wed Dec 20 03:26:11 2006
@@ -1021,7 +1021,6 @@
   locale,
   exampleString,
   type,
-  summary,
   detail
   )
 {
@@ -1030,7 +1029,6 @@
   this._class = "TrDateTimeConverter";
   this._exampleString = exampleString;
   this._type = type;
-  this._summary = summary;
   this._detail = detail;
   this._offset = null;
   
@@ -1128,16 +1126,17 @@
   var pattern = this._pattern;
   
   var facesMessage;
-  if(this._summary == undefined)
+  var key = "org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_"+this._type;
+  if(this._detail == undefined)
   {
-    facesMessage = _createFacesMessage( "org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_"+this._type,
+    facesMessage = _createFacesMessage( key,
                                           label,
                                           parseString,
                                           this._exampleString);
   }
   else
   {
-    facesMessage = _createCustomFacesMessage( this._summary,
+    facesMessage = _createCustomFacesMessage(TrMessageFactory.getSummaryString(key),
                                           this._detail,
                                           label,
                                           parseString,



Mime
View raw message