23 * have any questions. |
23 * have any questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.doclets.formats.html; |
26 package com.sun.tools.doclets.formats.html; |
27 |
27 |
28 import com.sun.tools.doclets.internal.toolkit.util.*; |
|
29 |
|
30 import com.sun.javadoc.*; |
|
31 import java.io.*; |
28 import java.io.*; |
32 import java.util.*; |
29 import java.util.*; |
|
30 |
|
31 import com.sun.javadoc.*; |
|
32 import com.sun.tools.doclets.internal.toolkit.util.*; |
33 |
33 |
34 /** |
34 /** |
35 * Generate Index for all the Member Names with Indexing in |
35 * Generate Index for all the Member Names with Indexing in |
36 * Unicode Order. This class is a base class for {@link SingleIndexWriter} and |
36 * Unicode Order. This class is a base class for {@link SingleIndexWriter} and |
37 * {@link SplitIndexWriter}. It uses the functionality from |
37 * {@link SplitIndexWriter}. It uses the functionality from |
98 protected void generateContents(Character unicode, List<? extends Doc> memberlist) { |
98 protected void generateContents(Character unicode, List<? extends Doc> memberlist) { |
99 anchor("_" + unicode + "_"); |
99 anchor("_" + unicode + "_"); |
100 h2(); |
100 h2(); |
101 strong(unicode.toString()); |
101 strong(unicode.toString()); |
102 h2End(); |
102 h2End(); |
103 dl(); |
103 int memberListSize = memberlist.size(); |
104 for (int i = 0; i < memberlist.size(); i++) { |
104 // Display the list only if there are elements to be displayed. |
105 Doc element = memberlist.get(i); |
105 if (memberListSize > 0) { |
106 if (element instanceof MemberDoc) { |
106 dl(); |
107 printDescription((MemberDoc)element); |
107 for (int i = 0; i < memberListSize; i++) { |
108 } else if (element instanceof ClassDoc) { |
108 Doc element = memberlist.get(i); |
109 printDescription((ClassDoc)element); |
109 if (element instanceof MemberDoc) { |
110 } else if (element instanceof PackageDoc) { |
110 printDescription((MemberDoc)element); |
111 printDescription((PackageDoc)element); |
111 } else if (element instanceof ClassDoc) { |
112 } |
112 printDescription((ClassDoc)element); |
113 } |
113 } else if (element instanceof PackageDoc) { |
114 dlEnd(); |
114 printDescription((PackageDoc)element); |
|
115 } |
|
116 } |
|
117 dlEnd(); |
|
118 } |
115 hr(); |
119 hr(); |
116 } |
120 } |
117 |
121 |
118 |
122 |
119 /** |
123 /** |
124 protected void printDescription(PackageDoc pkg) { |
128 protected void printDescription(PackageDoc pkg) { |
125 dt(); |
129 dt(); |
126 printPackageLink(pkg, Util.getPackageName(pkg), true); |
130 printPackageLink(pkg, Util.getPackageName(pkg), true); |
127 print(" - "); |
131 print(" - "); |
128 print(configuration.getText("doclet.package") + " " + pkg.name()); |
132 print(configuration.getText("doclet.package") + " " + pkg.name()); |
|
133 dtEnd(); |
129 dd(); |
134 dd(); |
130 printSummaryComment(pkg); |
135 printSummaryComment(pkg); |
|
136 ddEnd(); |
131 } |
137 } |
132 |
138 |
133 /** |
139 /** |
134 * Print one line summary comment for the class. |
140 * Print one line summary comment for the class. |
135 * |
141 * |
138 protected void printDescription(ClassDoc cd) { |
144 protected void printDescription(ClassDoc cd) { |
139 dt(); |
145 dt(); |
140 printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true)); |
146 printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true)); |
141 print(" - "); |
147 print(" - "); |
142 printClassInfo(cd); |
148 printClassInfo(cd); |
|
149 dtEnd(); |
143 dd(); |
150 dd(); |
144 printComment(cd); |
151 printComment(cd); |
|
152 ddEnd(); |
145 } |
153 } |
146 |
154 |
147 /** |
155 /** |
148 * Print the classkind(class, interface, exception, error of the class |
156 * Print the classkind(class, interface, exception, error of the class |
149 * passed. |
157 * passed. |