src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
changeset 48654 36f58bd6269f
parent 47850 4a28dc8a86c2
child 51797 3efead10e303
equal deleted inserted replaced
48653:89111a0e6355 48654:36f58bd6269f
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, 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
    22  * or visit www.oracle.com if you need additional information or have any
    22  * or visit www.oracle.com if you need additional information or have any
    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 
       
    28 import java.util.Collection;
       
    29 
    27 
    30 import javax.lang.model.element.PackageElement;
    28 import javax.lang.model.element.PackageElement;
    31 
    29 
    32 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
    30 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
    33 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
    31 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
   108     protected Content getPackage(PackageElement pe) {
   106     protected Content getPackage(PackageElement pe) {
   109         Content packageLinkContent;
   107         Content packageLinkContent;
   110         Content packageLabel;
   108         Content packageLabel;
   111         if (pe.isUnnamed()) {
   109         if (pe.isUnnamed()) {
   112             packageLabel = new StringContent("<unnamed package>");
   110             packageLabel = new StringContent("<unnamed package>");
   113             packageLinkContent = Links.createLink(DocPaths.PACKAGE_FRAME,
   111             packageLinkContent = links.createLink(DocPaths.PACKAGE_FRAME,
   114                     packageLabel, "", "packageFrame");
   112                     packageLabel, "", "packageFrame");
   115         } else {
   113         } else {
   116             packageLabel = getPackageLabel(pe.getQualifiedName());
   114             packageLabel = getPackageLabel(pe.getQualifiedName());
   117             packageLinkContent = Links.createLink(pathString(pe,
   115             packageLinkContent = links.createLink(pathString(pe,
   118                      DocPaths.PACKAGE_FRAME), packageLabel, "",
   116                      DocPaths.PACKAGE_FRAME), packageLabel, "",
   119                     "packageFrame");
   117                     "packageFrame");
   120         }
   118         }
   121         Content li = HtmlTree.LI(packageLinkContent);
   119         Content li = HtmlTree.LI(packageLinkContent);
   122         return li;
   120         return li;
   151      *
   149      *
   152      * @param ul the Content object to which the "All Classes" link should be added
   150      * @param ul the Content object to which the "All Classes" link should be added
   153      */
   151      */
   154     @Override
   152     @Override
   155     protected void addAllClassesLink(Content ul) {
   153     protected void addAllClassesLink(Content ul) {
   156         Content linkContent = Links.createLink(DocPaths.ALLCLASSES_FRAME,
   154         Content linkContent = links.createLink(DocPaths.ALLCLASSES_FRAME,
   157                 contents.allClassesLabel, "", "packageFrame");
   155                 contents.allClassesLabel, "", "packageFrame");
   158         Content li = HtmlTree.LI(linkContent);
   156         Content li = HtmlTree.LI(linkContent);
   159         ul.addContent(li);
   157         ul.addContent(li);
   160     }
   158     }
   161 
   159 
   165      *
   163      *
   166      * @param ul the Content object to which the "All Modules" link should be added
   164      * @param ul the Content object to which the "All Modules" link should be added
   167      */
   165      */
   168     @Override
   166     @Override
   169     protected void addAllModulesLink(Content ul) {
   167     protected void addAllModulesLink(Content ul) {
   170         Content linkContent = Links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
   168         Content linkContent = links.createLink(DocPaths.MODULE_OVERVIEW_FRAME,
   171                 contents.allModulesLabel, "", "packageListFrame");
   169                 contents.allModulesLabel, "", "packageListFrame");
   172         Content li = HtmlTree.LI(linkContent);
   170         Content li = HtmlTree.LI(linkContent);
   173         ul.addContent(li);
   171         ul.addContent(li);
   174     }
   172     }
   175 
   173