myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r939498 - in /myfaces: core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/ core/trunk/impl/src/main/java/org/apache/myfaces/resource/ core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ shared/trunk_4.0...
Date Thu, 29 Apr 2010 22:27:30 GMT
Author: jakobk
Date: Thu Apr 29 22:27:30 2010
New Revision: 939498

URL: http://svn.apache.org/viewvc?rev=939498&view=rev
Log:
use constants for "javax.faces", "jsf.js", "library", "name" and "target"

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/JSFAttr.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java?rev=939498&r1=939497&r2=939498&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
Thu Apr 29 22:27:30 2010
@@ -55,7 +55,7 @@ public class HtmlScriptRenderer extends 
     public void processEvent(ComponentSystemEvent event) {
         if (event instanceof PostAddToViewEvent) {
             UIComponent component = event.getComponent();
-            String target = (String) component.getAttributes().get("target");
+            String target = (String) component.getAttributes().get(JSFAttr.TARGET_ATTR);
             if (target != null) {
                 FacesContext facesContext = FacesContext.getCurrentInstance();
 
@@ -82,7 +82,7 @@ public class HtmlScriptRenderer extends 
         {
             //TODO target check here
             UIComponent component = event.getComponent();
-            String target = (String) component.getAttributes().get("target");
+            String target = (String) component.getAttributes().get(JSFAttr.TARGET_ATTR);
             if (target != null) {
                 FacesContext facesContext = FacesContext.getCurrentInstance();
                 UIComponent uiTarget = facesContext.getViewRoot().getFacet(target);

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java?rev=939498&r1=939497&r2=939498&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java Thu
Apr 29 22:27:30 2010
@@ -18,6 +18,9 @@
  */
 package org.apache.myfaces.resource;
 
+import static org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.JAVAX_FACES_LIBRARY_NAME;
+import static org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils.JSF_JS_RESOURCE_NAME;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PushbackInputStream;
@@ -206,8 +209,8 @@ public class ResourceImpl extends Resour
             useAmp = true;
             
             if (!facesContext.isProjectStage(ProjectStage.Production)
-                    && "jsf.js".equals(getResourceName()) 
-                    && "javax.faces".equals(getLibraryName()))
+                    && JSF_JS_RESOURCE_NAME.equals(getResourceName()) 
+                    && JAVAX_FACES_LIBRARY_NAME.equals(getLibraryName()))
             {
                 // append &stage=?? for all ProjectStages except Production
                 path = path + "&stage=" + facesContext.getApplication().getProjectStage().toString();

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java?rev=939498&r1=939497&r2=939498&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
Thu Apr 29 22:27:30 2010
@@ -45,6 +45,8 @@ import javax.faces.view.facelets.TagHand
 
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletAttribute;
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
+import org.apache.myfaces.shared_impl.renderkit.JSFAttr;
+import org.apache.myfaces.shared_impl.renderkit.html.util.ResourceUtils;
 import org.apache.myfaces.view.facelets.AbstractFaceletContext;
 import org.apache.myfaces.view.facelets.tag.TagHandlerUtils;
 import org.apache.myfaces.view.facelets.tag.composite.CompositeComponentResourceTagHandler;
@@ -234,9 +236,9 @@ public class AjaxHandler extends TagHand
         {
             UIComponent outputScript = facesContext.getApplication().
                 createComponent(facesContext, "javax.faces.Output", "javax.faces.resource.Script");
-            outputScript.getAttributes().put("name", "jsf.js");
-            outputScript.getAttributes().put("library", "javax.faces");
-            outputScript.getAttributes().put("target", "head");
+            outputScript.getAttributes().put(JSFAttr.NAME_ATTR, ResourceUtils.JSF_JS_RESOURCE_NAME);
+            outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceUtils.JAVAX_FACES_LIBRARY_NAME);
+            outputScript.getAttributes().put(JSFAttr.TARGET_ATTR, "head");
 
             //AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
 

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/JSFAttr.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/JSFAttr.java?rev=939498&r1=939497&r2=939498&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/JSFAttr.java
(original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/JSFAttr.java
Thu Apr 29 22:27:30 2010
@@ -122,6 +122,9 @@ public interface JSFAttr
     String URL_ATTR                    = "url";
     String LIBRARY_ATTR                = "library";
     
+    // HtmlOutputScript (missing) attributes
+    String TARGET_ATTR                 = "target";
+    
     // UISelectItem attributes
     String ITEM_DISABLED_ATTR          = "itemDisabled";
     String ITEM_DESCRIPTION_ATTR       = "itemDescription";



Mime
View raw message