langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java
changeset 29957 7740f9657f56
parent 26270 a3635e6d3d78
child 38617 d93a7f64e231
equal deleted inserted replaced
29845:38f98cb6b335 29957:7740f9657f56
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    51     /**
    51     /**
    52      * The class and interface tree built by using {@link ClassTree}
    52      * The class and interface tree built by using {@link ClassTree}
    53      */
    53      */
    54     protected final ClassTree classtree;
    54     protected final ClassTree classtree;
    55 
    55 
    56     private static final String LI_CIRCLE  = "circle";
       
    57 
       
    58     /**
    56     /**
    59      * Constructor initializes classtree variable. This constructor will be used
    57      * Constructor initializes classtree variable. This constructor will be used
    60      * while generating global tree file "overview-tree.html".
    58      * while generating global tree file "overview-tree.html".
    61      *
    59      *
    62      * @param configuration  The current configuration
    60      * @param configuration  The current configuration
    86             boolean isEnum, Content contentTree) {
    84             boolean isEnum, Content contentTree) {
    87         if (!list.isEmpty()) {
    85         if (!list.isEmpty()) {
    88             Content ul = new HtmlTree(HtmlTag.UL);
    86             Content ul = new HtmlTree(HtmlTag.UL);
    89             for (ClassDoc local : list) {
    87             for (ClassDoc local : list) {
    90                 HtmlTree li = new HtmlTree(HtmlTag.LI);
    88                 HtmlTree li = new HtmlTree(HtmlTag.LI);
    91                 li.addAttr(HtmlAttr.TYPE, LI_CIRCLE);
    89                 li.addStyle(HtmlStyle.circle);
    92                 addPartialInfo(local, li);
    90                 addPartialInfo(local, li);
    93                 addExtendsImplements(parent, local, li);
    91                 addExtendsImplements(parent, local, li);
    94                 addLevelInfo(local, classtree.subs(local, isEnum),
    92                 addLevelInfo(local, classtree.subs(local, isEnum),
    95                              isEnum, li);   // Recurse
    93                              isEnum, li);   // Recurse
    96                 ul.addContent(li);
    94                 ul.addContent(li);
   106      * @param list List of classes which are at the most base level, all the
   104      * @param list List of classes which are at the most base level, all the
   107      * other classes in this run will derive from these classes
   105      * other classes in this run will derive from these classes
   108      * @param heading heading for the tree
   106      * @param heading heading for the tree
   109      * @param div the content tree to which the tree will be added
   107      * @param div the content tree to which the tree will be added
   110      */
   108      */
   111     protected void addTree(SortedSet<ClassDoc> list, String heading, Content div) {
   109     protected void addTree(SortedSet<ClassDoc> list, String heading, HtmlTree div) {
   112         if (!list.isEmpty()) {
   110         if (!list.isEmpty()) {
   113             ClassDoc firstClassDoc = list.first();
   111             ClassDoc firstClassDoc = list.first();
   114             Content headingContent = getResource(heading);
   112             Content headingContent = getResource(heading);
   115             div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
   113             Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
   116                     headingContent));
   114                     headingContent);
       
   115             HtmlTree htmlTree;
       
   116             if (configuration.allowTag(HtmlTag.SECTION)) {
       
   117                 htmlTree = HtmlTree.SECTION(sectionHeading);
       
   118             } else {
       
   119                 div.addContent(sectionHeading);
       
   120                 htmlTree = div;
       
   121             }
   117             addLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null,
   122             addLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null,
   118                     list, list == classtree.baseEnums(), div);
   123                     list, list == classtree.baseEnums(), htmlTree);
       
   124             if (configuration.allowTag(HtmlTag.SECTION)) {
       
   125                 div.addContent(htmlTree);
       
   126             }
   119         }
   127         }
   120     }
   128     }
   121 
   129 
   122     /**
   130     /**
   123      * Add information regarding the classes which this class extends or
   131      * Add information regarding the classes which this class extends or