src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java

Mon, 09 Mar 2009 13:29:06 -0700

author
xdono
date
Mon, 09 Mar 2009 13:29:06 -0700
changeset 229
03bcd66bd8e7
parent 191
d79ad96ce47c
child 240
8c55d5b0ed71
permissions
-rw-r--r--

6814575: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 03/09
Reviewed-by: katleman, tbell, ohair

     1 /*
     2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Sun designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Sun in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
    23  * have any questions.
    24  */
    26 package com.sun.tools.doclets.formats.html.markup;
    28 import com.sun.tools.doclets.internal.toolkit.*;
    29 import com.sun.tools.doclets.internal.toolkit.util.*;
    30 import java.io.*;
    32 /**
    33  * Class for the Html format code generation.
    34  * Initilizes PrintWriter with FileWriter, to enable print
    35  * related methods to generate the code to the named File through FileWriter.
    36  *
    37  * @since 1.2
    38  * @author Atul M Dambalkar
    39  */
    40 public class HtmlWriter extends PrintWriter {
    42     /**
    43      * Name of the file, to which this writer is writing to.
    44      */
    45     protected final String htmlFilename;
    47     /**
    48      * The window title of this file
    49      */
    50     protected String winTitle;
    52     /**
    53      * URL file separator string("/").
    54      */
    55     public static final String fileseparator =
    56          DirectoryManager.URL_FILE_SEPERATOR;
    58     /**
    59      * The configuration
    60      */
    61     protected Configuration configuration;
    63     /**
    64      * Constructor.
    65      *
    66      * @param path The directory path to be created for this file
    67      *             or null if none to be created.
    68      * @param filename File Name to which the PrintWriter will
    69      *                 do the Output.
    70      * @param docencoding Encoding to be used for this file.
    71      * @exception IOException Exception raised by the FileWriter is passed on
    72      * to next level.
    73      * @exception UnSupportedEncodingException Exception raised by the
    74      * OutputStreamWriter is passed on to next level.
    75      */
    76     public HtmlWriter(Configuration configuration,
    77                       String path, String filename, String docencoding)
    78                       throws IOException, UnsupportedEncodingException {
    79         super(Util.genWriter(configuration, path, filename, docencoding));
    80         this.configuration = configuration;
    81         htmlFilename = filename;
    82     }
    84     /**
    85      * Print <HTML> tag. Add a newline character at the end.
    86      */
    87     public void html() {
    88         println("<HTML lang=\"" + configuration.getLocale().getLanguage() + "\">");
    89     }
    91     /**
    92      * Print &lt;/HTML&gt; tag. Add a newline character at the end.
    93      */
    94     public void htmlEnd() {
    95         println("</HTML>");
    96     }
    98     /**
    99      * Print the script code to be embeded before the  &lt;/HEAD&gt; tag.
   100      */
   101     protected void printWinTitleScript(String winTitle){
   102         if(winTitle != null && winTitle.length() > 0) {
   103             script();
   104             println("function windowTitle()");
   105             println("{");
   106             println("    if (location.href.indexOf('is-external=true') == -1) {");
   107             println("        parent.document.title=\"" + winTitle + "\";");
   108             println("    }");
   109             println("}");
   110             scriptEnd();
   111             noScript();
   112             noScriptEnd();
   113         }
   114     }
   116     /**
   117      * Print the Javascript &lt;SCRIPT&gt; start tag with its type
   118      * attribute.
   119      */
   120     public void script() {
   121         println("<SCRIPT type=\"text/javascript\">");
   122     }
   124     /**
   125      * Print the Javascript &lt;/SCRIPT&gt; end tag.
   126      */
   127     public void scriptEnd() {
   128         println("</SCRIPT>");
   129     }
   131     /**
   132      * Print the Javascript &lt;NOSCRIPT&gt; start tag.
   133      */
   134     public void noScript() {
   135         println("<NOSCRIPT>");
   136     }
   138     /**
   139      * Print the Javascript &lt;/NOSCRIPT&gt; end tag.
   140      */
   141     public void noScriptEnd() {
   142         println("</NOSCRIPT>");
   143     }
   145     /**
   146      * Return the Javascript call to be embedded in the &lt;BODY&gt; tag.
   147      * Return nothing if winTitle is empty.
   148      * @return the Javascript call to be embedded in the &lt;BODY&gt; tag.
   149      */
   150     protected String getWindowTitleOnload(){
   151         if(winTitle != null && winTitle.length() > 0) {
   152             return " onload=\"windowTitle();\"";
   153         } else {
   154             return "";
   155         }
   156     }
   158     /**
   159      * Print &lt;BODY BGCOLOR="bgcolor"&gt;, including JavaScript
   160      * "onload" call to load windowtitle script.  This script shows the name
   161      * of the document in the window title bar when frames are on.
   162      *
   163      * @param bgcolor Background color.
   164      * @param includeScript  boolean set true if printing windowtitle script
   165      */
   166     public void body(String bgcolor, boolean includeScript) {
   167         print("<BODY BGCOLOR=\"" + bgcolor + "\"");
   168         if (includeScript) {
   169             print(getWindowTitleOnload());
   170         }
   171         println(">");
   172     }
   174     /**
   175      * Print &lt;/BODY&gt; tag. Add a newline character at the end.
   176      */
   177     public void bodyEnd() {
   178         println("</BODY>");
   179     }
   181     /**
   182      * Print &lt;TITLE&gt; tag. Add a newline character at the end.
   183      */
   184     public void title() {
   185         println("<TITLE>");
   186     }
   188     /**
   189      * Print &lt;TITLE&gt; tag. Add a newline character at the end.
   190      *
   191      * @param winTitle The title of this document.
   192      */
   193     public void title(String winTitle) {
   194         // Set window title string which is later printed
   195         this.winTitle = winTitle;
   196         title();
   197     }
   200     /**
   201      * Print &lt;/TITLE&gt; tag. Add a newline character at the end.
   202      */
   203     public void titleEnd() {
   204         println("</TITLE>");
   205     }
   207     /**
   208      * Print &lt;UL&gt; tag. Add a newline character at the end.
   209      */
   210     public void ul() {
   211         println("<UL>");
   212     }
   214     /**
   215      * Print &lt;/UL&gt; tag. Add a newline character at the end.
   216      */
   217     public void ulEnd() {
   218         println("</UL>");
   219     }
   221     /**
   222      * Print &lt;LI&gt; tag.
   223      */
   224     public void li() {
   225         print("<LI>");
   226     }
   228     /**
   229      * Print &lt;LI TYPE="type"&gt; tag.
   230      *
   231      * @param type Type string.
   232      */
   233     public void li(String type) {
   234         print("<LI TYPE=\"" + type + "\">");
   235     }
   237     /**
   238      * Print &lt;H1&gt; tag. Add a newline character at the end.
   239      */
   240     public void h1() {
   241         println("<H1>");
   242     }
   244     /**
   245      * Print &lt;/H1&gt; tag. Add a newline character at the end.
   246      */
   247     public void h1End() {
   248         println("</H1>");
   249     }
   251     /**
   252      * Print text with &lt;H1&gt; tag. Also adds &lt;/H1&gt; tag. Add a newline character
   253      * at the end of the text.
   254      *
   255      * @param text Text to be printed with &lt;H1&gt; format.
   256      */
   257     public void h1(String text) {
   258         h1();
   259         println(text);
   260         h1End();
   261     }
   263     /**
   264      * Print &lt;H2&gt; tag. Add a newline character at the end.
   265      */
   266     public void h2() {
   267         println("<H2>");
   268     }
   270     /**
   271      * Print text with &lt;H2&gt; tag. Also adds &lt;/H2&gt; tag. Add a newline character
   272      *  at the end of the text.
   273      *
   274      * @param text Text to be printed with &lt;H2&gt; format.
   275      */
   276     public void h2(String text) {
   277         h2();
   278         println(text);
   279         h2End();
   280     }
   282     /**
   283      * Print &lt;/H2&gt; tag. Add a newline character at the end.
   284      */
   285     public void h2End() {
   286         println("</H2>");
   287     }
   289     /**
   290      * Print &lt;H3&gt; tag. Add a newline character at the end.
   291      */
   292     public void h3() {
   293         println("<H3>");
   294     }
   296     /**
   297      * Print text with &lt;H3&gt; tag. Also adds &lt;/H3&gt; tag. Add a newline character
   298      *  at the end of the text.
   299      *
   300      * @param text Text to be printed with &lt;H3&gt; format.
   301      */
   302     public void h3(String text) {
   303         h3();
   304         println(text);
   305         h3End();
   306     }
   308     /**
   309      * Print &lt;/H3&gt; tag. Add a newline character at the end.
   310      */
   311     public void h3End() {
   312         println("</H3>");
   313     }
   315     /**
   316      * Print &lt;H4&gt; tag. Add a newline character at the end.
   317      */
   318     public void h4() {
   319         println("<H4>");
   320     }
   322     /**
   323      * Print &lt;/H4&gt; tag. Add a newline character at the end.
   324      */
   325     public void h4End() {
   326         println("</H4>");
   327     }
   329     /**
   330      * Print text with &lt;H4&gt; tag. Also adds &lt;/H4&gt; tag. Add a newline character
   331      * at the end of the text.
   332      *
   333      * @param text Text to be printed with &lt;H4&gt; format.
   334      */
   335     public void h4(String text) {
   336         h4();
   337         println(text);
   338         h4End();
   339     }
   341     /**
   342      * Print &lt;H5&gt; tag. Add a newline character at the end.
   343      */
   344     public void h5() {
   345         println("<H5>");
   346     }
   348     /**
   349      * Print &lt;/H5&gt; tag. Add a newline character at the end.
   350      */
   351     public void h5End() {
   352         println("</H5>");
   353     }
   355     /**
   356      * Print HTML &lt;IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname&gt;
   357      * tag. It prepends the "images" directory name to the "imggif". This
   358      * method is used for oneone format generation. Add a newline character
   359      * at the end.
   360      *
   361      * @param imggif   Image GIF file.
   362      * @param imgname  Image name.
   363      * @param width    Width of the image.
   364      * @param height   Height of the image.
   365      */
   366     public void img(String imggif, String imgname, int width, int height) {
   367         println("<IMG SRC=\"images/" + imggif + ".gif\""
   368               + " WIDTH=\"" + width + "\" HEIGHT=\"" + height
   369               + "\" ALT=\"" + imgname + "\">");
   370     }
   372     /**
   373      * Print &lt;MENU&gt; tag. Add a newline character at the end.
   374      */
   375     public void menu() {
   376         println("<MENU>");
   377     }
   379     /**
   380      * Print &lt;/MENU&gt; tag. Add a newline character at the end.
   381      */
   382     public void menuEnd() {
   383         println("</MENU>");
   384     }
   386     /**
   387      * Print &lt;PRE&gt; tag. Add a newline character at the end.
   388      */
   389     public void pre() {
   390         println("<PRE>");
   391     }
   393     /**
   394      * Print &lt;PRE&gt; tag without adding new line character at th eend.
   395      */
   396     public void preNoNewLine() {
   397         print("<PRE>");
   398     }
   400     /**
   401      * Print &lt;/PRE&gt; tag. Add a newline character at the end.
   402      */
   403     public void preEnd() {
   404         println("</PRE>");
   405     }
   407     /**
   408      * Print &lt;HR&gt; tag. Add a newline character at the end.
   409      */
   410     public void hr() {
   411         println("<HR>");
   412     }
   414     /**
   415      * Print &lt;HR SIZE="size" WIDTH="widthpercent%"&gt; tag. Add a newline
   416      * character at the end.
   417      *
   418      * @param size           Size of the ruler.
   419      * @param widthPercent   Percentage Width of the ruler
   420      */
   421     public void hr(int size, int widthPercent) {
   422         println("<HR SIZE=\"" + size + "\" WIDTH=\"" + widthPercent + "%\">");
   423     }
   425     /**
   426      * Print &lt;HR SIZE="size" NOSHADE&gt; tag. Add a newline character at the end.
   427      *
   428      * @param size           Size of the ruler.
   429      * @param noshade        noshade string.
   430      */
   431     public void hr(int size, String noshade) {
   432         println("<HR SIZE=\"" + size + "\" NOSHADE>");
   433     }
   435     /**
   436      * Get the "&lt;STRONG&gt;" string.
   437      *
   438      * @return String Return String "&lt;STRONG&gt;";
   439      */
   440     public String getStrong() {
   441         return "<STRONG>";
   442     }
   444     /**
   445      * Get the "&lt;/STRONG&gt;" string.
   446      *
   447      * @return String Return String "&lt;/STRONG&gt;";
   448      */
   449     public String getStrongEnd() {
   450         return "</STRONG>";
   451     }
   453     /**
   454      * Print &lt;STRONG&gt; tag.
   455      */
   456     public void strong() {
   457         print("<STRONG>");
   458     }
   460     /**
   461      * Print &lt;/STRONG&gt; tag.
   462      */
   463     public void strongEnd() {
   464         print("</STRONG>");
   465     }
   467     /**
   468      * Print text passed, in strong format using &lt;STRONG&gt; and &lt;/STRONG&gt; tags.
   469      *
   470      * @param text String to be printed in between &lt;STRONG&gt; and &lt;/STRONG&gt; tags.
   471      */
   472     public void strong(String text) {
   473         strong();
   474         print(text);
   475         strongEnd();
   476     }
   478     /**
   479      * Print text passed, in Italics using &lt;I&gt; and &lt;/I&gt; tags.
   480      *
   481      * @param text String to be printed in between &lt;I&gt; and &lt;/I&gt; tags.
   482      */
   483     public void italics(String text) {
   484         print("<I>");
   485         print(text);
   486         println("</I>");
   487     }
   489     /**
   490      * Return, text passed, with Italics &lt;I&gt; and &lt;/I&gt; tags, surrounding it.
   491      * So if the text passed is "Hi", then string returned will be "&lt;I&gt;Hi&lt;/I&gt;".
   492      *
   493      * @param text String to be printed in between &lt;I&gt; and &lt;/I&gt; tags.
   494      */
   495     public String italicsText(String text) {
   496         return "<I>" + text + "</I>";
   497     }
   499     public String codeText(String text) {
   500         return "<CODE>" + text + "</CODE>";
   501     }
   503     /**
   504      * Print "&#38;nbsp;", non-breaking space.
   505      */
   506     public void space() {
   507         print("&nbsp;");
   508     }
   510     /**
   511      * Print &lt;DL&gt; tag. Add a newline character at the end.
   512      */
   513     public void dl() {
   514         println("<DL>");
   515     }
   517     /**
   518      * Print &lt;/DL&gt; tag. Add a newline character at the end.
   519      */
   520     public void dlEnd() {
   521         println("</DL>");
   522     }
   524     /**
   525      * Print &lt;DT&gt; tag.
   526      */
   527     public void dt() {
   528         print("<DT>");
   529     }
   531     /**
   532      * Print &lt;DT&gt; tag.
   533      */
   534     public void dd() {
   535         print("<DD>");
   536     }
   538     /**
   539      * Print &lt;/DD&gt; tag. Add a newline character at the end.
   540      */
   541     public void ddEnd() {
   542         println("</DD>");
   543     }
   545     /**
   546      * Print &lt;SUP&gt; tag. Add a newline character at the end.
   547      */
   548     public void sup() {
   549         println("<SUP>");
   550     }
   552     /**
   553      * Print &lt;/SUP&gt; tag. Add a newline character at the end.
   554      */
   555     public void supEnd() {
   556         println("</SUP>");
   557     }
   559     /**
   560      * Print &lt;FONT SIZE="size"&gt; tag. Add a newline character at the end.
   561      *
   562      * @param size String size.
   563      */
   564     public void font(String size) {
   565         println("<FONT SIZE=\"" + size + "\">");
   566     }
   568     /**
   569      * Print &lt;FONT SIZE="size"&gt; tag.
   570      *
   571      * @param size String size.
   572      */
   573     public void fontNoNewLine(String size) {
   574         print("<FONT SIZE=\"" + size + "\">");
   575     }
   577     /**
   578      * Print &lt;FONT CLASS="stylename"&gt; tag. Add a newline character at the end.
   579      *
   580      * @param stylename String stylename.
   581      */
   582     public void fontStyle(String stylename) {
   583         print("<FONT CLASS=\"" + stylename + "\">");
   584     }
   586     /**
   587      * Print &lt;FONT SIZE="size" CLASS="stylename"&gt; tag. Add a newline character
   588      * at the end.
   589      *
   590      * @param size String size.
   591      * @param stylename String stylename.
   592      */
   593     public void fontSizeStyle(String size, String stylename) {
   594         println("<FONT size=\"" + size + "\" CLASS=\"" + stylename + "\">");
   595     }
   597     /**
   598      * Print &lt;/FONT&gt; tag.
   599      */
   600     public void fontEnd() {
   601         print("</FONT>");
   602     }
   604     /**
   605      * Get the "&lt;FONT COLOR="color"&gt;" string.
   606      *
   607      * @param color String color.
   608      * @return String Return String "&lt;FONT COLOR="color"&gt;".
   609      */
   610     public String getFontColor(String color) {
   611         return "<FONT COLOR=\"" + color + "\">";
   612     }
   614     /**
   615      * Get the "&lt;/FONT&gt;" string.
   616      *
   617      * @return String Return String "&lt;/FONT&gt;";
   618      */
   619     public String getFontEnd() {
   620         return "</FONT>";
   621     }
   623     /**
   624      * Print &lt;CENTER&gt; tag. Add a newline character at the end.
   625      */
   626     public void center() {
   627         println("<CENTER>");
   628     }
   630     /**
   631      * Print &lt;/CENTER&gt; tag. Add a newline character at the end.
   632      */
   633     public void centerEnd() {
   634         println("</CENTER>");
   635     }
   637     /**
   638      * Print anchor &lt;A NAME="name"&gt; tag.
   639      *
   640      * @param name Name String.
   641      */
   642     public void aName(String name) {
   643         print("<A NAME=\"" + name + "\">");
   644     }
   646     /**
   647      * Print &lt;/A&gt; tag.
   648      */
   649     public void aEnd() {
   650         print("</A>");
   651     }
   653     /**
   654      * Print &lt;I&gt; tag.
   655      */
   656     public void italic() {
   657         print("<I>");
   658     }
   660     /**
   661      * Print &lt;/I&gt; tag.
   662      */
   663     public void italicEnd() {
   664         print("</I>");
   665     }
   667     /**
   668      * Print contents within anchor &lt;A NAME="name"&gt; tags.
   669      *
   670      * @param name String name.
   671      * @param content String contents.
   672      */
   673     public void anchor(String name, String content) {
   674         aName(name);
   675         print(content);
   676         aEnd();
   677     }
   679     /**
   680      * Print anchor &lt;A NAME="name"&gt; and &lt;/A&gt;tags. Print comment string
   681      * "&lt;!-- --&gt;" within those tags.
   682      *
   683      * @param name String name.
   684      */
   685     public void anchor(String name) {
   686         anchor(name, "<!-- -->");
   687     }
   689     /**
   690      * Print newline and then print &lt;P&gt; tag. Add a newline character at the
   691      * end.
   692      */
   693     public void p() {
   694         println();
   695         println("<P>");
   696     }
   698     /**
   699      * Print newline and then print &lt;/P&gt; tag. Add a newline character at the
   700      * end.
   701      */
   702     public void pEnd() {
   703         println();
   704         println("</P>");
   705     }
   707     /**
   708      * Print newline and then print &lt;BR&gt; tag. Add a newline character at the
   709      * end.
   710      */
   711     public void br() {
   712         println();
   713         println("<BR>");
   714     }
   716     /**
   717      * Print &lt;ADDRESS&gt; tag. Add a newline character at the end.
   718      */
   719     public void address() {
   720         println("<ADDRESS>");
   721     }
   723     /**
   724      * Print &lt;/ADDRESS&gt; tag. Add a newline character at the end.
   725      */
   726     public void addressEnd() {
   727         println("</ADDRESS>");
   728     }
   730     /**
   731      * Print &lt;HEAD&gt; tag. Add a newline character at the end.
   732      */
   733     public void head() {
   734         println("<HEAD>");
   735     }
   737     /**
   738      * Print &lt;/HEAD&gt; tag. Add a newline character at the end.
   739      */
   740     public void headEnd() {
   741         println("</HEAD>");
   742     }
   744     /**
   745      * Print &lt;CODE&gt; tag.
   746      */
   747     public void code() {
   748         print("<CODE>");
   749     }
   751     /**
   752      * Print &lt;/CODE&gt; tag.
   753      */
   754     public void codeEnd() {
   755         print("</CODE>");
   756     }
   758     /**
   759      * Print &lt;EM&gt; tag. Add a newline character at the end.
   760      */
   761     public void em() {
   762         println("<EM>");
   763     }
   765     /**
   766      * Print &lt;/EM&gt; tag. Add a newline character at the end.
   767      */
   768     public void emEnd() {
   769         println("</EM>");
   770     }
   772     /**
   773      * Print HTML &lt;TABLE BORDER="border" WIDTH="width"
   774      * CELLPADDING="cellpadding" CELLSPACING="cellspacing"&gt; tag.
   775      *
   776      * @param border       Border size.
   777      * @param width        Width of the table.
   778      * @param cellpadding  Cellpadding for the table cells.
   779      * @param cellspacing  Cellspacing for the table cells.
   780      */
   781     public void table(int border, String width, int cellpadding,
   782                       int cellspacing) {
   783         println(DocletConstants.NL +
   784                 "<TABLE BORDER=\"" + border +
   785                 "\" WIDTH=\"" + width +
   786                 "\" CELLPADDING=\"" + cellpadding +
   787                 "\" CELLSPACING=\"" + cellspacing +
   788                 "\" SUMMARY=\"\">");
   789     }
   791     /**
   792      * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
   793      * CELLSPACING="cellspacing"&gt; tag.
   794      *
   795      * @param border       Border size.
   796      * @param cellpadding  Cellpadding for the table cells.
   797      * @param cellspacing  Cellspacing for the table cells.
   798      */
   799     public void table(int border, int cellpadding, int cellspacing) {
   800         println(DocletConstants.NL +
   801                 "<TABLE BORDER=\"" + border +
   802                 "\" CELLPADDING=\"" + cellpadding +
   803                 "\" CELLSPACING=\"" + cellspacing +
   804                 "\" SUMMARY=\"\">");
   805     }
   807     /**
   808      * Print HTML &lt;TABLE BORDER="border" WIDTH="width"&gt;
   809      *
   810      * @param border       Border size.
   811      * @param width        Width of the table.
   812      */
   813     public void table(int border, String width) {
   814         println(DocletConstants.NL +
   815                 "<TABLE BORDER=\"" + border +
   816                 "\" WIDTH=\"" + width +
   817                 "\" SUMMARY=\"\">");
   818     }
   820     /**
   821      * Print the HTML table tag with border size 0 and width 100%.
   822      */
   823     public void table() {
   824         table(0, "100%");
   825     }
   827     /**
   828      * Print &lt;/TABLE&gt; tag. Add a newline character at the end.
   829      */
   830     public void tableEnd() {
   831         println("</TABLE>");
   832     }
   834     /**
   835      * Print &lt;TR&gt; tag. Add a newline character at the end.
   836      */
   837     public void tr() {
   838         println("<TR>");
   839     }
   841     /**
   842      * Print &lt;/TR&gt; tag. Add a newline character at the end.
   843      */
   844     public void trEnd() {
   845         println("</TR>");
   846     }
   848     /**
   849      * Print &lt;TD&gt; tag.
   850      */
   851     public void td() {
   852         print("<TD>");
   853     }
   855     /**
   856      * Print &lt;TD NOWRAP&gt; tag.
   857      */
   858     public void tdNowrap() {
   859         print("<TD NOWRAP>");
   860     }
   862     /**
   863      * Print &lt;TD WIDTH="width"&gt; tag.
   864      *
   865      * @param width String width.
   866      */
   867     public void tdWidth(String width) {
   868         print("<TD WIDTH=\"" + width + "\">");
   869     }
   871     /**
   872      * Print &lt;/TD&gt; tag. Add a newline character at the end.
   873      */
   874     public void tdEnd() {
   875         println("</TD>");
   876     }
   878     /**
   879      * Print &lt;LINK str&gt; tag.
   880      *
   881      * @param str String.
   882      */
   883     public void link(String str) {
   884         println("<LINK " + str + ">");
   885     }
   887     /**
   888      * Print "&lt;!-- " comment start string.
   889      */
   890     public void commentStart() {
   891          print("<!-- ");
   892     }
   894     /**
   895      * Print "--&gt;" comment end string. Add a newline character at the end.
   896      */
   897     public void commentEnd() {
   898          println("-->");
   899     }
   901     /**
   902      * Print &lt;TR BGCOLOR="color" CLASS="stylename"&gt; tag. Adds a newline character
   903      * at the end.
   904      *
   905      * @param color String color.
   906      * @param stylename String stylename.
   907      */
   908     public void trBgcolorStyle(String color, String stylename) {
   909         println("<TR BGCOLOR=\"" + color + "\" CLASS=\"" + stylename + "\">");
   910     }
   912     /**
   913      * Print &lt;TR BGCOLOR="color"&gt; tag. Adds a newline character at the end.
   914      *
   915      * @param color String color.
   916      */
   917     public void trBgcolor(String color) {
   918         println("<TR BGCOLOR=\"" + color + "\">");
   919     }
   921     /**
   922      * Print &lt;TR ALIGN="align" VALIGN="valign"&gt; tag. Adds a newline character
   923      * at the end.
   924      *
   925      * @param align String align.
   926      * @param valign String valign.
   927      */
   928     public void trAlignVAlign(String align, String valign) {
   929         println("<TR ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\">");
   930     }
   932     /**
   933      * Print &lt;TH ALIGN="align"&gt; tag.
   934      *
   935      * @param align the align attribute.
   936      */
   937     public void thAlign(String align) {
   938         print("<TH ALIGN=\"" + align + "\">");
   939     }
   941     /**
   942      * Print &lt;TH align="align" COLSPAN=i&gt; tag.
   943      *
   944      * @param align the align attribute.
   945      * @param i integer.
   946      */
   947     public void thAlignColspan(String align, int i) {
   948         print("<TH ALIGN=\"" + align + "\" COLSPAN=\"" + i + "\">");
   949     }
   951     /**
   952      * Print &lt;TH align="align" NOWRAP&gt; tag.
   953      *
   954      * @param align the align attribute.
   955      */
   956     public void thAlignNowrap(String align) {
   957         print("<TH ALIGN=\"" + align + "\" NOWRAP>");
   958     }
   960     /**
   961      * Print &lt;/TH&gt; tag. Add a newline character at the end.
   962      */
   963     public void thEnd() {
   964         println("</TH>");
   965     }
   967     /**
   968      * Print &lt;TD COLSPAN=i&gt; tag.
   969      *
   970      * @param i integer.
   971      */
   972     public void tdColspan(int i) {
   973         print("<TD COLSPAN=" + i + ">");
   974     }
   976     /**
   977      * Print &lt;TD BGCOLOR="color" CLASS="stylename"&gt; tag.
   978      *
   979      * @param color String color.
   980      * @param stylename String stylename.
   981      */
   982     public void tdBgcolorStyle(String color, String stylename) {
   983         print("<TD BGCOLOR=\"" + color + "\" CLASS=\"" + stylename + "\">");
   984     }
   986     /**
   987      * Print &lt;TD COLSPAN=i BGCOLOR="color" CLASS="stylename"&gt; tag.
   988      *
   989      * @param i integer.
   990      * @param color String color.
   991      * @param stylename String stylename.
   992      */
   993     public void tdColspanBgcolorStyle(int i, String color, String stylename) {
   994         print("<TD COLSPAN=" + i + " BGCOLOR=\"" + color + "\" CLASS=\"" +
   995               stylename + "\">");
   996     }
   998     /**
   999      * Print &lt;TD ALIGN="align"&gt; tag. Adds a newline character
  1000      * at the end.
  1002      * @param align String align.
  1003      */
  1004     public void tdAlign(String align) {
  1005         print("<TD ALIGN=\"" + align + "\">");
  1008     /**
  1009      * Print &lt;TD ALIGN="align" CLASS="stylename"&gt; tag.
  1011      * @param align        String align.
  1012      * @param stylename    String stylename.
  1013      */
  1014     public void tdVAlignClass(String align, String stylename) {
  1015         print("<TD VALIGN=\"" + align + "\" CLASS=\"" + stylename + "\">");
  1018     /**
  1019      * Print &lt;TD VALIGN="valign"&gt; tag.
  1021      * @param valign String valign.
  1022      */
  1023     public void tdVAlign(String valign) {
  1024         print("<TD VALIGN=\"" + valign + "\">");
  1027     /**
  1028      * Print &lt;TD ALIGN="align" VALIGN="valign"&gt; tag.
  1030      * @param align   String align.
  1031      * @param valign  String valign.
  1032      */
  1033     public void tdAlignVAlign(String align, String valign) {
  1034         print("<TD ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\">");
  1037     /**
  1038      * Print &lt;TD ALIGN="align" ROWSPAN=rowspan&gt; tag.
  1040      * @param align    String align.
  1041      * @param rowspan  integer rowspan.
  1042      */
  1043     public void tdAlignRowspan(String align, int rowspan) {
  1044         print("<TD ALIGN=\"" + align + "\" ROWSPAN=" + rowspan + ">");
  1047     /**
  1048      * Print &lt;TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan&gt; tag.
  1050      * @param align    String align.
  1051      * @param valign  String valign.
  1052      * @param rowspan  integer rowspan.
  1053      */
  1054     public void tdAlignVAlignRowspan(String align, String valign,
  1055                                      int rowspan) {
  1056         print("<TD ALIGN=\"" + align + "\" VALIGN=\"" + valign
  1057                 + "\" ROWSPAN=" + rowspan + ">");
  1060     /**
  1061      * Print &lt;BLOCKQUOTE&gt; tag. Add a newline character at the end.
  1062      */
  1063     public void blockquote() {
  1064         println("<BLOCKQUOTE>");
  1067     /**
  1068      * Print &lt;/BLOCKQUOTE&gt; tag. Add a newline character at the end.
  1069      */
  1070     public void blockquoteEnd() {
  1071         println("</BLOCKQUOTE>");
  1074     /**
  1075      * Get the "&lt;CODE&gt;" string.
  1077      * @return String Return String "&lt;CODE>";
  1078      */
  1079     public String getCode() {
  1080         return "<CODE>";
  1083     /**
  1084      * Get the "&lt;/CODE&gt;" string.
  1086      * @return String Return String "&lt;/CODE&gt;";
  1087      */
  1088     public String getCodeEnd() {
  1089         return "</CODE>";
  1092     /**
  1093      * Print &lt;NOFRAMES&gt; tag. Add a newline character at the end.
  1094      */
  1095     public void noFrames() {
  1096         println("<NOFRAMES>");
  1099     /**
  1100      * Print &lt;/NOFRAMES&gt; tag. Add a newline character at the end.
  1101      */
  1102     public void noFramesEnd() {
  1103         println("</NOFRAMES>");

mercurial