32 |
32 |
33 /** |
33 /** |
34 * Generate package usage information. |
34 * Generate package usage information. |
35 * |
35 * |
36 * @author Robert G. Field |
36 * @author Robert G. Field |
|
37 * @author Bhavesh Patel (Modified) |
37 */ |
38 */ |
38 public class PackageUseWriter extends SubWriterHolderWriter { |
39 public class PackageUseWriter extends SubWriterHolderWriter { |
39 |
40 |
40 final PackageDoc pkgdoc; |
41 final PackageDoc pkgdoc; |
41 final SortedMap<String,Set<ClassDoc>> usingPackageToUsedClasses = new TreeMap<String,Set<ClassDoc>>(); |
42 final SortedMap<String,Set<ClassDoc>> usingPackageToUsedClasses = new TreeMap<String,Set<ClassDoc>>(); |
129 } |
130 } |
130 generateClassList(); |
131 generateClassList(); |
131 } |
132 } |
132 |
133 |
133 protected void generatePackageList() throws IOException { |
134 protected void generatePackageList() throws IOException { |
134 tableIndexSummary(); |
135 tableIndexSummary(useTableSummary); |
135 tableHeaderStart("#CCCCFF"); |
136 tableCaptionStart(); |
136 printText("doclet.ClassUse_Packages.that.use.0", |
137 printText("doclet.ClassUse_Packages.that.use.0", |
137 getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false)); |
138 getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false)); |
138 tableHeaderEnd(); |
139 tableCaptionEnd(); |
|
140 summaryTableHeader(packageTableHeader, "col"); |
139 Iterator<String> it = usingPackageToUsedClasses.keySet().iterator(); |
141 Iterator<String> it = usingPackageToUsedClasses.keySet().iterator(); |
140 while (it.hasNext()) { |
142 while (it.hasNext()) { |
141 PackageDoc pkg = configuration.root.packageNamed(it.next()); |
143 PackageDoc pkg = configuration.root.packageNamed(it.next()); |
142 generatePackageUse(pkg); |
144 generatePackageUse(pkg); |
143 } |
145 } |
145 space(); |
147 space(); |
146 p(); |
148 p(); |
147 } |
149 } |
148 |
150 |
149 protected void generateClassList() throws IOException { |
151 protected void generateClassList() throws IOException { |
|
152 String[] classTableHeader = new String[] { |
|
153 configuration.getText("doclet.0_and_1", |
|
154 configuration.getText("doclet.Class"), |
|
155 configuration.getText("doclet.Description")) |
|
156 }; |
150 Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator(); |
157 Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator(); |
151 while (itp.hasNext()) { |
158 while (itp.hasNext()) { |
152 String packageName = itp.next(); |
159 String packageName = itp.next(); |
153 PackageDoc usingPackage = configuration.root.packageNamed(packageName); |
160 PackageDoc usingPackage = configuration.root.packageNamed(packageName); |
154 if (usingPackage != null) { |
161 if (usingPackage != null) { |
155 anchor(usingPackage.name()); |
162 anchor(usingPackage.name()); |
156 } |
163 } |
157 tableIndexSummary(); |
164 tableIndexSummary(configuration.getText("doclet.Use_Table_Summary", |
158 tableHeaderStart("#CCCCFF"); |
165 configuration.getText("doclet.classes"))); |
|
166 tableCaptionStart(); |
159 printText("doclet.ClassUse_Classes.in.0.used.by.1", |
167 printText("doclet.ClassUse_Classes.in.0.used.by.1", |
160 getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false), |
168 getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false), |
161 getPackageLink(usingPackage,Util.getPackageName(usingPackage), false)); |
169 getPackageLink(usingPackage,Util.getPackageName(usingPackage), false)); |
162 tableHeaderEnd(); |
170 tableCaptionEnd(); |
|
171 summaryTableHeader(classTableHeader, "col"); |
163 Iterator<ClassDoc> itc = |
172 Iterator<ClassDoc> itc = |
164 usingPackageToUsedClasses.get(packageName).iterator(); |
173 usingPackageToUsedClasses.get(packageName).iterator(); |
165 while (itc.hasNext()) { |
174 while (itc.hasNext()) { |
166 printClassRow(itc.next(), packageName); |
175 printClassRow(itc.next(), packageName); |
167 } |
176 } |