1 20 package org.enhydra.barracuda.core.comp; 21 22 import java.io.*; 23 import java.util.*; 24 25 import org.apache.log4j.*; 26 import org.w3c.dom.*; 27 import org.w3c.dom.html.*; 28 29 import org.enhydra.barracuda.core.comp.renderer.*; 30 import org.enhydra.barracuda.core.comp.renderer.html.*; 31 import org.enhydra.barracuda.core.event.*; 32 import org.enhydra.barracuda.core.event.events.*; 33 import org.enhydra.barracuda.core.util.dom.*; 34 import org.enhydra.barracuda.core.view.*; 35 import org.enhydra.barracuda.plankton.*; 36 37 38 56 public class BLink extends BAction { 57 58 protected static final Logger logger = Logger.getLogger(BLink.class.getName()); 60 61 protected String text = null; 63 protected String target = null; 64 protected boolean allowMarkupInText = false; 66 70 public BLink() {} 71 72 79 public BLink(String itext) { 80 if (itext!=null) setText(itext); 81 } 82 83 91 public BLink(String itext, String iactionUrl) { 92 this(itext, iactionUrl, null); 93 } 94 95 107 public BLink(String itext, String iactionUrl, ViewContext idvc) { 108 if (idvc!=null) setDefaultViewContext(idvc); 109 if (itext!=null) setText(itext); 110 if (iactionUrl!=null) setAction(iactionUrl); 111 } 112 113 121 public BLink(String itext, ControlEvent iactionEvent) { 122 this(itext, iactionEvent, null); 123 } 124 125 137 public BLink(String itext, ControlEvent iactionEvent, ViewContext idvc) { 138 if (idvc!=null) setDefaultViewContext(idvc); 139 if (itext!=null) setText(itext); 140 if (iactionEvent!=null) setAction(iactionEvent); 141 } 142 143 144 145 149 static { 150 HTMLRendererFactory rfHTML = new HTMLRendererFactory(); 151 installRendererFactory(rfHTML, BLink.class, HTMLElement.class); 152 } 153 154 157 static class HTMLRendererFactory implements RendererFactory { 158 public Renderer getInstance() {return new HTMLLinkRenderer();} 159 } 160 161 162 163 169 public void setText(String itext) { 170 text = itext; 171 invalidate(); 172 } 173 174 179 public String getText() { 180 return text; 181 } 182 183 188 public void setTarget(String itarget) { 189 target = itarget; 190 invalidate(); 191 } 192 193 198 public String getTarget() { 199 return target; 200 } 201 202 207 public void setAllowMarkupInText(boolean val) { 208 allowMarkupInText = val; 209 invalidate(); 210 } 211 212 217 public boolean allowMarkupInText() { 218 return allowMarkupInText; 219 } 220 221 222 } | Popular Tags |