incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r497435 - 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 Thu, 18 Jan 2007 14:02:36 GMT
Author: matzew
Date: Thu Jan 18 06:02:35 2007
New Revision: 497435

URL: http://svn.apache.org/viewvc?view=rev&rev=497435
Log:
added new hint properties for dateTimeConverter

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=497435&r1=497434&r2=497435
==============================================================================
--- 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
Thu Jan 18 06:02:35 2007
@@ -224,7 +224,8 @@
           "{0}", "{1}", "{2}"
       };
       Object msgPattern = getMessagePattern(context, key, params, component);
-      String hintFormat = getHint();
+      //if hintFormat is null, no custom hint for date, time or both has been specified
+      String hintFormat = _getHint();
 
       FacesMessage msg = null;
       String detailMessage = null;
@@ -479,6 +480,23 @@
     buffer.append('\'');
     XhtmlUtils.escapeJS(buffer, pattern);
     buffer.append('\'');
+  }
+  
+  private String _getHint()
+  {
+    String type = getType();
+    if(type.equals("date"))
+    {
+      return getHintDate();
+    }
+    else if (type.equals("both"))
+    {
+      return getHintBoth();
+    }
+    else 
+    {
+      return getHintTime();
+    }
   }
 
   private static String _getEscapedPattern(StringBuffer buffer, String pattern,

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=497435&r1=497434&r2=497435
==============================================================================
--- 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
Thu Jan 18 06:02:35 2007
@@ -1050,6 +1050,7 @@
 
 TrDateTimeConverter.prototype.getFormatHint = function()
 {
+	//customized hint
 	if(this._messages && this._messages["hint"])
 	{
     return TrMessageFactory.createCustomMessage(
@@ -1059,8 +1060,10 @@
 	}
 	else
 	{
+		//no customized hint
+		var key = "org.apache.myfaces.trinidad.convert.DateTimeConverter." + this._type + "_HINT";
     return TrMessageFactory.createMessage(
-      "org.apache.myfaces.trinidad.convert.DateTimeConverter.FORMAT_HINT",
+      key,
       ""+this._exampleString);
 	}
 }



Mime
View raw message