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