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

changeset 1738
6ea964c78845
parent 1737
7a9ef837e57f
child 1740
ce4f0769b4b2
equal deleted inserted replaced
1737:7a9ef837e57f 1738:6ea964c78845
371 if (!Util.isCoreClass(classes[i]) || 371 if (!Util.isCoreClass(classes[i]) ||
372 !configuration.isGeneratedDoc(classes[i])) { 372 !configuration.isGeneratedDoc(classes[i])) {
373 continue; 373 continue;
374 } 374 }
375 Content classContent = getLink(new LinkInfoImpl( 375 Content classContent = getLink(new LinkInfoImpl(
376 configuration, LinkInfoImpl.Kind.PACKAGE, classes[i], 376 configuration, LinkInfoImpl.Kind.PACKAGE, classes[i]));
377 false));
378 Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); 377 Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
379 HtmlTree tr = HtmlTree.TR(tdClass); 378 HtmlTree tr = HtmlTree.TR(tdClass);
380 if (i%2 == 0) 379 if (i%2 == 0)
381 tr.addStyle(HtmlStyle.altColor); 380 tr.addStyle(HtmlStyle.altColor);
382 else 381 else
1190 * @param context the id of the context where the link will be added 1189 * @param context the id of the context where the link will be added
1191 * @param cd the class doc to link to 1190 * @param cd the class doc to link to
1192 * @return a content tree for the link 1191 * @return a content tree for the link
1193 */ 1192 */
1194 public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) { 1193 public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) {
1195 return getLink(new LinkInfoImpl(configuration, context, cd, 1194 return getLink(new LinkInfoImpl(configuration, context, cd)
1196 new StringContent(configuration.getClassName(cd)), "")); 1195 .label(configuration.getClassName(cd)));
1197 } 1196 }
1198 1197
1199 /** 1198 /**
1200 * Add the class link. 1199 * Add the class link.
1201 * 1200 *
1222 PackageDoc pd = cd.containingPackage(); 1221 PackageDoc pd = cd.containingPackage();
1223 if (pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { 1222 if (pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
1224 classlink.addContent(getPkgName(cd)); 1223 classlink.addContent(getPkgName(cd));
1225 } 1224 }
1226 classlink.addContent(getLink(new LinkInfoImpl(configuration, 1225 classlink.addContent(getLink(new LinkInfoImpl(configuration,
1227 context, cd, cd.name(), isStrong))); 1226 context, cd).label(cd.name()).strong(isStrong)));
1228 return classlink; 1227 return classlink;
1229 } 1228 }
1230 1229
1231 /** 1230 /**
1232 * Add the class link with the package portion of the label in 1231 * Add the class link with the package portion of the label in
1243 PackageDoc pd = cd.containingPackage(); 1242 PackageDoc pd = cd.containingPackage();
1244 if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { 1243 if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
1245 contentTree.addContent(getPkgName(cd)); 1244 contentTree.addContent(getPkgName(cd));
1246 } 1245 }
1247 contentTree.addContent(getLink(new LinkInfoImpl(configuration, 1246 contentTree.addContent(getLink(new LinkInfoImpl(configuration,
1248 context, cd, cd.name(), isStrong))); 1247 context, cd).label(cd.name()).strong(isStrong)));
1249 } 1248 }
1250 1249
1251 /** 1250 /**
1252 * Add the class link, with only class name as the strong link and prefixing 1251 * Add the class link, with only class name as the strong link and prefixing
1253 * plain package name. 1252 * plain package name.
1327 if (! (doc.isIncluded() || 1326 if (! (doc.isIncluded() ||
1328 Util.isLinkable(classDoc, configuration))) { 1327 Util.isLinkable(classDoc, configuration))) {
1329 return label; 1328 return label;
1330 } else if (doc instanceof ExecutableMemberDoc) { 1329 } else if (doc instanceof ExecutableMemberDoc) {
1331 ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; 1330 ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
1332 return getLink(new LinkInfoImpl(configuration, context, classDoc, 1331 return getLink(new LinkInfoImpl(configuration, context, classDoc)
1333 getAnchor(emd, isProperty), label, strong)); 1332 .label(label).where(getAnchor(emd, isProperty)).strong(strong));
1334 } else if (doc instanceof MemberDoc) { 1333 } else if (doc instanceof MemberDoc) {
1335 return getLink(new LinkInfoImpl(configuration, context, classDoc, 1334 return getLink(new LinkInfoImpl(configuration, context, classDoc)
1336 doc.name(), label, strong)); 1335 .label(label).where(doc.name()).strong(strong));
1337 } else { 1336 } else {
1338 return label; 1337 return label;
1339 } 1338 }
1340 } 1339 }
1341 1340
1354 Content label) { 1353 Content label) {
1355 if (! (doc.isIncluded() || 1354 if (! (doc.isIncluded() ||
1356 Util.isLinkable(classDoc, configuration))) { 1355 Util.isLinkable(classDoc, configuration))) {
1357 return label; 1356 return label;
1358 } else if (doc instanceof ExecutableMemberDoc) { 1357 } else if (doc instanceof ExecutableMemberDoc) {
1359 ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; 1358 ExecutableMemberDoc emd = (ExecutableMemberDoc) doc;
1360 return getLink(new LinkInfoImpl(configuration, context, classDoc, 1359 return getLink(new LinkInfoImpl(configuration, context, classDoc)
1361 getAnchor(emd), label, false)); 1360 .label(label).where(getAnchor(emd)));
1362 } else if (doc instanceof MemberDoc) { 1361 } else if (doc instanceof MemberDoc) {
1363 return getLink(new LinkInfoImpl(configuration, context, classDoc, 1362 return getLink(new LinkInfoImpl(configuration, context, classDoc)
1364 doc.name(), label, false)); 1363 .label(label).where(doc.name()));
1365 } else { 1364 } else {
1366 return label; 1365 return label;
1367 } 1366 }
1368 } 1367 }
1369 1368
1445 } else if (refMemName == null) { 1444 } else if (refMemName == null) {
1446 // Must be a class reference since refClass is not null and refMemName is null. 1445 // Must be a class reference since refClass is not null and refMemName is null.
1447 if (label.isEmpty()) { 1446 if (label.isEmpty()) {
1448 label = plainOrCode(plain, new StringContent(refClass.name())); 1447 label = plainOrCode(plain, new StringContent(refClass.name()));
1449 } 1448 }
1450 return getLink(new LinkInfoImpl(configuration, refClass, label)).toString(); 1449 return getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, refClass)
1450 .label(label)).toString();
1451 } else if (refMem == null) { 1451 } else if (refMem == null) {
1452 // Must be a member reference since refClass is not null and refMemName is not null. 1452 // Must be a member reference since refClass is not null and refMemName is not null.
1453 // However, refMem is null, so this referenced member does not exist. 1453 // However, refMem is null, so this referenced member does not exist.
1454 return (label.isEmpty() ? text: label).toString(); 1454 return (label.isEmpty() ? text: label).toString();
1455 } else { 1455 } else {

mercurial