Patch 2: some fixes to the developer-docs stylesheet....

Patch 3: add "Since:" to the api level info
Patch 4: fix packages page and styles to reveal class summary

Squashed commit of the following:

commit 8fcdcb8dcbe9b93688f5eb1020654848d3242675
Author: Scott Main <smain@google.com>
Date:   Mon Jul 27 09:33:45 2009 -0700

    remove the toggle selector from the header.
    this will be added in a later change with the rest of the toggle script

commit 2423b30ee46c12f92051c4f2a096532e55752c46
Author: Scott Main <smain@google.com>
Date:   Fri Jul 24 16:29:21 2009 -0700

    Implement API Level styles.
    This changes the way we show the API Level for a given package/class/member.
    It also provides hooks in the document to allow us to restyle items
    based on a user-selected API Level (show/hide available items).
    More changes to provide the toggling feature will come soon.

commit efd94b33071070f0dfc2045131b81cbdfe078468
Author: Scott Main <smain@google.com>
Date:   Mon Jul 27 09:33:45 2009 -0700

    remove the toggle selector from the header.
    this will be added in a later change with the rest of the toggle script

commit 3fb79313232c993f700ee90a94f59dcca275fb0b
Author: Scott Main <smain@google.com>
Date:   Fri Jul 24 16:29:21 2009 -0700

    Implement API Level styles.
    This changes the way we show the API Level for a given package/class/member.
    It also provides hooks in the document to allow us to restyle items
    based on a user-selected API Level (show/hide available items).
    More changes to provide the toggling feature will come soon.
This commit is contained in:
Scott Main
2009-07-27 09:47:11 -07:00
parent 882bbe1489
commit df09424f19
9 changed files with 105 additions and 32 deletions

View File

@@ -512,6 +512,7 @@ public class DroidDoc
data.setValue("reference", "true"); data.setValue("reference", "true");
data.setValue("docs.packages." + i + ".name", s); data.setValue("docs.packages." + i + ".name", s);
data.setValue("docs.packages." + i + ".link", pkg.htmlPage()); data.setValue("docs.packages." + i + ".link", pkg.htmlPage());
data.setValue("docs.packages." + i + ".since", pkg.getSince());
TagInfo.makeHDF(data, "docs.packages." + i + ".shortDescr", TagInfo.makeHDF(data, "docs.packages." + i + ".shortDescr",
pkg.firstSentenceTags()); pkg.firstSentenceTags());
i++; i++;

View File

@@ -112,6 +112,7 @@ public class PackageInfo extends DocInfo implements ContainerInfo
data.setValue(base + ".link", htmlPage()); data.setValue(base + ".link", htmlPage());
} }
data.setValue(base + ".name", name()); data.setValue(base + ".name", name());
data.setValue(base + ".since", getSince());
} }
public void makeClassLinkListHDF(HDF data, String base) public void makeClassLinkListHDF(HDF data, String base)

View File

@@ -159,6 +159,7 @@ public class TypeInfo
} }
else if (!isPrimitive() && cl != null && cl.isIncluded()) { else if (!isPrimitive() && cl != null && cl.isIncluded()) {
data.setValue(base + ".link", cl.htmlPage()); data.setValue(base + ".link", cl.htmlPage());
data.setValue(base + ".since", cl.getSince());
} }
if (mIsTypeVariable) { if (mIsTypeVariable) {

View File

@@ -117,10 +117,8 @@ def:default_left_nav() ?>
<a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> | <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> |
<a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr> <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr>
</div> </div>
<ul><?cs <ul>
each:pkg=docs.packages ?> <?cs call:package_link_list(docs.packages) ?>
<li <?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>class="selected"<?cs /if ?>><?cs call:package_link(pkg) ?></li><?cs
/each ?>
</ul><br/> </ul><br/>
</div> <!-- end packages --> </div> <!-- end packages -->
</div> <!-- end resize-packages --> </div> <!-- end resize-packages -->

View File

@@ -49,8 +49,12 @@ a:visited code {
input, select, input, select,
textarea, option { textarea, option {
font-family:inherit; padding:0;
font-size:inherit; margin:0;
}
option {
padding:0 4px;
} }
p { p {
@@ -692,7 +696,6 @@ td.gsc-search-button {
#search-button { #search-button {
margin:0 0 0 2px; margin:0 0 0 2px;
font-size:11px; font-size:11px;
height:1.8em;
} }
/* search result tabs */ /* search result tabs */

View File

@@ -321,7 +321,6 @@ font-size:.9em;
/* a div that holds a short description */ /* a div that holds a short description */
.jd-descrdiv { .jd-descrdiv {
width:100%;
padding:3px 1em 0 1em; padding:3px 1em 0 1em;
margin:0; margin:0;
border:0; border:0;
@@ -340,6 +339,50 @@ links to summary tables) */
max-width:70%; max-width:70%;
} }
#api-level-toggle {
float:right;
padding:0 10px;
font-size:11px;
color:#999;
}
h4.jd-details-title .api-level,
div#jd-header .api-level {
font-size:12px;
font-weight:normal;
color:#999;
position:absolute;
top:5px;
right:5px;
}
div#jd-header .api-level {
position:relative;
float:right;
margin-top:-1.7em;
}
.absent,
.absent a:link,
.absent a:visited,
.absent a:hover,
.absent * {
color:#aaa !important;
background-color:#f6f6f6 !important;
cursor:default !important;
text-decoration:none !important;
}
#side-nav li.absent,
#side-nav li.absent * {
background-color:#fff !important;
}
#side-nav li.absent.selected,
#side-nav li.absent.selected * {
background-color:#eee !important;
}
/* applies to a div containing links to summary tables */ /* applies to a div containing links to summary tables */
.sum-details-links { .sum-details-links {
margin:0 .5em; margin:0 .5em;
@@ -471,6 +514,10 @@ seealso list, etc */
margin:.5em 1em; margin:.5em 1em;
} }
.jd-tagdata p {
margin:0 0 1em 1em;
}
/* API reference: adjustments to /* API reference: adjustments to
the detailed description block */ the detailed description block */
.jd-tagdescr { .jd-tagdescr {
@@ -508,6 +555,7 @@ h4.jd-details-title {
background-color: #E2E2E2; background-color: #E2E2E2;
margin:1.5em 0 .6em; margin:1.5em 0 .6em;
padding:3px; padding:3px;
position:relative; /* so the api level can be absolute */
} }
h4.jd-tagtitle { h4.jd-tagtitle {

View File

@@ -102,12 +102,12 @@ Summary:
<?cs if:inhmethods ?> <?cs if:inhmethods ?>
<?cs if:linkcount ?>&#124; <?cs /if ?><a href="#inhmethods">Inherited Methods</a> <?cs if:linkcount ?>&#124; <?cs /if ?><a href="#inhmethods">Inherited Methods</a>
<?cs /if ?> <?cs /if ?>
</nobr>
<?cs if:inhattrs || inhconstants || inhfields || inhmethods || subcount(class.subclasses.direct) || subcount(class.subclasses.indirect) ?> <?cs if:inhattrs || inhconstants || inhfields || inhmethods || subcount(class.subclasses.direct) || subcount(class.subclasses.indirect) ?>
&#124; <a href="#" onclick="return toggleAllSummaryInherited(this)">[Expand All]</a> &#124; <a href="#" onclick="return toggleAllSummaryInherited(this)">[Expand All]</a>
<?cs /if ?> <?cs /if ?>
</div> </div><!-- end sum-details-links -->
</div>
</div><!-- end api-info-block -->
<?cs # this next line must be exactly like this to be parsed by eclipse ?> <?cs # this next line must be exactly like this to be parsed by eclipse ?>
<!-- ======== START OF CLASS DATA ======== --> <!-- ======== START OF CLASS DATA ======== -->
@@ -134,10 +134,12 @@ Summary:
<?cs set:colspan = colspan-1 ?> <?cs set:colspan = colspan-1 ?>
<?cs /each ?> <?cs /each ?>
<div class="api-level"><?cs call:since_tags(class) ?></div>
</div><!-- end header --> </div><!-- end header -->
<div id="jd-content"> <div id="jd-content" class="apilevel-<?cs var:class.since ?>">
<table class="jd-inheritance-table"> <table class="jd-inheritance-table">
<?cs set:colspan = subcount(class.inheritance) ?> <?cs set:colspan = subcount(class.inheritance) ?>
<?cs each:supr = class.inheritance ?> <?cs each:supr = class.inheritance ?>
@@ -180,7 +182,6 @@ Summary:
<?cs /if ?> <?cs /if ?>
<?cs call:see_also_tags(class.seeAlso) ?> <?cs call:see_also_tags(class.seeAlso) ?>
<?cs call:since_tags(class) ?>
</div><!-- jd-descr --> </div><!-- jd-descr -->
@@ -190,7 +191,8 @@ Summary:
<?cs def:write_method_summary(methods) ?> <?cs def:write_method_summary(methods) ?>
<?cs set:count = #1 ?> <?cs set:count = #1 ?>
<?cs each:method = methods ?> <?cs each:method = methods ?>
<tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > <?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:method.since ?>" >
<td class="jd-typecol"><nobr> <td class="jd-typecol"><nobr>
<?cs var:method.abstract ?> <?cs var:method.abstract ?>
<?cs var:method.synchronized ?> <?cs var:method.synchronized ?>
@@ -473,7 +475,8 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va
<?cs # this next line must be exactly like this to be parsed by eclipse ?> <?cs # this next line must be exactly like this to be parsed by eclipse ?>
<?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?> <?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?>
<A NAME="<?cs var:field.anchor ?>"></A> <A NAME="<?cs var:field.anchor ?>"></A>
<div class="jd-details"> <?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
<div class="jd-details api apilevel-<?cs var:field.since ?>">
<h4 class="jd-details-title"> <h4 class="jd-details-title">
<span class="normal"> <span class="normal">
<?cs var:field.scope ?> <?cs var:field.scope ?>
@@ -482,6 +485,9 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va
<?cs call:type_link(field.type) ?> <?cs call:type_link(field.type) ?>
</span> </span>
<?cs var:field.name ?> <?cs var:field.name ?>
<span class="api-level">
<?cs call:since_tags(field) ?>
</span>
</h4> </h4>
<div class="jd-details-descr"><?cs call:description(field) ?> <div class="jd-details-descr"><?cs call:description(field) ?>
<?cs if:subcount(field.constantValue) ?> <?cs if:subcount(field.constantValue) ?>
@@ -506,7 +512,8 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va
<?cs each:method=methods ?> <?cs each:method=methods ?>
<?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?> <?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?>
<A NAME="<?cs var:method.anchor ?>"></A> <A NAME="<?cs var:method.anchor ?>"></A>
<div class="jd-details"> <?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
<div class="jd-details api apilevel-<?cs var:method.since ?>">
<h4 class="jd-details-title"> <h4 class="jd-details-title">
<span class="normal"> <span class="normal">
<?cs var:method.scope ?> <?cs var:method.scope ?>
@@ -518,6 +525,9 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va
</span> </span>
<span class="sympad"><?cs var:method.name ?></span> <span class="sympad"><?cs var:method.name ?></span>
<span class="normal">(<?cs call:parameter_list(method.params) ?>)</span> <span class="normal">(<?cs call:parameter_list(method.params) ?>)</span>
<span class="api-level">
<?cs call:since_tags(method) ?>
</span>
</h4> </h4>
<div class="jd-details-descr"><?cs call:description(method) ?></div> <div class="jd-details-descr"><?cs call:description(method) ?></div>
</div> </div>
@@ -528,8 +538,13 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va
<?cs each:attr=attrs ?> <?cs each:attr=attrs ?>
<?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?> <?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?>
<A NAME="<?cs var:attr.anchor ?>"></A> <A NAME="<?cs var:attr.anchor ?>"></A>
<div class="jd-details"> <?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
<h4 class="jd-details-title"><?cs var:attr.name ?></h4> <div class="jd-details api apilevel-<?cs var:attr.since ?>">
<h4 class="jd-details-title"><?cs var:attr.name ?>
<span class="api-level">
<?cs call:since_tags(attr) ?>
</span>
</h4>
<div class="jd-details-descr"> <div class="jd-details-descr">
<?cs call:description(attr) ?> <?cs call:description(attr) ?>

View File

@@ -115,11 +115,9 @@ def:see_also_tags(also) ?><?cs
/if ?> /if ?>
<?cs /def ?> <?cs /def ?>
<?cs # print the Since: section ?><?cs <?cs # print the API Level ?><?cs
def:since_tags(obj) ?> def:since_tags(obj) ?>
<div class="jd-tagdata"> Since: API Level <?cs var:obj.since ?>
<h5 class="jd-tagtitle">Since <?cs var:obj.since ?></h5>
</div>
<?cs /def ?> <?cs /def ?>
<?cs # Print the long-form description for something. <?cs # Print the long-form description for something.
@@ -170,8 +168,7 @@ def:description(obj) ?><?cs
</table> </table>
</div><?cs </div><?cs
/if ?><?cs /if ?><?cs
call:see_also_tags(obj.seeAlso) ?><?cs call:see_also_tags(obj.seeAlso) ?><?cs
call:since_tags(obj) ?><?cs
/def ?> /def ?>
<?cs # A table of links to classes with descriptions, as in a package file or the nested classes ?><?cs <?cs # A table of links to classes with descriptions, as in a package file or the nested classes ?><?cs
@@ -179,7 +176,7 @@ def:class_link_table(classes) ?><?cs
set:count = #1 ?> set:count = #1 ?>
<table class="jd-sumtable-expando"><?cs <table class="jd-sumtable-expando"><?cs
each:cl=classes ?> each:cl=classes ?>
<tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.type.since ?>" >
<td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td> <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td>
<td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?>&nbsp;</td> <td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?>&nbsp;</td>
</tr><?cs set:count = count + #1 ?><?cs </tr><?cs set:count = count + #1 ?><?cs
@@ -187,32 +184,39 @@ def:class_link_table(classes) ?><?cs
</table><?cs </table><?cs
/def ?> /def ?>
<?cs # A list of links to classes, for use in the side navigation of packages ?><?cs <?cs # A list of links to classes, for use in the side navigation of classes when viewing a package (panel nav) ?><?cs
def:class_link_list(label, classes) ?><?cs def:class_link_list(label, classes) ?><?cs
if:subcount(classes) ?> if:subcount(classes) ?>
<li><h2><?cs var:label ?></h2> <li><h2><?cs var:label ?></h2>
<ul><?cs <ul><?cs
each:cl=classes ?> each:cl=classes ?>
<li><?cs call:type_link(cl.type) ?></li><?cs <li class="api apilevel-<?cs var:cl.type.since ?>"><?cs call:type_link(cl.type) ?></li><?cs
/each ?> /each ?>
</ul> </ul>
</li><?cs </li><?cs
/if ?><?cs /if ?><?cs
/def ?> /def ?>
<?cs # A list of links to classes, for use in the side navigation of classes ?><?cs <?cs # A list of links to classes, for use in the side navigation of classes when viewing a class (panel nav) ?><?cs
def:list(label, classes) ?><?cs def:list(label, classes) ?><?cs
if:subcount(classes) ?> if:subcount(classes) ?>
<li><h2><?cs var:label ?></h2> <li><h2><?cs var:label ?></h2>
<ul><?cs <ul><?cs
each:cl=classes ?> each:cl=classes ?>
<li <?cs if:class.name == cl.label?>class="selected"<?cs /if ?>><?cs call:type_link(cl) ?></li><?cs <li class="<?cs if:class.name == cl.label?>selected<?cs /if ?> api apilevel-<?cs var:cl.since ?>"><?cs call:type_link(cl) ?></li><?cs
/each ?> /each ?>
</ul> </ul>
</li><?cs </li><?cs
/if ?><?cs /if ?><?cs
/def ?> /def ?>
<?cs # A list of links to packages, for use in the side navigation of packages (panel nav) ?><?cs
def:package_link_list(packages) ?><?cs
each:pkg=packages ?>
<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
/each ?><?cs
/def ?>
<?cs # An expando trigger ?><?cs <?cs # An expando trigger ?><?cs
def:expando_trigger(id, default) ?> def:expando_trigger(id, default) ?>
<a href="#" onclick="return toggleInherited(this, null)" id="<?cs var:id ?>" class="jd-expando-trigger closed" <a href="#" onclick="return toggleInherited(this, null)" id="<?cs var:id ?>" class="jd-expando-trigger closed"

View File

@@ -9,21 +9,23 @@
<div id="jd-header"> <div id="jd-header">
package package
<h1><?cs var:package.name ?></h1> <h1><?cs var:package.name ?></h1>
<div class="jd-nav"> <div class="jd-nav">
<?cs if:subcount(package.shortDescr) ?> <?cs if:subcount(package.shortDescr) ?>
Classes | Classes |
<a class="jd-navlink" href="package-descr.html">Description</a> <a class="jd-navlink" href="package-descr.html">Description</a>
<?cs /if ?> <?cs /if ?>
</div> </div>
<span class="api-level">
<?cs call:since_tags(package) ?>
</span>
</div> </div>
<div id="jd-content"> <div id="jd-content">
<?cs if:subcount(package.shortDescr) ?> <?cs if:subcount(package.shortDescr) ?>
<div class="jd-descr"> <div class="jd-descr">
<p><?cs call:tag_list(package.shortDescr) ?> <p><?cs call:tag_list(package.shortDescr) ?></p>
<span class="jd-more"><a href="package-descr.html">more...</a></span></p> <p><span class="jd-more"><a href="package-descr.html">more...</a></span></p>
</div> </div>
<?cs /if ?> <?cs /if ?>