Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
8653a1d4
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8653a1d4
编写于
11月 19, 2012
作者:
B
bpatel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8002304: Group methods by types in methods summary section
Reviewed-by: jjg
上级
3fd20c70
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
702 addition
and
20 deletion
+702
-20
src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
.../sun/tools/doclets/formats/html/AbstractMemberWriter.java
+45
-6
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
...lasses/com/sun/tools/doclets/formats/html/HtmlDoclet.java
+6
-1
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
.../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+12
-0
src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java
...sun/tools/doclets/formats/html/SubWriterHolderWriter.java
+58
-2
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
.../com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
+2
-0
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
...s/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
+34
-0
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
...com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
+52
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java
...n/tools/doclets/internal/toolkit/MemberSummaryWriter.java
+6
-4
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java
...clets/internal/toolkit/builders/MemberSummaryBuilder.java
+6
-5
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/activetitlebar.gif
...ols/doclets/internal/toolkit/resources/activetitlebar.gif
+0
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/activetitlebar_end.gif
...doclets/internal/toolkit/resources/activetitlebar_end.gif
+0
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/script.js
...om/sun/tools/doclets/internal/toolkit/resources/script.js
+30
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
...n/tools/doclets/internal/toolkit/resources/stylesheet.css
+43
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPaths.java
...com/sun/tools/doclets/internal/toolkit/util/DocPaths.java
+3
-0
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java
.../sun/tools/doclets/internal/toolkit/util/MethodTypes.java
+68
-0
test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java
.../com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java
+9
-1
test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java
test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java
+139
-0
test/com/sun/javadoc/testMethodTypes/pkg1/A.java
test/com/sun/javadoc/testMethodTypes/pkg1/A.java
+77
-0
test/com/sun/javadoc/testMethodTypes/pkg1/B.java
test/com/sun/javadoc/testMethodTypes/pkg1/B.java
+56
-0
test/com/sun/javadoc/testMethodTypes/pkg1/D.java
test/com/sun/javadoc/testMethodTypes/pkg1/D.java
+53
-0
test/tools/javadoc/api/basic/APITest.java
test/tools/javadoc/api/basic/APITest.java
+3
-0
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
浏览文件 @
8653a1d4
...
...
@@ -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 table
Tree the content tree
to which the documentation will be added
* @param counter the counter for determin
g
style for the table row
* @param table
Contents the list of contents
to which the documentation will be added
* @param counter the counter for determin
ing 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
()
);
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
浏览文件 @
8653a1d4
...
...
@@ -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
);
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
浏览文件 @
8653a1d4
...
...
@@ -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™ Language Specification</cite>,
...
...
src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java
浏览文件 @
8653a1d4
...
...
@@ -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.
*
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
浏览文件 @
8653a1d4
...
...
@@ -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
;
}
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
浏览文件 @
8653a1d4
...
...
@@ -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
();
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
浏览文件 @
8653a1d4
...
...
@@ -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.
*
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java
浏览文件 @
8653a1d4
...
...
@@ -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 table
Tree the content treeto which the information
will be added
* @param counter the counter for determin
g
style for the table row
* @param table
Contents list of contents to which the summary
will be added
* @param counter the counter for determin
ing 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.
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java
浏览文件 @
8653a1d4
...
...
@@ -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
)
);
}
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/activetitlebar.gif
0 → 100644
浏览文件 @
8653a1d4
10.6 KB
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/activetitlebar_end.gif
0 → 100644
浏览文件 @
8653a1d4
909 字节
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/script.js
0 → 100644
浏览文件 @
8653a1d4
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>
"
;
}
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
浏览文件 @
8653a1d4
...
...
@@ -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%
;
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPaths.java
浏览文件 @
8653a1d4
...
...
@@ -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"
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java
0 → 100644
浏览文件 @
8653a1d4
/*
* 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
;
}
}
test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java
浏览文件 @
8653a1d4
...
...
@@ -201,7 +201,15 @@ public class TestHtmlTableTags extends JavadocTester {
"<caption><span>Fields</span><span class=\"tabEnd\"> </span></caption>"
},
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"C1.html"
,
"<caption><span>Methods</span><span class=\"tabEnd\"> </span></caption>"
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All "
+
"Methods</span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
+
"Instance Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">"
+
"Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">"
+
"Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"</caption>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"C2.html"
,
"<caption><span>Nested Classes</span><span class=\"tabEnd\"> </span></caption>"
...
...
test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java
0 → 100644
浏览文件 @
8653a1d4
/*
* 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\"> </span></span>"
+
"<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">"
+
"Static Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
+
"Instance Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">"
+
"Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">"
+
"Deprecated Methods</a></span><span class=\"tabEnd\"> </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\"> </span></span>"
+
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
+
"Instance Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
+
"Abstract Methods</a></span><span class=\"tabEnd\"> </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\"> </span></span>"
+
"<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
+
"Instance Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
+
"Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">"
+
"Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>"
+
"<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">"
+
"Deprecated Methods</a></span><span class=\"tabEnd\"> </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\"> </span>"
+
"</caption>"
},
{
BUG_ID
+
FS
+
"pkg1"
+
FS
+
"B.html"
,
"<caption><span>Methods</span><span class=\"tabEnd\"> </span>"
+
"</caption>"
},
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"D.html"
,
"<caption><span>Methods</span><span class=\"tabEnd\"> </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
();
}
}
test/com/sun/javadoc/testMethodTypes/pkg1/A.java
0 → 100644
浏览文件 @
8653a1d4
/*
* 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
()
{
}
}
test/com/sun/javadoc/testMethodTypes/pkg1/B.java
0 → 100644
浏览文件 @
8653a1d4
/*
* 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
();
}
test/com/sun/javadoc/testMethodTypes/pkg1/D.java
0 → 100644
浏览文件 @
8653a1d4
/*
* 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"
;
}
}
test/tools/javadoc/api/basic/APITest.java
浏览文件 @
8653a1d4
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录