blob: 3ba743bbf6fa0669f7848d777afc511edcfbb8dd [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 Dougherty911e3112009-04-20 17:56:31 -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
118
119<?cs # Print the long-form description for something.
120 Uses the following fields: deprecated descr seeAlso ?><?cs
121def:description(obj) ?><?cs
122 call:deprecated_warning(obj) ?>
123 <div class="jd-tagdata jd-tagdescr"><p><?cs call:tag_list(obj.descr) ?></p></div><?cs
124 if:subcount(obj.attrRefs) ?>
125 <div class="jd-tagdata">
126 <h5 class="jd-tagtitle">Related XML Attributes</h5>
127 <ul class="nolist"><?cs
128 each:attr=obj.attrRefs ?>
129 <li><a href="<?cs var:toroot ?><?cs var:attr.href ?>"><?cs var:attr.name ?></a></li><?cs
130 /each ?>
131 </ul>
132 </div><?cs
133 /if ?><?cs
134 if:subcount(obj.paramTags) ?>
135 <div class="jd-tagdata">
136 <h5 class="jd-tagtitle">Parameters</h5>
137 <table class="jd-tagtable"><?cs
138 each:tag=obj.paramTags ?>
139 <tr>
140 <th><?cs if:tag.isTypeParameter ?>&lt;<?cs /if ?><?cs var:tag.name
141 ?><?cs if:tag.isTypeParameter ?>&gt;<?cs /if ?></td>
142 <td><?cs call:tag_list(tag.comment) ?></td>
143 </tr><?cs
144 /each ?>
145 </table>
146 </div><?cs
147 /if ?><?cs
148 if:subcount(obj.returns) ?>
149 <div class="jd-tagdata">
150 <h5 class="jd-tagtitle">Returns</h5>
151 <ul class="nolist"><li><?cs call:tag_list(obj.returns) ?></li></ul>
152 </div><?cs
153 /if ?><?cs
154 if:subcount(obj.throws) ?>
155 <div class="jd-tagdata">
156 <h5 class="jd-tagtitle">Throws</h5>
157 <table class="jd-tagtable"><?cs
158 each:tag=obj.throws ?>
159 <tr>
160 <th><?cs call:type_link(tag.type) ?></td>
161 <td><?cs call:tag_list(tag.comment) ?></td>
162 </tr><?cs
163 /each ?>
164 </table>
165 </div><?cs
166 /if ?><?cs
167 call:see_also_tags(obj.seeAlso) ?><?cs
168/def ?>
169
170<?cs # A table of links to classes with descriptions, as in a package file or the nested classes ?><?cs
171def:class_link_table(classes) ?><?cs
172 set:count = #1 ?>
173 <table class="jd-sumtable-expando"><?cs
174 each:cl=classes ?>
175 <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> >
176 <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td>
177 <td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?>&nbsp;</td>
178 </tr><?cs set:count = count + #1 ?><?cs
179 /each ?>
180 </table><?cs
181/def ?>
182
183<?cs # A list of links to classes, for use in the side navigation of packages ?><?cs
184def:class_link_list(label, classes) ?><?cs
185 if:subcount(classes) ?>
186 <li><h2><?cs var:label ?></h2>
187 <ul><?cs
188 each:cl=classes ?>
189 <li><?cs call:type_link(cl.type) ?></li><?cs
190 /each ?>
191 </ul>
192 </li><?cs
193 /if ?><?cs
194/def ?>
195
196<?cs # A list of links to classes, for use in the side navigation of classes ?><?cs
197def:list(label, classes) ?><?cs
198 if:subcount(classes) ?>
199 <li><h2><?cs var:label ?></h2>
200 <ul><?cs
201 each:cl=classes ?>
202 <li <?cs if:class.name == cl.label?>class="selected"<?cs /if ?>><?cs call:type_link(cl) ?></li><?cs
203 /each ?>
204 </ul>
205 </li><?cs
206 /if ?><?cs
207/def ?>
208
209<?cs # An expando trigger ?><?cs
210def:expando_trigger(id, default) ?>
211 <a href="#" onclick="return toggleInherited(this, null)" id="<?cs var:id ?>" class="jd-expando-trigger closed"
212 ><img id="<?cs var:id ?>-trigger"
213 src="<?cs var:toroot ?>assets/images/triangle-<?cs var:default ?>.png"
214 class="jd-expando-trigger-img" /></a><?cs
215/def ?>
216
217<?cs # An expandable list of classes ?><?cs
218def:expandable_class_list(id, classes, default) ?>
219 <div id="<?cs var:id ?>">
220 <div id="<?cs var:id ?>-list"
221 class="jd-inheritedlinks"
222 <?cs if:default != "list" ?>style="display: none;"<?cs /if ?>
223 ><?cs
224 each:cl=classes ?>
225 <?cs call:type_link(cl.type) ?><?cs if:!last(cl) ?>,<?cs /if ?><?cs
226 /each ?>
227 </div>
228 <div id="<?cs var:id ?>-summary"
229 <?cs if:default != "summary" ?>style="display: none;"<?cs /if ?>
230 ><?cs
231 call:class_link_table(classes) ?>
232 </div>
233 </div><?cs
234/def ?>
235
236<?cs # The default side navigation for the reference docs ?><?cs
237def:default_left_nav() ?>
238 <div class="g-section g-tpl-240" id="body-content">
239 <div class="g-unit g-first side-nav-resizable" id="side-nav">
240 <div id="swapper">
241 <div id="nav-panels">
242 <div id="resize-packages-nav">
243 <div id="packages-nav">
244 <div id="index-links"><nobr>
245 <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> |
246 <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr>
247 </div>
248 <ul><?cs
249 each:pkg=docs.packages ?>
250 <li <?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>class="selected"<?cs /if ?>><?cs call:package_link(pkg) ?></li><?cs
251 /each ?>
252 </ul><br/>
253 </div> <!-- end packages -->
254 </div> <!-- end resize-packages -->
255 <div id="classes-nav"><?cs
256 if:subcount(class.package) ?>
257 <ul>
258 <?cs call:list("Interfaces", class.package.interfaces) ?>
259 <?cs call:list("Classes", class.package.classes) ?>
260 <?cs call:list("Enums", class.package.enums) ?>
261 <?cs call:list("Exceptions", class.package.exceptions) ?>
262 <?cs call:list("Errors", class.package.errors) ?>
263 </ul><?cs
264 elif:subcount(package) ?>
265 <ul>
266 <?cs call:class_link_list("Interfaces", package.interfaces) ?>
267 <?cs call:class_link_list("Classes", package.classes) ?>
268 <?cs call:class_link_list("Enums", package.enums) ?>
269 <?cs call:class_link_list("Exceptions", package.exceptions) ?>
270 <?cs call:class_link_list("Errors", package.errors) ?>
271 </ul><?cs
272 else ?>
273 <script>
274 /*addLoadEvent(maxPackageHeight);*/
275 </script>
276 <p style="padding:10px">Select a package to view its members</p><?cs
277 /if ?><br/>
278 </div><!-- end classes -->
279 </div><!-- end nav-panels -->
280 <div id="nav-tree" style="display:none">
281 <div id="index-links"><nobr>
282 <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> |
283 <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr>
284 </div>
285 </div><!-- end nav-tree -->
286 </div><!-- end swapper -->
287 </div> <!-- end side-nav -->
288 <script>
The Android Open Source Projectfdd3a102009-03-11 12:11:54 -0700289 if (!isMobile) {
290 $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
291 chooseDefaultNav();
292 if ($("#nav-tree").is(':visible')) init_navtree("nav-tree", "<?cs var:toroot ?>", NAVTREE_DATA);
293 else {
294 addLoadEvent(function() {
295 scrollIntoView("packages-nav");
296 scrollIntoView("classes-nav");
297 });
298 }
299 $("#swapper").css({borderBottom:"2px solid #aaa"});
300 } else {
301 swapNav(); // tree view should be used on mobile
The Android Open Source Project88b60792009-03-03 19:28:42 -0800302 }
The Android Open Source Project88b60792009-03-03 19:28:42 -0800303 </script><?cs
304/def ?>
305
306<?cs # The default search box that goes in the header ?><?cs
307def:default_search_box() ?>
308 <div id="search" >
309 <div id="searchForm">
310 <form accept-charset="utf-8" class="gsc-search-box"
311 onsubmit="return submit_search()">
312 <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
313 <tr>
314 <td class="gsc-input">
315 <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
316 title="search developer docs" name="q"
317 value="search developer docs"
318 onFocus="search_focus_changed(this, true)"
319 onBlur="search_focus_changed(this, false)"
320 onkeydown="return search_changed(event, true, '<?cs var:toroot?>')"
321 onkeyup="return search_changed(event, false, '<?cs var:toroot?>')" />
322 <div id="search_filtered_div" class="no-display">
323 <table id="search_filtered" cellspacing=0>
324 </table>
325 </div>
326 </td>
327 <td class="gsc-search-button">
328 <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
329 </td>
330 <td class="gsc-clear-button">
331 <div title="clear results" class="gsc-clear-button">&nbsp;</div>
332 </td>
333 </tr></tbody>
334 </table>
335 </form>
336 </div><!-- searchForm -->
337 </div><!-- search --><?cs
338/def ?>
339
340<?cs include:"customization.cs" ?>