You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2007/02/19 18:35:03 UTC

svn commit: r509267 - in /tapestry/tapestry5/tapestry-core/trunk/src: main/java/org/apache/tapestry/corelib/components/Img.java test/java/org/apache/tapestry/integration/app1/components/Img.java

Author: hlship
Date: Mon Feb 19 09:35:01 2007
New Revision: 509267

URL: http://svn.apache.org/viewvc?view=rev&rev=509267
Log:
Move the Img component into the core library.

Added:
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Img.java
      - copied, changed from r508273, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java
Removed:
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Img.java (from r508273, tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Img.java?view=diff&rev=509267&p1=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java&r1=508273&p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Img.java&r2=509267
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/Img.java Mon Feb 19 09:35:01 2007
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.integration.app1.components;
+package org.apache.tapestry.corelib.components;
 
 import org.apache.tapestry.Asset;
 import org.apache.tapestry.ComponentResources;
@@ -26,6 +26,14 @@
 import org.apache.tapestry.annotations.SupportsInformalParameters;
 import org.apache.tapestry.services.PageRenderSupport;
 
+/**
+ * Renders an HTML img element using a supplied {@link Asset} as the image source. This is useful
+ * when image to render is packaged within a component library JAR, or when the image to display is
+ * computed dynamically.
+ * <p>
+ * Renders an id attribute (a {@link PageRenderSupport#allocateClientId(String) uniqued} version of
+ * the component's id) as well as informal parameters.
+ */
 @SupportsInformalParameters
 public class Img
 {
@@ -35,6 +43,9 @@
     @Inject
     private ComponentResources _resources;
 
+    /**
+     * The image asset to render.
+     */
     @Parameter(required = true)
     private Asset _src;