HtmlWriter.java revision 792
553N/A * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 553N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 553N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 553N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Class for the Html format code generation. 0N/A * Initilizes PrintWriter with FileWriter, to enable print 0N/A * related methods to generate the code to the named File through FileWriter. 0N/A * @author Atul M Dambalkar 242N/A * @author Bhavesh Patel (Modified) 0N/A * Name of the file, to which this writer is writing to. 0N/A * The window title of this file 0N/A * URL file separator string("/"). 232N/A * The flag to indicate whether a member details list is printed or not. 242N/A * Header for tables displaying packages and description.. 242N/A * Summary for use tables displaying class and package use. 242N/A * Column header for class docs displaying Modifier and Type header. 0N/A * @param path The directory path to be created for this file 0N/A * or null if none to be created. 0N/A * @param filename File Name to which the PrintWriter will 0N/A * @param docencoding Encoding to be used for this file. 0N/A * @exception IOException Exception raised by the FileWriter is passed on 0N/A * @exception UnSupportedEncodingException Exception raised by the 0N/A * OutputStreamWriter is passed on to next level. 765N/A * Get the configuration string as a content. 765N/A * @param key the key to look for in the configuration file 765N/A * @return a content tree for the text 765N/A * Get the configuration string as a content. 765N/A * @param key the key to look for in the configuration file 765N/A * @param a1 string argument added to configuration text 765N/A * @return a content tree for the text 765N/A * Get the configuration string as a content. 765N/A * @param key the key to look for in the configuration file 765N/A * @param a1 string argument added to configuration text 765N/A * @param a2 string argument added to configuration text 765N/A * @return a content tree for the text 0N/A * Print <HTML> tag. Add a newline character at the end. 0N/A * Print </HTML> tag. Add a newline character at the end. 0N/A * Print the script code to be embeded before the </HEAD> tag. 0N/A println(
" if (location.href.indexOf('is-external=true') == -1) {");
765N/A * Returns an HtmlTree for the SCRIPT tag. 765N/A * @return an HtmlTree for the SCRIPT tag 765N/A * Returns a content tree for the SCRIPT tag for the main page(index.html). 765N/A * @return a content for the SCRIPT tag 0N/A * Print the Javascript <SCRIPT> start tag with its type 0N/A * Print the Javascript </SCRIPT> end tag. 0N/A * Print the Javascript <NOSCRIPT> start tag. 0N/A * Print the Javascript </NOSCRIPT> end tag. 0N/A * Return the Javascript call to be embedded in the <BODY> tag. 0N/A * Return nothing if winTitle is empty. 0N/A * @return the Javascript call to be embedded in the <BODY> tag. 0N/A return " onload=\"windowTitle();\"";
0N/A * Print <BODY BGCOLOR="bgcolor">, including JavaScript 0N/A * "onload" call to load windowtitle script. This script shows the name 0N/A * of the document in the window title bar when frames are on. 0N/A * @param bgcolor Background color. 0N/A * @param includeScript boolean set true if printing windowtitle script 765N/A * Returns an HtmlTree for the BODY tag. 765N/A * @param includeScript set true if printing windowtitle script 765N/A * @param title title for the window 765N/A * @return an HtmlTree for the BODY tag 765N/A // Set window title string which is later printed 765N/A // Don't print windowtitle script for overview-frame, allclasses-frame 0N/A * Print </BODY> tag. Add a newline character at the end. 0N/A * Print <TITLE> tag. Add a newline character at the end. 0N/A * Print <TITLE> tag. Add a newline character at the end. 0N/A * @param winTitle The title of this document. 0N/A // Set window title string which is later printed 765N/A * Returns an HtmlTree for the TITLE tag. 765N/A * @return an HtmlTree for the TITLE tag 0N/A * Print </TITLE> tag. Add a newline character at the end. 0N/A * Print <UL> tag. Add a newline character at the end. 0N/A * Print </UL> tag. Add a newline character at the end. 0N/A * Print <LI> tag. 0N/A * Print <LI TYPE="type"> tag. 0N/A * @param type Type string. 0N/A * Print <H1> tag. Add a newline character at the end. 0N/A * Print </H1> tag. Add a newline character at the end. 0N/A * Print text with <H1> tag. Also adds </H1> tag. Add a newline character 0N/A * at the end of the text. 0N/A * @param text Text to be printed with <H1> format. 0N/A * Print <H2> tag. Add a newline character at the end. 0N/A * Print text with <H2> tag. Also adds </H2> tag. Add a newline character 0N/A * at the end of the text. 0N/A * @param text Text to be printed with <H2> format. 0N/A * Print </H2> tag. Add a newline character at the end. 0N/A * Print <H3> tag. Add a newline character at the end. 0N/A * Print text with <H3> tag. Also adds </H3> tag. Add a newline character 0N/A * at the end of the text. 0N/A * @param text Text to be printed with <H3> format. 0N/A * Print </H3> tag. Add a newline character at the end. 0N/A * Print <H4> tag. Add a newline character at the end. 0N/A * Print </H4> tag. Add a newline character at the end. 0N/A * Print text with <H4> tag. Also adds </H4> tag. Add a newline character 0N/A * at the end of the text. 0N/A * @param text Text to be printed with <H4> format. 0N/A * Print <H5> tag. Add a newline character at the end. 0N/A * Print </H5> tag. Add a newline character at the end. 0N/A * Print HTML <IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname> 0N/A * tag. It prepends the "images" directory name to the "imggif". This 0N/A * method is used for oneone format generation. Add a newline character 0N/A * @param imggif Image GIF file. 0N/A * @param imgname Image name. 0N/A * @param width Width of the image. 0N/A * @param height Height of the image. 0N/A * Print <MENU> tag. Add a newline character at the end. 0N/A * Print </MENU> tag. Add a newline character at the end. 0N/A * Print <PRE> tag. Add a newline character at the end. 0N/A * Print <PRE> tag without adding new line character at th eend. 0N/A * Print </PRE> tag. Add a newline character at the end. 0N/A * Print <HR> tag. Add a newline character at the end. 0N/A * Print <HR SIZE="size" WIDTH="widthpercent%"> tag. Add a newline 0N/A * character at the end. 0N/A * @param size Size of the ruler. 0N/A * @param widthPercent Percentage Width of the ruler 0N/A * Print <HR SIZE="size" NOSHADE> tag. Add a newline character at the end. 0N/A * @param size Size of the ruler. 0N/A * @param noshade noshade string. 181N/A * Get the "<STRONG>" string. 181N/A * @return String Return String "<STRONG>"; 181N/A * Get the "</STRONG>" string. 181N/A * @return String Return String "</STRONG>"; 181N/A * Print <STRONG> tag. 181N/A * Print </STRONG> tag. 181N/A * Print text passed, in strong format using <STRONG> and </STRONG> tags. 181N/A * @param text String to be printed in between <STRONG> and </STRONG> tags. 0N/A * Print text passed, in Italics using <I> and </I> tags. 0N/A * @param text String to be printed in between <I> and </I> tags. 765N/A * Return, text passed, with Italics <i> and </i> tags, surrounding it. 765N/A * So if the text passed is "Hi", then string returned will be "<i>Hi</i>". 0N/A * @param text String to be printed in between <I> and </I> tags. 0N/A * Print "&nbsp;", non-breaking space. 765N/A * Return "&nbsp;", non-breaking space. 0N/A * Print <DL> tag. Add a newline character at the end. 0N/A * Print </DL> tag. Add a newline character at the end. 0N/A * Print <DT> tag. 232N/A * Print </DT> tag. 232N/A * Print <DD> tag. 0N/A * Print </DD> tag. Add a newline character at the end. 0N/A * Print <SUP> tag. Add a newline character at the end. 0N/A * Print </SUP> tag. Add a newline character at the end. 0N/A * Print <FONT SIZE="size"> tag. Add a newline character at the end. 0N/A * @param size String size. 0N/A * Print <FONT SIZE="size"> tag. 0N/A * @param size String size. 0N/A * Print <FONT CLASS="stylename"> tag. Add a newline character at the end. 0N/A * @param stylename String stylename. 0N/A * Print <FONT SIZE="size" CLASS="stylename"> tag. Add a newline character 0N/A * @param size String size. 0N/A * @param stylename String stylename. 0N/A * Print </FONT> tag. 0N/A * Get the "<FONT COLOR="color">" string. 0N/A * @param color String color. 0N/A * @return String Return String "<FONT COLOR="color">". 0N/A return "<FONT COLOR=\"" +
color +
"\">";
0N/A * Get the "</FONT>" string. 0N/A * @return String Return String "</FONT>"; 0N/A * Print <CENTER> tag. Add a newline character at the end. 0N/A * Print </CENTER> tag. Add a newline character at the end. 0N/A * Print anchor <A NAME="name"> tag. 0N/A * @param name Name String. 0N/A * Print </A> tag. 0N/A * Print <I> tag. 0N/A * Print </I> tag. 0N/A * Print contents within anchor <A NAME="name"> tags. 0N/A * @param name String name. 0N/A * @param content String contents. 0N/A * Print anchor <A NAME="name"> and </A>tags. Print comment string 0N/A * "<!-- -->" within those tags. 0N/A * @param name String name. 0N/A * Print newline and then print <P> tag. Add a newline character at the 0N/A * Print newline and then print </P> tag. Add a newline character at the 0N/A * Print newline and then print <BR> tag. Add a newline character at the 0N/A * Print <ADDRESS> tag. Add a newline character at the end. 0N/A * Print </ADDRESS> tag. Add a newline character at the end. 0N/A * Print <HEAD> tag. Add a newline character at the end. 0N/A * Print </HEAD> tag. Add a newline character at the end. 0N/A * Print <CODE> tag. 0N/A * Print </CODE> tag. 0N/A * Print <EM> tag. Add a newline character at the end. 0N/A * Print </EM> tag. Add a newline character at the end. 0N/A * Print HTML <TABLE BORDER="border" WIDTH="width" 0N/A * CELLPADDING="cellpadding" CELLSPACING="cellspacing"> tag. 0N/A * @param border Border size. 0N/A * @param width Width of the table. 0N/A * @param cellpadding Cellpadding for the table cells. 0N/A * @param cellspacing Cellspacing for the table cells. 0N/A "\" SUMMARY=\"\">");
242N/A * Print HTML <TABLE BORDER="border" WIDTH="width" 242N/A * CELLPADDING="cellpadding" CELLSPACING="cellspacing" SUMMARY="summary"> tag. 242N/A * @param border Border size. 242N/A * @param width Width of the table. 242N/A * @param cellpadding Cellpadding for the table cells. 242N/A * @param cellspacing Cellspacing for the table cells. 242N/A * @param summary Table summary. 0N/A * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding" 0N/A * CELLSPACING="cellspacing"> tag. 0N/A * @param border Border size. 0N/A * @param cellpadding Cellpadding for the table cells. 0N/A * @param cellspacing Cellspacing for the table cells. 0N/A "\" SUMMARY=\"\">");
242N/A * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding" 242N/A * CELLSPACING="cellspacing" SUMMARY="summary"> tag. 242N/A * @param border Border size. 242N/A * @param cellpadding Cellpadding for the table cells. 242N/A * @param cellspacing Cellspacing for the table cells. 242N/A * @param summary Table summary. 0N/A * Print HTML <TABLE BORDER="border" WIDTH="width"> 0N/A * @param border Border size. 0N/A * @param width Width of the table. 0N/A "\" SUMMARY=\"\">");
0N/A * Print the HTML table tag with border size 0 and width 100%. 0N/A * Print </TABLE> tag. Add a newline character at the end. 0N/A * Print <TR> tag. Add a newline character at the end. 0N/A * Print </TR> tag. Add a newline character at the end. 0N/A * Print <TD> tag. 0N/A * Print <TD NOWRAP> tag. 0N/A * Print <TD WIDTH="width"> tag. 0N/A * @param width String width. 0N/A * Print </TD> tag. Add a newline character at the end. 0N/A * Print <LINK str> tag. 0N/A * @param str String. 0N/A * Print "<!-- " comment start string. 0N/A * Print "-->" comment end string. Add a newline character at the end. 242N/A * Print <CAPTION CLASS="stylename"> tag. Adds a newline character 242N/A * @param stylename style to be applied. 242N/A * Print </CAPTION> tag. Add a newline character at the end. 0N/A * Print <TR BGCOLOR="color" CLASS="stylename"> tag. Adds a newline character 0N/A * @param color String color. 0N/A * @param stylename String stylename. 0N/A * Print <TR BGCOLOR="color"> tag. Adds a newline character at the end. 0N/A * @param color String color. 0N/A * Print <TR ALIGN="align" VALIGN="valign"> tag. Adds a newline character 0N/A * @param align String align. 0N/A * @param valign String valign. 0N/A * Print <TH ALIGN="align"> tag. 0N/A * @param align the align attribute. 242N/A * Print <TH CLASS="stylename" SCOPE="scope" NOWRAP> tag. 242N/A * @param stylename style to be applied. 242N/A * @param scope the scope attribute. 242N/A * Returns a header for Modifier and Type column of a table. 0N/A * Print <TH align="align" COLSPAN=i> tag. 0N/A * @param align the align attribute. 0N/A * Print <TH align="align" NOWRAP> tag. 0N/A * @param align the align attribute. 0N/A * Print </TH> tag. Add a newline character at the end. 0N/A * Print <TD COLSPAN=i> tag. 0N/A * Print <TD BGCOLOR="color" CLASS="stylename"> tag. 0N/A * @param color String color. 0N/A * @param stylename String stylename. 0N/A * Print <TD COLSPAN=i BGCOLOR="color" CLASS="stylename"> tag. 0N/A * @param color String color. 0N/A * @param stylename String stylename. 0N/A print(
"<TD COLSPAN=" + i +
" BGCOLOR=\"" +
color +
"\" CLASS=\"" +
0N/A * Print <TD ALIGN="align"> tag. Adds a newline character 0N/A * @param align String align. 0N/A * Print <TD ALIGN="align" CLASS="stylename"> tag. 0N/A * @param align String align. 0N/A * @param stylename String stylename. 0N/A * Print <TD VALIGN="valign"> tag. 0N/A * @param valign String valign. 0N/A * Print <TD ALIGN="align" VALIGN="valign"> tag. 0N/A * @param align String align. 0N/A * @param valign String valign. 0N/A * Print <TD ALIGN="align" ROWSPAN=rowspan> tag. 0N/A * @param align String align. 0N/A * @param rowspan integer rowspan. 0N/A * Print <TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan> tag. 0N/A * @param align String align. 0N/A * @param valign String valign. 0N/A * @param rowspan integer rowspan. 0N/A * Print <BLOCKQUOTE> tag. Add a newline character at the end. 0N/A * Print </BLOCKQUOTE> tag. Add a newline character at the end. 765N/A * Get the "<code>" string. 765N/A * @return String Return String "<code>"; 765N/A * Get the "</code>" string. 765N/A * @return String Return String "</code>"; 0N/A * Print <NOFRAMES> tag. Add a newline character at the end. 0N/A * Print </NOFRAMES> tag. Add a newline character at the end.