1 15 package tutorial.components; 16 17 import net.sf.tapestry.BaseComponent; 18 import net.sf.tapestry.IBinding; 19 import net.sf.tapestry.IRequestCycle; 20 import net.sf.tapestry.components.Foreach; 21 22 26 public class ArrayViewer extends BaseComponent { 27 30 public String getHeading() { 31 IBinding binding = (IBinding)getBinding("heading"); 32 if(binding.getObject() != null) { 33 return binding.getObject().toString(); 34 } 35 return heading; 36 } 37 38 42 public void setHeading(String heading) { 43 this.heading = heading; 44 } 45 46 49 protected void cleanupAfterRender(IRequestCycle cycle) { 50 source = null; 51 heading = "Array Viewer"; 52 super.cleanupAfterRender(cycle); 53 } 54 55 59 public Object getSource() { 60 return source; 61 } 62 63 67 public void setSource(Object source) { 68 this.source = source; 69 } 70 71 private String heading = "Array Viewer"; 72 private Object source; 73 } 74 | Popular Tags |