1 /* |
1 /* |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2016, 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 |
30 import java.util.Collection; |
30 import java.util.Collection; |
31 import java.util.List; |
31 import java.util.List; |
32 import java.util.ListIterator; |
32 import java.util.ListIterator; |
33 import java.util.Set; |
33 import java.util.Set; |
34 import java.util.TreeSet; |
34 import java.util.TreeSet; |
|
35 |
35 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
36 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
36 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
37 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
37 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
38 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
38 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
39 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
39 import jdk.javadoc.internal.doclets.toolkit.Content; |
40 import jdk.javadoc.internal.doclets.toolkit.Content; |
|
41 import jdk.javadoc.internal.doclets.toolkit.Messages; |
40 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
42 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
41 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
43 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
42 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; |
44 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; |
43 import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder; |
45 import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder; |
44 |
46 |
113 indexbuilder, keys, li.previousIndex(), li.nextIndex()); |
115 indexbuilder, keys, li.previousIndex(), li.nextIndex()); |
114 indexgen.generateIndexFile((Character) ch); |
116 indexgen.generateIndexFile((Character) ch); |
115 if (!li.hasNext()) { |
117 if (!li.hasNext()) { |
116 indexgen.createSearchIndexFiles(); |
118 indexgen.createSearchIndexFiles(); |
117 } |
119 } |
118 indexgen.close(); |
|
119 } |
120 } |
120 } catch (IOException exc) { |
121 } catch (IOException exc) { |
121 configuration.standardmessage.error( |
122 Messages messages = configuration.getMessages(); |
122 "doclet.exception_encountered", |
123 messages.error("doclet.exception_encountered", |
123 exc.toString(), filename.getPath()); |
124 exc.toString(), filename.getPath()); |
124 throw new DocletAbortException(exc); |
125 throw new DocletAbortException(exc); |
125 } |
126 } |
126 } |
127 } |
127 |
128 |
176 protected void addLinksForIndexes(Content contentTree) { |
177 protected void addLinksForIndexes(Content contentTree) { |
177 for (int i = 0; i < indexElements.size(); i++) { |
178 for (int i = 0; i < indexElements.size(); i++) { |
178 int j = i + 1; |
179 int j = i + 1; |
179 contentTree.addContent(getHyperLink(DocPaths.indexN(j), |
180 contentTree.addContent(getHyperLink(DocPaths.indexN(j), |
180 new StringContent(indexElements.get(i).toString()))); |
181 new StringContent(indexElements.get(i).toString()))); |
181 contentTree.addContent(getSpace()); |
182 contentTree.addContent(Contents.SPACE); |
182 } |
183 } |
183 } |
184 } |
184 |
185 |
185 /** |
186 /** |
186 * Get link to the previous unicode character. |
187 * Get link to the previous unicode character. |
187 * |
188 * |
188 * @return a content tree for the link |
189 * @return a content tree for the link |
189 */ |
190 */ |
190 public Content getNavLinkPrevious() { |
191 public Content getNavLinkPrevious() { |
191 Content prevletterLabel = getResource("doclet.Prev_Letter"); |
192 Content prevletterLabel = contents.prevLetter; |
192 if (prev == -1) { |
193 if (prev == -1) { |
193 return HtmlTree.LI(prevletterLabel); |
194 return HtmlTree.LI(prevletterLabel); |
194 } |
195 } |
195 else { |
196 else { |
196 Content prevLink = getHyperLink(DocPaths.indexN(prev), |
197 Content prevLink = getHyperLink(DocPaths.indexN(prev), |
203 * Get link to the next unicode character. |
204 * Get link to the next unicode character. |
204 * |
205 * |
205 * @return a content tree for the link |
206 * @return a content tree for the link |
206 */ |
207 */ |
207 public Content getNavLinkNext() { |
208 public Content getNavLinkNext() { |
208 Content nextletterLabel = getResource("doclet.Next_Letter"); |
209 Content nextletterLabel = contents.nextLetter; |
209 if (next == -1) { |
210 if (next == -1) { |
210 return HtmlTree.LI(nextletterLabel); |
211 return HtmlTree.LI(nextletterLabel); |
211 } |
212 } |
212 else { |
213 else { |
213 Content nextLink = getHyperLink(DocPaths.indexN(next), |
214 Content nextLink = getHyperLink(DocPaths.indexN(next), |