001: /*
002: * Copyright (c) 1998-2007 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Emil Ong
028: */
029:
030: package com.caucho.xtpdoc;
031:
032: import com.caucho.config.types.RawString;
033:
034: public class FormattedText extends ContainerNode {
035: public FormattedText(Document document) {
036: super (document);
037: }
038:
039: public void setOccur(String occur) {
040: }
041:
042: public void addText(RawString text) {
043: addItem(new Text(text.getValue()));
044: }
045:
046: public void addG(GlossaryText text) {
047: addItem(text);
048: }
049:
050: public Object createObject() {
051: Object object = new Object(getDocument());
052: addItem(object);
053: return object;
054: }
055:
056: public LineBreak createBr() {
057: LineBreak lineBreak = new LineBreak(getDocument());
058: addItem(lineBreak);
059: return lineBreak;
060: }
061:
062: public ItalicizedText createI() {
063: ItalicizedText text = new ItalicizedText(getDocument());
064: addItem(text);
065: return text;
066: }
067:
068: public BoldText createB() {
069: BoldText text = new BoldText(getDocument());
070: addItem(text);
071: return text;
072: }
073:
074: public EmphasizedText createEm() {
075: EmphasizedText text = new EmphasizedText(getDocument());
076: addItem(text);
077: return text;
078: }
079:
080: public SuperText createSup() {
081: SuperText text = new SuperText(getDocument());
082: addItem(text);
083: return text;
084: }
085:
086: public SmallText createSmall() {
087: SmallText text = new SmallText(getDocument());
088: addItem(text);
089: return text;
090: }
091:
092: public PreFormattedText createPre() {
093: PreFormattedText pretext = new PreFormattedText(getDocument());
094: addItem(pretext);
095: return pretext;
096: }
097:
098: public Variable createVar() {
099: Variable variable = new Variable(getDocument());
100: addItem(variable);
101: return variable;
102: }
103:
104: public Code createCode() {
105: Code code = new Code(getDocument());
106: addItem(code);
107: return code;
108: }
109:
110: public Font createFont() {
111: Font font = new Font(getDocument());
112: addItem(font);
113: return font;
114: }
115:
116: public Url createUrl() {
117: Url url = new Url(getDocument());
118: addItem(url);
119: return url;
120: }
121:
122: public Example createExample() {
123: Example example = new Example(getDocument());
124: addItem(example);
125: return example;
126: }
127:
128: public WebOnly createWebOnly() {
129: WebOnly webOnly = new WebOnly(getDocument());
130: addItem(webOnly);
131: return webOnly;
132: }
133: }
|