1 20 package org.enhydra.barracuda.core.comp.scripting; 21 22 import java.util.*; 23 24 import org.apache.log4j.*; 25 import org.w3c.dom.*; 26 import org.w3c.dom.html.*; 27 28 import org.enhydra.barracuda.core.comp.*; 29 import org.enhydra.barracuda.core.comp.renderer.*; 30 import org.enhydra.barracuda.core.comp.renderer.html.*; 31 import org.enhydra.barracuda.core.comp.renderer.xml.*; 32 import org.enhydra.barracuda.core.util.*; 33 import org.enhydra.barracuda.core.util.dom.DOMUtil; 34 import org.enhydra.barracuda.core.view.*; 35 import org.enhydra.barracuda.plankton.data.*; 36 37 38 51 public class BScriptResource extends BComponent { 52 53 protected static final Logger logger = Logger.getLogger(BScriptResource.class.getName()); 55 56 public static final String JS_CLIENT_SERVER_HTTP_LIB = "/org/enhydra/barracuda/core/scripts/ClientServerHTTPLib.js"; 57 public static final String JS_FORM_CONTROL = "/org/enhydra/barracuda/core/scripts/FormControl.js"; 58 public static final String JS_SCRIPTING_CHECK = "/org/enhydra/barracuda/core/scripts/ScriptingCheck.js"; 59 60 protected String src = null; 62 63 67 public BScriptResource() {} 68 69 81 public BScriptResource(String src) { 82 this(src, null); 83 } 84 85 98 BScriptResource(String src, View view) { 99 if (src!=null) this.setSrc(src); 100 if (view!=null) this.addView(view); 101 } 102 103 104 108 static { 109 HTMLRendererFactory rfHTML = new HTMLRendererFactory(); 110 installRendererFactory(rfHTML, BScriptResource.class, HTMLElement.class); 111 installRendererFactory(rfHTML, BScriptResource.class, HTMLDocument.class); 112 117 } 118 119 122 static class HTMLRendererFactory implements RendererFactory { 123 public Renderer getInstance() {return new HTMLScriptResourceRenderer();} 124 } 125 126 127 128 134 public void setSrc(String isrc) { 135 src = isrc; 136 invalidate(); 137 } 138 139 144 public String getSrc() { 145 return src; 146 } 147 148 156 171 174 public String toString() { 175 return src; 176 } 177 178 } | Popular Tags |