1 /*
   2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.javadoc.internal.doclets.toolkit.util;
  27 
  28 import javax.lang.model.element.ModuleElement;
  29 
  30 /**
  31  * Standard DocPath objects.
  32  *
  33  *  <p><b>This is NOT part of any supported API.
  34  *  If you write code that depends on this, you do so at your own risk.
  35  *  This code and its internal interfaces are subject to change or
  36  *  deletion without notice.</b>
  37  *
  38  */
  39 public class DocPaths {
  40     /** The name of the file for all classes, without using frames, when --no-frames is specified. */
  41     public static final DocPath ALLCLASSES = DocPath.create("allclasses.html");
  42 
  43     /** The name of the file for all classes, using frames. */
  44     public static final DocPath ALLCLASSES_FRAME = DocPath.create("allclasses-frame.html");
  45 
  46     /** The name of the file for all classes, without using frames. */
  47     public static final DocPath ALLCLASSES_NOFRAME = DocPath.create("allclasses-noframe.html");
  48 
  49     public static DocPath AllClasses(boolean frames) {
  50         return frames ? ALLCLASSES_NOFRAME : ALLCLASSES;
  51     }
  52 
  53     /** The name of the sub-directory for storing class usage info. */
  54     public static final DocPath CLASS_USE = DocPath.create("class-use");
  55 
  56     /** The name of the file for constant values. */
  57     public static final DocPath CONSTANT_VALUES = DocPath.create("constant-values.html");
  58 
  59     /** The name of the fie for deprecated elements. */
  60     public static final DocPath DEPRECATED_LIST = DocPath.create("deprecated-list.html");
  61 
  62     /** The name of the subdirectory for user-provided additional documentation files. */
  63     public static final DocPath DOC_FILES = DocPath.create("doc-files");
  64 
  65     /** The name of the file for the element list. */
  66     public static final DocPath ELEMENT_LIST = DocPath.create("element-list");
  67 
  68     /** The name of the image file showing a magnifying glass on the search box. */
  69     public static final DocPath GLASS_IMG = DocPath.create("glass.png");
  70 
  71     /** The name of the file for help info. */
  72     public static final DocPath HELP_DOC = DocPath.create("help-doc.html");
  73 
  74     /** The name of the main index file. */
  75     public static final DocPath INDEX = DocPath.create("index.html");
  76 
  77     /** The name of the single index file for all classes. */
  78     public static final DocPath INDEX_ALL = DocPath.create("index-all.html");
  79 
  80     /** The name of the directory for the split index files. */
  81     public static final DocPath INDEX_FILES = DocPath.create("index-files");
  82 
  83     /** Generate the name of one of the files in the split index. */
  84     public static DocPath indexN(int n) {
  85         return DocPath.create("index-" + n + ".html");
  86     }
  87 
  88     /** The name of the default javascript file. */
  89     public static final DocPath JAVASCRIPT = DocPath.create("script.js");
  90 
  91     /** The name of the directory for the jQuery. */
  92     public static final DocPath JQUERY_FILES = DocPath.create("jquery");
  93 
  94     /** The name of the default jQuery stylesheet file. */
  95     public static final DocPath JQUERY_STYLESHEET_FILE = DocPath.create("jquery-ui.css");
  96 
  97     /** The name of the default jQuery javascript file. */
  98     public static final DocPath JQUERY_JS_1_10 = DocPath.create("jquery-1.10.2.js");
  99 
 100     /** The name of the default jQuery javascript file. */
 101     public static final DocPath JQUERY_JS = DocPath.create("jquery-ui.js");
 102 
 103     /** The name of the default jszip javascript file. */
 104     public static final DocPath JSZIP = DocPath.create("jszip/dist/jszip.js");
 105 
 106     /** The name of the default jszip javascript file. */
 107     public static final DocPath JSZIP_MIN = DocPath.create("jszip/dist/jszip.min.js");
 108 
 109     /** The name of the default jszip-utils javascript file. */
 110     public static final DocPath JSZIPUTILS = DocPath.create("jszip-utils/dist/jszip-utils.js");
 111 
 112     /** The name of the default jszip-utils javascript file. */
 113     public static final DocPath JSZIPUTILS_MIN = DocPath.create("jszip-utils/dist/jszip-utils.min.js");
 114 
 115     /** The name of the default jszip-utils javascript file. */
 116     public static final DocPath JSZIPUTILS_IE = DocPath.create("jszip-utils/dist/jszip-utils-ie.js");
 117 
 118     /** The name of the default jszip-utils javascript file. */
 119     public static final DocPath JSZIPUTILS_IE_MIN = DocPath.create("jszip-utils/dist/jszip-utils-ie.min.js");
 120 
 121     /** The name of the member search index file. */
 122     public static final DocPath MEMBER_SEARCH_INDEX_JSON = DocPath.create("member-search-index.json");
 123 
 124     /** The name of the member search index zip file. */
 125     public static final DocPath MEMBER_SEARCH_INDEX_ZIP = DocPath.create("member-search-index.zip");
 126 
 127     /** The name of the member search index js file. */
 128     public static final DocPath MEMBER_SEARCH_INDEX_JS = DocPath.create("member-search-index.js");
 129 
 130     /** The name of the module search index file. */
 131     public static final DocPath MODULE_SEARCH_INDEX_JSON = DocPath.create("module-search-index.json");
 132 
 133     /** The name of the module search index zip file. */
 134     public static final DocPath MODULE_SEARCH_INDEX_ZIP = DocPath.create("module-search-index.zip");
 135 
 136     /** The name of the module search index js file. */
 137     public static final DocPath MODULE_SEARCH_INDEX_JS = DocPath.create("module-search-index.js");
 138 
 139     /** The name of the file for the overview frame. */
 140     public static final DocPath OVERVIEW_FRAME = DocPath.create("overview-frame.html");
 141 
 142     /** The name of the file for the overview summary. */
 143     public static final DocPath OVERVIEW_SUMMARY = DocPath.create("overview-summary.html");
 144 
 145     public static DocPath overviewSummary(boolean frames) {
 146         return frames ? OVERVIEW_SUMMARY : INDEX;
 147     }
 148 
 149     /** The name of the file for the overview tree. */
 150     public static final DocPath OVERVIEW_TREE = DocPath.create("overview-tree.html");
 151 
 152     /** The name of the file for the package frame. */
 153     public static final DocPath PACKAGE_FRAME = DocPath.create("package-frame.html");
 154 
 155     /** The name of the file for the package list. This is to support the legacy mode. */
 156     public static final DocPath PACKAGE_LIST = DocPath.create("package-list");
 157 
 158     /** The name of the package search index file. */
 159     public static final DocPath PACKAGE_SEARCH_INDEX_JSON = DocPath.create("package-search-index.json");
 160 
 161     /** The name of the package search index zip file. */
 162     public static final DocPath PACKAGE_SEARCH_INDEX_ZIP = DocPath.create("package-search-index.zip");
 163 
 164     /** The name of the package search index js file. */
 165     public static final DocPath PACKAGE_SEARCH_INDEX_JS = DocPath.create("package-search-index.js");
 166 
 167     /** The name of the file for the package summary. */
 168     public static final DocPath PACKAGE_SUMMARY = DocPath.create("package-summary.html");
 169 
 170     /** The name of the file for the package tree. */
 171     public static final DocPath PACKAGE_TREE = DocPath.create("package-tree.html");
 172 
 173     /** The name of the file for the package usage info. */
 174     public static final DocPath PACKAGE_USE = DocPath.create("package-use.html");
 175 
 176     /** The name of the output directory for module documentation files. */
 177     public static DocPath moduleDocFiles(ModuleElement mdle) {
 178         return DocPath.create(mdle.getQualifiedName() + "-doc-files");
 179     }
 180 
 181     /** The name of the file for the module frame. */
 182     public static DocPath moduleFrame(ModuleElement mdle) {
 183         return DocPath.create(mdle.getQualifiedName() + "-frame.html");
 184     }
 185 
 186     /** The name of the file for the module summary. */
 187     public static DocPath moduleSummary(ModuleElement mdle) {
 188         return DocPaths.moduleSummary(mdle.getQualifiedName().toString());
 189     }
 190 
 191     /** The name of the file for the module summary. */
 192     public static DocPath moduleSummary(String mdleName) {
 193         return DocPath.create(mdleName + "-summary.html");
 194     }
 195 
 196     /** The name of the file for the module frame. */
 197     public static DocPath moduleTypeFrame(ModuleElement mdle) {
 198         return DocPath.create(mdle.getQualifiedName() + "-type-frame.html");
 199     }
 200 
 201     /** The name of the file for the module overview frame. */
 202     public static final DocPath MODULE_OVERVIEW_FRAME = DocPath.create("module-overview-frame.html");
 203 
 204     /** The name of the sub-package from which resources are read. */
 205     public static final DocPath RESOURCES = DocPath.create("resources");
 206 
 207     /** The name of the search javascript file. */
 208     public static final DocPath SEARCH_JS = DocPath.create("search.js");
 209 
 210     /** The name of the file for the serialized form info. */
 211     public static final DocPath SERIALIZED_FORM = DocPath.create("serialized-form.html");
 212 
 213     /** The name of the directory in which HTML versions of the source code
 214      *  are generated.
 215      */
 216     public static final DocPath SOURCE_OUTPUT = DocPath.create("src-html");
 217 
 218     /** The name of the default stylesheet. */
 219     public static final DocPath STYLESHEET = DocPath.create("stylesheet.css");
 220 
 221     /** The name of the tag search index file. */
 222     public static final DocPath TAG_SEARCH_INDEX_JSON = DocPath.create("tag-search-index.json");
 223 
 224     /** The name of the tag search index zip file. */
 225     public static final DocPath TAG_SEARCH_INDEX_ZIP = DocPath.create("tag-search-index.zip");
 226 
 227     /** The name of the tag search index js file. */
 228     public static final DocPath TAG_SEARCH_INDEX_JS = DocPath.create("tag-search-index.js");
 229 
 230     /** The name of the type search index file. */
 231     public static final DocPath TYPE_SEARCH_INDEX_JSON = DocPath.create("type-search-index.json");
 232 
 233     /** The name of the type search index zip file. */
 234     public static final DocPath TYPE_SEARCH_INDEX_ZIP = DocPath.create("type-search-index.zip");
 235 
 236     /** The name of the type search index js file. */
 237     public static final DocPath TYPE_SEARCH_INDEX_JS = DocPath.create("type-search-index.js");
 238 
 239     /** The name of the image file for undo button on the search box. */
 240     public static final DocPath X_IMG = DocPath.create("x.png");
 241 
 242 }