63 /** |
64 /** |
64 * {@inheritDoc} |
65 * {@inheritDoc} |
65 */ |
66 */ |
66 protected Content getClassLink(LinkInfo linkInfo) { |
67 protected Content getClassLink(LinkInfo linkInfo) { |
67 LinkInfoImpl classLinkInfo = (LinkInfoImpl) linkInfo; |
68 LinkInfoImpl classLinkInfo = (LinkInfoImpl) linkInfo; |
68 boolean noLabel = linkInfo.label == null || linkInfo.label.length() == 0; |
69 boolean noLabel = linkInfo.label == null || linkInfo.label.isEmpty(); |
69 ClassDoc classDoc = classLinkInfo.classDoc; |
70 ClassDoc classDoc = classLinkInfo.classDoc; |
70 //Create a tool tip if we are linking to a class or interface. Don't |
71 //Create a tool tip if we are linking to a class or interface. Don't |
71 //create one if we are linking to a member. |
72 //create one if we are linking to a member. |
72 String title = |
73 String title = |
73 (classLinkInfo.where == null || classLinkInfo.where.length() == 0) ? |
74 (classLinkInfo.where == null || classLinkInfo.where.length() == 0) ? |
74 getClassToolTip(classDoc, |
75 getClassToolTip(classDoc, |
75 classLinkInfo.type != null && |
76 classLinkInfo.type != null && |
76 !classDoc.qualifiedTypeName().equals(classLinkInfo.type.qualifiedTypeName())) : |
77 !classDoc.qualifiedTypeName().equals(classLinkInfo.type.qualifiedTypeName())) : |
77 ""; |
78 ""; |
78 StringBuilder label = new StringBuilder( |
79 Content label = classLinkInfo.getClassLinkLabel(m_writer.configuration); |
79 classLinkInfo.getClassLinkLabel(m_writer.configuration)); |
80 classLinkInfo.displayLength += label.charCount(); |
80 classLinkInfo.displayLength += label.length(); |
|
81 Configuration configuration = m_writer.configuration; |
81 Configuration configuration = m_writer.configuration; |
82 Content link = new ContentBuilder(); |
82 Content link = new ContentBuilder(); |
83 if (classDoc.isIncluded()) { |
83 if (classDoc.isIncluded()) { |
84 if (configuration.isGeneratedDoc(classDoc)) { |
84 if (configuration.isGeneratedDoc(classDoc)) { |
85 DocPath filename = getPath(classLinkInfo); |
85 DocPath filename = getPath(classLinkInfo); |
86 if (linkInfo.linkToSelf || |
86 if (linkInfo.linkToSelf || |
87 !(DocPath.forName(classDoc)).equals(m_writer.filename)) { |
87 !(DocPath.forName(classDoc)).equals(m_writer.filename)) { |
88 link.addContent(new RawHtml(m_writer.getHyperLinkString( |
88 link.addContent(m_writer.getHyperLink( |
89 filename.fragment(classLinkInfo.where), |
89 filename.fragment(classLinkInfo.where), |
90 label.toString(), |
90 label, |
91 classLinkInfo.isStrong, classLinkInfo.styleName, |
91 classLinkInfo.isStrong, classLinkInfo.styleName, |
92 title, classLinkInfo.target))); |
92 title, classLinkInfo.target)); |
93 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { |
93 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { |
94 link.addContent(getTypeParameterLinks(linkInfo)); |
94 link.addContent(getTypeParameterLinks(linkInfo)); |
95 } |
95 } |
96 return link; |
96 return link; |
97 } |
97 } |
98 } |
98 } |
99 } else { |
99 } else { |
100 String crossLink = m_writer.getCrossClassLink( |
100 Content crossLink = m_writer.getCrossClassLink( |
101 classDoc.qualifiedName(), classLinkInfo.where, |
101 classDoc.qualifiedName(), classLinkInfo.where, |
102 label.toString(), classLinkInfo.isStrong, classLinkInfo.styleName, |
102 label, classLinkInfo.isStrong, classLinkInfo.styleName, |
103 true); |
103 true); |
104 if (crossLink != null) { |
104 if (crossLink != null) { |
105 link.addContent(new RawHtml(crossLink)); |
105 link.addContent(crossLink); |
106 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { |
106 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { |
107 link.addContent(getTypeParameterLinks(linkInfo)); |
107 link.addContent(getTypeParameterLinks(linkInfo)); |
108 } |
108 } |
109 return link; |
109 return link; |
110 } |
110 } |
111 } |
111 } |
112 // Can't link so just write label. |
112 // Can't link so just write label. |
113 link.addContent(new RawHtml(label.toString())); |
113 link.addContent(label.toString()); |
114 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { |
114 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { |
115 link.addContent(getTypeParameterLinks(linkInfo)); |
115 link.addContent(getTypeParameterLinks(linkInfo)); |
116 } |
116 } |
117 return link; |
117 return link; |
118 } |
118 } |