提交 8653a1d4 编写于 作者: B bpatel

8002304: Group methods by types in methods summary section

Reviewed-by: jjg
上级 3fd20c70
......@@ -52,6 +52,9 @@ public abstract class AbstractMemberWriter {
protected final ConfigurationImpl configuration;
protected final SubWriterHolderWriter writer;
protected final ClassDoc classdoc;
protected Map<String,Integer> typeMap = new LinkedHashMap<String,Integer>();
protected Set<MethodTypes> methodTypes = EnumSet.noneOf(MethodTypes.class);
private int methodTypesOr = 0;
public final boolean nodepr;
protected boolean printedSummaryHeader = false;
......@@ -524,11 +527,11 @@ public abstract class AbstractMemberWriter {
* @param classDoc the class that is being documented
* @param member the member being documented
* @param firstSentenceTags the first sentence tags to be added to the summary
* @param tableTree the content tree to which the documentation will be added
* @param counter the counter for determing style for the table row
* @param tableContents the list of contents to which the documentation will be added
* @param counter the counter for determining id and style for the table row
*/
public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
Tag[] firstSentenceTags, Content tableTree, int counter) {
Tag[] firstSentenceTags, List<Content> tableContents, int counter) {
HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
tdSummaryType.addStyle(HtmlStyle.colFirst);
writer.addSummaryType(this, member, tdSummaryType);
......@@ -538,11 +541,46 @@ public abstract class AbstractMemberWriter {
writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary);
HtmlTree tr = HtmlTree.TR(tdSummaryType);
tr.addContent(tdSummary);
if (member instanceof MethodDoc && !member.isAnnotationTypeElement()) {
int methodType = (member.isStatic()) ? MethodTypes.STATIC.value() :
MethodTypes.INSTANCE.value();
methodType = (classdoc.isInterface() || ((MethodDoc)member).isAbstract()) ?
methodType | MethodTypes.ABSTRACT.value() :
methodType | MethodTypes.CONCRETE.value();
if (Util.isDeprecated(member) || Util.isDeprecated(classdoc)) {
methodType = methodType | MethodTypes.DEPRECATED.value();
}
methodTypesOr = methodTypesOr | methodType;
String tableId = "i" + counter;
typeMap.put(tableId, methodType);
tr.addAttr(HtmlAttr.ID, tableId);
}
if (counter%2 == 0)
tr.addStyle(HtmlStyle.altColor);
else
tr.addStyle(HtmlStyle.rowColor);
tableTree.addContent(tr);
tableContents.add(tr);
}
/**
* Generate the method types set and return true if the method summary table
* needs to show tabs.
*
* @return true if the table should show tabs
*/
public boolean showTabs() {
int value;
for (MethodTypes type : EnumSet.allOf(MethodTypes.class)) {
value = type.value();
if ((value & methodTypesOr) == value) {
methodTypes.add(type);
}
}
boolean showTabs = methodTypes.size() > 1;
if (showTabs) {
methodTypes.add(MethodTypes.ALL);
}
return showTabs;
}
/**
......@@ -595,10 +633,11 @@ public abstract class AbstractMemberWriter {
* Get the summary table tree for the given class.
*
* @param classDoc the class for which the summary table is generated
* @param tableContents list of contents to be displayed in the summary table
* @return a content tree for the summary table
*/
public Content getSummaryTableTree(ClassDoc classDoc) {
return writer.getSummaryTableTree(this, classDoc);
public Content getSummaryTableTree(ClassDoc classDoc, List<Content> tableContents) {
return writer.getSummaryTableTree(this, classDoc, tableContents, showTabs());
}
/**
......
......@@ -117,6 +117,8 @@ public class HtmlDoclet extends AbstractDoclet {
copyResourceFile("tab.gif");
copyResourceFile("titlebar.gif");
copyResourceFile("titlebar_end.gif");
copyResourceFile("activetitlebar.gif");
copyResourceFile("activetitlebar_end.gif");
// do early to reduce memory footprint
if (configuration.classuse) {
ClassUseWriter.generate(configuration, classtree);
......@@ -152,10 +154,13 @@ public class HtmlDoclet extends AbstractDoclet {
}
// If a stylesheet file is not specified, copy the default stylesheet
// and replace newline with platform-specific newline.
DocFile f;
if (configuration.stylesheetfile.length() == 0) {
DocFile f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET);
f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET);
f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.STYLESHEET), false, true);
}
f = DocFile.createFileForOutput(configuration, DocPaths.JAVASCRIPT);
f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.JAVASCRIPT), true, true);
}
/**
......
......@@ -327,6 +327,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
}
}
head.addContent(getStyleSheetProperties());
head.addContent(getScriptProperties());
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
head, body);
Content htmlDocument = new HtmlDocument(htmlDocType,
......@@ -1687,6 +1688,17 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return link;
}
/**
* Returns a link to the JavaScript file.
*
* @return an HtmlTree for the Script tag which provides the JavaScript location
*/
public HtmlTree getScriptProperties() {
HtmlTree script = HtmlTree.SCRIPT("text/javascript",
pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
return script;
}
/**
* According to
* <cite>The Java&trade; Language Specification</cite>,
......
......@@ -26,6 +26,7 @@
package com.sun.tools.doclets.formats.html;
import java.io.*;
import java.util.*;
import com.sun.javadoc.*;
import com.sun.tools.doclets.formats.html.markup.*;
......@@ -77,15 +78,70 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
*
* @param mw the writer for the member being documented
* @param cd the classdoc to be documented
* @param tableContents list of summary table contents
* @param showTabs true if the table needs to show tabs
* @return the content tree for the summary table
*/
public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd) {
public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd,
List<Content> tableContents, boolean showTabs) {
Content caption;
if (showTabs) {
caption = getTableCaption(mw.methodTypes);
generateMethodTypesScript(mw.typeMap, mw.methodTypes);
}
else {
caption = getTableCaption(mw.getCaption());
}
Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0,
mw.getTableSummary(), getTableCaption(mw.getCaption()));
mw.getTableSummary(), caption);
table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col"));
for (int i = 0; i < tableContents.size(); i++) {
table.addContent(tableContents.get(i));
}
return table;
}
/**
* Get the summary table caption.
*
* @param methodTypes set comprising of method types to show as table caption
* @return the caption for the summary table
*/
public Content getTableCaption(Set<MethodTypes> methodTypes) {
Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION);
for (MethodTypes type : methodTypes) {
Content captionSpan;
Content span;
if (type.isDefaultTab()) {
captionSpan = HtmlTree.SPAN(new StringContent(type.text()));
span = HtmlTree.SPAN(type.tabId(),
HtmlStyle.activeTableTab, captionSpan);
} else {
captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type));
span = HtmlTree.SPAN(type.tabId(),
HtmlStyle.tableTab, captionSpan);
}
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, getSpace());
span.addContent(tabSpan);
tabbedCaption.addContent(span);
}
return tabbedCaption;
}
/**
* Get the method type links for the table caption.
*
* @param methodType the method type to be displayed as link
* @return the content tree for the method type link
*/
public Content getMethodTypeLinks(MethodTypes methodType) {
StringBuilder jsShow = new StringBuilder("javascript:show(");
jsShow.append(methodType.value()).append(");");
HtmlTree link = HtmlTree.A(jsShow.toString(),
new StringContent(methodType.text()));
return link;
}
/**
* Add the inherited summary header.
*
......
......@@ -37,6 +37,7 @@ package com.sun.tools.doclets.formats.html.markup;
*/
public enum HtmlStyle {
aboutLanguage,
activeTableTab,
altColor,
bar,
block,
......@@ -75,6 +76,7 @@ public enum HtmlStyle {
summary,
deprecatedContent,
tabEnd,
tableTab,
title,
topNav;
}
......@@ -493,6 +493,20 @@ public class HtmlTree extends Content {
return htmltree;
}
/**
* Generates a SCRIPT tag with the type and src attributes.
*
* @param type type of link
* @param src the path for the script
* @return an HtmlTree object for the SCRIPT tag
*/
public static HtmlTree SCRIPT(String type, String src) {
HtmlTree htmltree = new HtmlTree(HtmlTag.SCRIPT);
htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type));
htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
return htmltree;
}
/**
* Generates a SMALL tag with some content.
*
......@@ -539,6 +553,23 @@ public class HtmlTree extends Content {
return htmltree;
}
/**
* Generates a SPAN tag with id and style class attributes. It also encloses
* a content.
*
* @param id the id for the tag
* @param styleClass stylesheet class for the tag
* @param body content for the tag
* @return an HtmlTree object for the SPAN tag
*/
public static HtmlTree SPAN(String id, HtmlStyle styleClass, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body));
htmltree.addAttr(HtmlAttr.ID, nullCheck(id));
if (styleClass != null)
htmltree.addStyle(styleClass);
return htmltree;
}
/**
* Generates a Table tag with border, width and summary attributes and
* some content.
......@@ -742,6 +773,9 @@ public class HtmlTree extends Content {
return (hasAttr(HtmlAttr.HREF) && !hasContent());
case META :
return (hasAttr(HtmlAttr.CONTENT) && !hasContent());
case SCRIPT :
return ((hasAttr(HtmlAttr.TYPE) && hasAttr(HtmlAttr.SRC) && !hasContent()) ||
(hasAttr(HtmlAttr.TYPE) && hasContent()));
default :
return hasContent();
}
......
......@@ -26,6 +26,7 @@
package com.sun.tools.doclets.formats.html.markup;
import java.io.*;
import java.util.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
......@@ -144,6 +145,8 @@ public class HtmlWriter {
private final Writer writer;
private Content script;
/**
* Constructor.
*
......@@ -301,7 +304,8 @@ public class HtmlWriter {
// Don't print windowtitle script for overview-frame, allclasses-frame
// and package-frame
if (includeScript) {
body.addContent(getWinTitleScript());
this.script = getWinTitleScript();
body.addContent(script);
Content noScript = HtmlTree.NOSCRIPT(
HtmlTree.DIV(getResource("doclet.No_Script_Message")));
body.addContent(noScript);
......@@ -309,6 +313,53 @@ public class HtmlWriter {
return body;
}
/**
* Generated javascript variables for the document.
*
* @param typeMap map comprising of method and type relationship
* @param methodTypes set comprising of all methods types for this class
*/
public void generateMethodTypesScript(Map<String,Integer> typeMap,
Set<MethodTypes> methodTypes) {
String sep = "";
StringBuilder vars = new StringBuilder("var methods = {");
for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
vars.append(sep);
sep = ",";
vars.append("\"");
vars.append(entry.getKey());
vars.append("\":");
vars.append(entry.getValue());
}
vars.append("};").append(DocletConstants.NL);
sep = "";
vars.append("var tabs = {");
for (MethodTypes entry : methodTypes) {
vars.append(sep);
sep = ",";
vars.append(entry.value()).append(":");
vars.append("[").append("\"").append(entry.tabId());
vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]");
}
vars.append("};").append(DocletConstants.NL);
addStyles(HtmlStyle.altColor, vars);
addStyles(HtmlStyle.rowColor, vars);
addStyles(HtmlStyle.tableTab, vars);
addStyles(HtmlStyle.activeTableTab, vars);
script.addContent(new RawHtml(vars.toString()));
}
/**
* Adds javascript style variables to the document.
*
* @param style style to be added as a javascript variable
* @param vars variable string to which the style variable will be added
*/
public void addStyles(HtmlStyle style, StringBuilder vars) {
vars.append("var ").append(style).append(" = \"").append(style)
.append("\";").append(DocletConstants.NL);
}
/**
* Returns an HtmlTree for the TITLE tag.
*
......
......@@ -58,9 +58,11 @@ public interface MemberSummaryWriter {
* Get the summary table for the given class.
*
* @param classDoc the class the summary table belongs to
* @param tableContents list of contents that will be added to the summary table
* @return a content tree for the member summary table
*/
public Content getSummaryTableTree(ClassDoc classDoc);
public Content getSummaryTableTree(ClassDoc classDoc,
List<Content> tableContents);
/**
* Add the member summary for the given class and member.
......@@ -68,11 +70,11 @@ public interface MemberSummaryWriter {
* @param classDoc the class the summary belongs to
* @param member the member that is documented
* @param firstSentenceTags the tags for the sentence being documented
* @param tableTree the content treeto which the information will be added
* @param counter the counter for determing style for the table row
* @param tableContents list of contents to which the summary will be added
* @param counter the counter for determining id and style for the table row
*/
public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
Tag[] firstSentenceTags, Content tableTree, int counter);
Tag[] firstSentenceTags, List<Content> tableContents, int counter);
/**
* Get the inherited member summary header for the given class.
......
......@@ -308,7 +308,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
configuration));
if (members.size() > 0) {
Collections.sort(members);
Content tableTree = writer.getSummaryTableTree(classDoc);
List<Content> tableContents = new LinkedList<Content>();
for (int i = 0; i < members.size(); i++) {
ProgramElementDoc member = members.get(i);
Tag[] firstSentenceTags = member.firstSentenceTags();
......@@ -317,14 +317,15 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
//necessary.
DocFinder.Output inheritedDoc =
DocFinder.search(new DocFinder.Input((MethodDoc) member));
if (inheritedDoc.holder != null &&
inheritedDoc.holder.firstSentenceTags().length > 0) {
if (inheritedDoc.holder != null
&& inheritedDoc.holder.firstSentenceTags().length > 0) {
firstSentenceTags = inheritedDoc.holder.firstSentenceTags();
}
}
writer.addMemberSummary(classDoc, member, firstSentenceTags, tableTree, i);
writer.addMemberSummary(classDoc, member, firstSentenceTags,
tableContents, i);
}
summaryTreeList.add(tableTree);
summaryTreeList.add(writer.getSummaryTableTree(classDoc, tableContents));
}
}
......
function show(type)
{
count = 0;
for (var key in methods) {
var row = document.getElementById(key);
if ((methods[key] & type) != 0) {
row.style.display = '';
row.className = (count++ % 2) ? rowColor : altColor;
}
else
row.style.display = 'none';
}
updateTabs(type);
}
function updateTabs(type)
{
for (var value in tabs) {
var sNode = document.getElementById(tabs[value][0]);
var spanNode = sNode.firstChild;
if (value == type) {
sNode.className = activeTableTab;
spanNode.innerHTML = tabs[value][1];
}
else {
sNode.className = tableTab;
spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>";
}
}
}
......@@ -381,6 +381,31 @@ caption a:link, caption a:hover, caption a:active, caption a:visited {
background-image:url(resources/titlebar.gif);
height:18px;
}
.contentContainer ul.blockList li.blockList caption span.activeTableTab span {
white-space:nowrap;
padding-top:8px;
padding-left:8px;
display:block;
float:left;
background-image:url(resources/activetitlebar.gif);
height:18px;
}
.contentContainer ul.blockList li.blockList caption span.tableTab span {
white-space:nowrap;
padding-top:8px;
padding-left:8px;
display:block;
float:left;
background-image:url(resources/titlebar.gif);
height:18px;
}
.contentContainer ul.blockList li.blockList caption span.tableTab, .contentContainer ul.blockList li.blockList caption span.activeTableTab {
padding-top:0px;
padding-left:0px;
background-image:none;
float:none;
display:inline;
}
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
width:10px;
background-image:url(resources/titlebar_end.gif);
......@@ -389,6 +414,24 @@ caption a:link, caption a:hover, caption a:active, caption a:visited {
position:relative;
float:left;
}
.contentContainer ul.blockList li.blockList .activeTableTab .tabEnd {
width:10px;
margin-right:5px;
background-image:url(resources/activetitlebar_end.gif);
background-repeat:no-repeat;
background-position:top right;
position:relative;
float:left;
}
.contentContainer ul.blockList li.blockList .tableTab .tabEnd {
width:10px;
margin-right:5px;
background-image:url(resources/titlebar_end.gif);
background-repeat:no-repeat;
background-position:top right;
position:relative;
float:left;
}
ul.blockList ul.blockList li.blockList table {
margin:0 0 12px 0px;
width:100%;
......
......@@ -72,6 +72,9 @@ public class DocPaths {
return DocPath.create("index-" + n + ".html");
}
/** The name of the default javascript file. */
public static final DocPath JAVASCRIPT = DocPath.create("script.js");
/** The name of the file for the overview frame. */
public static final DocPath OVERVIEW_FRAME = DocPath.create("overview-frame.html");
......
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.util;
/**
* Enum representing method types.
*
* @author Bhavesh Patel
*/
public enum MethodTypes {
ALL(0xffff, "All Methods", "t0", true),
STATIC(0x1, "Static Methods", "t1", false),
INSTANCE(0x2, "Instance Methods", "t2", false),
ABSTRACT(0x4, "Abstract Methods", "t3", false),
CONCRETE(0x8, "Concrete Methods", "t4", false),
DEPRECATED(0x10, "Deprecated Methods", "t5", false);
private final int value;
private final String text;
private final String tabId;
private final boolean isDefaultTab;
MethodTypes(int v, String t, String id, boolean dt) {
this.value = v;
this.text = t;
this.tabId = id;
this.isDefaultTab = dt;
}
public int value() {
return value;
}
public String text() {
return text;
}
public String tabId() {
return tabId;
}
public boolean isDefaultTab() {
return isDefaultTab;
}
}
......@@ -201,7 +201,15 @@ public class TestHtmlTableTags extends JavadocTester {
"<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>"
},
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>"
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
"Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
"Instance Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" +
"Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">" +
"Deprecated Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"</caption>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<caption><span>Nested Classes</span><span class=\"tabEnd\">&nbsp;</span></caption>"
......
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8002304
* @summary Test for various method types in the method summary table
* @author Bhavesh Patel
* @library ../lib/
* @build JavadocTester TestMethodTypes
* @run main TestMethodTypes
*/
public class TestMethodTypes extends JavadocTester {
//Test information.
private static final String BUG_ID = "8002304";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
};
private static final String[][] TEST = {
{BUG_ID + FS + "pkg1" + FS + "A.html",
"var methods = {"
},
{BUG_ID + FS + "pkg1" + FS + "A.html",
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
"Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">" +
"Static Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
"Instance Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" +
"Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">" +
"Deprecated Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"</caption>"
},
{BUG_ID + FS + "pkg1" + FS + "A.html",
"<tr id=\"i0\" class=\"altColor\">"
},
{BUG_ID + FS + "pkg1" + FS + "B.html",
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
"Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
"Instance Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
"Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"</caption>"
},
{BUG_ID + FS + "pkg1" + FS + "D.html",
"var methods = {"
},
{BUG_ID + FS + "pkg1" + FS + "D.html",
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " +
"Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" +
"Instance Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
"Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" +
"Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">" +
"Deprecated Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
"</caption>"
},
{BUG_ID + FS + "pkg1" + FS + "D.html",
"<tr id=\"i0\" class=\"altColor\">"
},
};
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg1" + FS + "A.html",
"<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
"</caption>"
},
{BUG_ID + FS + "pkg1" + FS + "B.html",
"<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
"</caption>"
},
{BUG_ID + FS + "pkg" + FS + "D.html",
"<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span>" +
"</caption>"
},
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestMethodTypes tester = new TestMethodTypes();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package pkg1;
/**
* This class has a mixture of different types of methods. The methods summary
* table should appear with "All Methods", "Static Methods", "Instance Methods",
* "Concrete Methods" and "Deprecated Methods".
*/
public class A {
/**
* This is the first concrete instance method.
*/
public void readObject() {
}
/**
* This is the second concrete instance method.
*/
public final void setStub() {
}
/**
* This is the third concrete instance method.
*/
public String getParameter() {
return "test";
}
/**
* This is the first concrete instance deprecated method.
* @deprecated This is a deprecated method that should appear in the tab.
*/
public void resize() {
}
/**
* This is the fourth concrete instance method.
*/
public void showStatus() {
}
/**
* This is the first concrete static method.
*/
public final static void staticMethod() {
}
/**
* This is the second concrete instance deprecated method.
*/
@Deprecated
public void init() {
}
}
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package pkg1;
/**
* This interface has different types of methods such as "Instance Methods" and
* "Abstract Methods". All the tabs will display same list of methods.
*/
public interface B {
/**
* This is the first abstract instance method.
*/
public void setName();
/**
* This is the second abstract instance method.
*/
public String getName();
/**
* This is the third abstract instance method.
*/
public boolean addEntry();
/**
* This is the fourth abstract instance method.
*/
public boolean removeEntry();
/**
* This is the fifth abstract instance method.
*/
public String getPermissions();
}
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package pkg1;
/**
* This class is marked as deprecated and has a mixture of different types of
* methods such as "Instance Methods", "Abstract Methods" and "Concrete
* Methods". None of the methods are marked as deprecated but since the class is
* deprecated, the methods will also be deprecated and "Deprecated Methods" tab
* will also be shown with all the methods.
*/
@Deprecated
public abstract class D {
/**
* This is the first abstract instance method.
*/
public abstract void readObject();
/**
* This is the first concrete instance method.
*/
public final void setStub() {
}
/**
* This is the second concrete instance method.
*/
public String getParameter() {
return "test";
}
}
......@@ -201,8 +201,11 @@ class APITest {
"pkg/package-tree.html",
"resources/background.gif",
"resources/tab.gif",
"resources/activetitlebar_end.gif",
"resources/activetitlebar.gif",
"resources/titlebar_end.gif",
"resources/titlebar.gif",
"script.js",
"stylesheet.css"
));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册