1 15 package org.apache.tapestry.wml; 16 17 import org.apache.tapestry.AbstractComponent; 18 import org.apache.tapestry.IAsset; 19 import org.apache.tapestry.IMarkupWriter; 20 import org.apache.tapestry.IRequestCycle; 21 22 30 31 public abstract class Image extends AbstractComponent 32 { 33 36 37 protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) 38 { 39 boolean render = !cycle.isRewinding(); 40 41 if (render) 42 { 43 writer.beginEmpty("img"); 44 45 writer.attribute("src", getImage().buildURL(cycle)); 46 47 writer.attribute("alt", getAlt()); 48 49 renderInformalParameters(writer, cycle); 50 51 writer.closeTag(); 52 } 53 } 54 55 public abstract IAsset getImage(); 56 57 public abstract String getAlt(); 58 } 59 | Popular Tags |