You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/05/02 03:36:15 UTC

svn commit: r940141 - in /myfaces/tomahawk/trunk/core20: ./ src/main/java/org/apache/myfaces/custom/calendar/ src/main/java/org/apache/myfaces/custom/date/ src/main/java/org/apache/myfaces/custom/tree2/

Author: lu4242
Date: Sun May  2 01:36:14 2010
New Revision: 940141

URL: http://svn.apache.org/viewvc?rev=940141&view=rev
Log:
MYFACES-2691 Enhance MessageUtils adding methods when custom library bundle should be scanned

Modified:
    myfaces/tomahawk/trunk/core20/pom.xml
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/date/HtmlDateRenderer.java
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java

Modified: myfaces/tomahawk/trunk/core20/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/pom.xml?rev=940141&r1=940140&r2=940141&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/pom.xml (original)
+++ myfaces/tomahawk/trunk/core20/pom.xml Sun May  2 01:36:14 2010
@@ -450,7 +450,8 @@
                   org/apache/myfaces/renderkit/html/jsf/**,
                   org/apache/myfaces/shared_tomahawk/**,
                   org/apache/myfaces/taglib/**,
-                  org/apache/myfaces/tomahawk/**,
+                  org/apache/myfaces/tomahawk/application/**,
+                  org/apache/myfaces/tomahawk/util/**,
                   org/apache/myfaces/validator/**,
                   org/apache/myfaces/webapp/**</excludes>
                 </artifactItem>

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java?rev=940141&r1=940140&r2=940141&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java Sun May  2 01:36:14 2010
@@ -65,6 +65,7 @@ import org.apache.myfaces.shared_tomahaw
 import org.apache.myfaces.shared_tomahawk.renderkit.html.util.JavascriptUtils;
 import org.apache.myfaces.shared_tomahawk.util.MessageUtils;
 import org.apache.myfaces.tomahawk.application.PreRenderViewAddResourceEvent;
+import org.apache.myfaces.tomahawk.util.Constants;
 import org.apache.myfaces.tomahawk.util.TomahawkResourceUtils;
 
 /**
@@ -1278,8 +1279,8 @@ public class HtmlCalendarRenderer
                 if (date != null) {
                     return date;
                 }
-                FacesMessage msg = MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR,CONVERSION_MESSAGE_ID,new Object[]{
-                        uiComponent.getId(),s});
+                FacesMessage msg = MessageUtils.getMessage(Constants.TOMAHAWK_DEFAULT_BUNDLE,FacesMessage.SEVERITY_ERROR,CONVERSION_MESSAGE_ID,new Object[]{
+                        uiComponent.getId(),s},facesContext);
                 throw new ConverterException(msg);
             }
             else
@@ -1293,8 +1294,8 @@ public class HtmlCalendarRenderer
                 }
                 catch (ParseException e)
                 {
-                    FacesMessage msg = MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR,CONVERSION_MESSAGE_ID,new Object[]{
-                            uiComponent.getId(),s});
+                    FacesMessage msg = MessageUtils.getMessage(Constants.TOMAHAWK_DEFAULT_BUNDLE,FacesMessage.SEVERITY_ERROR,CONVERSION_MESSAGE_ID,new Object[]{
+                            uiComponent.getId(),s},facesContext);
                     throw new ConverterException(msg,e);
                 }
             }

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/date/HtmlDateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/date/HtmlDateRenderer.java?rev=940141&r1=940140&r2=940141&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/date/HtmlDateRenderer.java (original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/date/HtmlDateRenderer.java Sun May  2 01:36:14 2010
@@ -51,6 +51,7 @@ import org.apache.myfaces.shared_tomahaw
 import org.apache.myfaces.shared_tomahawk.renderkit.html.util.JavascriptUtils;
 import org.apache.myfaces.shared_tomahawk.util.MessageUtils;
 import org.apache.myfaces.tomahawk.application.PreRenderViewAddResourceEvent;
+import org.apache.myfaces.tomahawk.util.Constants;
 
 /**
  * @JSFRenderer
@@ -555,7 +556,7 @@ public class HtmlDateRenderer extends Ht
                 return userData.parse();
             } catch (ParseException e) {
                 Object[] args = {uiComponent.getId()};
-                throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
+                throw new ConverterException(MessageUtils.getMessage(Constants.TOMAHAWK_DEFAULT_BUNDLE, FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args, context));
             }            
         }
         else

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java?rev=940141&r1=940140&r2=940141&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java (original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java Sun May  2 01:36:14 2010
@@ -38,11 +38,11 @@ import javax.faces.event.FacesEvent;
 import javax.faces.event.FacesListener;
 import javax.faces.event.PhaseId;
 
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
-import org.apache.myfaces.shared_tomahawk.util.MessageUtils;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.shared_tomahawk.util.MessageUtils;
+import org.apache.myfaces.tomahawk.util.Constants;
 
 /**
  * TreeData is a {@link UIComponent} that supports binding data stored in a tree represented
@@ -374,7 +374,7 @@ public class UITreeData extends UICompon
              * message so the user can optionally display the warning.  Also, we will allow the user to provide
              * their own value binding method to be called so they can handle it how they see fit.
              */
-            FacesMessage message = MessageUtils.getMessage(MISSING_NODE, new String[] {nodeId});
+            FacesMessage message = MessageUtils.getMessageFromBundle(Constants.TOMAHAWK_DEFAULT_BUNDLE, MISSING_NODE, new String[] {nodeId});
             message.setSeverity(FacesMessage.SEVERITY_WARN);
             FacesContext.getCurrentInstance().addMessage(getId(), message);