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

changeset 1365
2013982bee34
parent 1364
8db45b13526e
child 1372
78962d89f283
equal deleted inserted replaced
1364:8db45b13526e 1365:2013982bee34
30 import com.sun.tools.doclets.internal.toolkit.*; 30 import com.sun.tools.doclets.internal.toolkit.*;
31 import com.sun.tools.doclets.internal.toolkit.util.*; 31 import com.sun.tools.doclets.internal.toolkit.util.*;
32 32
33 /** 33 /**
34 * Class for the Html format code generation. 34 * Class for the Html format code generation.
35 * Initilizes PrintWriter with FileWriter, to enable print 35 * Initializes PrintWriter with FileWriter, to enable print
36 * related methods to generate the code to the named File through FileWriter. 36 * related methods to generate the code to the named File through FileWriter.
37 * 37 *
38 * <p><b>This is NOT part of any supported API. 38 * <p><b>This is NOT part of any supported API.
39 * If you write code that depends on this, you do so at your own risk. 39 * If you write code that depends on this, you do so at your own risk.
40 * This code and its internal interfaces are subject to change or 40 * This code and its internal interfaces are subject to change or
42 * 42 *
43 * @since 1.2 43 * @since 1.2
44 * @author Atul M Dambalkar 44 * @author Atul M Dambalkar
45 * @author Bhavesh Patel (Modified) 45 * @author Bhavesh Patel (Modified)
46 */ 46 */
47 public class HtmlWriter extends PrintWriter { 47 public class HtmlWriter {
48 48
49 /** 49 /**
50 * Name of the file, to which this writer is writing to. 50 * Name of the file, to which this writer is writing to.
51 */ 51 */
52 protected final String htmlFilename; 52 protected final String htmlFilename;
150 public final Content overridesLabel; 150 public final Content overridesLabel;
151 151
152 public final Content descfrmClassLabel; 152 public final Content descfrmClassLabel;
153 153
154 public final Content descfrmInterfaceLabel; 154 public final Content descfrmInterfaceLabel;
155
156 private final Writer writer;
155 157
156 /** 158 /**
157 * Constructor. 159 * Constructor.
158 * 160 *
159 * @param path The directory path to be created for this file 161 * @param path The directory path to be created for this file
167 * OutputStreamWriter is passed on to next level. 169 * OutputStreamWriter is passed on to next level.
168 */ 170 */
169 public HtmlWriter(Configuration configuration, 171 public HtmlWriter(Configuration configuration,
170 String path, String filename, String docencoding) 172 String path, String filename, String docencoding)
171 throws IOException, UnsupportedEncodingException { 173 throws IOException, UnsupportedEncodingException {
172 super(Util.genWriter(configuration, path, filename, docencoding)); 174 writer = Util.genWriter(configuration, path, filename, docencoding);
173 this.configuration = configuration; 175 this.configuration = configuration;
174 htmlFilename = filename; 176 htmlFilename = filename;
175 this.memberDetailsListPrinted = false; 177 this.memberDetailsListPrinted = false;
176 packageTableHeader = new String[] { 178 packageTableHeader = new String[] {
177 configuration.getText("doclet.Package"), 179 configuration.getText("doclet.Package"),
216 overridesLabel = getResource("doclet.Overrides"); 218 overridesLabel = getResource("doclet.Overrides");
217 descfrmClassLabel = getResource("doclet.Description_From_Class"); 219 descfrmClassLabel = getResource("doclet.Description_From_Class");
218 descfrmInterfaceLabel = getResource("doclet.Description_From_Interface"); 220 descfrmInterfaceLabel = getResource("doclet.Description_From_Interface");
219 } 221 }
220 222
223 public void write(Content c) throws IOException {
224 c.write(writer, true);
225 }
226
227 public void close() throws IOException {
228 writer.close();
229 }
230
221 /** 231 /**
222 * Get the configuration string as a content. 232 * Get the configuration string as a content.
223 * 233 *
224 * @param key the key to look for in the configuration file 234 * @param key the key to look for in the configuration file
225 * @return a content tree for the text 235 * @return a content tree for the text
247 * @param a2 string argument added to configuration text 257 * @param a2 string argument added to configuration text
248 * @return a content tree for the text 258 * @return a content tree for the text
249 */ 259 */
250 public Content getResource(String key, String a1, String a2) { 260 public Content getResource(String key, String a1, String a2) {
251 return new RawHtml(configuration.getText(key, a1, a2)); 261 return new RawHtml(configuration.getText(key, a1, a2));
252 }
253
254 /**
255 * Print &lt;HTML&gt; tag. Add a newline character at the end.
256 */
257 public void html() {
258 println("<HTML lang=\"" + configuration.getLocale().getLanguage() + "\">");
259 }
260
261 /**
262 * Print &lt;/HTML&gt; tag. Add a newline character at the end.
263 */
264 public void htmlEnd() {
265 println("</HTML>");
266 }
267
268 /**
269 * Print the script code to be embedded before the &lt;/HEAD&gt; tag.
270 */
271 protected void printWinTitleScript(String winTitle){
272 if(winTitle != null && winTitle.length() > 0) {
273 script();
274 println("function windowTitle()");
275 println("{");
276 println(" if (location.href.indexOf('is-external=true') == -1) {");
277 println(" parent.document.title=\"" + winTitle + "\";");
278 println(" }");
279 println("}");
280 scriptEnd();
281 noScript();
282 noScriptEnd();
283 }
284 } 262 }
285 263
286 /** 264 /**
287 * Returns an HtmlTree for the SCRIPT tag. 265 * Returns an HtmlTree for the SCRIPT tag.
288 * 266 *
324 script.addContent(scriptContent); 302 script.addContent(scriptContent);
325 return script; 303 return script;
326 } 304 }
327 305
328 /** 306 /**
329 * Print the Javascript &lt;SCRIPT&gt; start tag with its type
330 * attribute.
331 */
332 public void script() {
333 println("<SCRIPT type=\"text/javascript\">");
334 }
335
336 /**
337 * Print the Javascript &lt;/SCRIPT&gt; end tag.
338 */
339 public void scriptEnd() {
340 println("</SCRIPT>");
341 }
342
343 /**
344 * Print the Javascript &lt;NOSCRIPT&gt; start tag.
345 */
346 public void noScript() {
347 println("<NOSCRIPT>");
348 }
349
350 /**
351 * Print the Javascript &lt;/NOSCRIPT&gt; end tag.
352 */
353 public void noScriptEnd() {
354 println("</NOSCRIPT>");
355 }
356
357 /**
358 * Return the Javascript call to be embedded in the &lt;BODY&gt; tag.
359 * Return nothing if winTitle is empty.
360 * @return the Javascript call to be embedded in the &lt;BODY&gt; tag.
361 */
362 protected String getWindowTitleOnload(){
363 if(winTitle != null && winTitle.length() > 0) {
364 return " onload=\"windowTitle();\"";
365 } else {
366 return "";
367 }
368 }
369
370 /**
371 * Print &lt;BODY BGCOLOR="bgcolor"&gt;, including JavaScript
372 * "onload" call to load windowtitle script. This script shows the name
373 * of the document in the window title bar when frames are on.
374 *
375 * @param bgcolor Background color.
376 * @param includeScript boolean set true if printing windowtitle script
377 */
378 public void body(String bgcolor, boolean includeScript) {
379 print("<BODY BGCOLOR=\"" + bgcolor + "\"");
380 if (includeScript) {
381 print(getWindowTitleOnload());
382 }
383 println(">");
384 }
385
386 /**
387 * Returns an HtmlTree for the BODY tag. 307 * Returns an HtmlTree for the BODY tag.
388 * 308 *
389 * @param includeScript set true if printing windowtitle script 309 * @param includeScript set true if printing windowtitle script
390 * @param title title for the window 310 * @param title title for the window
391 * @return an HtmlTree for the BODY tag 311 * @return an HtmlTree for the BODY tag
404 } 324 }
405 return body; 325 return body;
406 } 326 }
407 327
408 /** 328 /**
409 * Print &lt;/BODY&gt; tag. Add a newline character at the end.
410 */
411 public void bodyEnd() {
412 println("</BODY>");
413 }
414
415 /**
416 * Print &lt;TITLE&gt; tag. Add a newline character at the end.
417 */
418 public void title() {
419 println("<TITLE>");
420 }
421
422 /**
423 * Print &lt;TITLE&gt; tag. Add a newline character at the end.
424 *
425 * @param winTitle The title of this document.
426 */
427 public void title(String winTitle) {
428 // Set window title string which is later printed
429 this.winTitle = winTitle;
430 title();
431 }
432
433 /**
434 * Returns an HtmlTree for the TITLE tag. 329 * Returns an HtmlTree for the TITLE tag.
435 * 330 *
436 * @return an HtmlTree for the TITLE tag 331 * @return an HtmlTree for the TITLE tag
437 */ 332 */
438 public HtmlTree getTitle() { 333 public HtmlTree getTitle() {
439 HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle)); 334 HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle));
440 return title; 335 return title;
441 } 336 }
442 337
443 /** 338 /**
444 * Print &lt;/TITLE&gt; tag. Add a newline character at the end.
445 */
446 public void titleEnd() {
447 println("</TITLE>");
448 }
449
450 /**
451 * Print &lt;UL&gt; tag. Add a newline character at the end.
452 */
453 public void ul() {
454 println("<UL>");
455 }
456
457 /**
458 * Print &lt;/UL&gt; tag. Add a newline character at the end.
459 */
460 public void ulEnd() {
461 println("</UL>");
462 }
463
464 /**
465 * Print &lt;LI&gt; tag.
466 */
467 public void li() {
468 print("<LI>");
469 }
470
471 /**
472 * Print &lt;LI TYPE="type"&gt; tag.
473 *
474 * @param type Type string.
475 */
476 public void li(String type) {
477 print("<LI TYPE=\"" + type + "\">");
478 }
479
480 /**
481 * Print &lt;H1&gt; tag. Add a newline character at the end.
482 */
483 public void h1() {
484 println("<H1>");
485 }
486
487 /**
488 * Print &lt;/H1&gt; tag. Add a newline character at the end.
489 */
490 public void h1End() {
491 println("</H1>");
492 }
493
494 /**
495 * Print text with &lt;H1&gt; tag. Also adds &lt;/H1&gt; tag. Add a newline character
496 * at the end of the text.
497 *
498 * @param text Text to be printed with &lt;H1&gt; format.
499 */
500 public void h1(String text) {
501 h1();
502 println(text);
503 h1End();
504 }
505
506 /**
507 * Print &lt;H2&gt; tag. Add a newline character at the end.
508 */
509 public void h2() {
510 println("<H2>");
511 }
512
513 /**
514 * Print text with &lt;H2&gt; tag. Also adds &lt;/H2&gt; tag. Add a newline character
515 * at the end of the text.
516 *
517 * @param text Text to be printed with &lt;H2&gt; format.
518 */
519 public void h2(String text) {
520 h2();
521 println(text);
522 h2End();
523 }
524
525 /**
526 * Print &lt;/H2&gt; tag. Add a newline character at the end.
527 */
528 public void h2End() {
529 println("</H2>");
530 }
531
532 /**
533 * Print &lt;H3&gt; tag. Add a newline character at the end.
534 */
535 public void h3() {
536 println("<H3>");
537 }
538
539 /**
540 * Print text with &lt;H3&gt; tag. Also adds &lt;/H3&gt; tag. Add a newline character
541 * at the end of the text.
542 *
543 * @param text Text to be printed with &lt;H3&gt; format.
544 */
545 public void h3(String text) {
546 h3();
547 println(text);
548 h3End();
549 }
550
551 /**
552 * Print &lt;/H3&gt; tag. Add a newline character at the end.
553 */
554 public void h3End() {
555 println("</H3>");
556 }
557
558 /**
559 * Print &lt;H4&gt; tag. Add a newline character at the end.
560 */
561 public void h4() {
562 println("<H4>");
563 }
564
565 /**
566 * Print &lt;/H4&gt; tag. Add a newline character at the end.
567 */
568 public void h4End() {
569 println("</H4>");
570 }
571
572 /**
573 * Print text with &lt;H4&gt; tag. Also adds &lt;/H4&gt; tag. Add a newline character
574 * at the end of the text.
575 *
576 * @param text Text to be printed with &lt;H4&gt; format.
577 */
578 public void h4(String text) {
579 h4();
580 println(text);
581 h4End();
582 }
583
584 /**
585 * Print &lt;H5&gt; tag. Add a newline character at the end.
586 */
587 public void h5() {
588 println("<H5>");
589 }
590
591 /**
592 * Print &lt;/H5&gt; tag. Add a newline character at the end.
593 */
594 public void h5End() {
595 println("</H5>");
596 }
597
598 /**
599 * Print HTML &lt;IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname&gt;
600 * tag. It prepends the "images" directory name to the "imggif". This
601 * method is used for oneone format generation. Add a newline character
602 * at the end.
603 *
604 * @param imggif Image GIF file.
605 * @param imgname Image name.
606 * @param width Width of the image.
607 * @param height Height of the image.
608 */
609 public void img(String imggif, String imgname, int width, int height) {
610 println("<IMG SRC=\"images/" + imggif + ".gif\""
611 + " WIDTH=\"" + width + "\" HEIGHT=\"" + height
612 + "\" ALT=\"" + imgname + "\">");
613 }
614
615 /**
616 * Print &lt;MENU&gt; tag. Add a newline character at the end.
617 */
618 public void menu() {
619 println("<MENU>");
620 }
621
622 /**
623 * Print &lt;/MENU&gt; tag. Add a newline character at the end.
624 */
625 public void menuEnd() {
626 println("</MENU>");
627 }
628
629 /**
630 * Print &lt;PRE&gt; tag. Add a newline character at the end.
631 */
632 public void pre() {
633 println("<PRE>");
634 }
635
636 /**
637 * Print &lt;PRE&gt; tag without adding new line character at th eend.
638 */
639 public void preNoNewLine() {
640 print("<PRE>");
641 }
642
643 /**
644 * Print &lt;/PRE&gt; tag. Add a newline character at the end.
645 */
646 public void preEnd() {
647 println("</PRE>");
648 }
649
650 /**
651 * Print &lt;HR&gt; tag. Add a newline character at the end.
652 */
653 public void hr() {
654 println("<HR>");
655 }
656
657 /**
658 * Print &lt;HR SIZE="size" WIDTH="widthpercent%"&gt; tag. Add a newline
659 * character at the end.
660 *
661 * @param size Size of the ruler.
662 * @param widthPercent Percentage Width of the ruler
663 */
664 public void hr(int size, int widthPercent) {
665 println("<HR SIZE=\"" + size + "\" WIDTH=\"" + widthPercent + "%\">");
666 }
667
668 /**
669 * Print &lt;HR SIZE="size" NOSHADE&gt; tag. Add a newline character at the end.
670 *
671 * @param size Size of the ruler.
672 * @param noshade noshade string.
673 */
674 public void hr(int size, String noshade) {
675 println("<HR SIZE=\"" + size + "\" NOSHADE>");
676 }
677
678 /**
679 * Get the "&lt;STRONG&gt;" string.
680 *
681 * @return String Return String "&lt;STRONG&gt;";
682 */
683 public String getStrong() {
684 return "<STRONG>";
685 }
686
687 /**
688 * Get the "&lt;/STRONG&gt;" string.
689 *
690 * @return String Return String "&lt;/STRONG&gt;";
691 */
692 public String getStrongEnd() {
693 return "</STRONG>";
694 }
695
696 /**
697 * Print &lt;STRONG&gt; tag.
698 */
699 public void strong() {
700 print("<STRONG>");
701 }
702
703 /**
704 * Print &lt;/STRONG&gt; tag.
705 */
706 public void strongEnd() {
707 print("</STRONG>");
708 }
709
710 /**
711 * Print text passed, in strong format using &lt;STRONG&gt; and &lt;/STRONG&gt; tags.
712 *
713 * @param text String to be printed in between &lt;STRONG&gt; and &lt;/STRONG&gt; tags.
714 */
715 public void strong(String text) {
716 strong();
717 print(text);
718 strongEnd();
719 }
720
721 /**
722 * Print text passed, in Italics using &lt;I&gt; and &lt;/I&gt; tags.
723 *
724 * @param text String to be printed in between &lt;I&gt; and &lt;/I&gt; tags.
725 */
726 public void italics(String text) {
727 print("<I>");
728 print(text);
729 println("</I>");
730 }
731
732 /**
733 * Return, text passed, with Italics &lt;i&gt; and &lt;/i&gt; tags, surrounding it. 339 * Return, text passed, with Italics &lt;i&gt; and &lt;/i&gt; tags, surrounding it.
734 * So if the text passed is "Hi", then string returned will be "&lt;i&gt;Hi&lt;/i&gt;". 340 * So if the text passed is "Hi", then string returned will be "&lt;i&gt;Hi&lt;/i&gt;".
735 * 341 *
736 * @param text String to be printed in between &lt;I&gt; and &lt;/I&gt; tags. 342 * @param text String to be printed in between &lt;I&gt; and &lt;/I&gt; tags.
737 */ 343 */
742 public String codeText(String text) { 348 public String codeText(String text) {
743 return "<code>" + text + "</code>"; 349 return "<code>" + text + "</code>";
744 } 350 }
745 351
746 /** 352 /**
747 * Print "&#38;nbsp;", non-breaking space.
748 */
749 public void space() {
750 print("&nbsp;");
751 }
752
753 /**
754 * Return "&#38;nbsp;", non-breaking space. 353 * Return "&#38;nbsp;", non-breaking space.
755 */ 354 */
756 public Content getSpace() { 355 public Content getSpace() {
757 return RawHtml.nbsp; 356 return RawHtml.nbsp;
758 } 357 }
759 358
760 /**
761 * Print &lt;DL&gt; tag. Add a newline character at the end.
762 */
763 public void dl() {
764 println("<DL>");
765 }
766
767 /**
768 * Print &lt;/DL&gt; tag. Add a newline character at the end.
769 */
770 public void dlEnd() {
771 println("</DL>");
772 }
773
774 /**
775 * Print &lt;DT&gt; tag.
776 */
777 public void dt() {
778 print("<DT>");
779 }
780
781 /**
782 * Print &lt;/DT&gt; tag.
783 */
784 public void dtEnd() {
785 print("</DT>");
786 }
787
788 /**
789 * Print &lt;DD&gt; tag.
790 */
791 public void dd() {
792 print("<DD>");
793 }
794
795 /**
796 * Print &lt;/DD&gt; tag. Add a newline character at the end.
797 */
798 public void ddEnd() {
799 println("</DD>");
800 }
801
802 /**
803 * Print &lt;SUP&gt; tag. Add a newline character at the end.
804 */
805 public void sup() {
806 println("<SUP>");
807 }
808
809 /**
810 * Print &lt;/SUP&gt; tag. Add a newline character at the end.
811 */
812 public void supEnd() {
813 println("</SUP>");
814 }
815
816 /**
817 * Print &lt;FONT SIZE="size"&gt; tag. Add a newline character at the end.
818 *
819 * @param size String size.
820 */
821 public void font(String size) {
822 println("<FONT SIZE=\"" + size + "\">");
823 }
824
825 /**
826 * Print &lt;FONT SIZE="size"&gt; tag.
827 *
828 * @param size String size.
829 */
830 public void fontNoNewLine(String size) {
831 print("<FONT SIZE=\"" + size + "\">");
832 }
833
834 /**
835 * Print &lt;FONT CLASS="stylename"&gt; tag. Add a newline character at the end.
836 *
837 * @param stylename String stylename.
838 */
839 public void fontStyle(String stylename) {
840 print("<FONT CLASS=\"" + stylename + "\">");
841 }
842
843 /**
844 * Print &lt;FONT SIZE="size" CLASS="stylename"&gt; tag. Add a newline character
845 * at the end.
846 *
847 * @param size String size.
848 * @param stylename String stylename.
849 */
850 public void fontSizeStyle(String size, String stylename) {
851 println("<FONT size=\"" + size + "\" CLASS=\"" + stylename + "\">");
852 }
853
854 /**
855 * Print &lt;/FONT&gt; tag.
856 */
857 public void fontEnd() {
858 print("</FONT>");
859 }
860
861 /**
862 * Get the "&lt;FONT COLOR="color"&gt;" string.
863 *
864 * @param color String color.
865 * @return String Return String "&lt;FONT COLOR="color"&gt;".
866 */
867 public String getFontColor(String color) {
868 return "<FONT COLOR=\"" + color + "\">";
869 }
870
871 /**
872 * Get the "&lt;/FONT&gt;" string.
873 *
874 * @return String Return String "&lt;/FONT&gt;";
875 */
876 public String getFontEnd() {
877 return "</FONT>";
878 }
879
880 /**
881 * Print &lt;CENTER&gt; tag. Add a newline character at the end.
882 */
883 public void center() {
884 println("<CENTER>");
885 }
886
887 /**
888 * Print &lt;/CENTER&gt; tag. Add a newline character at the end.
889 */
890 public void centerEnd() {
891 println("</CENTER>");
892 }
893
894 /**
895 * Print anchor &lt;A NAME="name"&gt; tag.
896 *
897 * @param name Name String.
898 */
899 public void aName(String name) {
900 print("<A NAME=\"" + name + "\">");
901 }
902
903 /**
904 * Print &lt;/A&gt; tag.
905 */
906 public void aEnd() {
907 print("</A>");
908 }
909
910 /**
911 * Print &lt;I&gt; tag.
912 */
913 public void italic() {
914 print("<I>");
915 }
916
917 /**
918 * Print &lt;/I&gt; tag.
919 */
920 public void italicEnd() {
921 print("</I>");
922 }
923
924 /**
925 * Print contents within anchor &lt;A NAME="name"&gt; tags.
926 *
927 * @param name String name.
928 * @param content String contents.
929 */
930 public void anchor(String name, String content) {
931 aName(name);
932 print(content);
933 aEnd();
934 }
935
936 /**
937 * Print anchor &lt;A NAME="name"&gt; and &lt;/A&gt;tags. Print comment string
938 * "&lt;!-- --&gt;" within those tags.
939 *
940 * @param name String name.
941 */
942 public void anchor(String name) {
943 anchor(name, "<!-- -->");
944 }
945
946 /**
947 * Print newline and then print &lt;P&gt; tag. Add a newline character at the
948 * end.
949 */
950 public void p() {
951 println();
952 println("<P>");
953 }
954
955 /**
956 * Print newline and then print &lt;/P&gt; tag. Add a newline character at the
957 * end.
958 */
959 public void pEnd() {
960 println();
961 println("</P>");
962 }
963
964 /**
965 * Print newline and then print &lt;BR&gt; tag. Add a newline character at the
966 * end.
967 */
968 public void br() {
969 println();
970 println("<BR>");
971 }
972
973 /**
974 * Print &lt;ADDRESS&gt; tag. Add a newline character at the end.
975 */
976 public void address() {
977 println("<ADDRESS>");
978 }
979
980 /**
981 * Print &lt;/ADDRESS&gt; tag. Add a newline character at the end.
982 */
983 public void addressEnd() {
984 println("</ADDRESS>");
985 }
986
987 /**
988 * Print &lt;HEAD&gt; tag. Add a newline character at the end.
989 */
990 public void head() {
991 println("<HEAD>");
992 }
993
994 /**
995 * Print &lt;/HEAD&gt; tag. Add a newline character at the end.
996 */
997 public void headEnd() {
998 println("</HEAD>");
999 }
1000
1001 /**
1002 * Print &lt;CODE&gt; tag.
1003 */
1004 public void code() {
1005 print("<CODE>");
1006 }
1007
1008 /**
1009 * Print &lt;/CODE&gt; tag.
1010 */
1011 public void codeEnd() {
1012 print("</CODE>");
1013 }
1014
1015 /**
1016 * Print &lt;EM&gt; tag. Add a newline character at the end.
1017 */
1018 public void em() {
1019 println("<EM>");
1020 }
1021
1022 /**
1023 * Print &lt;/EM&gt; tag. Add a newline character at the end.
1024 */
1025 public void emEnd() {
1026 println("</EM>");
1027 }
1028
1029 /**
1030 * Print HTML &lt;TABLE BORDER="border" WIDTH="width"
1031 * CELLPADDING="cellpadding" CELLSPACING="cellspacing"&gt; tag.
1032 *
1033 * @param border Border size.
1034 * @param width Width of the table.
1035 * @param cellpadding Cellpadding for the table cells.
1036 * @param cellspacing Cellspacing for the table cells.
1037 */
1038 public void table(int border, String width, int cellpadding,
1039 int cellspacing) {
1040 println(DocletConstants.NL +
1041 "<TABLE BORDER=\"" + border +
1042 "\" WIDTH=\"" + width +
1043 "\" CELLPADDING=\"" + cellpadding +
1044 "\" CELLSPACING=\"" + cellspacing +
1045 "\" SUMMARY=\"\">");
1046 }
1047
1048 /**
1049 * Print HTML &lt;TABLE BORDER="border" WIDTH="width"
1050 * CELLPADDING="cellpadding" CELLSPACING="cellspacing" SUMMARY="summary"&gt; tag.
1051 *
1052 * @param border Border size.
1053 * @param width Width of the table.
1054 * @param cellpadding Cellpadding for the table cells.
1055 * @param cellspacing Cellspacing for the table cells.
1056 * @param summary Table summary.
1057 */
1058 public void table(int border, String width, int cellpadding,
1059 int cellspacing, String summary) {
1060 println(DocletConstants.NL +
1061 "<TABLE BORDER=\"" + border +
1062 "\" WIDTH=\"" + width +
1063 "\" CELLPADDING=\"" + cellpadding +
1064 "\" CELLSPACING=\"" + cellspacing +
1065 "\" SUMMARY=\"" + summary + "\">");
1066 }
1067
1068 /**
1069 * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
1070 * CELLSPACING="cellspacing"&gt; tag.
1071 *
1072 * @param border Border size.
1073 * @param cellpadding Cellpadding for the table cells.
1074 * @param cellspacing Cellspacing for the table cells.
1075 */
1076 public void table(int border, int cellpadding, int cellspacing) {
1077 println(DocletConstants.NL +
1078 "<TABLE BORDER=\"" + border +
1079 "\" CELLPADDING=\"" + cellpadding +
1080 "\" CELLSPACING=\"" + cellspacing +
1081 "\" SUMMARY=\"\">");
1082 }
1083
1084 /**
1085 * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
1086 * CELLSPACING="cellspacing" SUMMARY="summary"&gt; tag.
1087 *
1088 * @param border Border size.
1089 * @param cellpadding Cellpadding for the table cells.
1090 * @param cellspacing Cellspacing for the table cells.
1091 * @param summary Table summary.
1092 */
1093 public void table(int border, int cellpadding, int cellspacing, String summary) {
1094 println(DocletConstants.NL +
1095 "<TABLE BORDER=\"" + border +
1096 "\" CELLPADDING=\"" + cellpadding +
1097 "\" CELLSPACING=\"" + cellspacing +
1098 "\" SUMMARY=\"" + summary + "\">");
1099 }
1100
1101 /**
1102 * Print HTML &lt;TABLE BORDER="border" WIDTH="width"&gt;
1103 *
1104 * @param border Border size.
1105 * @param width Width of the table.
1106 */
1107 public void table(int border, String width) {
1108 println(DocletConstants.NL +
1109 "<TABLE BORDER=\"" + border +
1110 "\" WIDTH=\"" + width +
1111 "\" SUMMARY=\"\">");
1112 }
1113
1114 /**
1115 * Print the HTML table tag with border size 0 and width 100%.
1116 */
1117 public void table() {
1118 table(0, "100%");
1119 }
1120
1121 /**
1122 * Print &lt;/TABLE&gt; tag. Add a newline character at the end.
1123 */
1124 public void tableEnd() {
1125 println("</TABLE>");
1126 }
1127
1128 /**
1129 * Print &lt;TR&gt; tag. Add a newline character at the end.
1130 */
1131 public void tr() {
1132 println("<TR>");
1133 }
1134
1135 /**
1136 * Print &lt;/TR&gt; tag. Add a newline character at the end.
1137 */
1138 public void trEnd() {
1139 println("</TR>");
1140 }
1141
1142 /**
1143 * Print &lt;TD&gt; tag.
1144 */
1145 public void td() {
1146 print("<TD>");
1147 }
1148
1149 /**
1150 * Print &lt;TD NOWRAP&gt; tag.
1151 */
1152 public void tdNowrap() {
1153 print("<TD NOWRAP>");
1154 }
1155
1156 /**
1157 * Print &lt;TD WIDTH="width"&gt; tag.
1158 *
1159 * @param width String width.
1160 */
1161 public void tdWidth(String width) {
1162 print("<TD WIDTH=\"" + width + "\">");
1163 }
1164
1165 /**
1166 * Print &lt;/TD&gt; tag. Add a newline character at the end.
1167 */
1168 public void tdEnd() {
1169 println("</TD>");
1170 }
1171
1172 /**
1173 * Print &lt;LINK str&gt; tag.
1174 *
1175 * @param str String.
1176 */
1177 public void link(String str) {
1178 println("<LINK " + str + ">");
1179 }
1180
1181 /**
1182 * Print "&lt;!-- " comment start string.
1183 */
1184 public void commentStart() {
1185 print("<!-- ");
1186 }
1187
1188 /**
1189 * Print "--&gt;" comment end string. Add a newline character at the end.
1190 */
1191 public void commentEnd() {
1192 println("-->");
1193 }
1194
1195 /**
1196 * Print &lt;CAPTION CLASS="stylename"&gt; tag. Adds a newline character
1197 * at the end.
1198 *
1199 * @param stylename style to be applied.
1200 */
1201 public void captionStyle(String stylename) {
1202 println("<CAPTION CLASS=\"" + stylename + "\">");
1203 }
1204
1205 /**
1206 * Print &lt;/CAPTION&gt; tag. Add a newline character at the end.
1207 */
1208 public void captionEnd() {
1209 println("</CAPTION>");
1210 }
1211
1212 /**
1213 * Print &lt;TR BGCOLOR="color" CLASS="stylename"&gt; tag. Adds a newline character
1214 * at the end.
1215 *
1216 * @param color String color.
1217 * @param stylename String stylename.
1218 */
1219 public void trBgcolorStyle(String color, String stylename) {
1220 println("<TR BGCOLOR=\"" + color + "\" CLASS=\"" + stylename + "\">");
1221 }
1222
1223 /**
1224 * Print &lt;TR BGCOLOR="color"&gt; tag. Adds a newline character at the end.
1225 *
1226 * @param color String color.
1227 */
1228 public void trBgcolor(String color) {
1229 println("<TR BGCOLOR=\"" + color + "\">");
1230 }
1231
1232 /**
1233 * Print &lt;TR ALIGN="align" VALIGN="valign"&gt; tag. Adds a newline character
1234 * at the end.
1235 *
1236 * @param align String align.
1237 * @param valign String valign.
1238 */
1239 public void trAlignVAlign(String align, String valign) {
1240 println("<TR ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\">");
1241 }
1242
1243 /**
1244 * Print &lt;TH ALIGN="align"&gt; tag.
1245 *
1246 * @param align the align attribute.
1247 */
1248 public void thAlign(String align) {
1249 print("<TH ALIGN=\"" + align + "\">");
1250 }
1251
1252 /**
1253 * Print &lt;TH CLASS="stylename" SCOPE="scope" NOWRAP&gt; tag.
1254 *
1255 * @param stylename style to be applied.
1256 * @param scope the scope attribute.
1257 */
1258 public void thScopeNoWrap(String stylename, String scope) {
1259 print("<TH CLASS=\"" + stylename + "\" SCOPE=\"" + scope + "\" NOWRAP>");
1260 }
1261
1262 /* 359 /*
1263 * Returns a header for Modifier and Type column of a table. 360 * Returns a header for Modifier and Type column of a table.
1264 */ 361 */
1265 public String getModifierTypeHeader() { 362 public String getModifierTypeHeader() {
1266 return modifierTypeHeader; 363 return modifierTypeHeader;
1267 } 364 }
1268
1269 /**
1270 * Print &lt;TH align="align" COLSPAN=i&gt; tag.
1271 *
1272 * @param align the align attribute.
1273 * @param i integer.
1274 */
1275 public void thAlignColspan(String align, int i) {
1276 print("<TH ALIGN=\"" + align + "\" COLSPAN=\"" + i + "\">");
1277 }
1278
1279 /**
1280 * Print &lt;TH align="align" NOWRAP&gt; tag.
1281 *
1282 * @param align the align attribute.
1283 */
1284 public void thAlignNowrap(String align) {
1285 print("<TH ALIGN=\"" + align + "\" NOWRAP>");
1286 }
1287
1288 /**
1289 * Print &lt;/TH&gt; tag. Add a newline character at the end.
1290 */
1291 public void thEnd() {
1292 println("</TH>");
1293 }
1294
1295 /**
1296 * Print &lt;TD COLSPAN=i&gt; tag.
1297 *
1298 * @param i integer.
1299 */
1300 public void tdColspan(int i) {
1301 print("<TD COLSPAN=" + i + ">");
1302 }
1303
1304 /**
1305 * Print &lt;TD BGCOLOR="color" CLASS="stylename"&gt; tag.
1306 *
1307 * @param color String color.
1308 * @param stylename String stylename.
1309 */
1310 public void tdBgcolorStyle(String color, String stylename) {
1311 print("<TD BGCOLOR=\"" + color + "\" CLASS=\"" + stylename + "\">");
1312 }
1313
1314 /**
1315 * Print &lt;TD COLSPAN=i BGCOLOR="color" CLASS="stylename"&gt; tag.
1316 *
1317 * @param i integer.
1318 * @param color String color.
1319 * @param stylename String stylename.
1320 */
1321 public void tdColspanBgcolorStyle(int i, String color, String stylename) {
1322 print("<TD COLSPAN=" + i + " BGCOLOR=\"" + color + "\" CLASS=\"" +
1323 stylename + "\">");
1324 }
1325
1326 /**
1327 * Print &lt;TD ALIGN="align"&gt; tag. Adds a newline character
1328 * at the end.
1329 *
1330 * @param align String align.
1331 */
1332 public void tdAlign(String align) {
1333 print("<TD ALIGN=\"" + align + "\">");
1334 }
1335
1336 /**
1337 * Print &lt;TD ALIGN="align" CLASS="stylename"&gt; tag.
1338 *
1339 * @param align String align.
1340 * @param stylename String stylename.
1341 */
1342 public void tdVAlignClass(String align, String stylename) {
1343 print("<TD VALIGN=\"" + align + "\" CLASS=\"" + stylename + "\">");
1344 }
1345
1346 /**
1347 * Print &lt;TD VALIGN="valign"&gt; tag.
1348 *
1349 * @param valign String valign.
1350 */
1351 public void tdVAlign(String valign) {
1352 print("<TD VALIGN=\"" + valign + "\">");
1353 }
1354
1355 /**
1356 * Print &lt;TD ALIGN="align" VALIGN="valign"&gt; tag.
1357 *
1358 * @param align String align.
1359 * @param valign String valign.
1360 */
1361 public void tdAlignVAlign(String align, String valign) {
1362 print("<TD ALIGN=\"" + align + "\" VALIGN=\"" + valign + "\">");
1363 }
1364
1365 /**
1366 * Print &lt;TD ALIGN="align" ROWSPAN=rowspan&gt; tag.
1367 *
1368 * @param align String align.
1369 * @param rowspan integer rowspan.
1370 */
1371 public void tdAlignRowspan(String align, int rowspan) {
1372 print("<TD ALIGN=\"" + align + "\" ROWSPAN=" + rowspan + ">");
1373 }
1374
1375 /**
1376 * Print &lt;TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan&gt; tag.
1377 *
1378 * @param align String align.
1379 * @param valign String valign.
1380 * @param rowspan integer rowspan.
1381 */
1382 public void tdAlignVAlignRowspan(String align, String valign,
1383 int rowspan) {
1384 print("<TD ALIGN=\"" + align + "\" VALIGN=\"" + valign
1385 + "\" ROWSPAN=" + rowspan + ">");
1386 }
1387
1388 /**
1389 * Print &lt;BLOCKQUOTE&gt; tag. Add a newline character at the end.
1390 */
1391 public void blockquote() {
1392 println("<BLOCKQUOTE>");
1393 }
1394
1395 /**
1396 * Print &lt;/BLOCKQUOTE&gt; tag. Add a newline character at the end.
1397 */
1398 public void blockquoteEnd() {
1399 println("</BLOCKQUOTE>");
1400 }
1401
1402 /**
1403 * Get the "&lt;code&gt;" string.
1404 *
1405 * @return String Return String "&lt;code&gt;";
1406 */
1407 public String getCode() {
1408 return "<code>";
1409 }
1410
1411 /**
1412 * Get the "&lt;/code&gt;" string.
1413 *
1414 * @return String Return String "&lt;/code&gt;";
1415 */
1416 public String getCodeEnd() {
1417 return "</code>";
1418 }
1419
1420 /**
1421 * Print &lt;NOFRAMES&gt; tag. Add a newline character at the end.
1422 */
1423 public void noFrames() {
1424 println("<NOFRAMES>");
1425 }
1426
1427 /**
1428 * Print &lt;/NOFRAMES&gt; tag. Add a newline character at the end.
1429 */
1430 public void noFramesEnd() {
1431 println("</NOFRAMES>");
1432 }
1433 } 365 }

mercurial