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

changeset 1735
8ea30d59ac41
parent 1410
bfec2a1cc869
child 1736
74cd21f2c2fe
equal deleted inserted replaced
1734:8dd528992c15 1735:8ea30d59ac41
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
101 public Content getSignature(FieldDoc field) { 101 public Content getSignature(FieldDoc field) {
102 Content pre = new HtmlTree(HtmlTag.PRE); 102 Content pre = new HtmlTree(HtmlTag.PRE);
103 writer.addAnnotationInfo(field, pre); 103 writer.addAnnotationInfo(field, pre);
104 addModifiers(field, pre); 104 addModifiers(field, pre);
105 Content fieldlink = new RawHtml(writer.getLink(new LinkInfoImpl( 105 Content fieldlink = new RawHtml(writer.getLink(new LinkInfoImpl(
106 configuration, LinkInfoImpl.CONTEXT_MEMBER, field.type()))); 106 configuration, LinkInfoImpl.Kind.MEMBER, field.type())));
107 pre.addContent(fieldlink); 107 pre.addContent(fieldlink);
108 pre.addContent(" "); 108 pre.addContent(" ");
109 if (configuration.linksource) { 109 if (configuration.linksource) {
110 Content fieldName = new StringContent(field.name()); 110 Content fieldName = new StringContent(field.name());
111 writer.addSrcLink(field, fieldName, pre); 111 writer.addSrcLink(field, fieldName, pre);
131 if (holder.equals(classdoc) || 131 if (holder.equals(classdoc) ||
132 (! (holder.isPublic() || Util.isLinkable(holder, configuration)))) { 132 (! (holder.isPublic() || Util.isLinkable(holder, configuration)))) {
133 writer.addInlineComment(field, fieldDocTree); 133 writer.addInlineComment(field, fieldDocTree);
134 } else { 134 } else {
135 Content link = new RawHtml( 135 Content link = new RawHtml(
136 writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY, 136 writer.getDocLink(LinkInfoImpl.Kind.FIELD_DOC_COPY,
137 holder, field, 137 holder, field,
138 holder.isIncluded() ? 138 holder.isIncluded() ?
139 holder.typeName() : holder.qualifiedTypeName(), 139 holder.typeName() : holder.qualifiedTypeName(),
140 false)); 140 false));
141 Content codeLink = HtmlTree.CODE(link); 141 Content codeLink = HtmlTree.CODE(link);
238 /** 238 /**
239 * {@inheritDoc} 239 * {@inheritDoc}
240 */ 240 */
241 public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { 241 public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
242 Content classLink = new RawHtml(writer.getPreQualifiedClassLink( 242 Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
243 LinkInfoImpl.CONTEXT_MEMBER, cd, false)); 243 LinkInfoImpl.Kind.MEMBER, cd, false));
244 Content label = new StringContent(cd.isClass() ? 244 Content label = new StringContent(cd.isClass() ?
245 configuration.getText("doclet.Fields_Inherited_From_Class") : 245 configuration.getText("doclet.Fields_Inherited_From_Class") :
246 configuration.getText("doclet.Fields_Inherited_From_Interface")); 246 configuration.getText("doclet.Fields_Inherited_From_Interface"));
247 Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, 247 Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
248 label); 248 label);
252 } 252 }
253 253
254 /** 254 /**
255 * {@inheritDoc} 255 * {@inheritDoc}
256 */ 256 */
257 protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, 257 protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
258 Content tdSummary) { 258 Content tdSummary) {
259 Content strong = HtmlTree.STRONG(new RawHtml( 259 Content strong = HtmlTree.STRONG(new RawHtml(
260 writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false))); 260 writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false)));
261 Content code = HtmlTree.CODE(strong); 261 Content code = HtmlTree.CODE(strong);
262 tdSummary.addContent(code); 262 tdSummary.addContent(code);
266 * {@inheritDoc} 266 * {@inheritDoc}
267 */ 267 */
268 protected void addInheritedSummaryLink(ClassDoc cd, 268 protected void addInheritedSummaryLink(ClassDoc cd,
269 ProgramElementDoc member, Content linksTree) { 269 ProgramElementDoc member, Content linksTree) {
270 linksTree.addContent(new RawHtml( 270 linksTree.addContent(new RawHtml(
271 writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member, 271 writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc)member,
272 member.name(), false))); 272 member.name(), false)));
273 } 273 }
274 274
275 /** 275 /**
276 * {@inheritDoc} 276 * {@inheritDoc}
282 282
283 /** 283 /**
284 * {@inheritDoc} 284 * {@inheritDoc}
285 */ 285 */
286 protected Content getDeprecatedLink(ProgramElementDoc member) { 286 protected Content getDeprecatedLink(ProgramElementDoc member) {
287 return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, 287 return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
288 (MemberDoc) member, ((FieldDoc)member).qualifiedName()); 288 (MemberDoc) member, ((FieldDoc)member).qualifiedName());
289 } 289 }
290 290
291 /** 291 /**
292 * {@inheritDoc} 292 * {@inheritDoc}

mercurial