duke@1: /* ohair@798: * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@554: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@554: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. duke@1: */ duke@1: duke@1: package com.sun.tools.doclets.formats.html.markup; duke@1: bpatel@233: import java.io.*; bpatel@233: duke@1: import com.sun.tools.doclets.internal.toolkit.*; duke@1: import com.sun.tools.doclets.internal.toolkit.util.*; duke@1: duke@1: /** duke@1: * Class for the Html format code generation. duke@1: * Initilizes PrintWriter with FileWriter, to enable print duke@1: * related methods to generate the code to the named File through FileWriter. duke@1: * duke@1: * @since 1.2 duke@1: * @author Atul M Dambalkar bpatel@243: * @author Bhavesh Patel (Modified) duke@1: */ duke@1: public class HtmlWriter extends PrintWriter { duke@1: duke@1: /** duke@1: * Name of the file, to which this writer is writing to. duke@1: */ duke@1: protected final String htmlFilename; duke@1: duke@1: /** duke@1: * The window title of this file duke@1: */ duke@1: protected String winTitle; duke@1: duke@1: /** duke@1: * URL file separator string("/"). duke@1: */ duke@1: public static final String fileseparator = bpatel@766: DirectoryManager.URL_FILE_SEPARATOR; duke@1: duke@1: /** duke@1: * The configuration duke@1: */ duke@1: protected Configuration configuration; duke@1: duke@1: /** bpatel@233: * The flag to indicate whether a member details list is printed or not. bpatel@233: */ bpatel@233: protected boolean memberDetailsListPrinted; bpatel@233: bpatel@233: /** bpatel@243: * Header for tables displaying packages and description.. bpatel@243: */ bpatel@243: protected final String[] packageTableHeader; bpatel@243: bpatel@243: /** bpatel@243: * Summary for use tables displaying class and package use. bpatel@243: */ bpatel@243: protected final String useTableSummary; bpatel@243: bpatel@243: /** bpatel@243: * Column header for class docs displaying Modifier and Type header. bpatel@243: */ bpatel@243: protected final String modifierTypeHeader; bpatel@243: bpatel@766: public final Content overviewLabel; bpatel@766: bpatel@766: public final Content defaultPackageLabel; bpatel@766: bpatel@766: public final Content packageLabel; bpatel@766: bpatel@766: public final Content useLabel; bpatel@766: bpatel@766: public final Content prevLabel; bpatel@766: bpatel@766: public final Content nextLabel; bpatel@766: bpatel@766: public final Content prevclassLabel; bpatel@766: bpatel@766: public final Content nextclassLabel; bpatel@766: bpatel@766: public final Content summaryLabel; bpatel@766: bpatel@766: public final Content detailLabel; bpatel@766: bpatel@766: public final Content framesLabel; bpatel@766: bpatel@766: public final Content noframesLabel; bpatel@766: bpatel@766: public final Content treeLabel; bpatel@766: bpatel@766: public final Content classLabel; bpatel@766: bpatel@766: public final Content deprecatedLabel; bpatel@766: bpatel@766: public final Content deprecatedPhrase; bpatel@766: bpatel@766: public final Content allclassesLabel; bpatel@766: bpatel@766: public final Content indexLabel; bpatel@766: bpatel@766: public final Content helpLabel; bpatel@766: bpatel@766: public final Content seeLabel; bpatel@766: bpatel@766: public final Content descriptionLabel; bpatel@766: bpatel@766: public final Content prevpackageLabel; bpatel@766: bpatel@766: public final Content nextpackageLabel; bpatel@766: bpatel@766: public final Content packagesLabel; bpatel@766: bpatel@766: public final Content methodDetailsLabel; bpatel@766: bpatel@766: public final Content annotationTypeDetailsLabel; bpatel@766: bpatel@766: public final Content fieldDetailsLabel; bpatel@766: bpatel@766: public final Content constructorDetailsLabel; bpatel@766: bpatel@766: public final Content enumConstantsDetailsLabel; bpatel@766: bpatel@766: public final Content specifiedByLabel; bpatel@766: bpatel@766: public final Content overridesLabel; bpatel@766: bpatel@766: public final Content descfrmClassLabel; bpatel@766: bpatel@766: public final Content descfrmInterfaceLabel; bpatel@766: bpatel@243: /** duke@1: * Constructor. duke@1: * duke@1: * @param path The directory path to be created for this file duke@1: * or null if none to be created. duke@1: * @param filename File Name to which the PrintWriter will duke@1: * do the Output. duke@1: * @param docencoding Encoding to be used for this file. duke@1: * @exception IOException Exception raised by the FileWriter is passed on duke@1: * to next level. duke@1: * @exception UnSupportedEncodingException Exception raised by the duke@1: * OutputStreamWriter is passed on to next level. duke@1: */ duke@1: public HtmlWriter(Configuration configuration, duke@1: String path, String filename, String docencoding) duke@1: throws IOException, UnsupportedEncodingException { duke@1: super(Util.genWriter(configuration, path, filename, docencoding)); duke@1: this.configuration = configuration; duke@1: htmlFilename = filename; bpatel@233: this.memberDetailsListPrinted = false; bpatel@243: packageTableHeader = new String[] { bpatel@243: configuration.getText("doclet.Package"), bpatel@243: configuration.getText("doclet.Description") bpatel@243: }; bpatel@243: useTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.packages")); bpatel@243: modifierTypeHeader = configuration.getText("doclet.0_and_1", bpatel@243: configuration.getText("doclet.Modifier"), bpatel@243: configuration.getText("doclet.Type")); bpatel@766: overviewLabel = getResource("doclet.Overview"); bpatel@766: defaultPackageLabel = new RawHtml( bpatel@766: DocletConstants.DEFAULT_PACKAGE_NAME); bpatel@766: packageLabel = getResource("doclet.Package"); bpatel@766: useLabel = getResource("doclet.navClassUse"); bpatel@766: prevLabel = getResource("doclet.Prev"); bpatel@766: nextLabel = getResource("doclet.Next"); bpatel@766: prevclassLabel = getResource("doclet.Prev_Class"); bpatel@766: nextclassLabel = getResource("doclet.Next_Class"); bpatel@766: summaryLabel = getResource("doclet.Summary"); bpatel@766: detailLabel = getResource("doclet.Detail"); bpatel@766: framesLabel = getResource("doclet.FRAMES"); bpatel@766: noframesLabel = getResource("doclet.NO_FRAMES"); bpatel@766: treeLabel = getResource("doclet.Tree"); bpatel@766: classLabel = getResource("doclet.Class"); bpatel@766: deprecatedLabel = getResource("doclet.navDeprecated"); bpatel@766: deprecatedPhrase = getResource("doclet.Deprecated"); bpatel@766: allclassesLabel = getResource("doclet.All_Classes"); bpatel@766: indexLabel = getResource("doclet.Index"); bpatel@766: helpLabel = getResource("doclet.Help"); bpatel@766: seeLabel = getResource("doclet.See"); bpatel@766: descriptionLabel = getResource("doclet.Description"); bpatel@766: prevpackageLabel = getResource("doclet.Prev_Package"); bpatel@766: nextpackageLabel = getResource("doclet.Next_Package"); bpatel@766: packagesLabel = getResource("doclet.Packages"); bpatel@766: methodDetailsLabel = getResource("doclet.Method_Detail"); bpatel@766: annotationTypeDetailsLabel = getResource("doclet.Annotation_Type_Member_Detail"); bpatel@766: fieldDetailsLabel = getResource("doclet.Field_Detail"); bpatel@766: constructorDetailsLabel = getResource("doclet.Constructor_Detail"); bpatel@766: enumConstantsDetailsLabel = getResource("doclet.Enum_Constant_Detail"); bpatel@766: specifiedByLabel = getResource("doclet.Specified_By"); bpatel@766: overridesLabel = getResource("doclet.Overrides"); bpatel@766: descfrmClassLabel = getResource("doclet.Description_From_Class"); bpatel@766: descfrmInterfaceLabel = getResource("doclet.Description_From_Interface"); bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Get the configuration string as a content. bpatel@766: * bpatel@766: * @param key the key to look for in the configuration file bpatel@766: * @return a content tree for the text bpatel@766: */ bpatel@766: public Content getResource(String key) { bpatel@766: return new StringContent(configuration.getText(key)); bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Get the configuration string as a content. bpatel@766: * bpatel@766: * @param key the key to look for in the configuration file bpatel@766: * @param a1 string argument added to configuration text bpatel@766: * @return a content tree for the text bpatel@766: */ bpatel@766: public Content getResource(String key, String a1) { bpatel@766: return new RawHtml(configuration.getText(key, a1)); bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Get the configuration string as a content. bpatel@766: * bpatel@766: * @param key the key to look for in the configuration file bpatel@766: * @param a1 string argument added to configuration text bpatel@766: * @param a2 string argument added to configuration text bpatel@766: * @return a content tree for the text bpatel@766: */ bpatel@766: public Content getResource(String key, String a1, String a2) { bpatel@766: return new RawHtml(configuration.getText(key, a1, a2)); duke@1: } duke@1: duke@1: /** duke@1: * Print <HTML> tag. Add a newline character at the end. duke@1: */ duke@1: public void html() { bpatel@191: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </HTML> tag. Add a newline character at the end. duke@1: */ duke@1: public void htmlEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print the script code to be embeded before the </HEAD> tag. duke@1: */ duke@1: protected void printWinTitleScript(String winTitle){ duke@1: if(winTitle != null && winTitle.length() > 0) { duke@1: script(); duke@1: println("function windowTitle()"); duke@1: println("{"); duke@1: println(" if (location.href.indexOf('is-external=true') == -1) {"); duke@1: println(" parent.document.title=\"" + winTitle + "\";"); duke@1: println(" }"); duke@1: println("}"); duke@1: scriptEnd(); duke@1: noScript(); duke@1: noScriptEnd(); duke@1: } duke@1: } duke@1: duke@1: /** bpatel@766: * Returns an HtmlTree for the SCRIPT tag. bpatel@766: * bpatel@766: * @return an HtmlTree for the SCRIPT tag bpatel@766: */ bpatel@766: protected HtmlTree getWinTitleScript(){ bpatel@766: HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); bpatel@766: if(winTitle != null && winTitle.length() > 0) { bpatel@766: script.addAttr(HtmlAttr.TYPE, "text/javascript"); bpatel@793: String scriptCode = "" + DocletConstants.NL; bpatel@766: RawHtml scriptContent = new RawHtml(scriptCode); bpatel@766: script.addContent(scriptContent); bpatel@766: } bpatel@766: return script; bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Returns a content tree for the SCRIPT tag for the main page(index.html). bpatel@766: * bpatel@766: * @return a content for the SCRIPT tag bpatel@766: */ bpatel@766: protected Content getFramesetJavaScript(){ bpatel@766: HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); bpatel@766: script.addAttr(HtmlAttr.TYPE, "text/javascript"); bpatel@793: String scriptCode = DocletConstants.NL + " targetPage = \"\" + window.location.search;" + DocletConstants.NL + bpatel@793: " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + bpatel@793: " targetPage = targetPage.substring(1);" + DocletConstants.NL + bpatel@793: " if (targetPage.indexOf(\":\") != -1)" + DocletConstants.NL + bpatel@793: " targetPage = \"undefined\";" + DocletConstants.NL + bpatel@793: " function loadFrames() {" + DocletConstants.NL + bpatel@793: " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + bpatel@793: " top.classFrame.location = top.targetPage;" + DocletConstants.NL + bpatel@793: " }" + DocletConstants.NL; bpatel@766: RawHtml scriptContent = new RawHtml(scriptCode); bpatel@766: script.addContent(scriptContent); bpatel@766: return script; bpatel@766: } bpatel@766: bpatel@766: /** duke@1: * Print the Javascript <SCRIPT> start tag with its type duke@1: * attribute. duke@1: */ duke@1: public void script() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print the Javascript <NOSCRIPT> start tag. duke@1: */ duke@1: public void noScript() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Return the Javascript call to be embedded in the <BODY> tag. duke@1: * Return nothing if winTitle is empty. duke@1: * @return the Javascript call to be embedded in the <BODY> tag. duke@1: */ duke@1: protected String getWindowTitleOnload(){ duke@1: if(winTitle != null && winTitle.length() > 0) { duke@1: return " onload=\"windowTitle();\""; duke@1: } else { duke@1: return ""; duke@1: } duke@1: } duke@1: duke@1: /** duke@1: * Print <BODY BGCOLOR="bgcolor">, including JavaScript duke@1: * "onload" call to load windowtitle script. This script shows the name duke@1: * of the document in the window title bar when frames are on. duke@1: * duke@1: * @param bgcolor Background color. duke@1: * @param includeScript boolean set true if printing windowtitle script duke@1: */ duke@1: public void body(String bgcolor, boolean includeScript) { duke@1: print(""); duke@1: } duke@1: duke@1: /** bpatel@766: * Returns an HtmlTree for the BODY tag. bpatel@766: * bpatel@766: * @param includeScript set true if printing windowtitle script bpatel@766: * @param title title for the window bpatel@766: * @return an HtmlTree for the BODY tag bpatel@766: */ bpatel@766: public HtmlTree getBody(boolean includeScript, String title) { bpatel@766: HtmlTree body = new HtmlTree(HtmlTag.BODY); bpatel@766: // Set window title string which is later printed bpatel@766: this.winTitle = title; bpatel@766: // Don't print windowtitle script for overview-frame, allclasses-frame bpatel@766: // and package-frame bpatel@766: if (includeScript) { bpatel@766: body.addContent(getWinTitleScript()); bpatel@766: Content noScript = HtmlTree.NOSCRIPT( bpatel@766: HtmlTree.DIV(getResource("doclet.No_Script_Message"))); bpatel@766: body.addContent(noScript); bpatel@766: } bpatel@766: return body; bpatel@766: } bpatel@766: bpatel@766: /** duke@1: * Print </BODY> tag. Add a newline character at the end. duke@1: */ duke@1: public void bodyEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TITLE> tag. Add a newline character at the end. duke@1: */ duke@1: public void title() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TITLE> tag. Add a newline character at the end. duke@1: * duke@1: * @param winTitle The title of this document. duke@1: */ duke@1: public void title(String winTitle) { duke@1: // Set window title string which is later printed duke@1: this.winTitle = winTitle; duke@1: title(); duke@1: } duke@1: bpatel@766: /** bpatel@766: * Returns an HtmlTree for the TITLE tag. bpatel@766: * bpatel@766: * @return an HtmlTree for the TITLE tag bpatel@766: */ bpatel@766: public HtmlTree getTitle() { bpatel@766: HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle)); bpatel@766: return title; bpatel@766: } duke@1: duke@1: /** duke@1: * Print </TITLE> tag. Add a newline character at the end. duke@1: */ duke@1: public void titleEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <UL> tag. Add a newline character at the end. duke@1: */ duke@1: public void ul() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <LI> tag. duke@1: */ duke@1: public void li() { duke@1: print("
  • "); duke@1: } duke@1: duke@1: /** duke@1: * Print <LI TYPE="type"> tag. duke@1: * duke@1: * @param type Type string. duke@1: */ duke@1: public void li(String type) { duke@1: print("
  • "); duke@1: } duke@1: duke@1: /** duke@1: * Print <H1> tag. Add a newline character at the end. duke@1: */ duke@1: public void h1() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </H1> tag. Add a newline character at the end. duke@1: */ duke@1: public void h1End() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print text with <H1> tag. Also adds </H1> tag. Add a newline character duke@1: * at the end of the text. duke@1: * duke@1: * @param text Text to be printed with <H1> format. duke@1: */ duke@1: public void h1(String text) { duke@1: h1(); duke@1: println(text); duke@1: h1End(); duke@1: } duke@1: duke@1: /** duke@1: * Print <H2> tag. Add a newline character at the end. duke@1: */ duke@1: public void h2() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print text with <H2> tag. Also adds </H2> tag. Add a newline character duke@1: * at the end of the text. duke@1: * duke@1: * @param text Text to be printed with <H2> format. duke@1: */ duke@1: public void h2(String text) { duke@1: h2(); duke@1: println(text); duke@1: h2End(); duke@1: } duke@1: duke@1: /** duke@1: * Print </H2> tag. Add a newline character at the end. duke@1: */ duke@1: public void h2End() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <H3> tag. Add a newline character at the end. duke@1: */ duke@1: public void h3() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print text with <H3> tag. Also adds </H3> tag. Add a newline character duke@1: * at the end of the text. duke@1: * duke@1: * @param text Text to be printed with <H3> format. duke@1: */ duke@1: public void h3(String text) { duke@1: h3(); duke@1: println(text); duke@1: h3End(); duke@1: } duke@1: duke@1: /** duke@1: * Print </H3> tag. Add a newline character at the end. duke@1: */ duke@1: public void h3End() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <H4> tag. Add a newline character at the end. duke@1: */ duke@1: public void h4() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </H4> tag. Add a newline character at the end. duke@1: */ duke@1: public void h4End() { duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print text with <H4> tag. Also adds </H4> tag. Add a newline character duke@1: * at the end of the text. duke@1: * duke@1: * @param text Text to be printed with <H4> format. duke@1: */ duke@1: public void h4(String text) { duke@1: h4(); duke@1: println(text); duke@1: h4End(); duke@1: } duke@1: duke@1: /** duke@1: * Print <H5> tag. Add a newline character at the end. duke@1: */ duke@1: public void h5() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </H5> tag. Add a newline character at the end. duke@1: */ duke@1: public void h5End() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print HTML <IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname> duke@1: * tag. It prepends the "images" directory name to the "imggif". This duke@1: * method is used for oneone format generation. Add a newline character duke@1: * at the end. duke@1: * duke@1: * @param imggif Image GIF file. duke@1: * @param imgname Image name. duke@1: * @param width Width of the image. duke@1: * @param height Height of the image. duke@1: */ duke@1: public void img(String imggif, String imgname, int width, int height) { duke@1: println("\"""); duke@1: } duke@1: duke@1: /** duke@1: * Print <MENU> tag. Add a newline character at the end. duke@1: */ duke@1: public void menu() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </MENU> tag. Add a newline character at the end. duke@1: */ duke@1: public void menuEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <PRE> tag. Add a newline character at the end. duke@1: */ duke@1: public void pre() { duke@1: println("
    ");
    duke@1:     }
    duke@1: 
    duke@1:     /**
    duke@1:      * Print <PRE> tag without adding new line character at th eend.
    duke@1:      */
    duke@1:     public void preNoNewLine() {
    duke@1:         print("
    ");
    duke@1:     }
    duke@1: 
    duke@1:     /**
    duke@1:      * Print </PRE> tag. Add a newline character at the end.
    duke@1:      */
    duke@1:     public void preEnd() {
    duke@1:         println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <HR> tag. Add a newline character at the end. duke@1: */ duke@1: public void hr() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <HR SIZE="size" WIDTH="widthpercent%"> tag. Add a newline duke@1: * character at the end. duke@1: * duke@1: * @param size Size of the ruler. duke@1: * @param widthPercent Percentage Width of the ruler duke@1: */ duke@1: public void hr(int size, int widthPercent) { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <HR SIZE="size" NOSHADE> tag. Add a newline character at the end. duke@1: * duke@1: * @param size Size of the ruler. duke@1: * @param noshade noshade string. duke@1: */ duke@1: public void hr(int size, String noshade) { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** bpatel@182: * Get the "<STRONG>" string. duke@1: * bpatel@182: * @return String Return String "<STRONG>"; duke@1: */ bpatel@182: public String getStrong() { bpatel@182: return ""; duke@1: } duke@1: duke@1: /** bpatel@182: * Get the "</STRONG>" string. duke@1: * bpatel@182: * @return String Return String "</STRONG>"; duke@1: */ bpatel@182: public String getStrongEnd() { bpatel@182: return ""; duke@1: } duke@1: duke@1: /** bpatel@182: * Print <STRONG> tag. duke@1: */ bpatel@182: public void strong() { bpatel@182: print(""); duke@1: } duke@1: duke@1: /** bpatel@182: * Print </STRONG> tag. duke@1: */ bpatel@182: public void strongEnd() { bpatel@182: print(""); duke@1: } duke@1: duke@1: /** bpatel@182: * Print text passed, in strong format using <STRONG> and </STRONG> tags. duke@1: * bpatel@182: * @param text String to be printed in between <STRONG> and </STRONG> tags. duke@1: */ bpatel@182: public void strong(String text) { bpatel@182: strong(); duke@1: print(text); bpatel@182: strongEnd(); duke@1: } duke@1: duke@1: /** duke@1: * Print text passed, in Italics using <I> and </I> tags. duke@1: * duke@1: * @param text String to be printed in between <I> and </I> tags. duke@1: */ duke@1: public void italics(String text) { duke@1: print(""); duke@1: print(text); duke@1: println(""); duke@1: } duke@1: duke@1: /** bpatel@766: * Return, text passed, with Italics <i> and </i> tags, surrounding it. bpatel@766: * So if the text passed is "Hi", then string returned will be "<i>Hi</i>". duke@1: * duke@1: * @param text String to be printed in between <I> and </I> tags. duke@1: */ duke@1: public String italicsText(String text) { bpatel@766: return "" + text + ""; duke@1: } duke@1: duke@1: public String codeText(String text) { bpatel@766: return "" + text + ""; duke@1: } duke@1: duke@1: /** duke@1: * Print "&nbsp;", non-breaking space. duke@1: */ duke@1: public void space() { duke@1: print(" "); duke@1: } duke@1: duke@1: /** bpatel@766: * Return "&nbsp;", non-breaking space. bpatel@766: */ bpatel@766: public Content getSpace() { bpatel@766: return RawHtml.nbsp; bpatel@766: } bpatel@766: bpatel@766: /** duke@1: * Print <DL> tag. Add a newline character at the end. duke@1: */ duke@1: public void dl() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </DL> tag. Add a newline character at the end. duke@1: */ duke@1: public void dlEnd() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <DT> tag. duke@1: */ duke@1: public void dt() { duke@1: print("
    "); duke@1: } duke@1: duke@1: /** bpatel@233: * Print </DT> tag. bpatel@233: */ bpatel@233: public void dtEnd() { bpatel@233: print("
    "); bpatel@233: } bpatel@233: bpatel@233: /** bpatel@233: * Print <DD> tag. duke@1: */ duke@1: public void dd() { duke@1: print("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </DD> tag. Add a newline character at the end. duke@1: */ duke@1: public void ddEnd() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <SUP> tag. Add a newline character at the end. duke@1: */ duke@1: public void sup() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </SUP> tag. Add a newline character at the end. duke@1: */ duke@1: public void supEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <FONT SIZE="size"> tag. Add a newline character at the end. duke@1: * duke@1: * @param size String size. duke@1: */ duke@1: public void font(String size) { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <FONT SIZE="size"> tag. duke@1: * duke@1: * @param size String size. duke@1: */ duke@1: public void fontNoNewLine(String size) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <FONT CLASS="stylename"> tag. Add a newline character at the end. duke@1: * duke@1: * @param stylename String stylename. duke@1: */ duke@1: public void fontStyle(String stylename) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <FONT SIZE="size" CLASS="stylename"> tag. Add a newline character duke@1: * at the end. duke@1: * duke@1: * @param size String size. duke@1: * @param stylename String stylename. duke@1: */ duke@1: public void fontSizeStyle(String size, String stylename) { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </FONT> tag. duke@1: */ duke@1: public void fontEnd() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Get the "<FONT COLOR="color">" string. duke@1: * duke@1: * @param color String color. duke@1: * @return String Return String "<FONT COLOR="color">". duke@1: */ duke@1: public String getFontColor(String color) { duke@1: return ""; duke@1: } duke@1: duke@1: /** duke@1: * Get the "</FONT>" string. duke@1: * duke@1: * @return String Return String "</FONT>"; duke@1: */ duke@1: public String getFontEnd() { duke@1: return ""; duke@1: } duke@1: duke@1: /** duke@1: * Print <CENTER> tag. Add a newline character at the end. duke@1: */ duke@1: public void center() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </CENTER> tag. Add a newline character at the end. duke@1: */ duke@1: public void centerEnd() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print anchor <A NAME="name"> tag. duke@1: * duke@1: * @param name Name String. duke@1: */ duke@1: public void aName(String name) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </A> tag. duke@1: */ duke@1: public void aEnd() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <I> tag. duke@1: */ duke@1: public void italic() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </I> tag. duke@1: */ duke@1: public void italicEnd() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print contents within anchor <A NAME="name"> tags. duke@1: * duke@1: * @param name String name. duke@1: * @param content String contents. duke@1: */ duke@1: public void anchor(String name, String content) { duke@1: aName(name); duke@1: print(content); duke@1: aEnd(); duke@1: } duke@1: duke@1: /** duke@1: * Print anchor <A NAME="name"> and </A>tags. Print comment string duke@1: * "<!-- -->" within those tags. duke@1: * duke@1: * @param name String name. duke@1: */ duke@1: public void anchor(String name) { duke@1: anchor(name, ""); duke@1: } duke@1: duke@1: /** duke@1: * Print newline and then print <P> tag. Add a newline character at the duke@1: * end. duke@1: */ duke@1: public void p() { duke@1: println(); duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print newline and then print </P> tag. Add a newline character at the duke@1: * end. duke@1: */ duke@1: public void pEnd() { duke@1: println(); duke@1: println("

    "); duke@1: } duke@1: duke@1: /** duke@1: * Print newline and then print <BR> tag. Add a newline character at the duke@1: * end. duke@1: */ duke@1: public void br() { duke@1: println(); duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <ADDRESS> tag. Add a newline character at the end. duke@1: */ duke@1: public void address() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </ADDRESS> tag. Add a newline character at the end. duke@1: */ duke@1: public void addressEnd() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <HEAD> tag. Add a newline character at the end. duke@1: */ duke@1: public void head() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </HEAD> tag. Add a newline character at the end. duke@1: */ duke@1: public void headEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <CODE> tag. duke@1: */ duke@1: public void code() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </CODE> tag. duke@1: */ duke@1: public void codeEnd() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <EM> tag. Add a newline character at the end. duke@1: */ duke@1: public void em() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </EM> tag. Add a newline character at the end. duke@1: */ duke@1: public void emEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print HTML <TABLE BORDER="border" WIDTH="width" duke@1: * CELLPADDING="cellpadding" CELLSPACING="cellspacing"> tag. duke@1: * duke@1: * @param border Border size. duke@1: * @param width Width of the table. duke@1: * @param cellpadding Cellpadding for the table cells. duke@1: * @param cellspacing Cellspacing for the table cells. duke@1: */ duke@1: public void table(int border, String width, int cellpadding, duke@1: int cellspacing) { duke@1: println(DocletConstants.NL + duke@1: ""); duke@1: } duke@1: duke@1: /** bpatel@243: * Print HTML <TABLE BORDER="border" WIDTH="width" bpatel@243: * CELLPADDING="cellpadding" CELLSPACING="cellspacing" SUMMARY="summary"> tag. bpatel@243: * bpatel@243: * @param border Border size. bpatel@243: * @param width Width of the table. bpatel@243: * @param cellpadding Cellpadding for the table cells. bpatel@243: * @param cellspacing Cellspacing for the table cells. bpatel@243: * @param summary Table summary. bpatel@243: */ bpatel@243: public void table(int border, String width, int cellpadding, bpatel@243: int cellspacing, String summary) { bpatel@243: println(DocletConstants.NL + bpatel@243: "
    "); bpatel@243: } bpatel@243: bpatel@243: /** duke@1: * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding" duke@1: * CELLSPACING="cellspacing"> tag. duke@1: * duke@1: * @param border Border size. duke@1: * @param cellpadding Cellpadding for the table cells. duke@1: * @param cellspacing Cellspacing for the table cells. duke@1: */ duke@1: public void table(int border, int cellpadding, int cellspacing) { duke@1: println(DocletConstants.NL + duke@1: "
    "); duke@1: } duke@1: duke@1: /** bpatel@243: * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding" bpatel@243: * CELLSPACING="cellspacing" SUMMARY="summary"> tag. bpatel@243: * bpatel@243: * @param border Border size. bpatel@243: * @param cellpadding Cellpadding for the table cells. bpatel@243: * @param cellspacing Cellspacing for the table cells. bpatel@243: * @param summary Table summary. bpatel@243: */ bpatel@243: public void table(int border, int cellpadding, int cellspacing, String summary) { bpatel@243: println(DocletConstants.NL + bpatel@243: "
    "); bpatel@243: } bpatel@243: bpatel@243: /** duke@1: * Print HTML <TABLE BORDER="border" WIDTH="width"> duke@1: * duke@1: * @param border Border size. duke@1: * @param width Width of the table. duke@1: */ duke@1: public void table(int border, String width) { duke@1: println(DocletConstants.NL + duke@1: "
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print the HTML table tag with border size 0 and width 100%. duke@1: */ duke@1: public void table() { duke@1: table(0, "100%"); duke@1: } duke@1: duke@1: /** duke@1: * Print </TABLE> tag. Add a newline character at the end. duke@1: */ duke@1: public void tableEnd() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print <TR> tag. Add a newline character at the end. duke@1: */ duke@1: public void tr() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </TR> tag. Add a newline character at the end. duke@1: */ duke@1: public void trEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD> tag. duke@1: */ duke@1: public void td() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD NOWRAP> tag. duke@1: */ duke@1: public void tdNowrap() { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD WIDTH="width"> tag. duke@1: * duke@1: * @param width String width. duke@1: */ duke@1: public void tdWidth(String width) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </TD> tag. Add a newline character at the end. duke@1: */ duke@1: public void tdEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <LINK str> tag. duke@1: * duke@1: * @param str String. duke@1: */ duke@1: public void link(String str) { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print "<!-- " comment start string. duke@1: */ duke@1: public void commentStart() { duke@1: print(""); duke@1: } duke@1: duke@1: /** bpatel@243: * Print <CAPTION CLASS="stylename"> tag. Adds a newline character bpatel@243: * at the end. bpatel@243: * bpatel@243: * @param stylename style to be applied. bpatel@243: */ bpatel@243: public void captionStyle(String stylename) { bpatel@243: println(""); bpatel@243: } bpatel@243: bpatel@243: /** bpatel@243: * Print </CAPTION> tag. Add a newline character at the end. bpatel@243: */ bpatel@243: public void captionEnd() { bpatel@243: println(""); bpatel@243: } bpatel@243: bpatel@243: /** duke@1: * Print <TR BGCOLOR="color" CLASS="stylename"> tag. Adds a newline character duke@1: * at the end. duke@1: * duke@1: * @param color String color. duke@1: * @param stylename String stylename. duke@1: */ duke@1: public void trBgcolorStyle(String color, String stylename) { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TR BGCOLOR="color"> tag. Adds a newline character at the end. duke@1: * duke@1: * @param color String color. duke@1: */ duke@1: public void trBgcolor(String color) { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TR ALIGN="align" VALIGN="valign"> tag. Adds a newline character duke@1: * at the end. duke@1: * duke@1: * @param align String align. duke@1: * @param valign String valign. duke@1: */ duke@1: public void trAlignVAlign(String align, String valign) { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TH ALIGN="align"> tag. duke@1: * duke@1: * @param align the align attribute. duke@1: */ duke@1: public void thAlign(String align) { duke@1: print(""); duke@1: } duke@1: duke@1: /** bpatel@243: * Print <TH CLASS="stylename" SCOPE="scope" NOWRAP> tag. bpatel@243: * bpatel@243: * @param stylename style to be applied. bpatel@243: * @param scope the scope attribute. bpatel@243: */ bpatel@243: public void thScopeNoWrap(String stylename, String scope) { bpatel@243: print(""); bpatel@243: } bpatel@243: bpatel@243: /* bpatel@243: * Returns a header for Modifier and Type column of a table. bpatel@243: */ bpatel@243: public String getModifierTypeHeader() { bpatel@243: return modifierTypeHeader; bpatel@243: } bpatel@243: bpatel@243: /** duke@1: * Print <TH align="align" COLSPAN=i> tag. duke@1: * duke@1: * @param align the align attribute. duke@1: * @param i integer. duke@1: */ duke@1: public void thAlignColspan(String align, int i) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TH align="align" NOWRAP> tag. duke@1: * duke@1: * @param align the align attribute. duke@1: */ duke@1: public void thAlignNowrap(String align) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print </TH> tag. Add a newline character at the end. duke@1: */ duke@1: public void thEnd() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD COLSPAN=i> tag. duke@1: * duke@1: * @param i integer. duke@1: */ duke@1: public void tdColspan(int i) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD BGCOLOR="color" CLASS="stylename"> tag. duke@1: * duke@1: * @param color String color. duke@1: * @param stylename String stylename. duke@1: */ duke@1: public void tdBgcolorStyle(String color, String stylename) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD COLSPAN=i BGCOLOR="color" CLASS="stylename"> tag. duke@1: * duke@1: * @param i integer. duke@1: * @param color String color. duke@1: * @param stylename String stylename. duke@1: */ duke@1: public void tdColspanBgcolorStyle(int i, String color, String stylename) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD ALIGN="align"> tag. Adds a newline character duke@1: * at the end. duke@1: * duke@1: * @param align String align. duke@1: */ duke@1: public void tdAlign(String align) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD ALIGN="align" CLASS="stylename"> tag. duke@1: * duke@1: * @param align String align. duke@1: * @param stylename String stylename. duke@1: */ duke@1: public void tdVAlignClass(String align, String stylename) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD VALIGN="valign"> tag. duke@1: * duke@1: * @param valign String valign. duke@1: */ duke@1: public void tdVAlign(String valign) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD ALIGN="align" VALIGN="valign"> tag. duke@1: * duke@1: * @param align String align. duke@1: * @param valign String valign. duke@1: */ duke@1: public void tdAlignVAlign(String align, String valign) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD ALIGN="align" ROWSPAN=rowspan> tag. duke@1: * duke@1: * @param align String align. duke@1: * @param rowspan integer rowspan. duke@1: */ duke@1: public void tdAlignRowspan(String align, int rowspan) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan> tag. duke@1: * duke@1: * @param align String align. duke@1: * @param valign String valign. duke@1: * @param rowspan integer rowspan. duke@1: */ duke@1: public void tdAlignVAlignRowspan(String align, String valign, duke@1: int rowspan) { duke@1: print(""); duke@1: } duke@1: duke@1: /** duke@1: * Print <BLOCKQUOTE> tag. Add a newline character at the end. duke@1: */ duke@1: public void blockquote() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** duke@1: * Print </BLOCKQUOTE> tag. Add a newline character at the end. duke@1: */ duke@1: public void blockquoteEnd() { duke@1: println("
    "); duke@1: } duke@1: duke@1: /** bpatel@766: * Get the "<code>" string. duke@1: * bpatel@766: * @return String Return String "<code>"; duke@1: */ duke@1: public String getCode() { bpatel@766: return ""; duke@1: } duke@1: duke@1: /** bpatel@766: * Get the "</code>" string. duke@1: * bpatel@766: * @return String Return String "</code>"; duke@1: */ duke@1: public String getCodeEnd() { bpatel@766: return ""; duke@1: } duke@1: duke@1: /** duke@1: * Print <NOFRAMES> tag. Add a newline character at the end. duke@1: */ duke@1: public void noFrames() { duke@1: println(""); duke@1: } duke@1: duke@1: /** duke@1: * Print &lt;/NOFRAMES&gt; tag. Add a newline character at the end. duke@1: */ duke@1: public void noFramesEnd() { duke@1: println(""); duke@1: } duke@1: }