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

changeset 766
90af8d87741f
parent 554
9d9f26857129
child 798
4868a36f6fd8
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Tue Nov 30 09:38:48 2010 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Wed Dec 01 11:02:38 2010 -0800
     1.3 @@ -28,9 +28,9 @@
     1.4  import java.io.*;
     1.5  
     1.6  import com.sun.javadoc.*;
     1.7 +import com.sun.tools.doclets.formats.html.markup.*;
     1.8  import com.sun.tools.doclets.internal.toolkit.*;
     1.9  import com.sun.tools.doclets.internal.toolkit.util.*;
    1.10 -import com.sun.tools.doclets.internal.toolkit.taglets.*;
    1.11  
    1.12  /**
    1.13   * Writes method documentation in HTML format.
    1.14 @@ -43,8 +43,6 @@
    1.15  public class MethodWriterImpl extends AbstractExecutableMemberWriter
    1.16          implements MethodWriter, MemberSummaryWriter {
    1.17  
    1.18 -    private boolean printedSummaryHeader = false;
    1.19 -
    1.20      /**
    1.21       * Construct a new MethodWriterImpl.
    1.22       *
    1.23 @@ -65,184 +63,127 @@
    1.24      }
    1.25  
    1.26      /**
    1.27 -     * Write the methods summary header for the given class.
    1.28 -     *
    1.29 -     * @param classDoc the class the summary belongs to.
    1.30 +     * {@inheritDoc}
    1.31       */
    1.32 -    public void writeMemberSummaryHeader(ClassDoc classDoc) {
    1.33 -        printedSummaryHeader = true;
    1.34 -        writer.println();
    1.35 -        writer.println("<!-- ========== METHOD SUMMARY =========== -->");
    1.36 -        writer.println();
    1.37 -        writer.printSummaryHeader(this, classDoc);
    1.38 -    }
    1.39 -
    1.40 -    /**
    1.41 -     * Write the methods summary footer for the given class.
    1.42 -     *
    1.43 -     * @param classDoc the class the summary belongs to.
    1.44 -     */
    1.45 -    public void writeMemberSummaryFooter(ClassDoc classDoc) {
    1.46 -        writer.printSummaryFooter(this, classDoc);
    1.47 -    }
    1.48 -
    1.49 -    /**
    1.50 -     * Write the inherited methods summary header for the given class.
    1.51 -     *
    1.52 -     * @param classDoc the class the summary belongs to.
    1.53 -     */
    1.54 -    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
    1.55 -        if(! printedSummaryHeader){
    1.56 -            //We don't want inherited summary to not be under heading.
    1.57 -            writeMemberSummaryHeader(classDoc);
    1.58 -            writeMemberSummaryFooter(classDoc);
    1.59 -            printedSummaryHeader = true;
    1.60 -        }
    1.61 -        writer.printInheritedSummaryHeader(this, classDoc);
    1.62 +    public Content getMemberSummaryHeader(ClassDoc classDoc,
    1.63 +            Content memberSummaryTree) {
    1.64 +        memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY);
    1.65 +        Content memberTree = writer.getMemberTreeHeader();
    1.66 +        writer.addSummaryHeader(this, classDoc, memberTree);
    1.67 +        return memberTree;
    1.68      }
    1.69  
    1.70      /**
    1.71       * {@inheritDoc}
    1.72       */
    1.73 -    public void writeInheritedMemberSummary(ClassDoc classDoc,
    1.74 -        ProgramElementDoc method, boolean isFirst, boolean isLast) {
    1.75 -        writer.printInheritedSummaryMember(this, classDoc, method, isFirst);
    1.76 +    public Content getMethodDetailsTreeHeader(ClassDoc classDoc,
    1.77 +            Content memberDetailsTree) {
    1.78 +        memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS);
    1.79 +        Content methodDetailsTree = writer.getMemberTreeHeader();
    1.80 +        methodDetailsTree.addContent(writer.getMarkerAnchor("method_detail"));
    1.81 +        Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
    1.82 +                writer.methodDetailsLabel);
    1.83 +        methodDetailsTree.addContent(heading);
    1.84 +        return methodDetailsTree;
    1.85      }
    1.86  
    1.87      /**
    1.88 -     * Write the inherited methods summary footer for the given class.
    1.89 -     *
    1.90 -     * @param classDoc the class the summary belongs to.
    1.91 +     * {@inheritDoc}
    1.92       */
    1.93 -    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
    1.94 -        writer.printInheritedSummaryFooter(this, classDoc);        ;
    1.95 +    public Content getMethodDocTreeHeader(MethodDoc method,
    1.96 +            Content methodDetailsTree) {
    1.97 +        String erasureAnchor;
    1.98 +        if ((erasureAnchor = getErasureAnchor(method)) != null) {
    1.99 +            methodDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor)));
   1.100 +        }
   1.101 +        methodDetailsTree.addContent(
   1.102 +                writer.getMarkerAnchor(writer.getAnchor(method)));
   1.103 +        Content methodDocTree = writer.getMemberTreeHeader();
   1.104 +        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
   1.105 +        heading.addContent(method.name());
   1.106 +        methodDocTree.addContent(heading);
   1.107 +        return methodDocTree;
   1.108      }
   1.109  
   1.110      /**
   1.111 -     * Write the header for the method documentation.
   1.112 +     * Get the signature for the given method.
   1.113       *
   1.114 -     * @param classDoc the class that the methods belong to.
   1.115 +     * @param method the method being documented.
   1.116 +     * @return a content object for the signature
   1.117       */
   1.118 -    public void writeHeader(ClassDoc classDoc, String header) {
   1.119 -        writer.println();
   1.120 -        writer.println("<!-- ============ METHOD DETAIL ========== -->");
   1.121 -        writer.println();
   1.122 -        writer.anchor("method_detail");
   1.123 -        writer.printTableHeadingBackground(header);
   1.124 +    public Content getSignature(MethodDoc method) {
   1.125 +        writer.displayLength = 0;
   1.126 +        Content pre = new HtmlTree(HtmlTag.PRE);
   1.127 +        writer.addAnnotationInfo(method, pre);
   1.128 +        addModifiers(method, pre);
   1.129 +        addTypeParameters(method, pre);
   1.130 +        addReturnType(method, pre);
   1.131 +        if (configuration().linksource) {
   1.132 +            Content methodName = new StringContent(method.name());
   1.133 +            writer.addSrcLink(method, methodName, pre);
   1.134 +        } else {
   1.135 +            addName(method.name(), pre);
   1.136 +        }
   1.137 +        addParameters(method, pre);
   1.138 +        addExceptions(method, pre);
   1.139 +        return pre;
   1.140      }
   1.141  
   1.142      /**
   1.143 -     * Write the method header for the given method.
   1.144 -     *
   1.145 -     * @param method the method being documented.
   1.146 -     * @param isFirst the flag to indicate whether or not the method is the
   1.147 -     *        first to be documented.
   1.148 +     * {@inheritDoc}
   1.149       */
   1.150 -    public void writeMethodHeader(MethodDoc method, boolean isFirst) {
   1.151 -        if (! isFirst) {
   1.152 -            writer.printMemberHeader();
   1.153 -        }
   1.154 -        writer.println();
   1.155 -        String erasureAnchor;
   1.156 -        if ((erasureAnchor = getErasureAnchor(method)) != null) {
   1.157 -            writer.anchor(erasureAnchor);
   1.158 -        }
   1.159 -        writer.anchor(method);
   1.160 -        writer.h3();
   1.161 -        writer.print(method.name());
   1.162 -        writer.h3End();
   1.163 +    public void addDeprecated(MethodDoc method, Content methodDocTree) {
   1.164 +        addDeprecatedInfo(method, methodDocTree);
   1.165      }
   1.166  
   1.167      /**
   1.168 -     * Write the signature for the given method.
   1.169 -     *
   1.170 -     * @param method the method being documented.
   1.171 +     * {@inheritDoc}
   1.172       */
   1.173 -    public void writeSignature(MethodDoc method) {
   1.174 -        writer.displayLength = 0;
   1.175 -        writer.pre();
   1.176 -        writer.writeAnnotationInfo(method);
   1.177 -        printModifiers(method);
   1.178 -        writeTypeParameters(method);
   1.179 -        printReturnType(method);
   1.180 -        if (configuration().linksource) {
   1.181 -            writer.printSrcLink(method, method.name());
   1.182 -        } else {
   1.183 -            strong(method.name());
   1.184 -        }
   1.185 -        writeParameters(method);
   1.186 -        writeExceptions(method);
   1.187 -        writer.preEnd();
   1.188 -        assert !writer.getMemberDetailsListPrinted();
   1.189 -    }
   1.190 -
   1.191 -    /**
   1.192 -     * Write the deprecated output for the given method.
   1.193 -     *
   1.194 -     * @param method the method being documented.
   1.195 -     */
   1.196 -    public void writeDeprecated(MethodDoc method) {
   1.197 -        printDeprecated(method);
   1.198 -    }
   1.199 -
   1.200 -    /**
   1.201 -     * Write the comments for the given method.
   1.202 -     *
   1.203 -     * @param method the method being documented.
   1.204 -     */
   1.205 -    public void writeComments(Type holder, MethodDoc method) {
   1.206 +    public void addComments(Type holder, MethodDoc method, Content methodDocTree) {
   1.207          ClassDoc holderClassDoc = holder.asClassDoc();
   1.208          if (method.inlineTags().length > 0) {
   1.209 -            writer.printMemberDetailsListStartTag();
   1.210              if (holder.asClassDoc().equals(classdoc) ||
   1.211 -                (! (holderClassDoc.isPublic() ||
   1.212 +                    (! (holderClassDoc.isPublic() ||
   1.213                      Util.isLinkable(holderClassDoc, configuration())))) {
   1.214 -                writer.dd();
   1.215 -                writer.printInlineComment(method);
   1.216 -                writer.ddEnd();
   1.217 +                writer.addInlineComment(method, methodDocTree);
   1.218              } else {
   1.219 -                String classlink = writer.codeText(
   1.220 -                    writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
   1.221 +                Content link = new RawHtml(
   1.222 +                        writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
   1.223                          holder.asClassDoc(), method,
   1.224                          holder.asClassDoc().isIncluded() ?
   1.225                              holder.typeName() : holder.qualifiedTypeName(),
   1.226 -                        false));
   1.227 -                writer.dd();
   1.228 -                writer.strongText(holder.asClassDoc().isClass()?
   1.229 -                        "doclet.Description_From_Class":
   1.230 -                        "doclet.Description_From_Interface",
   1.231 -                    classlink);
   1.232 -                writer.ddEnd();
   1.233 -                writer.dd();
   1.234 -                writer.printInlineComment(method);
   1.235 -                writer.ddEnd();
   1.236 +                            false));
   1.237 +                Content codelLink = HtmlTree.CODE(link);
   1.238 +                Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()?
   1.239 +                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
   1.240 +                strong.addContent(writer.getSpace());
   1.241 +                strong.addContent(codelLink);
   1.242 +                methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
   1.243 +                writer.addInlineComment(method, methodDocTree);
   1.244              }
   1.245          }
   1.246      }
   1.247  
   1.248      /**
   1.249 -     * Write the tag output for the given method.
   1.250 -     *
   1.251 -     * @param method the method being documented.
   1.252 +     * {@inheritDoc}
   1.253       */
   1.254 -    public void writeTags(MethodDoc method) {
   1.255 -        writer.printTags(method);
   1.256 +    public void addTags(MethodDoc method, Content methodDocTree) {
   1.257 +        writer.addTagsInfo(method, methodDocTree);
   1.258      }
   1.259  
   1.260      /**
   1.261 -     * Write the method footer.
   1.262 +     * {@inheritDoc}
   1.263       */
   1.264 -    public void writeMethodFooter() {
   1.265 -        printMemberFooter();
   1.266 +    public Content getMethodDetails(Content methodDetailsTree) {
   1.267 +        return getMemberTree(methodDetailsTree);
   1.268      }
   1.269  
   1.270      /**
   1.271 -     * Write the footer for the method documentation.
   1.272 -     *
   1.273 -     * @param classDoc the class that the methods belong to.
   1.274 +     * {@inheritDoc}
   1.275       */
   1.276 -    public void writeFooter(ClassDoc classDoc) {
   1.277 -        //No footer to write for method documentation
   1.278 +    public Content getMethodDoc(Content methodDocTree,
   1.279 +            boolean isLastContent) {
   1.280 +        return getMemberTree(methodDocTree, isLastContent);
   1.281      }
   1.282  
   1.283      /**
   1.284 @@ -256,53 +197,89 @@
   1.285          return VisibleMemberMap.METHODS;
   1.286      }
   1.287  
   1.288 -    public void printSummaryLabel() {
   1.289 -        writer.printText("doclet.Method_Summary");
   1.290 +    /**
   1.291 +     * {@inheritDoc}
   1.292 +     */
   1.293 +    public void addSummaryLabel(Content memberTree) {
   1.294 +        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
   1.295 +                writer.getResource("doclet.Method_Summary"));
   1.296 +        memberTree.addContent(label);
   1.297      }
   1.298  
   1.299 -    public void printTableSummary() {
   1.300 -        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
   1.301 +    /**
   1.302 +     * {@inheritDoc}
   1.303 +     */
   1.304 +    public String getTableSummary() {
   1.305 +        return configuration().getText("doclet.Member_Table_Summary",
   1.306                  configuration().getText("doclet.Method_Summary"),
   1.307 -                configuration().getText("doclet.methods")));
   1.308 +                configuration().getText("doclet.methods"));
   1.309      }
   1.310  
   1.311 -    public void printSummaryTableHeader(ProgramElementDoc member) {
   1.312 +    /**
   1.313 +     * {@inheritDoc}
   1.314 +     */
   1.315 +    public String getCaption() {
   1.316 +        return configuration().getText("doclet.Methods");
   1.317 +    }
   1.318 +
   1.319 +    /**
   1.320 +     * {@inheritDoc}
   1.321 +     */
   1.322 +    public String[] getSummaryTableHeader(ProgramElementDoc member) {
   1.323          String[] header = new String[] {
   1.324              writer.getModifierTypeHeader(),
   1.325              configuration().getText("doclet.0_and_1",
   1.326                      configuration().getText("doclet.Method"),
   1.327                      configuration().getText("doclet.Description"))
   1.328          };
   1.329 -        writer.summaryTableHeader(header, "col");
   1.330 +        return header;
   1.331      }
   1.332  
   1.333 -    public void printSummaryAnchor(ClassDoc cd) {
   1.334 -        writer.anchor("method_summary");
   1.335 +    /**
   1.336 +     * {@inheritDoc}
   1.337 +     */
   1.338 +    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
   1.339 +        memberTree.addContent(writer.getMarkerAnchor("method_summary"));
   1.340      }
   1.341  
   1.342 -    public void printInheritedSummaryAnchor(ClassDoc cd) {
   1.343 -        writer.anchor("methods_inherited_from_class_" +
   1.344 -            ConfigurationImpl.getInstance().getClassName(cd));
   1.345 +    /**
   1.346 +     * {@inheritDoc}
   1.347 +     */
   1.348 +    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
   1.349 +        inheritedTree.addContent(writer.getMarkerAnchor(
   1.350 +                "methods_inherited_from_class_" +
   1.351 +                configuration().getClassName(cd)));
   1.352      }
   1.353  
   1.354 -    public void printInheritedSummaryLabel(ClassDoc cd) {
   1.355 -        String classlink = writer.getPreQualifiedClassLink(
   1.356 -            LinkInfoImpl.CONTEXT_MEMBER, cd, false);
   1.357 -        writer.strong();
   1.358 -        String key = cd.isClass()?
   1.359 -            "doclet.Methods_Inherited_From_Class" :
   1.360 -            "doclet.Methods_Inherited_From_Interface";
   1.361 -        writer.printText(key, classlink);
   1.362 -        writer.strongEnd();
   1.363 +    /**
   1.364 +     * {@inheritDoc}
   1.365 +     */
   1.366 +    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
   1.367 +        Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
   1.368 +                LinkInfoImpl.CONTEXT_MEMBER, cd, false));
   1.369 +        Content label = new StringContent(cd.isClass() ?
   1.370 +            configuration().getText("doclet.Methods_Inherited_From_Class") :
   1.371 +            configuration().getText("doclet.Methods_Inherited_From_Interface"));
   1.372 +        Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
   1.373 +                label);
   1.374 +        labelHeading.addContent(writer.getSpace());
   1.375 +        labelHeading.addContent(classLink);
   1.376 +        inheritedTree.addContent(labelHeading);
   1.377      }
   1.378  
   1.379 -    protected void printSummaryType(ProgramElementDoc member) {
   1.380 +    /**
   1.381 +     * {@inheritDoc}
   1.382 +     */
   1.383 +    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
   1.384          MethodDoc meth = (MethodDoc)member;
   1.385 -        printModifierAndType(meth, meth.returnType());
   1.386 +        addModifierAndType(meth, meth.returnType(), tdSummaryType);
   1.387      }
   1.388  
   1.389 -    protected static void printOverridden(HtmlDocletWriter writer,
   1.390 -            Type overriddenType, MethodDoc method) {
   1.391 +    /**
   1.392 +     * {@inheritDoc}
   1.393 +     */
   1.394 +    protected static void addOverridden(HtmlDocletWriter writer,
   1.395 +            Type overriddenType, MethodDoc method, Content dl) {
   1.396          if(writer.configuration.nocomment){
   1.397              return;
   1.398          }
   1.399 @@ -317,31 +294,33 @@
   1.400              //is not visible so don't document this.
   1.401              return;
   1.402          }
   1.403 -        String label = "doclet.Overrides";
   1.404 +        Content label = writer.overridesLabel;
   1.405          int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES;
   1.406  
   1.407          if (method != null) {
   1.408              if(overriddenType.asClassDoc().isAbstract() && method.isAbstract()){
   1.409                  //Abstract method is implemented from abstract class,
   1.410                  //not overridden
   1.411 -                label = "doclet.Specified_By";
   1.412 +                label = writer.specifiedByLabel;
   1.413                  context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY;
   1.414              }
   1.415 -            String overriddenTypeLink = writer.codeText(
   1.416 -                writer.getLink(new LinkInfoImpl(context, overriddenType)));
   1.417 +            Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
   1.418 +            dl.addContent(dt);
   1.419 +            Content overriddenTypeLink = new RawHtml(
   1.420 +                    writer.getLink(new LinkInfoImpl(context, overriddenType)));
   1.421 +            Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink);
   1.422              String name = method.name();
   1.423 -            writer.dt();
   1.424 -            writer.strongText(label);
   1.425 -            writer.dtEnd();
   1.426 -            writer.dd();
   1.427 -            String methLink = writer.codeText(
   1.428 -                writer.getLink(
   1.429 +            Content methlink = new RawHtml(writer.getLink(
   1.430                      new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
   1.431 -                        overriddenType.asClassDoc(),
   1.432 -                        writer.getAnchor(method), name, false)
   1.433 -                ));
   1.434 -            writer.printText("doclet.in_class", methLink, overriddenTypeLink);
   1.435 -            writer.ddEnd();
   1.436 +                    overriddenType.asClassDoc(),
   1.437 +                    writer.getAnchor(method), name, false)));
   1.438 +            Content codeMethLink = HtmlTree.CODE(methlink);
   1.439 +            Content dd = HtmlTree.DD(codeMethLink);
   1.440 +            dd.addContent(writer.getSpace());
   1.441 +            dd.addContent(writer.getResource("doclet.in_class"));
   1.442 +            dd.addContent(writer.getSpace());
   1.443 +            dd.addContent(codeOverridenTypeLink);
   1.444 +            dl.addContent(dd);
   1.445          }
   1.446      }
   1.447  
   1.448 @@ -363,61 +342,78 @@
   1.449          }
   1.450      }
   1.451  
   1.452 -    protected static void printImplementsInfo(HtmlDocletWriter writer,
   1.453 -            MethodDoc method) {
   1.454 +    /**
   1.455 +     * {@inheritDoc}
   1.456 +     */
   1.457 +    protected static void addImplementsInfo(HtmlDocletWriter writer,
   1.458 +            MethodDoc method, Content dl) {
   1.459          if(writer.configuration.nocomment){
   1.460              return;
   1.461          }
   1.462          ImplementedMethods implementedMethodsFinder =
   1.463 -            new ImplementedMethods(method, writer.configuration);
   1.464 +                new ImplementedMethods(method, writer.configuration);
   1.465          MethodDoc[] implementedMethods = implementedMethodsFinder.build();
   1.466          for (int i = 0; i < implementedMethods.length; i++) {
   1.467              MethodDoc implementedMeth = implementedMethods[i];
   1.468              Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth);
   1.469 -            String methlink = "";
   1.470 -            String intfaclink = writer.codeText(
   1.471 -                writer.getLink(new LinkInfoImpl(
   1.472 +            Content intfaclink = new RawHtml(writer.getLink(new LinkInfoImpl(
   1.473                      LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac)));
   1.474 -            writer.dt();
   1.475 -            writer.strongText("doclet.Specified_By");
   1.476 -            writer.dtEnd();
   1.477 -            writer.dd();
   1.478 -            methlink = writer.codeText(writer.getDocLink(
   1.479 -                LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
   1.480 -                implementedMeth.name(), false));
   1.481 -            writer.printText("doclet.in_interface", methlink, intfaclink);
   1.482 -            writer.ddEnd();
   1.483 -        }
   1.484 -
   1.485 -    }
   1.486 -
   1.487 -    protected void printReturnType(MethodDoc method) {
   1.488 -        Type type = method.returnType();
   1.489 -        if (type != null) {
   1.490 -            writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE,
   1.491 -                type));
   1.492 -            print(' ');
   1.493 +            Content codeIntfacLink = HtmlTree.CODE(intfaclink);
   1.494 +            Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
   1.495 +            dl.addContent(dt);
   1.496 +            Content methlink = new RawHtml(writer.getDocLink(
   1.497 +                    LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
   1.498 +                    implementedMeth.name(), false));
   1.499 +            Content codeMethLink = HtmlTree.CODE(methlink);
   1.500 +            Content dd = HtmlTree.DD(codeMethLink);
   1.501 +            dd.addContent(writer.getSpace());
   1.502 +            dd.addContent(writer.getResource("doclet.in_interface"));
   1.503 +            dd.addContent(writer.getSpace());
   1.504 +            dd.addContent(codeIntfacLink);
   1.505 +            dl.addContent(dd);
   1.506          }
   1.507      }
   1.508  
   1.509 -    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
   1.510 -        if (link) {
   1.511 -            writer.printHyperLink("", (cd == null)?
   1.512 -                "method_summary":
   1.513 -                "methods_inherited_from_class_" +
   1.514 -                ConfigurationImpl.getInstance().getClassName(cd),
   1.515 -                ConfigurationImpl.getInstance().getText("doclet.navMethod"));
   1.516 -        } else {
   1.517 -            writer.printText("doclet.navMethod");
   1.518 +    /**
   1.519 +     * Add the return type.
   1.520 +     *
   1.521 +     * @param method the method being documented.
   1.522 +     * @param htmltree the content tree to which the return type will be added
   1.523 +     */
   1.524 +    protected void addReturnType(MethodDoc method, Content htmltree) {
   1.525 +        Type type = method.returnType();
   1.526 +        if (type != null) {
   1.527 +            Content linkContent = new RawHtml(writer.getLink(
   1.528 +                    new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE, type)));
   1.529 +            htmltree.addContent(linkContent);
   1.530 +            htmltree.addContent(writer.getSpace());
   1.531          }
   1.532      }
   1.533  
   1.534 -    protected void printNavDetailLink(boolean link) {
   1.535 +    /**
   1.536 +     * {@inheritDoc}
   1.537 +     */
   1.538 +    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
   1.539          if (link) {
   1.540 -            writer.printHyperLink("", "method_detail",
   1.541 -                ConfigurationImpl.getInstance().getText("doclet.navMethod"));
   1.542 +            return writer.getHyperLink("", (cd == null)?
   1.543 +                "method_summary":
   1.544 +                "methods_inherited_from_class_" +
   1.545 +                configuration().getClassName(cd),
   1.546 +                writer.getResource("doclet.navMethod"));
   1.547          } else {
   1.548 -            writer.printText("doclet.navMethod");
   1.549 +            return writer.getResource("doclet.navMethod");
   1.550 +        }
   1.551 +    }
   1.552 +
   1.553 +    /**
   1.554 +     * {@inheritDoc}
   1.555 +     */
   1.556 +    protected void addNavDetailLink(boolean link, Content liNav) {
   1.557 +        if (link) {
   1.558 +            liNav.addContent(writer.getHyperLink("", "method_detail",
   1.559 +                    writer.getResource("doclet.navMethod")));
   1.560 +        } else {
   1.561 +            liNav.addContent(writer.getResource("doclet.navMethod"));
   1.562          }
   1.563      }
   1.564  }

mercurial