[scaladoc] Abstract members can be filtered in or out. Pointer icons are less crazy. Review by dubochet. Contributed by Pedro Furlanetto.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@22361 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
101153f534
commit
21e9e92885
|
@ -79,6 +79,12 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
|
|||
<ol><li class="public in">Public</li><li class="all out">All</li></ol>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
<div id="impl">
|
||||
<span class="filtertype">Impl.</span>
|
||||
<ol><li class="concrete in">Concrete</li><li class="abstract in">Abstract</li></ol>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
{ if (constructors.isEmpty) NodeSeq.Empty else
|
||||
|
@ -116,10 +122,39 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
|
|||
|
||||
</body>
|
||||
|
||||
|
||||
def boundsToString(hi: Option[TypeEntity], lo: Option[TypeEntity]): String = {
|
||||
def bound0(bnd: Option[TypeEntity], pre: String): String = bnd match {
|
||||
case None => ""
|
||||
case Some(tpe) => pre ++ tpe.toString
|
||||
}
|
||||
bound0(hi, "<:") ++ bound0(lo, ">:")
|
||||
}
|
||||
|
||||
def tparamsToString(tpss: List[TypeParam]): String =
|
||||
if (tpss.isEmpty) "" else {
|
||||
def tparam0(tp: TypeParam): String =
|
||||
tp.variance + tp.name + boundsToString(tp.hi, tp.lo)
|
||||
def tparams0(tpss: List[TypeParam]): String = (tpss: @unchecked) match {
|
||||
case tp :: Nil => tparam0(tp)
|
||||
case tp :: tps => tparam0(tp) ++ ", " ++ tparams0(tps)
|
||||
}
|
||||
"[" + tparams0(tpss) + "]"
|
||||
}
|
||||
|
||||
def defParamsToString(d: MemberEntity with Def):String = {
|
||||
val namess = for( ps <- d.valueParams ) yield
|
||||
for( p <- ps ) yield p.resultType.name
|
||||
tparamsToString(d.typeParams) + namess.foldLeft("") { (s,names) => s + (names mkString("(",",",")")) }
|
||||
}
|
||||
|
||||
def memberToHtml(mbr: MemberEntity): NodeSeq = {
|
||||
val attributes: List[comment.Body] = Nil
|
||||
<li name={ mbr.definitionName } visbl={ if (mbr.visibility.isProtected) "prt" else "pub" }>
|
||||
val defParamsString = mbr match {
|
||||
case d:MemberEntity with Def => defParamsToString(d)
|
||||
case _ => ""
|
||||
}
|
||||
<li name={ mbr.definitionName } visbl={ if (mbr.visibility.isProtected) "prt" else "pub" }
|
||||
data-isabs={ mbr.isAbstract.toString }>
|
||||
<a id={ mbr.name +defParamsString +":"+ mbr.resultType.name}/>
|
||||
{ signature(mbr, false) }
|
||||
{ memberToCommentHtml(mbr, false) }
|
||||
</li>
|
||||
|
|
|
@ -15,7 +15,6 @@ body {
|
|||
}
|
||||
|
||||
a {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
color: #69481D; /* brown */
|
||||
}
|
||||
|
@ -311,7 +310,7 @@ p.comment {
|
|||
p.shortcomment {
|
||||
display: block;
|
||||
margin-left: 8.7em;
|
||||
cursor: help;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.fullcomment {
|
||||
|
@ -444,7 +443,7 @@ div.fullcomment dl.paramcmts > dd + dt + dd {
|
|||
padding: 4px 8px 4px 8px;
|
||||
background-color: white;
|
||||
display: inline-block;
|
||||
cursor: crosshair;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#mbrsel > div > ol > li.in {
|
||||
|
@ -465,4 +464,4 @@ div.fullcomment dl.paramcmts > dd + dt + dd {
|
|||
#mbrsel .showall {
|
||||
color: #4C4C4C;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,24 @@ $(document).ready(function(){
|
|||
filter();
|
||||
};
|
||||
});
|
||||
$("#impl > ol > li.concrete").click(function() {
|
||||
if ($(this).hasClass("out")) {
|
||||
$(this).removeClass("out").addClass("in");
|
||||
$("li[data-isabs='false']").show();
|
||||
} else {
|
||||
$(this).removeClass("in").addClass("out");
|
||||
$("li[data-isabs='false']").hide();
|
||||
}
|
||||
});
|
||||
$("#impl > ol > li.abstract").click(function() {
|
||||
if ($(this).hasClass("out")) {
|
||||
$(this).removeClass("out").addClass("in");
|
||||
$("li[data-isabs='true']").show();
|
||||
} else {
|
||||
$(this).removeClass("in").addClass("out");
|
||||
$("li[data-isabs='true']").hide();
|
||||
}
|
||||
});
|
||||
$("#order > ol > li.alpha").click(function() {
|
||||
if ($(this).hasClass("out")) {
|
||||
$(this).removeClass("out").addClass("in");
|
||||
|
@ -97,7 +115,7 @@ $(document).ready(function(){
|
|||
var docShowSigs = docAllSigs.filter(function(){
|
||||
return $("+ div.fullcomment", $(this)).length > 0;
|
||||
});
|
||||
docShowSigs.css("cursor", "help");
|
||||
docShowSigs.css("cursor", "pointer");
|
||||
docShowSigs.click(function(){
|
||||
commentShowFct($("+ div.fullcomment", $(this)));
|
||||
});
|
||||
|
@ -116,7 +134,7 @@ $(document).ready(function(){
|
|||
var docToggleSigs = docAllSigs.filter(function(){
|
||||
return $("+ p.shortcomment", $(this)).length > 0;
|
||||
});
|
||||
docToggleSigs.css("cursor", "help");
|
||||
docToggleSigs.css("cursor", "pointer");
|
||||
docToggleSigs.click(function(){
|
||||
commentToggleFct($("+ p.shortcomment", $(this)));
|
||||
});
|
||||
|
|
|
@ -52,6 +52,7 @@ trait MemberEntity extends Entity {
|
|||
def isLazyVal: Boolean
|
||||
def isVar: Boolean
|
||||
def isImplicit: Boolean
|
||||
def isAbstract: Boolean
|
||||
def isConstructor: Boolean
|
||||
def isAliasType: Boolean
|
||||
def isAbstractType: Boolean
|
||||
|
|
|
@ -127,6 +127,9 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory
|
|||
def isConstructor = false
|
||||
def isAliasType = false
|
||||
def isAbstractType = false
|
||||
def isAbstract =
|
||||
((!sym.isTrait && ((sym hasFlag Flags.ABSTRACT) || (sym hasFlag Flags.DEFERRED))) ||
|
||||
sym.isAbstractClass || sym.isAbstractType) && !sym.isSynthetic
|
||||
def isTemplate = false
|
||||
}
|
||||
|
||||
|
|
|
@ -69,4 +69,3 @@ abstract class Comment {
|
|||
(version map ("@version " + _.toString)).mkString
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue