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

changeset 1736
74cd21f2c2fe
parent 1735
8ea30d59ac41
child 1737
7a9ef837e57f
equal deleted inserted replaced
1735:8ea30d59ac41 1736:74cd21f2c2fe
61 * @return the display length required to write this information. 61 * @return the display length required to write this information.
62 */ 62 */
63 protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) { 63 protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
64 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, 64 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
65 LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member, false); 65 LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member, false);
66 String typeParameters = writer.getTypeParameterLinks(linkInfo); 66 Content typeParameters = writer.getTypeParameterLinks(linkInfo);
67 if (linkInfo.displayLength > 0) { 67 if (linkInfo.displayLength > 0) {
68 Content linkContent = new RawHtml(typeParameters); 68 Content linkContent = typeParameters;
69 htmltree.addContent(linkContent); 69 htmltree.addContent(linkContent);
70 htmltree.addContent(writer.getSpace()); 70 htmltree.addContent(writer.getSpace());
71 writer.displayLength += linkInfo.displayLength + 1; 71 writer.displayLength += linkInfo.displayLength + 1;
72 } 72 }
73 return linkInfo.displayLength; 73 return linkInfo.displayLength;
92 */ 92 */
93 protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, 93 protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
94 Content tdSummary) { 94 Content tdSummary) {
95 ExecutableMemberDoc emd = (ExecutableMemberDoc)member; 95 ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
96 String name = emd.name(); 96 String name = emd.name();
97 Content strong = HtmlTree.STRONG(new RawHtml( 97 Content strong = HtmlTree.STRONG(
98 writer.getDocLink(context, cd, (MemberDoc) emd, 98 writer.getDocLink(context, cd, (MemberDoc) emd,
99 name, false))); 99 name, false));
100 Content code = HtmlTree.CODE(strong); 100 Content code = HtmlTree.CODE(strong);
101 writer.displayLength = name.length(); 101 writer.displayLength = name.length();
102 addParameters(emd, false, code); 102 addParameters(emd, false, code);
103 tdSummary.addContent(code); 103 tdSummary.addContent(code);
104 } 104 }
110 * @param member the member being linked to 110 * @param member the member being linked to
111 * @param linksTree the content tree to which the link will be added 111 * @param linksTree the content tree to which the link will be added
112 */ 112 */
113 protected void addInheritedSummaryLink(ClassDoc cd, 113 protected void addInheritedSummaryLink(ClassDoc cd,
114 ProgramElementDoc member, Content linksTree) { 114 ProgramElementDoc member, Content linksTree) {
115 linksTree.addContent(new RawHtml( 115 linksTree.addContent(
116 writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc) member, 116 writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc) member,
117 member.name(), false))); 117 member.name(), false));
118 } 118 }
119 119
120 /** 120 /**
121 * Add the parameter for the executable member. 121 * Add the parameter for the executable member.
122 * 122 *
126 * @param tree the content tree to which the parameter information will be added. 126 * @param tree the content tree to which the parameter information will be added.
127 */ 127 */
128 protected void addParam(ExecutableMemberDoc member, Parameter param, 128 protected void addParam(ExecutableMemberDoc member, Parameter param,
129 boolean isVarArg, Content tree) { 129 boolean isVarArg, Content tree) {
130 if (param.type() != null) { 130 if (param.type() != null) {
131 Content link = new RawHtml(writer.getLink(new LinkInfoImpl( 131 Content link = writer.getLink(new LinkInfoImpl(
132 configuration, LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM, 132 configuration, LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM,
133 param.type(), isVarArg))); 133 param.type(), isVarArg));
134 tree.addContent(link); 134 tree.addContent(link);
135 } 135 }
136 if(param.name().length() > 0) { 136 if(param.name().length() > 0) {
137 tree.addContent(writer.getSpace()); 137 tree.addContent(writer.getSpace());
138 tree.addContent(param.name()); 138 tree.addContent(param.name());
152 writer.addReceiverAnnotationInfo(member, descList, tree); 152 writer.addReceiverAnnotationInfo(member, descList, tree);
153 tree.addContent(writer.getSpace()); 153 tree.addContent(writer.getSpace());
154 tree.addContent(rcvrType.typeName()); 154 tree.addContent(rcvrType.typeName());
155 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, 155 LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
156 LinkInfoImpl.Kind.CLASS_SIGNATURE, rcvrType); 156 LinkInfoImpl.Kind.CLASS_SIGNATURE, rcvrType);
157 tree.addContent(new RawHtml(writer.getTypeParameterLinks(linkInfo))); 157 tree.addContent(writer.getTypeParameterLinks(linkInfo));
158 tree.addContent(writer.getSpace()); 158 tree.addContent(writer.getSpace());
159 tree.addContent("this"); 159 tree.addContent("this");
160 } 160 }
161 161
162 162
253 member.name().length() + retlen - 4); 253 member.name().length() + retlen - 4);
254 htmltree.addContent(DocletConstants.NL); 254 htmltree.addContent(DocletConstants.NL);
255 htmltree.addContent(indent); 255 htmltree.addContent(indent);
256 htmltree.addContent("throws "); 256 htmltree.addContent("throws ");
257 indent += " "; 257 indent += " ";
258 Content link = new RawHtml(writer.getLink(new LinkInfoImpl(configuration, 258 Content link = writer.getLink(new LinkInfoImpl(configuration,
259 LinkInfoImpl.Kind.MEMBER, exceptions[0]))); 259 LinkInfoImpl.Kind.MEMBER, exceptions[0]));
260 htmltree.addContent(link); 260 htmltree.addContent(link);
261 for(int i = 1; i < exceptions.length; i++) { 261 for(int i = 1; i < exceptions.length; i++) {
262 htmltree.addContent(","); 262 htmltree.addContent(",");
263 htmltree.addContent(DocletConstants.NL); 263 htmltree.addContent(DocletConstants.NL);
264 htmltree.addContent(indent); 264 htmltree.addContent(indent);
265 Content exceptionLink = new RawHtml(writer.getLink(new LinkInfoImpl( 265 Content exceptionLink = writer.getLink(new LinkInfoImpl(
266 configuration, LinkInfoImpl.Kind.MEMBER, exceptions[i]))); 266 configuration, LinkInfoImpl.Kind.MEMBER, exceptions[i]));
267 htmltree.addContent(exceptionLink); 267 htmltree.addContent(exceptionLink);
268 } 268 }
269 } 269 }
270 } 270 }
271 271

mercurial