Tue, 25 May 2010 15:54:51 -0700
6943119: Rebrand source copyright notices
Reviewed-by: darcy
1 /*
2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.tools.doclets.formats.html.markup;
28 import java.io.*;
30 import com.sun.tools.doclets.internal.toolkit.*;
31 import com.sun.tools.doclets.internal.toolkit.util.*;
33 /**
34 * Class for the Html format code generation.
35 * Initilizes PrintWriter with FileWriter, to enable print
36 * related methods to generate the code to the named File through FileWriter.
37 *
38 * @since 1.2
39 * @author Atul M Dambalkar
40 * @author Bhavesh Patel (Modified)
41 */
42 public class HtmlWriter extends PrintWriter {
44 /**
45 * Name of the file, to which this writer is writing to.
46 */
47 protected final String htmlFilename;
49 /**
50 * The window title of this file
51 */
52 protected String winTitle;
54 /**
55 * URL file separator string("/").
56 */
57 public static final String fileseparator =
58 DirectoryManager.URL_FILE_SEPERATOR;
60 /**
61 * The configuration
62 */
63 protected Configuration configuration;
65 /**
66 * The flag to indicate whether a member details list is printed or not.
67 */
68 protected boolean memberDetailsListPrinted;
70 /**
71 * Header for tables displaying packages and description..
72 */
73 protected final String[] packageTableHeader;
75 /**
76 * Summary for use tables displaying class and package use.
77 */
78 protected final String useTableSummary;
80 /**
81 * Column header for class docs displaying Modifier and Type header.
82 */
83 protected final String modifierTypeHeader;
85 /**
86 * Constructor.
87 *
88 * @param path The directory path to be created for this file
89 * or null if none to be created.
90 * @param filename File Name to which the PrintWriter will
91 * do the Output.
92 * @param docencoding Encoding to be used for this file.
93 * @exception IOException Exception raised by the FileWriter is passed on
94 * to next level.
95 * @exception UnSupportedEncodingException Exception raised by the
96 * OutputStreamWriter is passed on to next level.
97 */
98 public HtmlWriter(Configuration configuration,
99 String path, String filename, String docencoding)
100 throws IOException, UnsupportedEncodingException {
101 super(Util.genWriter(configuration, path, filename, docencoding));
102 this.configuration = configuration;
103 htmlFilename = filename;
104 this.memberDetailsListPrinted = false;
105 packageTableHeader = new String[] {
106 configuration.getText("doclet.Package"),
107 configuration.getText("doclet.Description")
108 };
109 useTableSummary = configuration.getText("doclet.Use_Table_Summary",
110 configuration.getText("doclet.packages"));
111 modifierTypeHeader = configuration.getText("doclet.0_and_1",
112 configuration.getText("doclet.Modifier"),
113 configuration.getText("doclet.Type"));
114 }
116 /**
117 * Print <HTML> tag. Add a newline character at the end.
118 */
119 public void html() {
120 println("<HTML lang=\"" + configuration.getLocale().getLanguage() + "\">");
121 }
123 /**
124 * Print </HTML> tag. Add a newline character at the end.
125 */
126 public void htmlEnd() {
127 println("</HTML>");
128 }
130 /**
131 * Print the script code to be embeded before the </HEAD> tag.
132 */
133 protected void printWinTitleScript(String winTitle){
134 if(winTitle != null && winTitle.length() > 0) {
135 script();
136 println("function windowTitle()");
137 println("{");
138 println(" if (location.href.indexOf('is-external=true') == -1) {");
139 println(" parent.document.title=\"" + winTitle + "\";");
140 println(" }");
141 println("}");
142 scriptEnd();
143 noScript();
144 noScriptEnd();
145 }
146 }
148 /**
149 * Print the Javascript <SCRIPT> start tag with its type
150 * attribute.
151 */
152 public void script() {
153 println("<SCRIPT type=\"text/javascript\">");
154 }
156 /**
157 * Print the Javascript </SCRIPT> end tag.
158 */
159 public void scriptEnd() {
160 println("</SCRIPT>");
161 }
163 /**
164 * Print the Javascript <NOSCRIPT> start tag.
165 */
166 public void noScript() {
167 println("<NOSCRIPT>");
168 }
170 /**
171 * Print the Javascript </NOSCRIPT> end tag.
172 */
173 public void noScriptEnd() {
174 println("</NOSCRIPT>");
175 }
177 /**
178 * Return the Javascript call to be embedded in the <BODY> tag.
179 * Return nothing if winTitle is empty.
180 * @return the Javascript call to be embedded in the <BODY> tag.
181 */
182 protected String getWindowTitleOnload(){
183 if(winTitle != null && winTitle.length() > 0) {
184 return " onload=\"windowTitle();\"";
185 } else {
186 return "";
187 }
188 }
190 /**
191 * Print <BODY BGCOLOR="bgcolor">, including JavaScript
192 * "onload" call to load windowtitle script. This script shows the name
193 * of the document in the window title bar when frames are on.
194 *
195 * @param bgcolor Background color.
196 * @param includeScript boolean set true if printing windowtitle script
197 */
198 public void body(String bgcolor, boolean includeScript) {
199 print("<BODY BGCOLOR=\"" + bgcolor + "\"");
200 if (includeScript) {
201 print(getWindowTitleOnload());
202 }
203 println(">");
204 }
206 /**
207 * Print </BODY> tag. Add a newline character at the end.
208 */
209 public void bodyEnd() {
210 println("</BODY>");
211 }
213 /**
214 * Print <TITLE> tag. Add a newline character at the end.
215 */
216 public void title() {
217 println("<TITLE>");
218 }
220 /**
221 * Print <TITLE> tag. Add a newline character at the end.
222 *
223 * @param winTitle The title of this document.
224 */
225 public void title(String winTitle) {
226 // Set window title string which is later printed
227 this.winTitle = winTitle;
228 title();
229 }
232 /**
233 * Print </TITLE> tag. Add a newline character at the end.
234 */
235 public void titleEnd() {
236 println("</TITLE>");
237 }
239 /**
240 * Print <UL> tag. Add a newline character at the end.
241 */
242 public void ul() {
243 println("<UL>");
244 }
246 /**
247 * Print </UL> tag. Add a newline character at the end.
248 */
249 public void ulEnd() {
250 println("</UL>");
251 }
253 /**
254 * Print <LI> tag.
255 */
256 public void li() {
257 print("<LI>");
258 }
260 /**
261 * Print <LI TYPE="type"> tag.
262 *
263 * @param type Type string.
264 */
265 public void li(String type) {
266 print("<LI TYPE=\"" + type + "\">");
267 }
269 /**
270 * Print <H1> tag. Add a newline character at the end.
271 */
272 public void h1() {
273 println("<H1>");
274 }
276 /**
277 * Print </H1> tag. Add a newline character at the end.
278 */
279 public void h1End() {
280 println("</H1>");
281 }
283 /**
284 * Print text with <H1> tag. Also adds </H1> tag. Add a newline character
285 * at the end of the text.
286 *
287 * @param text Text to be printed with <H1> format.
288 */
289 public void h1(String text) {
290 h1();
291 println(text);
292 h1End();
293 }
295 /**
296 * Print <H2> tag. Add a newline character at the end.
297 */
298 public void h2() {
299 println("<H2>");
300 }
302 /**
303 * Print text with <H2> tag. Also adds </H2> tag. Add a newline character
304 * at the end of the text.
305 *
306 * @param text Text to be printed with <H2> format.
307 */
308 public void h2(String text) {
309 h2();
310 println(text);
311 h2End();
312 }
314 /**
315 * Print </H2> tag. Add a newline character at the end.
316 */
317 public void h2End() {
318 println("</H2>");
319 }
321 /**
322 * Print <H3> tag. Add a newline character at the end.
323 */
324 public void h3() {
325 println("<H3>");
326 }
328 /**
329 * Print text with <H3> tag. Also adds </H3> tag. Add a newline character
330 * at the end of the text.
331 *
332 * @param text Text to be printed with <H3> format.
333 */
334 public void h3(String text) {
335 h3();
336 println(text);
337 h3End();
338 }
340 /**
341 * Print </H3> tag. Add a newline character at the end.
342 */
343 public void h3End() {
344 println("</H3>");
345 }
347 /**
348 * Print <H4> tag. Add a newline character at the end.
349 */
350 public void h4() {
351 println("<H4>");
352 }
354 /**
355 * Print </H4> tag. Add a newline character at the end.
356 */
357 public void h4End() {
358 println("</H4>");
359 }
361 /**
362 * Print text with <H4> tag. Also adds </H4> tag. Add a newline character
363 * at the end of the text.
364 *
365 * @param text Text to be printed with <H4> format.
366 */
367 public void h4(String text) {
368 h4();
369 println(text);
370 h4End();
371 }
373 /**
374 * Print <H5> tag. Add a newline character at the end.
375 */
376 public void h5() {
377 println("<H5>");
378 }
380 /**
381 * Print </H5> tag. Add a newline character at the end.
382 */
383 public void h5End() {
384 println("</H5>");
385 }
387 /**
388 * Print HTML <IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname>
389 * tag. It prepends the "images" directory name to the "imggif". This
390 * method is used for oneone format generation. Add a newline character
391 * at the end.
392 *
393 * @param imggif Image GIF file.
394 * @param imgname Image name.
395 * @param width Width of the image.
396 * @param height Height of the image.
397 */
398 public void img(String imggif, String imgname, int width, int height) {
399 println("<IMG SRC=\"images/" + imggif + ".gif\""
400 + " WIDTH=\"" + width + "\" HEIGHT=\"" + height
401 + "\" ALT=\"" + imgname + "\">");
402 }
404 /**
405 * Print <MENU> tag. Add a newline character at the end.
406 */
407 public void menu() {
408 println("<MENU>");
409 }
411 /**
412 * Print </MENU> tag. Add a newline character at the end.
413 */
414 public void menuEnd() {
415 println("</MENU>");
416 }
418 /**
419 * Print <PRE> tag. Add a newline character at the end.
420 */
421 public void pre() {
422 println("<PRE>");
423 }
425 /**
426 * Print <PRE> tag without adding new line character at th eend.
427 */
428 public void preNoNewLine() {
429 print("<PRE>");
430 }
432 /**
433 * Print </PRE> tag. Add a newline character at the end.
434 */
435 public void preEnd() {
436 println("</PRE>");
437 }
439 /**
440 * Print <HR> tag. Add a newline character at the end.
441 */
442 public void hr() {
443 println("<HR>");
444 }
446 /**
447 * Print <HR SIZE="size" WIDTH="widthpercent%"> tag. Add a newline
448 * character at the end.
449 *
450 * @param size Size of the ruler.
451 * @param widthPercent Percentage Width of the ruler
452 */
453 public void hr(int size, int widthPercent) {
454 println("<HR SIZE=\"" + size + "\" WIDTH=\"" + widthPercent + "%\">");
455 }
457 /**
458 * Print <HR SIZE="size" NOSHADE> tag. Add a newline character at the end.
459 *
460 * @param size Size of the ruler.
461 * @param noshade noshade string.
462 */
463 public void hr(int size, String noshade) {
464 println("<HR SIZE=\"" + size + "\" NOSHADE>");
465 }
467 /**
468 * Get the "<STRONG>" string.
469 *
470 * @return String Return String "<STRONG>";
471 */
472 public String getStrong() {
473 return "<STRONG>";
474 }
476 /**
477 * Get the "</STRONG>" string.
478 *
479 * @return String Return String "</STRONG>";
480 */
481 public String getStrongEnd() {
482 return "</STRONG>";
483 }
485 /**
486 * Print <STRONG> tag.
487 */
488 public void strong() {
489 print("<STRONG>");
490 }
492 /**
493 * Print </STRONG> tag.
494 */
495 public void strongEnd() {
496 print("</STRONG>");
497 }
499 /**
500 * Print text passed, in strong format using <STRONG> and </STRONG> tags.
501 *
502 * @param text String to be printed in between <STRONG> and </STRONG> tags.
503 */
504 public void strong(String text) {
505 strong();
506 print(text);
507 strongEnd();
508 }
510 /**
511 * Print text passed, in Italics using <I> and </I> tags.
512 *
513 * @param text String to be printed in between <I> and </I> tags.
514 */
515 public void italics(String text) {
516 print("<I>");
517 print(text);
518 println("</I>");
519 }
521 /**
522 * Return, text passed, with Italics <I> and </I> tags, surrounding it.
523 * So if the text passed is "Hi", then string returned will be "<I>Hi</I>".
524 *
525 * @param text String to be printed in between <I> and </I> tags.
526 */
527 public String italicsText(String text) {
528 return "<I>" + text + "</I>";
529 }
531 public String codeText(String text) {
532 return "<CODE>" + text + "</CODE>";
533 }
535 /**
536 * Print "&nbsp;", non-breaking space.
537 */
538 public void space() {
539 print(" ");
540 }
542 /**
543 * Print <DL> tag. Add a newline character at the end.
544 */
545 public void dl() {
546 println("<DL>");
547 }
549 /**
550 * Print </DL> tag. Add a newline character at the end.
551 */
552 public void dlEnd() {
553 println("</DL>");
554 }
556 /**
557 * Print <DT> tag.
558 */
559 public void dt() {
560 print("<DT>");
561 }
563 /**
564 * Print </DT> tag.
565 */
566 public void dtEnd() {
567 print("</DT>");
568 }
570 /**
571 * Print <DD> tag.
572 */
573 public void dd() {
574 print("<DD>");
575 }
577 /**
578 * Print </DD> tag. Add a newline character at the end.
579 */
580 public void ddEnd() {
581 println("</DD>");
582 }
584 /**
585 * Print <SUP> tag. Add a newline character at the end.
586 */
587 public void sup() {
588 println("<SUP>");
589 }
591 /**
592 * Print </SUP> tag. Add a newline character at the end.
593 */
594 public void supEnd() {
595 println("</SUP>");
596 }
598 /**
599 * Print <FONT SIZE="size"> tag. Add a newline character at the end.
600 *
601 * @param size String size.
602 */
603 public void font(String size) {
604 println("<FONT SIZE=\"" + size + "\">");
605 }
607 /**
608 * Print <FONT SIZE="size"> tag.
609 *
610 * @param size String size.
611 */
612 public void fontNoNewLine(String size) {
613 print("<FONT SIZE=\"" + size + "\">");
614 }
616 /**
617 * Print <FONT CLASS="stylename"> tag. Add a newline character at the end.
618 *
619 * @param stylename String stylename.
620 */
621 public void fontStyle(String stylename) {
622 print("<FONT CLASS=\"" + stylename + "\">");
623 }
625 /**
626 * Print <FONT SIZE="size" CLASS="stylename"> tag. Add a newline character
627 * at the end.
628 *
629 * @param size String size.
630 * @param stylename String stylename.
631 */
632 public void fontSizeStyle(String size, String stylename) {
633 println("<FONT size=\"" + size + "\" CLASS=\"" + stylename + "\">");
634 }
636 /**
637 * Print </FONT> tag.
638 */
639 public void fontEnd() {
640 print("</FONT>");
641 }
643 /**
644 * Get the "<FONT COLOR="color">" string.
645 *
646 * @param color String color.
647 * @return String Return String "<FONT COLOR="color">".
648 */
649 public String getFontColor(String color) {
650 return "<FONT COLOR=\"" + color + "\">";
651 }
653 /**
654 * Get the "</FONT>" string.
655 *
656 * @return String Return String "</FONT>";
657 */
658 public String getFontEnd() {
659 return "</FONT>";
660 }
662 /**
663 * Print <CENTER> tag. Add a newline character at the end.
664 */
665 public void center() {
666 println("<CENTER>");
667 }
669 /**
670 * Print </CENTER> tag. Add a newline character at the end.
671 */
672 public void centerEnd() {
673 println("</CENTER>");
674 }
676 /**
677 * Print anchor <A NAME="name"> tag.
678 *
679 * @param name Name String.
680 */
681 public void aName(String name) {
682 print("<A NAME=\"" + name + "\">");
683 }
685 /**
686 * Print </A> tag.
687 */
688 public void aEnd() {
689 print("</A>");
690 }
692 /**
693 * Print <I> tag.
694 */
695 public void italic() {
696 print("<I>");
697 }
699 /**
700 * Print </I> tag.
701 */
702 public void italicEnd() {
703 print("</I>");
704 }
706 /**
707 * Print contents within anchor <A NAME="name"> tags.
708 *
709 * @param name String name.
710 * @param content String contents.
711 */
712 public void anchor(String name, String content) {
713 aName(name);
714 print(content);
715 aEnd();
716 }
718 /**
719 * Print anchor <A NAME="name"> and </A>tags. Print comment string
720 * "<!-- -->" within those tags.
721 *
722 * @param name String name.
723 */
724 public void anchor(String name) {
725 anchor(name, "<!-- -->");
726 }
728 /**
729 * Print newline and then print <P> tag. Add a newline character at the
730 * end.
731 */
732 public void p() {
733 println();
734 println("<P>");
735 }
737 /**
738 * Print newline and then print </P> tag. Add a newline character at the
739 * end.
740 */
741 public void pEnd() {
742 println();
743 println("</P>");
744 }
746 /**
747 * Print newline and then print <BR> tag. Add a newline character at the
748 * end.
749 */
750 public void br() {
751 println();
752 println("<BR>");
753 }
755 /**
756 * Print <ADDRESS> tag. Add a newline character at the end.
757 */
758 public void address() {
759 println("<ADDRESS>");
760 }
762 /**
763 * Print </ADDRESS> tag. Add a newline character at the end.
764 */
765 public void addressEnd() {
766 println("</ADDRESS>");
767 }
769 /**
770 * Print <HEAD> tag. Add a newline character at the end.
771 */
772 public void head() {
773 println("<HEAD>");
774 }
776 /**
777 * Print </HEAD> tag. Add a newline character at the end.
778 */
779 public void headEnd() {
780 println("</HEAD>");
781 }
783 /**
784 * Print <CODE> tag.
785 */
786 public void code() {
787 print("<CODE>");
788 }
790 /**
791 * Print </CODE> tag.
792 */
793 public void codeEnd() {
794 print("</CODE>");
795 }
797 /**
798 * Print <EM> tag. Add a newline character at the end.
799 */
800 public void em() {
801 println("<EM>");
802 }
804 /**
805 * Print </EM> tag. Add a newline character at the end.
806 */
807 public void emEnd() {
808 println("</EM>");
809 }
811 /**
812 * Print HTML <TABLE BORDER="border" WIDTH="width"
813 * CELLPADDING="cellpadding" CELLSPACING="cellspacing"> tag.
814 *
815 * @param border Border size.
816 * @param width Width of the table.
817 * @param cellpadding Cellpadding for the table cells.
818 * @param cellspacing Cellspacing for the table cells.
819 */
820 public void table(int border, String width, int cellpadding,
821 int cellspacing) {
822 println(DocletConstants.NL +
823 "<TABLE BORDER=\"" + border +
824 "\" WIDTH=\"" + width +
825 "\" CELLPADDING=\"" + cellpadding +
826 "\" CELLSPACING=\"" + cellspacing +
827 "\" SUMMARY=\"\">");
828 }
830 /**
831 * Print HTML <TABLE BORDER="border" WIDTH="width"
832 * CELLPADDING="cellpadding" CELLSPACING="cellspacing" SUMMARY="summary"> tag.
833 *
834 * @param border Border size.
835 * @param width Width of the table.
836 * @param cellpadding Cellpadding for the table cells.
837 * @param cellspacing Cellspacing for the table cells.
838 * @param summary Table summary.
839 */
840 public void table(int border, String width, int cellpadding,
841 int cellspacing, String summary) {
842 println(DocletConstants.NL +
843 "<TABLE BORDER=\"" + border +
844 "\" WIDTH=\"" + width +
845 "\" CELLPADDING=\"" + cellpadding +
846 "\" CELLSPACING=\"" + cellspacing +
847 "\" SUMMARY=\"" + summary + "\">");
848 }
850 /**
851 * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding"
852 * CELLSPACING="cellspacing"> tag.
853 *
854 * @param border Border size.
855 * @param cellpadding Cellpadding for the table cells.
856 * @param cellspacing Cellspacing for the table cells.
857 */
858 public void table(int border, int cellpadding, int cellspacing) {
859 println(DocletConstants.NL +
860 "<TABLE BORDER=\"" + border +
861 "\" CELLPADDING=\"" + cellpadding +
862 "\" CELLSPACING=\"" + cellspacing +
863 "\" SUMMARY=\"\">");
864 }
866 /**
867 * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding"
868 * CELLSPACING="cellspacing" SUMMARY="summary"> tag.
869 *
870 * @param border Border size.
871 * @param cellpadding Cellpadding for the table cells.
872 * @param cellspacing Cellspacing for the table cells.
873 * @param summary Table summary.
874 */
875 public void table(int border, int cellpadding, int cellspacing, String summary) {
876 println(DocletConstants.NL +
877 "<TABLE BORDER=\"" + border +
878 "\" CELLPADDING=\"" + cellpadding +
879 "\" CELLSPACING=\"" + cellspacing +
880 "\" SUMMARY=\"" + summary + "\">");
881 }
883 /**
884 * Print HTML <TABLE BORDER="border" WIDTH="width">
885 *
886 * @param border Border size.
887 * @param width Width of the table.
888 */
889 public void table(int border, String width) {
890 println(DocletConstants.NL +
891 "<TABLE BORDER=\"" + border +
892 "\" WIDTH=\"" + width +
893 "\" SUMMARY=\"\">");
894 }
896 /**
897 * Print the HTML table tag with border size 0 and width 100%.
898 */
899 public void table() {
900 table(0, "100%");
901 }
903 /**
904 * Print </TABLE> tag. Add a newline character at the end.
905 */
906 public void tableEnd() {
907 println("</TABLE>");
908 }
910 /**
911 * Print <TR> tag. Add a newline character at the end.
912 */
913 public void tr() {
914 println("<TR>");
915 }
917 /**
918 * Print </TR> tag. Add a newline character at the end.
919 */
920 public void trEnd() {
921 println("</TR>");
922 }
924 /**
925 * Print <TD> tag.
926 */
927 public void td() {
928 print("<TD>");
929 }
931 /**
932 * Print <TD NOWRAP> tag.
933 */
934 public void tdNowrap() {
935 print("<TD NOWRAP>");
936 }
938 /**
939 * Print <TD WIDTH="width"> tag.
940 *
941 * @param width String width.
942 */
943 public void tdWidth(String width) {
944 print("<TD WIDTH=\"" + width + "\">");
945 }
947 /**
948 * Print </TD> tag. Add a newline character at the end.
949 */
950 public void tdEnd() {
951 println("</TD>");
952 }
954 /**
955 * Print <LINK str> tag.
956 *
957 * @param str String.
958 */
959 public void link(String str) {
960 println("<LINK " + str + ">");
961 }
963 /**
964 * Print "<!-- " comment start string.
965 */
966 public void commentStart() {
967 print("<!-- ");
968 }
970 /**
971 * Print "-->" comment end string. Add a newline character at the end.
972 */
973 public void commentEnd() {
974 println("-->");
975 }
977 /**
978 * Print <CAPTION CLASS="stylename"> tag. Adds a newline character
979 * at the end.
980 *
981 * @param stylename style to be applied.
982 */
983 public void captionStyle(String stylename) {
984 println("<CAPTION CLASS=\"" + stylename + "\">");
985 }
987 /**
988 * Print </CAPTION> tag. Add a newline character at the end.
989 */
990 public void captionEnd() {
991 println("</CAPTION>");
992 }
994 /**
995 * Print <TR BGCOLOR="color" CLASS="stylename"> tag. Adds a newline character
996 * at the end.
997 *
998 * @param color String color.
999 * @param stylename String stylename.
1000 */
1001 public void trBgcolorStyle(String color, String stylename) {
1002 println("<TR BGCOLOR=\"" + color + "\" CLASS=\"" + stylename + "\">");
1003 }
1005 /**
1006 * Print <TR BGCOLOR="color"> tag. Adds a newline character at the end.
1007 *
1008 * @param color String color.
1009 */
1010 public void trBgcolor(String color) {
1011 println("<TR BGCOLOR=\"" + color + "\">");
1012 }
1014 /**
1015 * Print <TR ALIGN="align" VALIGN="valign"> tag. Adds a newline character
1016 * at the end.
1017 *
1018 * @param align String align.
1019 * @param valign String valign.
1020 */
1021 public void trAlignVAlign(String align, String valign) {
1022 println("<TR ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\">");
1023 }
1025 /**
1026 * Print <TH ALIGN="align"> tag.
1027 *
1028 * @param align the align attribute.
1029 */
1030 public void thAlign(String align) {
1031 print("<TH ALIGN=\"" + align + "\">");
1032 }
1034 /**
1035 * Print <TH CLASS="stylename" SCOPE="scope" NOWRAP> tag.
1036 *
1037 * @param stylename style to be applied.
1038 * @param scope the scope attribute.
1039 */
1040 public void thScopeNoWrap(String stylename, String scope) {
1041 print("<TH CLASS=\"" + stylename + "\" SCOPE=\"" + scope + "\" NOWRAP>");
1042 }
1044 /*
1045 * Returns a header for Modifier and Type column of a table.
1046 */
1047 public String getModifierTypeHeader() {
1048 return modifierTypeHeader;
1049 }
1051 /**
1052 * Print <TH align="align" COLSPAN=i> tag.
1053 *
1054 * @param align the align attribute.
1055 * @param i integer.
1056 */
1057 public void thAlignColspan(String align, int i) {
1058 print("<TH ALIGN=\"" + align + "\" COLSPAN=\"" + i + "\">");
1059 }
1061 /**
1062 * Print <TH align="align" NOWRAP> tag.
1063 *
1064 * @param align the align attribute.
1065 */
1066 public void thAlignNowrap(String align) {
1067 print("<TH ALIGN=\"" + align + "\" NOWRAP>");
1068 }
1070 /**
1071 * Print </TH> tag. Add a newline character at the end.
1072 */
1073 public void thEnd() {
1074 println("</TH>");
1075 }
1077 /**
1078 * Print <TD COLSPAN=i> tag.
1079 *
1080 * @param i integer.
1081 */
1082 public void tdColspan(int i) {
1083 print("<TD COLSPAN=" + i + ">");
1084 }
1086 /**
1087 * Print <TD BGCOLOR="color" CLASS="stylename"> tag.
1088 *
1089 * @param color String color.
1090 * @param stylename String stylename.
1091 */
1092 public void tdBgcolorStyle(String color, String stylename) {
1093 print("<TD BGCOLOR=\"" + color + "\" CLASS=\"" + stylename + "\">");
1094 }
1096 /**
1097 * Print <TD COLSPAN=i BGCOLOR="color" CLASS="stylename"> tag.
1098 *
1099 * @param i integer.
1100 * @param color String color.
1101 * @param stylename String stylename.
1102 */
1103 public void tdColspanBgcolorStyle(int i, String color, String stylename) {
1104 print("<TD COLSPAN=" + i + " BGCOLOR=\"" + color + "\" CLASS=\"" +
1105 stylename + "\">");
1106 }
1108 /**
1109 * Print <TD ALIGN="align"> tag. Adds a newline character
1110 * at the end.
1111 *
1112 * @param align String align.
1113 */
1114 public void tdAlign(String align) {
1115 print("<TD ALIGN=\"" + align + "\">");
1116 }
1118 /**
1119 * Print <TD ALIGN="align" CLASS="stylename"> tag.
1120 *
1121 * @param align String align.
1122 * @param stylename String stylename.
1123 */
1124 public void tdVAlignClass(String align, String stylename) {
1125 print("<TD VALIGN=\"" + align + "\" CLASS=\"" + stylename + "\">");
1126 }
1128 /**
1129 * Print <TD VALIGN="valign"> tag.
1130 *
1131 * @param valign String valign.
1132 */
1133 public void tdVAlign(String valign) {
1134 print("<TD VALIGN=\"" + valign + "\">");
1135 }
1137 /**
1138 * Print <TD ALIGN="align" VALIGN="valign"> tag.
1139 *
1140 * @param align String align.
1141 * @param valign String valign.
1142 */
1143 public void tdAlignVAlign(String align, String valign) {
1144 print("<TD ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\">");
1145 }
1147 /**
1148 * Print <TD ALIGN="align" ROWSPAN=rowspan> tag.
1149 *
1150 * @param align String align.
1151 * @param rowspan integer rowspan.
1152 */
1153 public void tdAlignRowspan(String align, int rowspan) {
1154 print("<TD ALIGN=\"" + align + "\" ROWSPAN=" + rowspan + ">");
1155 }
1157 /**
1158 * Print <TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan> tag.
1159 *
1160 * @param align String align.
1161 * @param valign String valign.
1162 * @param rowspan integer rowspan.
1163 */
1164 public void tdAlignVAlignRowspan(String align, String valign,
1165 int rowspan) {
1166 print("<TD ALIGN=\"" + align + "\" VALIGN=\"" + valign
1167 + "\" ROWSPAN=" + rowspan + ">");
1168 }
1170 /**
1171 * Print <BLOCKQUOTE> tag. Add a newline character at the end.
1172 */
1173 public void blockquote() {
1174 println("<BLOCKQUOTE>");
1175 }
1177 /**
1178 * Print </BLOCKQUOTE> tag. Add a newline character at the end.
1179 */
1180 public void blockquoteEnd() {
1181 println("</BLOCKQUOTE>");
1182 }
1184 /**
1185 * Get the "<CODE>" string.
1186 *
1187 * @return String Return String "<CODE>";
1188 */
1189 public String getCode() {
1190 return "<CODE>";
1191 }
1193 /**
1194 * Get the "</CODE>" string.
1195 *
1196 * @return String Return String "</CODE>";
1197 */
1198 public String getCodeEnd() {
1199 return "</CODE>";
1200 }
1202 /**
1203 * Print <NOFRAMES> tag. Add a newline character at the end.
1204 */
1205 public void noFrames() {
1206 println("<NOFRAMES>");
1207 }
1209 /**
1210 * Print </NOFRAMES> tag. Add a newline character at the end.
1211 */
1212 public void noFramesEnd() {
1213 println("</NOFRAMES>");
1214 }
1215 }