1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.w3c.dom.html2.*; 27 28 public abstract class HTMLElementBuilder { 29 public final HTMLElement create(HTMLDocument document, String name) { 30 HTMLElementImpl element = this.build(name); 31 element.setOwnerDocument(document); 32 return element; 33 } 34 35 protected abstract HTMLElementImpl build(String name); 36 37 public static class Html extends HTMLElementBuilder { 38 public HTMLElementImpl build(String name) { 39 return new HTMLHtmlElementImpl(name); 40 } 41 } 42 43 public static class Title extends HTMLElementBuilder { 44 public HTMLElementImpl build(String name) { 45 return new HTMLTitleElementImpl(name); 46 } 47 } 48 49 public static class Base extends HTMLElementBuilder { 50 public HTMLElementImpl build(String name) { 51 return new HTMLBaseElementImpl(name); 52 } 53 } 54 55 public static class Body extends HTMLElementBuilder { 56 public HTMLElementImpl build(String name) { 57 return new HTMLBodyElementImpl(name); 58 } 59 } 60 61 public static class Span extends HTMLElementBuilder { 62 public HTMLElementImpl build(String name) { 63 return new HTMLSpanElementImpl(name); 64 } 65 } 66 67 public static class Script extends HTMLElementBuilder { 68 public HTMLElementImpl build(String name) { 69 return new HTMLScriptElementImpl(name); 70 } 71 } 72 73 public static class Img extends HTMLElementBuilder { 74 public HTMLElementImpl build(String name) { 75 return new HTMLImageElementImpl(name); 76 } 77 } 78 79 public static class Style extends HTMLElementBuilder { 80 public HTMLElementImpl build(String name) { 81 return new HTMLStyleElementImpl(name); 82 } 83 } 84 85 public static class Table extends HTMLElementBuilder { 86 public HTMLElementImpl build(String name) { 87 return new HTMLTableElementImpl(name); 88 } 89 } 90 91 public static class Td extends HTMLElementBuilder { 92 public HTMLElementImpl build(String name) { 93 return new HTMLTableCellElementImpl(name); 94 } 95 } 96 97 public static class Th extends HTMLElementBuilder { 98 public HTMLElementImpl build(String name) { 99 return new HTMLTableHeadElementImpl(name); 100 } 101 } 102 103 public static class Tr extends HTMLElementBuilder { 104 public HTMLElementImpl build(String name) { 105 return new HTMLTableRowElementImpl(name); 106 } 107 } 108 public static class Link extends HTMLElementBuilder { 109 public HTMLElementImpl build(String name) { 110 return new HTMLLinkElementImpl(name); 111 } 112 } 113 114 public static class Anchor extends HTMLElementBuilder { 115 public HTMLElementImpl build(String name) { 116 return new HTMLLinkElementImpl(name); 117 } 118 } 119 120 public static class Form extends HTMLElementBuilder { 121 public HTMLElementImpl build(String name) { 122 return new HTMLFormElementImpl(name); 123 } 124 } 125 126 public static class Input extends HTMLElementBuilder { 127 public HTMLElementImpl build(String name) { 128 return new HTMLInputElementImpl(name); 129 } 130 } 131 132 public static class Button extends HTMLElementBuilder { 133 public HTMLElementImpl build(String name) { 134 return new HTMLButtonElementImpl(name); 135 } 136 } 137 138 public static class Textarea extends HTMLElementBuilder { 139 public HTMLElementImpl build(String name) { 140 return new HTMLTextAreaElementImpl(name); 141 } 142 } 143 144 public static class Select extends HTMLElementBuilder { 145 public HTMLElementImpl build(String name) { 146 return new HTMLSelectElementImpl(name); 147 } 148 } 149 150 public static class Option extends HTMLElementBuilder { 151 public HTMLElementImpl build(String name) { 152 return new HTMLOptionElementImpl(name); 153 } 154 } 155 156 public static class Frameset extends HTMLElementBuilder { 157 public HTMLElementImpl build(String name) { 158 return new HTMLFrameSetElementImpl(name); 159 } 160 } 161 162 public static class Frame extends HTMLElementBuilder { 163 public HTMLElementImpl build(String name) { 164 return new HTMLFrameElementImpl(name); 165 } 166 } 167 168 public static class Ul extends HTMLElementBuilder { 169 public HTMLElementImpl build(String name) { 170 return new HTMLUListElementImpl(name); 171 } 172 } 173 174 public static class Ol extends HTMLElementBuilder { 175 public HTMLElementImpl build(String name) { 176 return new HTMLOListElementImpl(name); 177 } 178 } 179 180 public static class Li extends HTMLElementBuilder { 181 public HTMLElementImpl build(String name) { 182 return new HTMLLIElementImpl(name); 183 } 184 } 185 186 public static class Pre extends HTMLElementBuilder { 187 public HTMLElementImpl build(String name) { 188 return new HTMLPreElementImpl(name); 189 } 190 } 191 192 public static class Div extends HTMLElementBuilder { 193 public HTMLElementImpl build(String name) { 194 return new HTMLDivElementImpl(name); 195 } 196 } 197 198 public static class Blockquote extends HTMLElementBuilder { 199 public HTMLElementImpl build(String name) { 200 return new HTMLBlockQuoteElementImpl(name); 201 } 202 } 203 204 public static class Hr extends HTMLElementBuilder { 205 public HTMLElementImpl build(String name) { 206 return new HTMLHRElementImpl(name); 207 } 208 } 209 210 public static class Br extends HTMLElementBuilder { 211 public HTMLElementImpl build(String name) { 212 return new HTMLBRElementImpl(name); 213 } 214 } 215 216 public static class P extends HTMLElementBuilder { 217 public HTMLElementImpl build(String name) { 218 return new HTMLPElementImpl(name); 219 } 220 } 221 222 public static class GenericMarkup extends HTMLElementBuilder { 223 public HTMLElementImpl build(String name) { 224 return new HTMLGenericMarkupElement(name); 225 } 226 } 227 228 public static class HtmlObject extends HTMLElementBuilder { 229 public HTMLElementImpl build(String name) { 230 return new HTMLObjectElementImpl(name); 231 } 232 } 233 234 public static class Applet extends HTMLElementBuilder { 235 public HTMLElementImpl build(String name) { 236 return new HTMLAppletElementImpl(name); 237 } 238 } 239 240 public static class IFrame extends HTMLElementBuilder { 241 public HTMLElementImpl build(String name) { 242 return new HTMLIFrameElementImpl(name); 243 } 244 } 245 246 public static class BaseFont extends HTMLElementBuilder { 247 public HTMLElementImpl build(String name) { 248 return new HTMLBaseFontElementImpl(name); 249 } 250 } 251 252 public static class Font extends HTMLElementBuilder { 253 public HTMLElementImpl build(String name) { 254 return new HTMLFontElementImpl(name); 255 } 256 } 257 258 public static class Tt extends HTMLElementBuilder { 259 public HTMLElementImpl build(String name) { 260 return new HTMLMonospacedElementImpl(name); 261 } 262 } 263 264 public static class Code extends HTMLElementBuilder { 265 public HTMLElementImpl build(String name) { 266 return new HTMLMonospacedElementImpl(name); 267 } 268 } 269 270 public static class Heading extends HTMLElementBuilder { 271 public HTMLElementImpl build(String name) { 272 return new HTMLHeadingElementImpl(name); 273 } 274 } 275 276 public static class Small extends HTMLElementBuilder { 277 public HTMLElementImpl build(String name) { 278 return new HTMLFontSizeChangeElementImpl(name, -1); 279 } 280 } 281 282 public static class Big extends HTMLElementBuilder { 283 public HTMLElementImpl build(String name) { 284 return new HTMLFontSizeChangeElementImpl(name, +1); 285 } 286 } 287 288 public static class Em extends HTMLElementBuilder { 289 public HTMLElementImpl build(String name) { 290 return new HTMLEmElementImpl(name); 291 } 292 } 293 294 public static class Strong extends HTMLElementBuilder { 295 public HTMLElementImpl build(String name) { 296 return new HTMLStrongElementImpl(name); 297 } 298 } 299 300 public static class Underline extends HTMLElementBuilder { 301 public HTMLElementImpl build(String name) { 302 return new HTMLUnderlineElementImpl(name); 303 } 304 } 305 306 public static class Strike extends HTMLElementBuilder { 307 public HTMLElementImpl build(String name) { 308 return new HTMLStrikeElementImpl(name); 309 } 310 } 311 312 public static class Center extends HTMLElementBuilder { 313 public HTMLElementImpl build(String name) { 314 return new HTMLCenterElementImpl(name); 315 } 316 } 317 318 public static class NonStandard extends HTMLElementBuilder { 319 public HTMLElementImpl build(String name) { 320 return new HTMLNonStandardElement(name); 321 } 322 } 323 } 324 | Popular Tags |