langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java
changeset 25454 376a52c9540c
parent 24297 84baad0ac4d7
equal deleted inserted replaced
25453:be80cf0463b3 25454:376a52c9540c
    69     private boolean javafx;
    69     private boolean javafx;
    70 
    70 
    71     // make ProgramElementDoc[] when new toArray is available
    71     // make ProgramElementDoc[] when new toArray is available
    72     protected final Object[] elements;
    72     protected final Object[] elements;
    73 
    73 
       
    74     private final Configuration configuration;
    74     /**
    75     /**
    75      * Constructor. Build the index map.
    76      * Constructor. Build the index map.
    76      *
    77      *
    77      * @param configuration the current configuration of the doclet.
    78      * @param configuration the current configuration of the doclet.
    78      * @param noDeprecated  true if -nodeprecated option is used,
    79      * @param noDeprecated  true if -nodeprecated option is used,
    90      *                      false otherwise.
    91      *                      false otherwise.
    91      * @param classesOnly   Include only classes in index.
    92      * @param classesOnly   Include only classes in index.
    92      */
    93      */
    93     public IndexBuilder(Configuration configuration, boolean noDeprecated,
    94     public IndexBuilder(Configuration configuration, boolean noDeprecated,
    94                         boolean classesOnly) {
    95                         boolean classesOnly) {
       
    96         this.configuration  = configuration;
    95         if (classesOnly) {
    97         if (classesOnly) {
    96             configuration.message.notice("doclet.Building_Index_For_All_Classes");
    98             configuration.message.notice("doclet.Building_Index_For_All_Classes");
    97         } else {
    99         } else {
    98             configuration.message.notice("doclet.Building_Index");
   100             configuration.message.notice("doclet.Building_Index");
    99         }
   101         }
   110      * Sort the index map. Traverse the index map for all it's elements and
   112      * Sort the index map. Traverse the index map for all it's elements and
   111      * sort each element which is a list.
   113      * sort each element which is a list.
   112      */
   114      */
   113     protected void sortIndexMap() {
   115     protected void sortIndexMap() {
   114         for (List<Doc> docs : indexmap.values()) {
   116         for (List<Doc> docs : indexmap.values()) {
   115             Collections.sort(docs, Util.makeComparatorForIndexUse());
   117             Collections.sort(docs, configuration.utils.makeComparatorForIndexUse());
   116         }
   118         }
   117     }
   119     }
   118 
   120 
   119     /**
   121     /**
   120      * Get all the members in all the Packages and all the Classes
   122      * Get all the members in all the Packages and all the Classes
   200         }
   202         }
   201 
   203 
   202         if (element instanceof PackageDoc)
   204         if (element instanceof PackageDoc)
   203             // Do not add to index map if -nodeprecated option is set and the
   205             // Do not add to index map if -nodeprecated option is set and the
   204             // package is marked as deprecated.
   206             // package is marked as deprecated.
   205             return !(noDeprecated && Util.isDeprecated(element));
   207             return !(noDeprecated && configuration.utils.isDeprecated(element));
   206         else
   208         else
   207             // Do not add to index map if -nodeprecated option is set and if the
   209             // Do not add to index map if -nodeprecated option is set and if the
   208             // Doc is marked as deprecated or the containing package is marked as
   210             // Doc is marked as deprecated or the containing package is marked as
   209             // deprecated.
   211             // deprecated.
   210             return !(noDeprecated &&
   212             return !(noDeprecated &&
   211                     (Util.isDeprecated(element) ||
   213                     (configuration.utils.isDeprecated(element) ||
   212                     Util.isDeprecated(((ProgramElementDoc)element).containingPackage())));
   214                     configuration.utils.isDeprecated(((ProgramElementDoc)element).containingPackage())));
   213     }
   215     }
   214 
   216 
   215     /**
   217     /**
   216      * Return a map of all the individual member lists with Unicode character.
   218      * Return a map of all the individual member lists with Unicode character.
   217      *
   219      *