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.formats.html;
27
28 import java.util.ArrayList;
29 import java.util.Collection;
30 import java.util.List;
31 import java.util.ListIterator;
32 import java.util.Set;
33 import java.util.TreeSet;
34
35 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.HtmlTree;
38 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
39 import jdk.javadoc.internal.doclets.toolkit.Content;
40 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
41 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
42 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
43 import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder;
44
45
46 /**
47 * Generate Separate Index Files for all the member names with Indexing in
48 * Unicode Order. This will create "index-files" directory in the current or
49 * destination directory and will generate separate file for each unicode index.
50 *
51 * <p><b>This is NOT part of any supported API.
52 * If you write code that depends on this, you do so at your own risk.
53 * This code and its internal interfaces are subject to change or
54 * deletion without notice.</b>
55 *
56 * @see java.lang.Character
57 * @author Atul M Dambalkar
159 body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree);
160 if (configuration.allowTag(HtmlTag.FOOTER)) {
161 htmlTree = HtmlTree.FOOTER();
162 }
163 addNavLinks(false, htmlTree);
164 addBottom(htmlTree);
165 if (configuration.allowTag(HtmlTag.FOOTER)) {
166 body.addContent(htmlTree);
167 }
168 printHtmlDocument(null, true, body);
169 }
170
171 /**
172 * Add links for all the Index Files per unicode character.
173 *
174 * @param contentTree the content tree to which the links for indexes will be added
175 */
176 protected void addLinksForIndexes(Content contentTree) {
177 for (int i = 0; i < indexElements.size(); i++) {
178 int j = i + 1;
179 contentTree.addContent(getHyperLink(DocPaths.indexN(j),
180 new StringContent(indexElements.get(i).toString())));
181 contentTree.addContent(Contents.SPACE);
182 }
183 }
184
185 /**
186 * Get link to the previous unicode character.
187 *
188 * @return a content tree for the link
189 */
190 @Override
191 public Content getNavLinkPrevious() {
192 Content prevletterLabel = contents.prevLetter;
193 if (prev == -1) {
194 return HtmlTree.LI(prevletterLabel);
195 }
196 else {
197 Content prevLink = getHyperLink(DocPaths.indexN(prev),
198 prevletterLabel);
199 return HtmlTree.LI(prevLink);
200 }
201 }
202
203 /**
204 * Get link to the next unicode character.
205 *
206 * @return a content tree for the link
207 */
208 @Override
209 public Content getNavLinkNext() {
210 Content nextletterLabel = contents.nextLetter;
211 if (next == -1) {
212 return HtmlTree.LI(nextletterLabel);
213 }
214 else {
215 Content nextLink = getHyperLink(DocPaths.indexN(next),
216 nextletterLabel);
217 return HtmlTree.LI(nextLink);
218 }
219 }
220 }
|
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.formats.html;
27
28 import java.util.ArrayList;
29 import java.util.Collection;
30 import java.util.List;
31 import java.util.ListIterator;
32 import java.util.Set;
33 import java.util.TreeSet;
34
35 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.HtmlTree;
38 import jdk.javadoc.internal.doclets.formats.html.markup.Links;
39 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
40 import jdk.javadoc.internal.doclets.toolkit.Content;
41 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
42 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
43 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
44 import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder;
45
46
47 /**
48 * Generate Separate Index Files for all the member names with Indexing in
49 * Unicode Order. This will create "index-files" directory in the current or
50 * destination directory and will generate separate file for each unicode index.
51 *
52 * <p><b>This is NOT part of any supported API.
53 * If you write code that depends on this, you do so at your own risk.
54 * This code and its internal interfaces are subject to change or
55 * deletion without notice.</b>
56 *
57 * @see java.lang.Character
58 * @author Atul M Dambalkar
160 body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree);
161 if (configuration.allowTag(HtmlTag.FOOTER)) {
162 htmlTree = HtmlTree.FOOTER();
163 }
164 addNavLinks(false, htmlTree);
165 addBottom(htmlTree);
166 if (configuration.allowTag(HtmlTag.FOOTER)) {
167 body.addContent(htmlTree);
168 }
169 printHtmlDocument(null, true, body);
170 }
171
172 /**
173 * Add links for all the Index Files per unicode character.
174 *
175 * @param contentTree the content tree to which the links for indexes will be added
176 */
177 protected void addLinksForIndexes(Content contentTree) {
178 for (int i = 0; i < indexElements.size(); i++) {
179 int j = i + 1;
180 contentTree.addContent(Links.createLink(DocPaths.indexN(j),
181 new StringContent(indexElements.get(i).toString())));
182 contentTree.addContent(Contents.SPACE);
183 }
184 }
185
186 /**
187 * Get link to the previous unicode character.
188 *
189 * @return a content tree for the link
190 */
191 @Override
192 public Content getNavLinkPrevious() {
193 Content prevletterLabel = contents.prevLetter;
194 if (prev == -1) {
195 return HtmlTree.LI(prevletterLabel);
196 }
197 else {
198 Content prevLink = Links.createLink(DocPaths.indexN(prev),
199 prevletterLabel);
200 return HtmlTree.LI(prevLink);
201 }
202 }
203
204 /**
205 * Get link to the next unicode character.
206 *
207 * @return a content tree for the link
208 */
209 @Override
210 public Content getNavLinkNext() {
211 Content nextletterLabel = contents.nextLetter;
212 if (next == -1) {
213 return HtmlTree.LI(nextletterLabel);
214 }
215 else {
216 Content nextLink = Links.createLink(DocPaths.indexN(next),
217 nextletterLabel);
218 return HtmlTree.LI(nextLink);
219 }
220 }
221 }
|