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

changeset 243
edd944553131
parent 240
8c55d5b0ed71
child 554
9d9f26857129
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Tue Mar 17 11:28:24 2009 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Mar 19 19:00:54 2009 -0700
     1.3 @@ -37,6 +37,7 @@
     1.4   *
     1.5   * @since 1.2
     1.6   * @author Atul M Dambalkar
     1.7 + * @author Bhavesh Patel (Modified)
     1.8   */
     1.9  public class HtmlWriter extends PrintWriter {
    1.10  
    1.11 @@ -67,6 +68,21 @@
    1.12      protected boolean memberDetailsListPrinted;
    1.13  
    1.14      /**
    1.15 +     * Header for tables displaying packages and description..
    1.16 +     */
    1.17 +    protected final String[] packageTableHeader;
    1.18 +
    1.19 +    /**
    1.20 +     * Summary for use tables displaying class and package use.
    1.21 +     */
    1.22 +    protected final String useTableSummary;
    1.23 +
    1.24 +    /**
    1.25 +     * Column header for class docs displaying Modifier and Type header.
    1.26 +     */
    1.27 +    protected final String modifierTypeHeader;
    1.28 +
    1.29 +    /**
    1.30       * Constructor.
    1.31       *
    1.32       * @param path The directory path to be created for this file
    1.33 @@ -86,6 +102,15 @@
    1.34          this.configuration = configuration;
    1.35          htmlFilename = filename;
    1.36          this.memberDetailsListPrinted = false;
    1.37 +        packageTableHeader = new String[] {
    1.38 +            configuration.getText("doclet.Package"),
    1.39 +            configuration.getText("doclet.Description")
    1.40 +        };
    1.41 +        useTableSummary = configuration.getText("doclet.Use_Table_Summary",
    1.42 +                configuration.getText("doclet.packages"));
    1.43 +        modifierTypeHeader = configuration.getText("doclet.0_and_1",
    1.44 +                configuration.getText("doclet.Modifier"),
    1.45 +                configuration.getText("doclet.Type"));
    1.46      }
    1.47  
    1.48      /**
    1.49 @@ -803,6 +828,26 @@
    1.50      }
    1.51  
    1.52      /**
    1.53 +     * Print HTML <TABLE BORDER="border" WIDTH="width"
    1.54 +     * CELLPADDING="cellpadding" CELLSPACING="cellspacing" SUMMARY="summary"> tag.
    1.55 +     *
    1.56 +     * @param border       Border size.
    1.57 +     * @param width        Width of the table.
    1.58 +     * @param cellpadding  Cellpadding for the table cells.
    1.59 +     * @param cellspacing  Cellspacing for the table cells.
    1.60 +     * @param summary      Table summary.
    1.61 +     */
    1.62 +    public void table(int border, String width, int cellpadding,
    1.63 +                      int cellspacing, String summary) {
    1.64 +        println(DocletConstants.NL +
    1.65 +                "<TABLE BORDER=\"" + border +
    1.66 +                "\" WIDTH=\"" + width +
    1.67 +                "\" CELLPADDING=\"" + cellpadding +
    1.68 +                "\" CELLSPACING=\"" + cellspacing +
    1.69 +                "\" SUMMARY=\"" + summary + "\">");
    1.70 +    }
    1.71 +
    1.72 +    /**
    1.73       * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
    1.74       * CELLSPACING="cellspacing"&gt; tag.
    1.75       *
    1.76 @@ -819,6 +864,23 @@
    1.77      }
    1.78  
    1.79      /**
    1.80 +     * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
    1.81 +     * CELLSPACING="cellspacing" SUMMARY="summary"&gt; tag.
    1.82 +     *
    1.83 +     * @param border       Border size.
    1.84 +     * @param cellpadding  Cellpadding for the table cells.
    1.85 +     * @param cellspacing  Cellspacing for the table cells.
    1.86 +     * @param summary      Table summary.
    1.87 +     */
    1.88 +    public void table(int border, int cellpadding, int cellspacing, String summary) {
    1.89 +        println(DocletConstants.NL +
    1.90 +                "<TABLE BORDER=\"" + border +
    1.91 +                "\" CELLPADDING=\"" + cellpadding +
    1.92 +                "\" CELLSPACING=\"" + cellspacing +
    1.93 +                "\" SUMMARY=\"" + summary + "\">");
    1.94 +    }
    1.95 +
    1.96 +    /**
    1.97       * Print HTML &lt;TABLE BORDER="border" WIDTH="width"&gt;
    1.98       *
    1.99       * @param border       Border size.
   1.100 @@ -913,6 +975,23 @@
   1.101      }
   1.102  
   1.103      /**
   1.104 +     * Print &lt;CAPTION CLASS="stylename"&gt; tag. Adds a newline character
   1.105 +     * at the end.
   1.106 +     *
   1.107 +     * @param stylename style to be applied.
   1.108 +     */
   1.109 +    public void captionStyle(String stylename) {
   1.110 +        println("<CAPTION CLASS=\"" + stylename + "\">");
   1.111 +    }
   1.112 +
   1.113 +    /**
   1.114 +     * Print &lt;/CAPTION&gt; tag. Add a newline character at the end.
   1.115 +     */
   1.116 +    public void captionEnd() {
   1.117 +        println("</CAPTION>");
   1.118 +    }
   1.119 +
   1.120 +    /**
   1.121       * Print &lt;TR BGCOLOR="color" CLASS="stylename"&gt; tag. Adds a newline character
   1.122       * at the end.
   1.123       *
   1.124 @@ -953,6 +1032,23 @@
   1.125      }
   1.126  
   1.127      /**
   1.128 +     * Print &lt;TH CLASS="stylename" SCOPE="scope" NOWRAP&gt; tag.
   1.129 +     *
   1.130 +     * @param stylename style to be applied.
   1.131 +     * @param scope the scope attribute.
   1.132 +     */
   1.133 +    public void thScopeNoWrap(String stylename, String scope) {
   1.134 +        print("<TH CLASS=\"" + stylename + "\" SCOPE=\"" + scope + "\" NOWRAP>");
   1.135 +    }
   1.136 +
   1.137 +    /*
   1.138 +     * Returns a header for Modifier and Type column of a table.
   1.139 +     */
   1.140 +    public String getModifierTypeHeader() {
   1.141 +        return modifierTypeHeader;
   1.142 +    }
   1.143 +
   1.144 +    /**
   1.145       * Print &lt;TH align="align" COLSPAN=i&gt; tag.
   1.146       *
   1.147       * @param align the align attribute.

mercurial