1 15 package org.apache.tapestry.contrib.components; 16 17 import org.apache.tapestry.IRender; 18 import org.apache.tapestry.IRequestCycle; 19 import org.apache.tapestry.components.Conditional; 20 21 30 public abstract class Choose extends Conditional { 31 32 33 public void addBody(IRender element) 34 { 35 super.addBody(element); 36 if (element instanceof When) 37 ((When) element).setChoose(this); 38 } 39 40 protected void cleanupAfterRender(IRequestCycle cycle) 41 { 42 setConditionMet(false); 43 super.cleanupAfterRender(cycle); 44 } 45 46 protected boolean evaluateCondition() 47 { 48 return getCondition(); 49 } 50 51 public boolean getInvert() 52 { 53 return false; 55 } 56 57 public abstract boolean getCondition(); 58 59 public abstract boolean isConditionMet(); 60 public abstract void setConditionMet(boolean value); 61 } 62 | Popular Tags |