langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
changeset 40587 1c355ea550ed
parent 40506 258ad5fd9b57
child 40606 eb2c81860c86
equal deleted inserted replaced
40519:e17429a7e843 40587:1c355ea550ed
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package jdk.javadoc.internal.doclets.formats.html;
    26 package jdk.javadoc.internal.doclets.formats.html;
    27 
    27 
    28 import java.io.IOException;
       
    29 import java.util.*;
    28 import java.util.*;
    30 
    29 
    31 import javax.lang.model.element.AnnotationMirror;
    30 import javax.lang.model.element.AnnotationMirror;
    32 import javax.lang.model.element.Element;
    31 import javax.lang.model.element.Element;
    33 import javax.lang.model.element.ModuleElement;
    32 import javax.lang.model.element.ModuleElement;
    48 import jdk.javadoc.internal.doclets.toolkit.Content;
    47 import jdk.javadoc.internal.doclets.toolkit.Content;
    49 import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
    48 import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
    50 import jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet;
    49 import jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet;
    51 import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
    50 import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
    52 import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
    51 import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
       
    52 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
    53 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
    53 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
    54 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
    54 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
    55 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
       
    56 import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
    55 import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
    57 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    56 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    58 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind;
    57 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind;
    59 
    58 
    60 /**
    59 /**
    89      * @param configuration the configuration data for the doclet
    88      * @param configuration the configuration data for the doclet
    90      * @param typeElement the class being documented.
    89      * @param typeElement the class being documented.
    91      * @param prevClass the previous class that was documented.
    90      * @param prevClass the previous class that was documented.
    92      * @param nextClass the next class being documented.
    91      * @param nextClass the next class being documented.
    93      * @param classTree the class tree for the given class.
    92      * @param classTree the class tree for the given class.
    94      * @throws java.io.IOException
       
    95      */
    93      */
    96     public ClassWriterImpl(ConfigurationImpl configuration, TypeElement typeElement,
    94     public ClassWriterImpl(ConfigurationImpl configuration, TypeElement typeElement,
    97             TypeElement prevClass, TypeElement nextClass, ClassTree classTree)
    95             TypeElement prevClass, TypeElement nextClass, ClassTree classTree) {
    98             throws IOException {
       
    99         super(configuration, DocPath.forClass(configuration.utils, typeElement));
    96         super(configuration, DocPath.forClass(configuration.utils, typeElement));
   100         this.typeElement = typeElement;
    97         this.typeElement = typeElement;
   101         configuration.currentTypeElement = typeElement;
    98         configuration.currentTypeElement = typeElement;
   102         this.classtree = classTree;
    99         this.classtree = classTree;
   103         this.prev = prevClass;
   100         this.prev = prevClass;
   270 
   267 
   271     /**
   268     /**
   272      * {@inheritDoc}
   269      * {@inheritDoc}
   273      */
   270      */
   274     @Override
   271     @Override
   275     public void printDocument(Content contentTree) throws IOException {
   272     public void printDocument(Content contentTree) throws DocFileIOException {
   276         printHtmlDocument(configuration.metakeywords.getMetaKeywords(typeElement),
   273         printHtmlDocument(configuration.metakeywords.getMetaKeywords(typeElement),
   277                 true, contentTree);
   274                 true, contentTree);
   278     }
   275     }
   279 
   276 
   280     /**
   277     /**
   675     /**
   672     /**
   676      * Add summary details to the navigation bar.
   673      * Add summary details to the navigation bar.
   677      *
   674      *
   678      * @param subDiv the content tree to which the summary detail links will be added
   675      * @param subDiv the content tree to which the summary detail links will be added
   679      */
   676      */
       
   677     @Override
   680     protected void addSummaryDetailLinks(Content subDiv) {
   678     protected void addSummaryDetailLinks(Content subDiv) {
   681         try {
   679         Content div = HtmlTree.DIV(getNavSummaryLinks());
   682             Content div = HtmlTree.DIV(getNavSummaryLinks());
   680         div.addContent(getNavDetailLinks());
   683             div.addContent(getNavDetailLinks());
   681         subDiv.addContent(div);
   684             subDiv.addContent(div);
       
   685         } catch (Exception e) {
       
   686             throw new DocletAbortException(e);
       
   687         }
       
   688     }
   682     }
   689 
   683 
   690     /**
   684     /**
   691      * Get summary links for navigation bar.
   685      * Get summary links for navigation bar.
   692      *
   686      *
   693      * @return the content tree for the navigation summary links
   687      * @return the content tree for the navigation summary links
   694      */
   688      */
   695     protected Content getNavSummaryLinks() throws Exception {
   689     protected Content getNavSummaryLinks() {
   696         Content li = HtmlTree.LI(contents.summaryLabel);
   690         Content li = HtmlTree.LI(contents.summaryLabel);
   697         li.addContent(Contents.SPACE);
   691         li.addContent(Contents.SPACE);
   698         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   692         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   699         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   693         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   700                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   694                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   725 
   719 
   726     /**
   720     /**
   727      * Get detail links for the navigation bar.
   721      * Get detail links for the navigation bar.
   728      *
   722      *
   729      * @return the content tree for the detail links
   723      * @return the content tree for the detail links
   730      * @throws java.lang.Exception
   724      */
   731      */
   725     protected Content getNavDetailLinks() {
   732     protected Content getNavDetailLinks() throws Exception {
       
   733         Content li = HtmlTree.LI(contents.detailLabel);
   726         Content li = HtmlTree.LI(contents.detailLabel);
   734         li.addContent(Contents.SPACE);
   727         li.addContent(Contents.SPACE);
   735         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   728         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   736         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   729         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   737                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   730                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);