blob: 42ee9bb29c0a0f16b38cd0960ccb539488544d4c [file] [log] [blame]
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -07001<?cs # A link to a package ?>
2<?cs def:package_link(pkg)) ?>
3<a href="<?cs var:toroot ?><?cs var:pkg.link ?>"><?cs var:pkg.name ?></a>
4<?cs /def ?>
5
6
7<?cs # A link to a type, or not if it's a primitive type
8 link: whether to create a link at the top level, always creates links in
9 recursive invocations.
10 Expects the following fields:
11 .name
12 .link
13 .isPrimitive
14 .superBounds.N.(more links) (... super ... & ...)
15 .extendsBounds.N.(more links) (... extends ... & ...)
16 .typeArguments.N.(more links) (< ... >)
17?>
18<?cs def:type_link_impl(type, link) ?><?cs
19 if:type.link && link=="true" ?><a href="<?cs var:toroot ?><?cs var:type.link ?>"><?cs /if
20 ?><?cs var:type.label ?><?cs if:type.link && link=="true" ?></a><?cs /if ?><?cs
21 if:subcount(type.extendsBounds) ?><?cs
22 each:t=type.extendsBounds ?><?cs
23 if:first(t) ?>&nbsp;extends&nbsp;<?cs else ?>&nbsp;&amp;&nbsp;<?cs /if ?><?cs
24 call:type_link_impl(t, "true") ?><?cs
25 /each ?><?cs
26 /if ?><?cs
27 if:subcount(type.superBounds) ?><?cs
28 each:t=type.superBounds ?><?cs
29 if:first(t) ?>&nbsp;super&nbsp;<?cs else ?>&nbsp;&amp;&nbsp;<?cs /if ?><?cs
30 call:type_link_impl(t, "true") ?><?cs
31 /each ?><?cs
32 /if ?><?cs
33
34 if:subcount(type.typeArguments)
35 ?>&lt;<?cs each:t=type.typeArguments ?><?cs call:type_link_impl(t, "true") ?><?cs
36 if:!last(t) ?>,&nbsp;<?cs /if ?><?cs
37 /each ?>&gt;<?cs
38 /if ?><?cs
39/def ?>
40
41
42<?cs def:class_name(type) ?><?cs call:type_link_impl(type, "false") ?><?cs /def ?>
43<?cs def:type_link(type) ?><?cs call:type_link_impl(type, "true") ?><?cs /def ?>
44
45<?cs # A comma separated parameter list ?>
46<?cs def:parameter_list(params) ?><?cs
47 each:param = params ?><?cs
48 call:type_link(param.type)?> <?cs
49 var:param.name ?><?cs
50 if: name(param)!=subcount(params)-1?>, <?cs /if ?><?cs
51 /each ?><?cs
52/def ?>
53
54
55<?cs # Print a list of tags (e.g. description text ?>
56<?cs def:tag_list(tags) ?><?cs
57 each:tag = tags ?><?cs
58 if:tag.name == "Text" ?><?cs var:tag.text?><?cs
59 elif:tag.kind == "@more" ?><p><?cs
60 elif:tag.kind == "@see" ?><a href="<?cs var:toroot ?><?cs var:tag.href ?>"><?cs var:tag.label ?></a><?cs
61 elif:tag.kind == "@seeHref" ?><a href="<?cs var:tag.href ?>"><?cs var:tag.label ?></a><?cs
62 elif:tag.kind == "@seeJustLabel" ?><?cs var:tag.label ?><?cs
63 elif:tag.kind == "@code" ?><code class="Code prettyprint"><?cs var:tag.text ?></code><?cs
64 elif:tag.kind == "@samplecode" ?><pre class="Code prettyprint"><?cs var:tag.text ?></pre><?cs
65 elif:tag.name == "@sample" ?><pre class="Code prettyprint"><?cs var:tag.text ?></pre><?cs
66 elif:tag.name == "@include" ?><?cs var:tag.text ?><?cs
67 elif:tag.kind == "@docRoot" ?><?cs var:toroot ?><?cs
68 elif:tag.kind == "@inheritDoc" ?><?cs # This is the case when @inheritDoc is in something
69 that doesn't inherit from anything?><?cs
70 elif:tag.kind == "@attr" ?><?cs
71 else ?>{<?cs var:tag.name?> <?cs var:tag.text ?>}<?cs
72 /if ?><?cs
73 /each ?><?cs
74/def ?>
75
76
77<?cs # The message about This xxx is deprecated. ?>
78<?cs def:deprecated_text(kind) ?>
79This <?cs var:kind ?> is deprecated.
80<?cs /def ?>
81
82
83<?cs # Show the short-form description of something. These come from shortDescr and deprecated ?>
84<?cs def:short_descr(obj) ?><?cs
85 if:subcount(obj.deprecated) ?>
86 <em><?cs call:deprecated_text(obj.kind) ?>
87 <?cs call:tag_list(obj.deprecated) ?></em><?cs
88 else ?><?cs call:tag_list(obj.shortDescr) ?><?cs
89 /if ?><?cs
90/def ?>
91
92<?cs # Show the red box with the deprecated warning ?>
93<?cs def:deprecated_warning(obj) ?>
94<?cs if:subcount(obj.deprecated) ?><p>
95<p class="warning jd-deprecated-warning">
96 <strong><?cs call:deprecated_text(obj.kind) ?></strong>
97 <?cs call:tag_list(obj.deprecated) ?>
98</p>
99<?cs /if ?>
100<?cs /def ?>
101
102<?cs # print the See Also: section ?>
103<?cs def:see_also_tags(also) ?>
104<?cs if:subcount(also) ?>
105<div class="jd-tagdata">
106 <h4 class="jd-tagtitle">See Also</h4>
107 <ul class="nolist">
108 <?cs each:tag=also
109 ?><li><?cs
110 if:tag.kind == "@see" ?><a href="<?cs var:toroot ?><?cs var:tag.href ?>"><?cs
111 var:tag.label ?></a><?cs
112 elif:tag.kind == "@seeHref" ?><a href="<?cs var:tag.href ?>"><?cs var:tag.label ?></a><?cs
113 elif:tag.kind == "@seeJustLabel" ?><?cs var:tag.label ?><?cs
114 else ?>[ERROR: Unknown @see kind]<?cs
115 /if ?></li>
116 <?cs /each ?>
117 </table>
118 <ul>
119</div>
120<?cs /if ?>
121<?cs /def ?>
122
123
124<?cs # Print the long-form description for something.
125 Uses the following fields: deprecated descr seeAlso
126 ?>
127<?cs def:description(obj) ?>
128
129<?cs call:deprecated_warning(obj) ?>
130<?cs call:tag_list(obj.descr) ?>
131
132<?cs if:subcount(obj.attrRefs) ?>
133<div class="jd-tagdata">
134 <h4 class="jd-tagtitle">Related XML Attributes</h4>
135 <ul class="nolist">
136 <?cs each:attr=obj.attrRefs ?>
137 <li><a href="<?cs var:toroot ?><?cs var:attr.href ?>"><?cs var:attr.name ?></a></li>
138 <?cs /each ?>
139 </ul>
140</div>
141<?cs /if ?>
142
143<?cs if:subcount(obj.paramTags) ?>
144<div class="jd-tagdata">
145 <h4 class="jd-tagtitle">Parameters</h4>
146 <table class="jd-tagtable">
147 <?cs each:tag=obj.paramTags
148 ?><tr>
149 <th><?cs if:tag.isTypeParameter ?>&lt;<?cs /if ?><?cs var:tag.name
150 ?><?cs if:tag.isTypeParameter ?>&gt;<?cs /if ?></td>
151 <td><?cs call:tag_list(tag.comment) ?></td>
152 </tr>
153 <?cs /each ?>
154 </table>
155</div>
156<?cs /if ?>
157
158
159<?cs if:subcount(obj.returns) ?>
160<div class="jd-tagdata">
161 <h4 class="jd-tagtitle">Returns</h4>
162 <ul class="nolist"><li><?cs call:tag_list(obj.returns) ?></li></ul>
163</div>
164<?cs /if ?>
165
166<?cs if:subcount(obj.throws) ?>
167<div class="jd-tagdata">
168 <h4 class="jd-tagtitle">Throws</h4>
169 <table class="jd-tagtable">
170 <?cs each:tag=obj.throws
171 ?> <tr>
172 <th><?cs call:type_link(tag.type) ?></td>
173 <td><?cs call:tag_list(tag.comment) ?></td>
174 </tr>
175 <?cs /each ?>
176 </table>
177</div>
178<?cs /if ?>
179
180<?cs call:see_also_tags(obj.seeAlso) ?>
181
182<?cs /def ?>
183
184
185<?cs # A table of links to classes with descriptions, as in a package file or the nested classes ?>
186<?cs def:class_link_table(classes) ?>
187<?cs set:count = #1 ?>
188<table class="jd-linktable"><?cs
189 each:cl=classes ?>
190 <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> >
191 <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td>
192 <td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?>&nbsp;</td>
193 </tr><?cs set:count = count + #1 ?><?cs
194 /each ?>
195</table>
196<?cs /def ?>
197
198<?cs # A list of links to classes, for use in the side navigation of packages ?>
199<?cs def:class_link_list(label, classes) ?>
200<?cs if:subcount(classes) ?>
201 <li><h2><?cs var:label ?></h2>
202 <ul>
203 <?cs each:cl=classes ?>
204 <li><?cs call:type_link(cl.type) ?></li>
205 <?cs /each ?>
206 </ul>
207 </li>
208<?cs /if ?>
209<?cs /def ?>
210
211<?cs # A list of links to classes, for use in the side navigation of classes ?>
212<?cs def:list(label, classes) ?>
213<?cs if:subcount(classes) ?>
214 <li><h2><?cs var:label ?></h2>
215 <ul>
216 <?cs each:cl=classes ?>
217 <li <?cs if:class.name == cl.label?>class="selected"<?cs /if ?>><?cs call:type_link(cl) ?></li>
218 <?cs /each ?>
219 </ul>
220 </li>
221<?cs /if ?>
222<?cs /def ?>
223
224<?cs # An expando trigger ?>
225<?cs def:expando_trigger(id, default) ?>
226<a href="javascript:toggle_inherited('<?cs var:id ?>')" class="jd-expando-trigger"
227 ><img id="<?cs var:id ?>-trigger"
228 src="<?cs var:toroot ?>assets/triangle-<?cs var:default ?>.png"
229 class="jd-expando-trigger" /></a>
230<?cs /def ?>
231
232<?cs # An expandable list of classes ?>
233<?cs def:expandable_class_list(id, classes, default) ?>
234 <div id="<?cs var:id ?>">
235 <div id="<?cs var:id ?>-list"
236 class="jd-inheritedlinks"
237 <?cs if:default != "list" ?>style="display: none;"<?cs /if ?>
238 >
239 <?cs each:cl=classes ?>
240 <?cs call:type_link(cl.type) ?><?cs if:!last(cl) ?>,<?cs /if ?>
241 <?cs /each ?>
242 </div>
243 <div id="<?cs var:id ?>-summary"
244 <?cs if:default != "summary" ?>style="display: none;"<?cs /if ?>
245 >
246
247 <?cs call:class_link_table(classes) ?>
248 </div>
249 </div>
250<?cs /def ?>
251
252
253<?cs include:"customization.cs" ?>
254