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

changeset 233
5240b1120530
parent 182
47a62d8d98b4
child 554
9d9f26857129
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Tue Feb 24 17:48:53 2009 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Fri Feb 27 18:57:17 2009 -0800
     1.3 @@ -25,17 +25,18 @@
     1.4  
     1.5  package com.sun.tools.doclets.formats.html;
     1.6  
     1.7 +import com.sun.javadoc.*;
     1.8  import com.sun.tools.doclets.internal.toolkit.*;
     1.9  import com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder;
    1.10  import com.sun.tools.doclets.internal.toolkit.taglets.*;
    1.11  import com.sun.tools.doclets.internal.toolkit.util.*;
    1.12 -import com.sun.javadoc.*;
    1.13  
    1.14  /**
    1.15   * The taglet writer that writes HTML.
    1.16   *
    1.17   * @since 1.5
    1.18   * @author Jamie Ho
    1.19 + * @author Bhavesh Patel (Modified)
    1.20   */
    1.21  
    1.22  public class TagletWriterImpl extends TagletWriter {
    1.23 @@ -99,11 +100,12 @@
    1.24                      output.append(DocletConstants.NL + "<P>" +
    1.25                          DocletConstants.NL);
    1.26                  }
    1.27 +                output.append("</DD>");
    1.28              } else {
    1.29                  if (Util.isDeprecated(member.containingClass())) {
    1.30                      output.append("<DD><STRONG>" +
    1.31                      ConfigurationImpl.getInstance().
    1.32 -                            getText("doclet.Deprecated") + "</STRONG>&nbsp;");
    1.33 +                            getText("doclet.Deprecated") + "</STRONG>&nbsp;</DD>");
    1.34                  }
    1.35              }
    1.36          }
    1.37 @@ -123,7 +125,7 @@
    1.38      public TagletOutput getParamHeader(String header) {
    1.39          StringBuffer result = new StringBuffer();
    1.40          result.append("<DT>");
    1.41 -        result.append("<STRONG>" +  header + "</STRONG>");
    1.42 +        result.append("<STRONG>" +  header + "</STRONG></DT>");
    1.43          return new TagletOutputImpl(result.toString());
    1.44      }
    1.45  
    1.46 @@ -132,7 +134,7 @@
    1.47       */
    1.48      public TagletOutput paramTagOutput(ParamTag paramTag, String paramName) {
    1.49          TagletOutput result = new TagletOutputImpl("<DD><CODE>" + paramName + "</CODE>"
    1.50 -         + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false));
    1.51 +         + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "</DD>");
    1.52          return result;
    1.53      }
    1.54  
    1.55 @@ -142,9 +144,9 @@
    1.56      public TagletOutput returnTagOutput(Tag returnTag) {
    1.57          TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "<DT>" +
    1.58              "<STRONG>" + htmlWriter.configuration.getText("doclet.Returns") +
    1.59 -            "</STRONG>" + "<DD>" +
    1.60 +            "</STRONG>" + "</DT>" + "<DD>" +
    1.61              htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(),
    1.62 -            false));
    1.63 +            false) + "</DD>");
    1.64          return result;
    1.65      }
    1.66  
    1.67 @@ -174,22 +176,21 @@
    1.68          }
    1.69          if (holder.isClass() && ((ClassDoc)holder).isSerializable()) {
    1.70              //Automatically add link to serialized form page for serializable classes.
    1.71 -            if (!(SerializedFormBuilder.serialInclude(holder) &&
    1.72 +            if ((SerializedFormBuilder.serialInclude(holder) &&
    1.73                        SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) {
    1.74 -                return result.equals("") ? null : new TagletOutputImpl(result);
    1.75 +                result = addSeeHeader(result);
    1.76 +                result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html",
    1.77 +                        ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
    1.78              }
    1.79 -            result = addSeeHeader(result);
    1.80 -            result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html",
    1.81 -                ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
    1.82          }
    1.83 -        return result.equals("") ? null : new TagletOutputImpl(result);
    1.84 +        return result.equals("") ? null : new TagletOutputImpl(result + "</DD>");
    1.85      }
    1.86  
    1.87      private String addSeeHeader(String result) {
    1.88          if (result != null && result.length() > 0) {
    1.89              return result + ", " + DocletConstants.NL;
    1.90          } else {
    1.91 -            return "<DT><STRONG>" + htmlWriter.configuration().getText("doclet.See_Also") + "</STRONG><DD>";
    1.92 +            return "<DT><STRONG>" + htmlWriter.configuration().getText("doclet.See_Also") + "</STRONG></DT><DD>";
    1.93          }
    1.94       }
    1.95  
    1.96 @@ -205,7 +206,8 @@
    1.97              }
    1.98              result += htmlWriter.commentTagsToString(simpleTags[i], null, simpleTags[i].inlineTags(), false);
    1.99          }
   1.100 -         return new TagletOutputImpl(result + "</DD>" + DocletConstants.NL);
   1.101 +        result += "</DD>" + DocletConstants.NL;
   1.102 +        return new TagletOutputImpl(result);
   1.103      }
   1.104  
   1.105      /**
   1.106 @@ -222,7 +224,7 @@
   1.107       */
   1.108      public TagletOutput getThrowsHeader() {
   1.109          return new TagletOutputImpl(DocletConstants.NL + "<DT>" + "<STRONG>" +
   1.110 -            htmlWriter.configuration().getText("doclet.Throws") + "</STRONG>");
   1.111 +            htmlWriter.configuration().getText("doclet.Throws") + "</STRONG></DT>");
   1.112      }
   1.113  
   1.114      /**
   1.115 @@ -241,6 +243,7 @@
   1.116          if (text != null && text.toString().length() > 0) {
   1.117              result += " - " + text;
   1.118          }
   1.119 +        result += "</DD>";
   1.120          return new TagletOutputImpl(result);
   1.121      }
   1.122  
   1.123 @@ -250,7 +253,7 @@
   1.124      public TagletOutput throwsTagOutput(Type throwsType) {
   1.125          return new TagletOutputImpl(DocletConstants.NL + "<DD>" +
   1.126              htmlWriter.codeText(htmlWriter.getLink(
   1.127 -                new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))));
   1.128 +                new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</DD>");
   1.129      }
   1.130  
   1.131      /**

mercurial