Home | History | Annotate | Download | only in templates-sdk
      1 <?cs # Create a comma separated list of annotations on obj that were in showAnnotations in Doclava ?>
      2 <?cs # pre is an HTML string to start the list, post is an HTML string to close the list ?>
      3 <?cs # for example call:show_annotations_list(cl, "<td>Annotations: ", "</td>") ?>
      4 <?cs # if obj has nothing on obj.showAnnotations, nothing will be output ?>
      5 <?cs def:show_annotations_list(obj) ?>
      6     <?cs each:anno = obj.showAnnotations ?>
      7       <?cs if:first(anno) ?>
      8         <span class='annotation-message'>
      9           Included in documentation by the annotations:
     10       <?cs /if ?>
     11       @<?cs var:anno.type.label ?>
     12       <?cs if:last(anno) == 0 ?>
     13         , &nbsp;
     14       <?cs /if ?>
     15       <?cs if:last(anno)?>
     16         </span>
     17       <?cs /if ?>
     18     <?cs /each ?>
     19 <?cs /def ?>
     20 
     21 <?cs # Override default class_link_table to display annotations ?>
     22 <?cs def:class_link_table(classes) ?>
     23   <?cs set:count = #1 ?>
     24   <table class="jd-sumtable-expando">
     25     <?cs each:cl=classes ?>
     26       <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.type.since ?>" >
     27         <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td>
     28         <td class="jd-descrcol" width="100%">
     29           <?cs call:short_descr(cl) ?>&nbsp;
     30           <?cs call:show_annotations_list(cl) ?>
     31         </td>
     32       </tr>
     33       <?cs set:count = count + #1 ?>
     34     <?cs /each ?>
     35   </table>
     36 <?cs /def ?>
     37 
     38 <?cs
     39 # Prints a comma separated list of parameters with optional line breaks
     40 ?><?cs
     41 def:parameter_list(params, linebreaks) ?><?cs
     42   each:param = params ?><?cs
     43       call:simple_type_link(param.type)?> <?cs
     44       var:param.name ?><?cs
     45       if: name(param)!=subcount(params)-1
     46         ?>, <?cs if:linebreaks
     47 ?>
     48                 <?cs /if ?><?cs
     49       /if ?><?cs
     50   /each ?><?cs
     51 /def ?>