click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r955548 - in /click/trunk/click/framework/src/org/apache/click/element: CssImport.java CssStyle.java JsImport.java JsScript.java ResourceElement.java
Date Thu, 17 Jun 2010 10:56:10 GMT
Author: sabob
Date: Thu Jun 17 10:56:10 2010
New Revision: 955548

URL: http://svn.apache.org/viewvc?rev=955548&view=rev
Log:
Add a renderId property to ResourceElement to exclude the ID attribute from rendering. CLK-695

Modified:
    click/trunk/click/framework/src/org/apache/click/element/CssImport.java
    click/trunk/click/framework/src/org/apache/click/element/CssStyle.java
    click/trunk/click/framework/src/org/apache/click/element/JsImport.java
    click/trunk/click/framework/src/org/apache/click/element/JsScript.java
    click/trunk/click/framework/src/org/apache/click/element/ResourceElement.java

Modified: click/trunk/click/framework/src/org/apache/click/element/CssImport.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/element/CssImport.java?rev=955548&r1=955547&r2=955548&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/element/CssImport.java (original)
+++ click/trunk/click/framework/src/org/apache/click/element/CssImport.java Thu Jun 17 10:56:10
2010
@@ -209,7 +209,9 @@ public class CssImport extends ResourceE
 
         buffer.elementStart(getTag());
 
-        buffer.appendAttribute("id", getId());
+        if (isRenderId()) {
+            buffer.appendAttribute("id", getId());
+        }
 
         String href = getHref();
         renderResourcePath(buffer, "href", href);

Modified: click/trunk/click/framework/src/org/apache/click/element/CssStyle.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/element/CssStyle.java?rev=955548&r1=955547&r2=955548&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/element/CssStyle.java (original)
+++ click/trunk/click/framework/src/org/apache/click/element/CssStyle.java Thu Jun 17 10:56:10
2010
@@ -334,7 +334,10 @@ public class CssStyle extends ResourceEl
 
         buffer.elementStart(getTag());
 
-        buffer.appendAttribute("id", getId());
+        if (isRenderId()) {
+            buffer.appendAttribute("id", getId());
+        }
+
         appendAttributes(buffer);
 
         buffer.closeTag();

Modified: click/trunk/click/framework/src/org/apache/click/element/JsImport.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/element/JsImport.java?rev=955548&r1=955547&r2=955548&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/element/JsImport.java (original)
+++ click/trunk/click/framework/src/org/apache/click/element/JsImport.java Thu Jun 17 10:56:10
2010
@@ -208,7 +208,9 @@ public class JsImport extends ResourceEl
 
         buffer.elementStart(getTag());
 
-        buffer.appendAttribute("id", getId());
+        if (isRenderId()) {
+            buffer.appendAttribute("id", getId());
+        }
 
         String src = getSrc();
         renderResourcePath(buffer, "src", src);

Modified: click/trunk/click/framework/src/org/apache/click/element/JsScript.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/element/JsScript.java?rev=955548&r1=955547&r2=955548&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/element/JsScript.java (original)
+++ click/trunk/click/framework/src/org/apache/click/element/JsScript.java Thu Jun 17 10:56:10
2010
@@ -381,7 +381,10 @@ public class JsScript extends ResourceEl
 
         buffer.elementStart(getTag());
 
-        buffer.appendAttribute("id", getId());
+        if (isRenderId()) {
+            buffer.appendAttribute("id", getId());
+        }
+
         appendAttributes(buffer);
 
         buffer.closeTag();

Modified: click/trunk/click/framework/src/org/apache/click/element/ResourceElement.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/element/ResourceElement.java?rev=955548&r1=955547&r2=955548&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/element/ResourceElement.java (original)
+++ click/trunk/click/framework/src/org/apache/click/element/ResourceElement.java Thu Jun
17 10:56:10 2010
@@ -205,10 +205,10 @@ public class ResourceElement extends Ele
     private String conditionalComment;
 
     /**
-     * Indicates if Click should ensure the import is unique, default value is
-     * <tt>false</tt>.
+     * Indicates whether the {@link #getId() ID} attribute should be rendered
+     * or not, default value is <tt>true</tt>.
      */
-    private boolean unique = false;
+    private boolean renderId = true;
 
     /**
      * The <tt>version indicator</tt> to append to the Resource element.
@@ -239,8 +239,8 @@ public class ResourceElement extends Ele
     }
 
     /**
-     * Return true if the Resource should be unique, false otherwise. The default
-     * value is <tt>true</tt> if the {@link #getId() ID} attribute is defined,
+     * Returns whether or not the Resource unique. This method returns
+     * <tt>true</tt> if the {@link #getId() ID} attribute is defined,
      * false otherwise.
      *
      * @return true if the Resource should be unique, false otherwise.
@@ -253,7 +253,31 @@ public class ResourceElement extends Ele
         if (StringUtils.isNotBlank(id)) {
             return true;
         }
-        return unique;
+        return false;
+    }
+
+    /**
+     * Returns the element render {@link #getId() ID} attribute status, default
+     * value is true.
+     *
+     * @see {@link #setRenderId(boolean)}
+     *
+     * @return the element render id attribute status, default value is true
+     */
+    public boolean isRenderId() {
+        return renderId;
+    }
+
+    /**
+     * Set the element render {@link #getId() ID} attribute status.
+     * <p/>
+     * If renderId is false the element {@link #getId() ID} attribute will not
+     * be rendered.
+     *
+     * @param renderId set the element render id attribute status
+     */
+    public void setRenderId(boolean renderId) {
+        this.renderId = renderId;
     }
 
     /**



Mime
View raw message