The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | <?cs # A link to a package ?><?cs |
| 2 | def: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 |
| 17 | def: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) ?> extends <?cs else ?> & <?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) ?> super <?cs else ?> & <?cs /if ?><?cs |
| 29 | call:type_link_impl(t, "true") ?><?cs |
| 30 | /each ?><?cs |
| 31 | /if ?><?cs |
| 32 | if:subcount(type.typeArguments) |
| 33 | ?><<?cs each:t=type.typeArguments ?><?cs call:type_link_impl(t, "true") ?><?cs |
| 34 | if:!last(t) ?>, <?cs /if ?><?cs |
| 35 | /each ?>><?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 |
| 43 | def: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 |
| 52 | def: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 Dougherty | 8a81cce | 2009-04-21 01:00:11 -0700 | [diff] [blame] | 64 | 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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 67 | 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 |
| 76 | def: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 |
| 81 | def: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 |
| 90 | def: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 |
| 100 | def: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 Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 118 | <?cs # print the API Level ?><?cs |
Jesse Wilson | 289d80e | 2009-07-21 14:02:14 -0700 | [diff] [blame] | 119 | def:since_tags(obj) ?> |
Scott Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 120 | Since: API Level <?cs var:obj.since ?> |
Jesse Wilson | 289d80e | 2009-07-21 14:02:14 -0700 | [diff] [blame] | 121 | <?cs /def ?> |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 122 | |
| 123 | <?cs # Print the long-form description for something. |
Jesse Wilson | 289d80e | 2009-07-21 14:02:14 -0700 | [diff] [blame] | 124 | Uses the following fields: deprecated descr seeAlso since ?><?cs |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 125 | def: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 ?><<?cs /if ?><?cs var:tag.name |
| 145 | ?><?cs if:tag.isTypeParameter ?>><?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 Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 171 | call:see_also_tags(obj.seeAlso) ?><?cs |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 172 | /def ?> |
| 173 | |
| 174 | <?cs # A table of links to classes with descriptions, as in a package file or the nested classes ?><?cs |
| 175 | def:class_link_table(classes) ?><?cs |
| 176 | set:count = #1 ?> |
| 177 | <table class="jd-sumtable-expando"><?cs |
| 178 | each:cl=classes ?> |
Scott Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 179 | <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.type.since ?>" > |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 180 | <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td> |
| 181 | <td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?> </td> |
| 182 | </tr><?cs set:count = count + #1 ?><?cs |
| 183 | /each ?> |
| 184 | </table><?cs |
| 185 | /def ?> |
| 186 | |
Scott Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 187 | <?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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 188 | def: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 Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 193 | <li class="api apilevel-<?cs var:cl.type.since ?>"><?cs call:type_link(cl.type) ?></li><?cs |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 194 | /each ?> |
| 195 | </ul> |
| 196 | </li><?cs |
| 197 | /if ?><?cs |
| 198 | /def ?> |
| 199 | |
Scott Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 200 | <?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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 201 | def:list(label, classes) ?><?cs |
| 202 | if:subcount(classes) ?> |
| 203 | <li><h2><?cs var:label ?></h2> |
| 204 | <ul><?cs |
| 205 | each:cl=classes ?> |
Scott Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 206 | <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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 207 | /each ?> |
| 208 | </ul> |
| 209 | </li><?cs |
| 210 | /if ?><?cs |
| 211 | /def ?> |
| 212 | |
Scott Main | df09424 | 2009-07-27 09:47:11 -0700 | [diff] [blame^] | 213 | <?cs # A list of links to packages, for use in the side navigation of packages (panel nav) ?><?cs |
| 214 | def: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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 220 | <?cs # An expando trigger ?><?cs |
| 221 | def: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 |
| 229 | def: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 Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 247 | |
| 248 | <?cs include:"customization.cs" ?> |