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

changeset 1736
74cd21f2c2fe
parent 1735
8ea30d59ac41
child 1738
6ea964c78845
equal deleted inserted replaced
1735:8ea30d59ac41 1736:74cd21f2c2fe
122 * @return a content tree for the previous class link 122 * @return a content tree for the previous class link
123 */ 123 */
124 public Content getNavLinkPrevious() { 124 public Content getNavLinkPrevious() {
125 Content li; 125 Content li;
126 if (prev != null) { 126 if (prev != null) {
127 Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration, 127 Content prevLink = getLink(new LinkInfoImpl(configuration,
128 LinkInfoImpl.Kind.CLASS, prev, "", 128 LinkInfoImpl.Kind.CLASS, prev, "",
129 configuration.getText("doclet.Prev_Class"), true))); 129 configuration.getText("doclet.Prev_Class"), true));
130 li = HtmlTree.LI(prevLink); 130 li = HtmlTree.LI(prevLink);
131 } 131 }
132 else 132 else
133 li = HtmlTree.LI(prevclassLabel); 133 li = HtmlTree.LI(prevclassLabel);
134 return li; 134 return li;
140 * @return a content tree for the next class link 140 * @return a content tree for the next class link
141 */ 141 */
142 public Content getNavLinkNext() { 142 public Content getNavLinkNext() {
143 Content li; 143 Content li;
144 if (next != null) { 144 if (next != null) {
145 Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration, 145 Content nextLink = getLink(new LinkInfoImpl(configuration,
146 LinkInfoImpl.Kind.CLASS, next, "", 146 LinkInfoImpl.Kind.CLASS, next, "",
147 configuration.getText("doclet.Next_Class"), true))); 147 configuration.getText("doclet.Next_Class"), true));
148 li = HtmlTree.LI(nextLink); 148 li = HtmlTree.LI(nextLink);
149 } 149 }
150 else 150 else
151 li = HtmlTree.LI(nextclassLabel); 151 li = HtmlTree.LI(nextclassLabel);
152 return li; 152 return li;
189 //Let's not link to ourselves in the header. 189 //Let's not link to ourselves in the header.
190 linkInfo.linkToSelf = false; 190 linkInfo.linkToSelf = false;
191 Content headerContent = new StringContent(header); 191 Content headerContent = new StringContent(header);
192 Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, 192 Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
193 HtmlStyle.title, headerContent); 193 HtmlStyle.title, headerContent);
194 heading.addContent(new RawHtml(getTypeParameterLinks(linkInfo))); 194 heading.addContent(getTypeParameterLinks(linkInfo));
195 div.addContent(heading); 195 div.addContent(heading);
196 bodyTree.addContent(div); 196 bodyTree.addContent(div);
197 return bodyTree; 197 return bodyTree;
198 } 198 }
199 199
247 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, 247 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
248 LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc, false); 248 LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc, false);
249 //Let's not link to ourselves in the signature. 249 //Let's not link to ourselves in the signature.
250 linkInfo.linkToSelf = false; 250 linkInfo.linkToSelf = false;
251 Content className = new StringContent(classDoc.name()); 251 Content className = new StringContent(classDoc.name());
252 Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo)); 252 Content parameterLinks = getTypeParameterLinks(linkInfo);
253 if (configuration.linksource) { 253 if (configuration.linksource) {
254 addSrcLink(classDoc, className, pre); 254 addSrcLink(classDoc, className, pre);
255 pre.addContent(parameterLinks); 255 pre.addContent(parameterLinks);
256 } else { 256 } else {
257 Content span = HtmlTree.SPAN(HtmlStyle.strong, className); 257 Content span = HtmlTree.SPAN(HtmlStyle.strong, className);
262 Type superclass = Util.getFirstVisibleSuperClass(classDoc, 262 Type superclass = Util.getFirstVisibleSuperClass(classDoc,
263 configuration); 263 configuration);
264 if (superclass != null) { 264 if (superclass != null) {
265 pre.addContent(DocletConstants.NL); 265 pre.addContent(DocletConstants.NL);
266 pre.addContent("extends "); 266 pre.addContent("extends ");
267 Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, 267 Content link = getLink(new LinkInfoImpl(configuration,
268 LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, 268 LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
269 superclass))); 269 superclass));
270 pre.addContent(link); 270 pre.addContent(link);
271 } 271 }
272 } 272 }
273 Type[] implIntfacs = classDoc.interfaceTypes(); 273 Type[] implIntfacs = classDoc.interfaceTypes();
274 if (implIntfacs != null && implIntfacs.length > 0) { 274 if (implIntfacs != null && implIntfacs.length > 0) {
283 pre.addContent(DocletConstants.NL); 283 pre.addContent(DocletConstants.NL);
284 pre.addContent(isInterface? "extends " : "implements "); 284 pre.addContent(isInterface? "extends " : "implements ");
285 } else { 285 } else {
286 pre.addContent(", "); 286 pre.addContent(", ");
287 } 287 }
288 Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, 288 Content link = getLink(new LinkInfoImpl(configuration,
289 LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, 289 LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
290 implIntfacs[i]))); 290 implIntfacs[i]));
291 pre.addContent(link); 291 pre.addContent(link);
292 counter++; 292 counter++;
293 } 293 }
294 } 294 }
295 classInfoTree.addContent(pre); 295 classInfoTree.addContent(pre);
358 * @return a content tree for class helper 358 * @return a content tree for class helper
359 */ 359 */
360 private Content getTreeForClassHelper(Type type) { 360 private Content getTreeForClassHelper(Type type) {
361 Content li = new HtmlTree(HtmlTag.LI); 361 Content li = new HtmlTree(HtmlTag.LI);
362 if (type.equals(classDoc)) { 362 if (type.equals(classDoc)) {
363 String typeParameters = getTypeParameterLinks( 363 Content typeParameters = getTypeParameterLinks(
364 new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE, 364 new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
365 classDoc, false)); 365 classDoc, false));
366 if (configuration.shouldExcludeQualifier( 366 if (configuration.shouldExcludeQualifier(
367 classDoc.containingPackage().name())) { 367 classDoc.containingPackage().name())) {
368 li.addContent(type.asClassDoc().name()); 368 li.addContent(type.asClassDoc().name());
369 li.addContent(new RawHtml(typeParameters)); 369 li.addContent(typeParameters);
370 } else { 370 } else {
371 li.addContent(type.asClassDoc().qualifiedName()); 371 li.addContent(type.asClassDoc().qualifiedName());
372 li.addContent(new RawHtml(typeParameters)); 372 li.addContent(typeParameters);
373 } 373 }
374 } else { 374 } else {
375 Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, 375 Content link = getLink(new LinkInfoImpl(configuration,
376 LinkInfoImpl.Kind.CLASS_TREE_PARENT, 376 LinkInfoImpl.Kind.CLASS_TREE_PARENT,
377 type instanceof ClassDoc ? (ClassDoc) type : type, 377 type instanceof ClassDoc ? (ClassDoc) type : type,
378 configuration.getClassName(type.asClassDoc()), false))); 378 configuration.getClassName(type.asClassDoc()), false));
379 li.addContent(link); 379 li.addContent(link);
380 } 380 }
381 return li; 381 return li;
382 } 382 }
383 383
518 "doclet.Enclosing_Class"); 518 "doclet.Enclosing_Class");
519 } 519 }
520 Content dt = HtmlTree.DT(label); 520 Content dt = HtmlTree.DT(label);
521 Content dl = HtmlTree.DL(dt); 521 Content dl = HtmlTree.DL(dt);
522 Content dd = new HtmlTree(HtmlTag.DD); 522 Content dd = new HtmlTree(HtmlTag.DD);
523 dd.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration, 523 dd.addContent(getLink(new LinkInfoImpl(configuration,
524 LinkInfoImpl.Kind.CLASS, outerClass, false)))); 524 LinkInfoImpl.Kind.CLASS, outerClass, false)));
525 dl.addContent(dd); 525 dl.addContent(dd);
526 classInfoTree.addContent(dl); 526 classInfoTree.addContent(dl);
527 } 527 }
528 } 528 }
529 529
576 if (i > 0) { 576 if (i > 0) {
577 Content separator = new StringContent(", "); 577 Content separator = new StringContent(", ");
578 dd.addContent(separator); 578 dd.addContent(separator);
579 } 579 }
580 if (typeList[i] instanceof ClassDoc) { 580 if (typeList[i] instanceof ClassDoc) {
581 Content link = new RawHtml(getLink( 581 Content link = getLink(
582 new LinkInfoImpl(configuration, context, (ClassDoc)(typeList[i])))); 582 new LinkInfoImpl(configuration, context, (ClassDoc)(typeList[i])));
583 dd.addContent(link); 583 dd.addContent(link);
584 } else { 584 } else {
585 Content link = new RawHtml(getLink( 585 Content link = getLink(
586 new LinkInfoImpl(configuration, context, (Type)(typeList[i])))); 586 new LinkInfoImpl(configuration, context, (Type)(typeList[i])));
587 dd.addContent(link); 587 dd.addContent(link);
588 } 588 }
589 } 589 }
590 return dd; 590 return dd;
591 } 591 }

mercurial