001package com.hfg.html; 002 003 004import com.hfg.xml.XMLNode; 005 006//------------------------------------------------------------------------------ 007/** 008 * Represents a no break (<nobr>) tag. 009 * 010 * @author J. Alex Taylor, hairyfatguy.com 011 */ 012//------------------------------------------------------------------------------ 013// com.hfg XML/HTML Coding Library 014// 015// This library is free software; you can redistribute it and/or 016// modify it under the terms of the GNU Lesser General Public 017// License as published by the Free Software Foundation; either 018// version 2.1 of the License, or (at your option) any later version. 019// 020// This library is distributed in the hope that it will be useful, 021// but WITHOUT ANY WARRANTY; without even the implied warranty of 022// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 023// Lesser General Public License for more details. 024// 025// You should have received a copy of the GNU Lesser General Public 026// License along with this library; if not, write to the Free Software 027// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 028// 029// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 030// jataylor@hairyfatguy.com 031//------------------------------------------------------------------------------ 032 033public class Nobr extends HTMLTag 034{ 035 036 //########################################################################## 037 // CONSTRUCTORS 038 //########################################################################## 039 040 //-------------------------------------------------------------------------- 041 public Nobr() 042 { 043 super(HTML.NOBR); 044 } 045 046 //-------------------------------------------------------------------------- 047 public Nobr(String inContent) 048 { 049 this(); 050 addContent(inContent); 051 } 052 053 //-------------------------------------------------------------------------- 054 public Nobr(HTMLTag inContent) 055 { 056 this(); 057 addSubtag(inContent); 058 } 059 060 //-------------------------------------------------------------------------- 061 public Nobr(XMLNode inXMLNode) 062 { 063 this(); 064 initFromXMLNode(inXMLNode); 065 } 066 067 //########################################################################## 068 // PUBLIC METHODS 069 //########################################################################## 070 071 072 //-------------------------------------------------------------------------- 073 public Div addDiv() 074 { 075 Div div = new Div(); 076 addSubtag(div); 077 078 return div; 079 } 080 081 //-------------------------------------------------------------------------- 082 public Div addDiv(HTMLTag inContent) 083 { 084 Div div = new Div(inContent); 085 addSubtag(div); 086 087 return div; 088 } 089 090 //-------------------------------------------------------------------------- 091 public Img addImage(String inSrc) 092 { 093 Img image = new Img(inSrc); 094 addSubtag(image); 095 096 return image; 097 } 098 099 //-------------------------------------------------------------------------- 100 public Link addLink() 101 { 102 Link link = new Link(); 103 addSubtag(link); 104 105 return link; 106 } 107 108 //-------------------------------------------------------------------------- 109 public Link addLink(CharSequence inURL) 110 { 111 Link link = new Link(inURL); 112 addSubtag(link); 113 114 return link; 115 } 116 117 //-------------------------------------------------------------------------- 118 public Link addLink(CharSequence inURL, String inContent) 119 { 120 Link link = new Link(inURL, inContent); 121 addSubtag(link); 122 123 return link; 124 } 125 126 //-------------------------------------------------------------------------- 127 public Link addLink(CharSequence inURL, HTMLTag inContent) 128 { 129 Link link = new Link(inURL, inContent); 130 addSubtag(link); 131 132 return link; 133 } 134 135 //-------------------------------------------------------------------------- 136 public Span addSpan() 137 { 138 Span span = new Span(); 139 addSubtag(span); 140 141 return span; 142 } 143 144 //-------------------------------------------------------------------------- 145 public Span addSpan(String inContent) 146 { 147 Span span = new Span(inContent); 148 addSubtag(span); 149 150 return span; 151 } 152 153 //-------------------------------------------------------------------------- 154 public Span addSpan(HTMLTag inContent) 155 { 156 Span span = new Span(inContent); 157 addSubtag(span); 158 159 return span; 160 } 161 162 //-------------------------------------------------------------------------- 163 public Table addTable() 164 { 165 Table table = new Table(); 166 addSubtag(table); 167 168 return table; 169 } 170 171 //-------------------------------------------------------------------------- 172 public void nbsp(int inNumber) 173 { 174 HTMLUtil.nbsp(this, inNumber); 175 } 176 177 178}