1 package org.enhydra.barracuda.examples.xmlc; 2 3 import java.io.*; 4 import java.util.*; 5 import javax.servlet.*; 6 import javax.servlet.http.*; 7 8 import org.w3c.dom.*; 9 import org.w3c.dom.html.*; 10 import org.enhydra.xml.xmlc.*; 11 12 import org.enhydra.barracuda.core.comp.*; 13 import org.enhydra.barracuda.core.comp.helper.*; 14 import org.enhydra.barracuda.core.util.dom.*; 15 import org.enhydra.barracuda.core.event.*; 16 import org.enhydra.barracuda.core.util.dom.*; 17 import org.enhydra.barracuda.core.view.*; 18 import org.enhydra.barracuda.examples.xmlc.data.*; 19 20 24 public class CompEx8 extends BTemplateGateway { 25 26 27 28 32 public TemplateModel getTemplateModel() { 33 return new LocalTemplateModel(); 34 } 35 36 39 public Class getTemplateClass() { 40 return CompEx8HTML.class; 41 } 42 43 public DOMWriter getDOMWriter() { 44 return new DefaultDOMWriter(true); 45 } 46 47 51 class LocalTemplateModel extends AbstractTemplateModel { 52 53 public String getName() {return "Ex8";} 55 56 public Object getItem(String key) { 58 ViewContext vc = getViewContext(); 59 ViewCapabilities vcap = vc.getViewCapabilities(); 60 if (key.equals("Link1")) { 61 return new BLink("A sample link", "/Barracuda/CompTest8"); 62 } else if (key.equals("Form1")) { 63 return new BAction("/Barracuda/CompTest8"); 64 } else { 65 return super.getItem(key); 66 } 67 } 68 } 69 } 70 | Popular Tags |