001package com.hfg.html; 002 003import com.hfg.xml.XMLNode; 004 005//------------------------------------------------------------------------------ 006/** 007 * Represents a list item (<li>) tag. 008 * 009 * @author J. Alex Taylor, hairyfatguy.com 010 */ 011//------------------------------------------------------------------------------ 012// com.hfg XML/HTML Coding Library 013// 014// This library is free software; you can redistribute it and/or 015// modify it under the terms of the GNU Lesser General Public 016// License as published by the Free Software Foundation; either 017// version 2.1 of the License, or (at your option) any later version. 018// 019// This library is distributed in the hope that it will be useful, 020// but WITHOUT ANY WARRANTY; without even the implied warranty of 021// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 022// Lesser General Public License for more details. 023// 024// You should have received a copy of the GNU Lesser General Public 025// License along with this library; if not, write to the Free Software 026// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 027// 028// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 029// jataylor@hairyfatguy.com 030//------------------------------------------------------------------------------ 031 032public class Li extends HTMLTagWithCoreEvents 033{ 034 035 //########################################################################## 036 // PRIVATE FIELDS 037 //########################################################################## 038 039 040 //########################################################################## 041 // CONSTRUCTORS 042 //########################################################################## 043 044 //-------------------------------------------------------------------------- 045 public Li() 046 { 047 super(HTML.LI); 048 } 049 050 //-------------------------------------------------------------------------- 051 public Li(String inContent) 052 { 053 this(); 054 setContent(inContent); 055 } 056 057 //-------------------------------------------------------------------------- 058 public Li(HTMLTag inContent) 059 { 060 this(); 061 addSubtag(inContent); 062 } 063 064 //-------------------------------------------------------------------------- 065 public Li(XMLNode inXMLNode) 066 { 067 this(); 068 initFromXMLNode(inXMLNode); 069 } 070 071 //########################################################################## 072 // PUBLIC METHODS 073 //########################################################################## 074 075 076 077 // Overrides for HTMLTag setters to allow method chaining. 078 079 //-------------------------------------------------------------------------- 080 @Override 081 public Li addClass(String inValue) 082 { 083 return (Li) super.addClass(inValue); 084 } 085 086 //-------------------------------------------------------------------------- 087 @Override 088 public Li setClass(String inValue) 089 { 090 return (Li) super.setClass(inValue); 091 } 092 093 //-------------------------------------------------------------------------- 094 @Override 095 public Li setId(String inValue) 096 { 097 return (Li) super.setId(inValue); 098 } 099 100 //-------------------------------------------------------------------------- 101 @Override 102 public Li setStyle(CharSequence inValue) 103 { 104 return (Li) super.setStyle(inValue); 105 } 106 107 //-------------------------------------------------------------------------- 108 @Override 109 public Li addStyle(String inValue) 110 { 111 return (Li) super.addStyle(inValue); 112 } 113 114 // Overrides for HTMLTagWithCoreEvents setters to allow method chaining. 115 116 //-------------------------------------------------------------------------- 117 @Override 118 public Li setOnClick(String inValue) 119 { 120 return (Li) super.setOnClick(inValue); 121 } 122 123 //-------------------------------------------------------------------------- 124 @Override 125 public Li setOnDblClick(String inValue) 126 { 127 return (Li) super.setOnDblClick(inValue); 128 } 129 130 //-------------------------------------------------------------------------- 131 @Override 132 public Li setOnMouseDown(String inValue) 133 { 134 return (Li) super.setOnMouseDown(inValue); 135 } 136 137 //-------------------------------------------------------------------------- 138 @Override 139 public Li setOnMouseMove(String inValue) 140 { 141 return (Li) super.setOnMouseMove(inValue); 142 } 143 144 //-------------------------------------------------------------------------- 145 @Override 146 public Li appendToOnMouseOut(String inValue) 147 { 148 return (Li) super.appendToOnMouseOut(inValue); 149 } 150 151 //-------------------------------------------------------------------------- 152 @Override 153 public Li setOnMouseOut(String inValue) 154 { 155 return (Li) super.setOnMouseOut(inValue); 156 } 157 158 //-------------------------------------------------------------------------- 159 @Override 160 public Li appendToOnMouseOver(String inValue) 161 { 162 return (Li) super.appendToOnMouseOver(inValue); 163 } 164 165 //-------------------------------------------------------------------------- 166 @Override 167 public Li setOnMouseOver(String inValue) 168 { 169 return (Li) super.setOnMouseOver(inValue); 170 } 171 172 //-------------------------------------------------------------------------- 173 @Override 174 public Li setOnMouseUp(String inValue) 175 { 176 return (Li) super.setOnMouseUp(inValue); 177 } 178 179 //-------------------------------------------------------------------------- 180 @Override 181 public Li setOnKeyDown(String inValue) 182 { 183 return (Li) super.setOnKeyDown(inValue); 184 } 185 186 //-------------------------------------------------------------------------- 187 @Override 188 public Li setOnKeyPress(String inValue) 189 { 190 return (Li) super.setOnKeyPress(inValue); 191 } 192 193 //-------------------------------------------------------------------------- 194 @Override 195 public Li setOnKeyUp(String inValue) 196 { 197 return (Li) super.setOnKeyUp(inValue); 198 } 199 200 201 //-------------------------------------------------------------------------- 202 public Img addImage(String inSrc) 203 { 204 Img image = new Img(inSrc); 205 addSubtag(image); 206 207 return image; 208 } 209 210 //-------------------------------------------------------------------------- 211 public Link addLink() 212 { 213 Link link = new Link(); 214 addSubtag(link); 215 216 return link; 217 } 218 219 //-------------------------------------------------------------------------- 220 public Link addLink(CharSequence inURL) 221 { 222 Link link = new Link(inURL); 223 addSubtag(link); 224 225 return link; 226 } 227 228 //-------------------------------------------------------------------------- 229 public Link addLink(CharSequence inURL, String inContent) 230 { 231 Link link = new Link(inURL, inContent); 232 addSubtag(link); 233 234 return link; 235 } 236 237 //-------------------------------------------------------------------------- 238 public Link addLink(CharSequence inURL, HTMLTag inContent) 239 { 240 Link link = new Link(inURL, inContent); 241 addSubtag(link); 242 243 return link; 244 } 245 246 //-------------------------------------------------------------------------- 247 public Nobr addNobr() 248 { 249 Nobr nobr = new Nobr(); 250 addSubtag(nobr); 251 252 return nobr; 253 } 254 255 //-------------------------------------------------------------------------- 256 public Nobr addNobr(String inContent) 257 { 258 Nobr nobr = new Nobr(inContent); 259 addSubtag(nobr); 260 261 return nobr; 262 } 263 264 //-------------------------------------------------------------------------- 265 public Nobr addNobr(HTMLTag inContent) 266 { 267 Nobr nobr = new Nobr(inContent); 268 addSubtag(nobr); 269 270 return nobr; 271 } 272 273 274 //-------------------------------------------------------------------------- 275 public Pre addPre() 276 { 277 Pre pre = new Pre(); 278 addSubtag(pre); 279 280 return pre; 281 } 282 283 //-------------------------------------------------------------------------- 284 public Pre addPre(String inContent) 285 { 286 Pre pre = new Pre(inContent); 287 addSubtag(pre); 288 289 return pre; 290 } 291 292 //-------------------------------------------------------------------------- 293 public Pre addPre(HTMLTag inContent) 294 { 295 Pre pre = new Pre(inContent); 296 addSubtag(pre); 297 298 return pre; 299 } 300 301 //-------------------------------------------------------------------------- 302 public Span addSpan() 303 { 304 Span span = new Span(); 305 addSubtag(span); 306 307 return span; 308 } 309 310 //-------------------------------------------------------------------------- 311 public Span addSpan(String inContent) 312 { 313 Span span = new Span(inContent); 314 addSubtag(span); 315 316 return span; 317 } 318 319 //-------------------------------------------------------------------------- 320 public Span addSpan(HTMLTag inContent) 321 { 322 Span span = new Span(inContent); 323 addSubtag(span); 324 325 return span; 326 } 327 328 329 //-------------------------------------------------------------------------- 330 public Table addTable() 331 { 332 Table table = new Table(); 333 addSubtag(table); 334 335 return table; 336 } 337 338 //-------------------------------------------------------------------------- 339 public Ul addUnorderedList() 340 { 341 Ul ul = new Ul(); 342 addSubtag(ul); 343 344 return ul; 345 } 346 347 //-------------------------------------------------------------------------- 348 public Li br() 349 { 350 HTMLUtil.br(this); 351 return this; 352 } 353 354 //-------------------------------------------------------------------------- 355 public Li br(int inNumber) 356 { 357 HTMLUtil.br(this, inNumber); 358 return this; 359 } 360 361 //-------------------------------------------------------------------------- 362 public void nbsp(int inNumber) 363 { 364 HTMLUtil.nbsp(this, inNumber); 365 } 366 367 //-------------------------------------------------------------------------- 368 public void hr() 369 { 370 HTMLUtil.hr(this); 371 } 372 373 //-------------------------------------------------------------------------- 374 public void hr(String inWidth) 375 { 376 HTMLUtil.hr(this, inWidth); 377 } 378 379}