src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java

changeset 1568
5f0731e4e5e6
parent 1373
4a1c57a1c410
child 1571
af8417e590f4
equal deleted inserted replaced
1488:56c97aff46bb 1568:5f0731e4e5e6
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, 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
27 27
28 import java.io.*; 28 import java.io.*;
29 import java.util.*; 29 import java.util.*;
30 30
31 import com.sun.javadoc.*; 31 import com.sun.javadoc.*;
32 import com.sun.tools.javac.jvm.Profile;
32 import com.sun.tools.doclets.formats.html.markup.*; 33 import com.sun.tools.doclets.formats.html.markup.*;
33 import com.sun.tools.doclets.internal.toolkit.*; 34 import com.sun.tools.doclets.internal.toolkit.*;
34 import com.sun.tools.doclets.internal.toolkit.util.*; 35 import com.sun.tools.doclets.internal.toolkit.util.*;
35 36
36 /** 37 /**
120 } 121 }
121 122
122 /** 123 /**
123 * {@inheritDoc} 124 * {@inheritDoc}
124 */ 125 */
126 protected void addProfilesList(String profileSummary, String profilesTableSummary,
127 Content body) {
128 Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, profilesTableSummary,
129 getTableCaption(profileSummary));
130 table.addContent(getSummaryTableHeader(profileTableHeader, "col"));
131 Content tbody = new HtmlTree(HtmlTag.TBODY);
132 addProfilesList(tbody);
133 table.addContent(tbody);
134 Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
135 body.addContent(div);
136 }
137
138 /**
139 * {@inheritDoc}
140 */
125 protected void addPackagesList(PackageDoc[] packages, String text, 141 protected void addPackagesList(PackageDoc[] packages, String text,
126 String tableSummary, Content body) { 142 String tableSummary, Content body) {
127 Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, tableSummary, 143 Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, tableSummary,
128 getTableCaption(text)); 144 getTableCaption(text));
129 table.addContent(getSummaryTableHeader(packageTableHeader, "col")); 145 table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
130 Content tbody = new HtmlTree(HtmlTag.TBODY); 146 Content tbody = new HtmlTree(HtmlTag.TBODY);
131 addPackagesList(packages, tbody); 147 addPackagesList(packages, tbody);
132 table.addContent(tbody); 148 table.addContent(tbody);
133 Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); 149 Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
134 body.addContent(div); 150 body.addContent(div);
151 }
152
153 /**
154 * Adds list of profiles in the index table. Generate link to each profile.
155 *
156 * @param tbody the documentation tree to which the list will be added
157 */
158 protected void addProfilesList(Content tbody) {
159 for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
160 String profileName = Profile.lookup(i).name;
161 Content profileLinkContent = getTargetProfileLink("classFrame",
162 new StringContent(profileName), profileName);
163 Content tdProfile = HtmlTree.TD(HtmlStyle.colFirst, profileLinkContent);
164 HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
165 tdSummary.addStyle(HtmlStyle.colLast);
166 tdSummary.addContent(getSpace());
167 HtmlTree tr = HtmlTree.TR(tdProfile);
168 tr.addContent(tdSummary);
169 if (i % 2 == 0) {
170 tr.addStyle(HtmlStyle.altColor);
171 } else {
172 tr.addStyle(HtmlStyle.rowColor);
173 }
174 tbody.addContent(tr);
175 }
135 } 176 }
136 177
137 /** 178 /**
138 * Adds list of packages in the index table. Generate link to each package. 179 * Adds list of packages in the index table. Generate link to each package.
139 * 180 *

mercurial