KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > xtpdoc > FormattedText


1 /*
2  * Copyright (c) 1998-2000 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Emil Ong
28  */

29
30 package com.caucho.xtpdoc;
31
32 import com.caucho.config.types.RawString;
33
34 public class FormattedText extends ContainerNode {
35   public FormattedText(Document document)
36   {
37     super(document);
38   }
39
40   public void setOccur(String JavaDoc occur)
41   {
42   }
43
44   public void addText(RawString text)
45   {
46     addItem(new Text(text.getValue()));
47   }
48
49   public void addG(GlossaryText text)
50   {
51     addItem(text);
52   }
53
54   public LineBreak createBr()
55   {
56     LineBreak lineBreak = new LineBreak(getDocument());
57     addItem(lineBreak);
58     return lineBreak;
59   }
60
61   public ItalicizedText createI()
62   {
63     ItalicizedText text = new ItalicizedText(getDocument());
64     addItem(text);
65     return text;
66   }
67
68   public BoldText createB()
69   {
70     BoldText text = new BoldText(getDocument());
71     addItem(text);
72     return text;
73   }
74
75   public EmphasizedText createEm()
76   {
77     EmphasizedText text = new EmphasizedText(getDocument());
78     addItem(text);
79     return text;
80   }
81
82   public SuperText createSup()
83   {
84     SuperText text = new SuperText(getDocument());
85     addItem(text);
86     return text;
87   }
88
89   public SmallText createSmall()
90   {
91     SmallText text = new SmallText(getDocument());
92     addItem(text);
93     return text;
94   }
95
96   public PreFormattedText createPre()
97   {
98     PreFormattedText pretext = new PreFormattedText(getDocument());
99     addItem(pretext);
100     return pretext;
101   }
102
103   public Variable createVar()
104   {
105     Variable variable = new Variable(getDocument());
106     addItem(variable);
107     return variable;
108   }
109
110   public Code createCode()
111   {
112     Code code = new Code(getDocument());
113     addItem(code);
114     return code;
115   }
116
117   public Font createFont()
118   {
119     Font font = new Font(getDocument());
120     addItem(font);
121     return font;
122   }
123
124   public Url createUrl()
125   {
126     Url url = new Url(getDocument());
127     addItem(url);
128     return url;
129   }
130
131   public Example createExample()
132   {
133     Example example = new Example(getDocument());
134     addItem(example);
135     return example;
136   }
137
138   public WebOnly createWebOnly()
139   {
140     WebOnly webOnly = new WebOnly(getDocument());
141     addItem(webOnly);
142     return webOnly;
143   }
144 }
145
Popular Tags