1 15 package org.apache.tapestry.wml; 16 17 import org.apache.hivemind.HiveMind; 18 import org.apache.tapestry.AbstractComponent; 19 import org.apache.tapestry.IMarkupWriter; 20 import org.apache.tapestry.IRequestCycle; 21 22 29 30 public abstract class Timer extends AbstractComponent 31 { 32 35 36 protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) 37 { 38 boolean render = !cycle.isRewinding(); 39 40 if (render) 41 { 42 writer.beginEmpty("timer"); 43 44 writer.attribute("name", getName()); 45 46 String value = getValue(); 47 if (HiveMind.isNonBlank(value)) 48 writer.attribute("value", value); 49 else 50 writer.attribute("value", "0"); 51 52 renderInformalParameters(writer, cycle); 53 54 writer.closeTag(); 55 } 56 } 57 58 public abstract String getName(); 59 60 61 62 public abstract String getValue(); 63 } | Popular Tags |