8196200: Implement a navigation builder in javadoc
Reviewed-by: jjg, ksrini
This commit is contained in:
parent
347e295d9d
commit
40998ce018
@ -42,6 +42,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
|
||||
@ -72,6 +74,8 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
|
||||
*/
|
||||
protected IndexBuilder indexbuilder;
|
||||
|
||||
protected Navigation navBar;
|
||||
|
||||
/**
|
||||
* This constructor will be used by {@link SplitIndexWriter}. Initializes
|
||||
* path to this file and relative path from this file.
|
||||
@ -85,17 +89,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
|
||||
IndexBuilder indexbuilder) {
|
||||
super(configuration, path);
|
||||
this.indexbuilder = indexbuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the index label for navigation bar.
|
||||
*
|
||||
* @return a content tree for the tree label
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkIndex() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.indexLabel);
|
||||
return li;
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.INDEX, path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,6 +45,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
||||
@ -214,23 +215,6 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
||||
*/
|
||||
protected abstract Content getDeprecatedLink(Element member);
|
||||
|
||||
/**
|
||||
* Get the navigation summary link.
|
||||
*
|
||||
* @param typeElement the TypeElement to be documented
|
||||
* @param link true if its a link else the label to be printed
|
||||
* @return a content tree for the navigation summary link.
|
||||
*/
|
||||
protected abstract Content getNavSummaryLink(TypeElement typeElement, boolean link);
|
||||
|
||||
/**
|
||||
* Add the navigation detail link.
|
||||
*
|
||||
* @param link true if its a link else the label to be printed
|
||||
* @param liNav the content tree to which the navigation detail link will be added
|
||||
*/
|
||||
protected abstract void addNavDetailLink(boolean link, Content liNav);
|
||||
|
||||
/**
|
||||
* Add the member name to the content tree.
|
||||
*
|
||||
@ -474,41 +458,6 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the navigation detail link.
|
||||
*
|
||||
* @param members the members to be linked
|
||||
* @param liNav the content tree to which the navigation detail link will be added
|
||||
*/
|
||||
protected void addNavDetailLink(SortedSet<Element> members, Content liNav) {
|
||||
addNavDetailLink(!members.isEmpty(), liNav);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the navigation summary link.
|
||||
*
|
||||
* @param members members to be linked
|
||||
* @param visibleMemberMap the visible inherited members map
|
||||
* @param liNav the content tree to which the navigation summary link will be added
|
||||
*/
|
||||
protected void addNavSummaryLink(SortedSet<? extends Element> members,
|
||||
VisibleMemberMap visibleMemberMap, Content liNav) {
|
||||
if (!members.isEmpty()) {
|
||||
liNav.addContent(getNavSummaryLink(null, true));
|
||||
return;
|
||||
}
|
||||
|
||||
TypeElement superClass = utils.getSuperClass(typeElement);
|
||||
while (superClass != null) {
|
||||
if (visibleMemberMap.hasMembers(superClass)) {
|
||||
liNav.addContent(getNavSummaryLink(superClass, true));
|
||||
return;
|
||||
}
|
||||
superClass = utils.getSuperClass(superClass);
|
||||
}
|
||||
liNav.addContent(getNavSummaryLink(null, false));
|
||||
}
|
||||
|
||||
protected void serialWarning(Element e, String key, String a1, String a2) {
|
||||
if (configuration.serialwarn) {
|
||||
configuration.messages.warning(e, key, a1, a2);
|
||||
|
@ -37,6 +37,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
@ -61,6 +63,8 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
||||
*/
|
||||
protected SortedMap<ModuleElement, Set<PackageElement>> modules;
|
||||
|
||||
protected Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor. Also initializes the modules variable.
|
||||
*
|
||||
@ -71,6 +75,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
||||
DocPath filename) {
|
||||
super(configuration, filename);
|
||||
modules = configuration.modulePackages;
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.OVERVIEW, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -251,18 +256,6 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns highlighted "Overview", in the navigation bar as this is the
|
||||
* overview page.
|
||||
*
|
||||
* @return a Content object to be added to the documentation tree
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkContents() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.overviewLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing. This will be overridden in ModuleIndexFrameWriter.
|
||||
*
|
||||
|
@ -33,6 +33,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
@ -58,6 +60,8 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
||||
*/
|
||||
protected SortedSet<PackageElement> packages;
|
||||
|
||||
protected Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor. Also initializes the packages variable.
|
||||
*
|
||||
@ -68,6 +72,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
||||
DocPath filename) {
|
||||
super(configuration, filename);
|
||||
packages = configuration.packages;
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.OVERVIEW, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,18 +178,6 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns highlighted "Overview", in the navigation bar as this is the
|
||||
* overview page.
|
||||
*
|
||||
* @return a Content object to be added to the documentation tree
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkContents() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.overviewLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing. This will be overridden.
|
||||
*
|
||||
|
@ -184,14 +184,4 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
|
||||
protected void addPartialInfo(TypeElement typeElement, Content contentTree) {
|
||||
addPreQualifiedStrongClassLink(LinkInfoImpl.Kind.TREE, typeElement, contentTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tree label for the navigation bar.
|
||||
*
|
||||
* @return a content tree for the tree label
|
||||
*/
|
||||
protected Content getNavLinkTree() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.treeLabel);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
@ -285,31 +285,6 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
|
||||
member, utils.getFullyQualifiedName(member));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
return links.createLink(
|
||||
SectionName.ANNOTATION_TYPE_FIELD_SUMMARY,
|
||||
contents.navField);
|
||||
} else {
|
||||
return contents.navField;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.ANNOTATION_TYPE_FIELD_DETAIL,
|
||||
contents.navField));
|
||||
} else {
|
||||
liNav.addContent(contents.navField);
|
||||
}
|
||||
}
|
||||
private TypeMirror getType(Element member) {
|
||||
if (utils.isConstructor(member))
|
||||
return null;
|
||||
|
@ -35,7 +35,7 @@ import javax.lang.model.element.TypeElement;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
@ -152,18 +152,4 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
|
||||
memberTree.addContent(links.createAnchor(
|
||||
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
return links.createLink(
|
||||
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY,
|
||||
contents.navAnnotationTypeOptionalMember);
|
||||
} else {
|
||||
return contents.navAnnotationTypeOptionalMember;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
@ -300,32 +300,6 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
|
||||
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
return links.createLink(
|
||||
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY,
|
||||
contents.navAnnotationTypeRequiredMember);
|
||||
} else {
|
||||
return contents.navAnnotationTypeRequiredMember;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL,
|
||||
contents.navAnnotationTypeMember));
|
||||
} else {
|
||||
liNav.addContent(contents.navAnnotationTypeMember);
|
||||
}
|
||||
}
|
||||
|
||||
private TypeMirror getType(Element member) {
|
||||
return utils.isExecutableElement(member)
|
||||
? utils.getReturnType((ExecutableElement) member)
|
||||
|
@ -30,21 +30,20 @@ import java.util.List;
|
||||
import javax.lang.model.element.ModuleElement;
|
||||
import javax.lang.model.element.PackageElement;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
|
||||
import com.sun.source.doctree.DocTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
|
||||
|
||||
/**
|
||||
@ -69,6 +68,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
|
||||
protected TypeElement annotationType;
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* @param configuration the configuration
|
||||
* @param annotationType the annotation type being documented.
|
||||
@ -78,55 +79,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
super(configuration, configuration.docPaths.forClass(annotationType));
|
||||
this.annotationType = annotationType;
|
||||
configuration.currentTypeElement = annotationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this package link.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkPackage() {
|
||||
Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
|
||||
contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class link.
|
||||
*
|
||||
* @return a content tree for the class link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkClass() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.classLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class use link.
|
||||
*
|
||||
* @return a content tree for the class use link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkClassUse() {
|
||||
Content linkContent = links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
this.navBar = new Navigation(annotationType, configuration, fixedNavDiv, PageMode.CLASS, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,7 +92,12 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType),
|
||||
contents.moduleLabel);
|
||||
navBar.setNavLinkModule(linkContent);
|
||||
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -195,7 +153,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: contentTree;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
contentTree.addContent(htmlTree);
|
||||
@ -295,123 +254,6 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkTree() {
|
||||
Content treeLinkContent = links.createLink(DocPaths.PACKAGE_TREE,
|
||||
contents.treeLabel, "", "");
|
||||
Content li = HtmlTree.LI(treeLinkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add summary details to the navigation bar.
|
||||
*
|
||||
* @param subDiv the content tree to which the summary detail links will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addSummaryDetailLinks(Content subDiv) {
|
||||
Content div = HtmlTree.DIV(getNavSummaryLinks());
|
||||
div.addContent(getNavDetailLinks());
|
||||
subDiv.addContent(div);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary links for navigation bar.
|
||||
*
|
||||
* @return the content tree for the navigation summary links
|
||||
*/
|
||||
protected Content getNavSummaryLinks() {
|
||||
Content li = HtmlTree.LI(contents.summaryLabel);
|
||||
li.addContent(Contents.SPACE);
|
||||
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
|
||||
MemberSummaryBuilder memberSummaryBuilder =
|
||||
configuration.getBuilderFactory().getMemberSummaryBuilder(this);
|
||||
Content liNavField = new HtmlTree(HtmlTag.LI);
|
||||
addNavSummaryLink(memberSummaryBuilder,
|
||||
"doclet.navField",
|
||||
VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS, liNavField);
|
||||
addNavGap(liNavField);
|
||||
ulNav.addContent(liNavField);
|
||||
Content liNavReq = new HtmlTree(HtmlTag.LI);
|
||||
addNavSummaryLink(memberSummaryBuilder,
|
||||
"doclet.navAnnotationTypeRequiredMember",
|
||||
VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED, liNavReq);
|
||||
addNavGap(liNavReq);
|
||||
ulNav.addContent(liNavReq);
|
||||
Content liNavOpt = new HtmlTree(HtmlTag.LI);
|
||||
addNavSummaryLink(memberSummaryBuilder,
|
||||
"doclet.navAnnotationTypeOptionalMember",
|
||||
VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL, liNavOpt);
|
||||
ulNav.addContent(liNavOpt);
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the navigation summary link.
|
||||
*
|
||||
* @param builder builder for the member to be documented
|
||||
* @param label the label for the navigation
|
||||
* @param type type to be documented
|
||||
* @param liNav the content tree to which the navigation summary link will be added
|
||||
*/
|
||||
protected void addNavSummaryLink(MemberSummaryBuilder builder,
|
||||
String label, VisibleMemberMap.Kind type, Content liNav) {
|
||||
AbstractMemberWriter writer = ((AbstractMemberWriter) builder.
|
||||
getMemberSummaryWriter(type));
|
||||
if (writer == null) {
|
||||
liNav.addContent(contents.getContent(label));
|
||||
} else {
|
||||
liNav.addContent(writer.getNavSummaryLink(null,
|
||||
! builder.getVisibleMemberMap(type).noVisibleMembers()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get detail links for the navigation bar.
|
||||
*
|
||||
* @return the content tree for the detail links
|
||||
*/
|
||||
protected Content getNavDetailLinks() {
|
||||
Content li = HtmlTree.LI(contents.detailLabel);
|
||||
li.addContent(Contents.SPACE);
|
||||
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
|
||||
MemberSummaryBuilder memberSummaryBuilder =
|
||||
configuration.getBuilderFactory().getMemberSummaryBuilder(this);
|
||||
AbstractMemberWriter writerField =
|
||||
((AbstractMemberWriter) memberSummaryBuilder.
|
||||
getMemberSummaryWriter(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS));
|
||||
AbstractMemberWriter writerOptional =
|
||||
((AbstractMemberWriter) memberSummaryBuilder.
|
||||
getMemberSummaryWriter(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL));
|
||||
AbstractMemberWriter writerRequired =
|
||||
((AbstractMemberWriter) memberSummaryBuilder.
|
||||
getMemberSummaryWriter(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED));
|
||||
Content liNavField = new HtmlTree(HtmlTag.LI);
|
||||
if (writerField != null) {
|
||||
writerField.addNavDetailLink(!utils.getAnnotationFields(annotationType).isEmpty(), liNavField);
|
||||
} else {
|
||||
liNavField.addContent(contents.navField);
|
||||
}
|
||||
addNavGap(liNavField);
|
||||
ulNav.addContent(liNavField);
|
||||
if (writerOptional != null){
|
||||
Content liNavOpt = new HtmlTree(HtmlTag.LI);
|
||||
writerOptional.addNavDetailLink(!annotationType.getAnnotationMirrors().isEmpty(), liNavOpt);
|
||||
ulNav.addContent(liNavOpt);
|
||||
} else if (writerRequired != null){
|
||||
Content liNavReq = new HtmlTree(HtmlTag.LI);
|
||||
writerRequired.addNavDetailLink(!annotationType.getAnnotationMirrors().isEmpty(), liNavReq);
|
||||
ulNav.addContent(liNavReq);
|
||||
} else {
|
||||
Content liNav = HtmlTree.LI(contents.navAnnotationTypeMember);
|
||||
ulNav.addContent(liNav);
|
||||
}
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -47,7 +47,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
|
||||
@ -106,6 +107,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
final String methodUseTableSummary;
|
||||
final String constructorUseTableSummary;
|
||||
final String packageUseTableSummary;
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* The HTML tree for main tag.
|
||||
@ -178,6 +180,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
resources.getText("doclet.constructors"));
|
||||
packageUseTableSummary = MessageFormat.format(useTableSummary,
|
||||
resources.getText("doclet.packages"));
|
||||
this.navBar = new Navigation(typeElement, configuration, fixedNavDiv, PageMode.USE, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -264,7 +267,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmlTree);
|
||||
@ -476,7 +480,15 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
|
||||
contents.moduleLabel);
|
||||
navBar.setNavLinkModule(mdleLinkContent);
|
||||
Content classLinkContent = getLink(new LinkInfoImpl(
|
||||
configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)
|
||||
.label(configuration.getText("doclet.Class")));
|
||||
navBar.setNavLinkClass(classLinkContent);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -494,65 +506,4 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
}
|
||||
return bodyTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this package link.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
protected Content getNavLinkPackage() {
|
||||
Content linkContent =
|
||||
links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get class page link.
|
||||
*
|
||||
* @return a content tree for the class page link
|
||||
*/
|
||||
protected Content getNavLinkClass() {
|
||||
Content linkContent = getLink(new LinkInfoImpl(
|
||||
configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)
|
||||
.label(configuration.getText("doclet.Class")));
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the use link.
|
||||
*
|
||||
* @return a content tree for the use link
|
||||
*/
|
||||
protected Content getNavLinkClassUse() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.useLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tree link.
|
||||
*
|
||||
* @return a content tree for the tree link
|
||||
*/
|
||||
protected Content getNavLinkTree() {
|
||||
Content linkContent = utils.isEnclosingPackageIncluded(typeElement)
|
||||
? links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel)
|
||||
: links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
@ -48,11 +50,9 @@ import jdk.javadoc.internal.doclets.toolkit.taglets.ParamTaglet;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind;
|
||||
|
||||
/**
|
||||
* Generate the Class Information Page.
|
||||
@ -78,6 +78,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
|
||||
protected final ClassTree classtree;
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param typeElement the class being documented.
|
||||
@ -89,55 +91,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
this.typeElement = typeElement;
|
||||
configuration.currentTypeElement = typeElement;
|
||||
this.classtree = classTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this package link.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkPackage() {
|
||||
Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
|
||||
contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class link.
|
||||
*
|
||||
* @return a content tree for the class link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkClass() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.classLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class use link.
|
||||
*
|
||||
* @return a content tree for the class use link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkClassUse() {
|
||||
Content linkContent = links.createLink(DocPaths.CLASS_USE.resolve(filename), contents.useLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
this.navBar = new Navigation(typeElement, configuration, fixedNavDiv, PageMode.CLASS, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,7 +104,12 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
|
||||
contents.moduleLabel);
|
||||
navBar.setNavLinkModule(linkContent);
|
||||
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -210,7 +169,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: contentTree;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
contentTree.addContent(htmlTree);
|
||||
@ -608,100 +568,6 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
return dd;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkTree() {
|
||||
Content treeLinkContent = links.createLink(DocPaths.PACKAGE_TREE,
|
||||
contents.treeLabel, "", "");
|
||||
Content li = HtmlTree.LI(treeLinkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add summary details to the navigation bar.
|
||||
*
|
||||
* @param subDiv the content tree to which the summary detail links will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addSummaryDetailLinks(Content subDiv) {
|
||||
Content div = HtmlTree.DIV(getNavSummaryLinks());
|
||||
div.addContent(getNavDetailLinks());
|
||||
subDiv.addContent(div);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary links for navigation bar.
|
||||
*
|
||||
* @return the content tree for the navigation summary links
|
||||
*/
|
||||
protected Content getNavSummaryLinks() {
|
||||
Content li = HtmlTree.LI(contents.summaryLabel);
|
||||
li.addContent(Contents.SPACE);
|
||||
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
|
||||
MemberSummaryBuilder memberSummaryBuilder =
|
||||
configuration.getBuilderFactory().getMemberSummaryBuilder(this);
|
||||
for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.summarySet) {
|
||||
Content liNav = new HtmlTree(HtmlTag.LI);
|
||||
if (kind == VisibleMemberMap.Kind.ENUM_CONSTANTS && !utils.isEnum(typeElement)) {
|
||||
continue;
|
||||
}
|
||||
if (kind == VisibleMemberMap.Kind.CONSTRUCTORS && utils.isEnum(typeElement)) {
|
||||
continue;
|
||||
}
|
||||
AbstractMemberWriter writer =
|
||||
((AbstractMemberWriter) memberSummaryBuilder.getMemberSummaryWriter(kind));
|
||||
if (writer == null) {
|
||||
liNav.addContent(contents.getContent(VisibleMemberMap.Kind.getNavLinkLabels(kind)));
|
||||
} else {
|
||||
writer.addNavSummaryLink(
|
||||
memberSummaryBuilder.members(kind),
|
||||
memberSummaryBuilder.getVisibleMemberMap(kind), liNav);
|
||||
}
|
||||
if (kind != Kind.METHODS) {
|
||||
addNavGap(liNav);
|
||||
}
|
||||
ulNav.addContent(liNav);
|
||||
}
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get detail links for the navigation bar.
|
||||
*
|
||||
* @return the content tree for the detail links
|
||||
*/
|
||||
protected Content getNavDetailLinks() {
|
||||
Content li = HtmlTree.LI(contents.detailLabel);
|
||||
li.addContent(Contents.SPACE);
|
||||
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
|
||||
MemberSummaryBuilder memberSummaryBuilder =
|
||||
configuration.getBuilderFactory().getMemberSummaryBuilder(this);
|
||||
for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.detailSet) {
|
||||
Content liNav = new HtmlTree(HtmlTag.LI);
|
||||
AbstractMemberWriter writer =
|
||||
((AbstractMemberWriter) memberSummaryBuilder.
|
||||
getMemberSummaryWriter(kind));
|
||||
if (kind == VisibleMemberMap.Kind.ENUM_CONSTANTS && !utils.isEnum(typeElement)) {
|
||||
continue;
|
||||
}
|
||||
if (kind == VisibleMemberMap.Kind.CONSTRUCTORS && utils.isEnum(typeElement)) {
|
||||
continue;
|
||||
}
|
||||
if (writer == null) {
|
||||
liNav.addContent(contents.getContent(VisibleMemberMap.Kind.getNavLinkLabels(kind)));
|
||||
} else {
|
||||
writer.addNavDetailLink(memberSummaryBuilder.members(kind), liNav);
|
||||
}
|
||||
if (kind != Kind.METHODS) {
|
||||
addNavGap(liNav);
|
||||
}
|
||||
ulNav.addContent(liNav);
|
||||
}
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the TypeElement being documented.
|
||||
*
|
||||
|
@ -40,7 +40,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.ConstantsSummaryWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
@ -86,6 +87,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
|
||||
*/
|
||||
private HtmlTree summaryTree;
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Construct a ConstantsSummaryWriter.
|
||||
* @param configuration the configuration used in this run
|
||||
@ -98,6 +101,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
|
||||
configuration.getText("doclet.Constants_Summary"));
|
||||
constantsTableHeader = new TableHeader(
|
||||
contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel);
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.CONSTANTVALUES, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,7 +115,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -341,7 +346,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
|
||||
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: contentTree;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
contentTree.addContent(htmlTree);
|
||||
|
@ -38,7 +38,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
@ -294,33 +294,6 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
|
||||
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
return links.createLink(SectionName.CONSTRUCTOR_SUMMARY,
|
||||
contents.navConstructor);
|
||||
} else {
|
||||
return contents.navConstructor;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.CONSTRUCTOR_DETAIL,
|
||||
contents.navConstructor));
|
||||
} else {
|
||||
liNav.addContent(contents.navConstructor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -42,6 +42,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder;
|
||||
@ -209,6 +211,8 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
||||
|
||||
private HtmlConfiguration configuration;
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@ -219,6 +223,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
||||
public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
|
||||
super(configuration, filename);
|
||||
this.configuration = configuration;
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.DEPRECATED, path);
|
||||
NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
|
||||
writerMap = new EnumMap<>(DeprElementKind.class);
|
||||
for (DeprElementKind kind : DeprElementKind.values()) {
|
||||
@ -307,7 +312,8 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
||||
htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmlTree);
|
||||
@ -378,24 +384,14 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
return bodyTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the deprecated label.
|
||||
*
|
||||
* @return a content tree for the deprecated label
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkDeprecated() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.deprecatedLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add deprecated information to the documentation tree
|
||||
*
|
||||
|
@ -27,16 +27,15 @@ package jdk.javadoc.internal.doclets.formats.html;
|
||||
|
||||
import com.sun.source.doctree.AttributeTree;
|
||||
import com.sun.source.doctree.AttributeTree.ValueKind;
|
||||
import com.sun.source.doctree.DocRootTree;
|
||||
import com.sun.source.doctree.DocTree;
|
||||
import com.sun.source.doctree.EndElementTree;
|
||||
import com.sun.source.doctree.LinkTree;
|
||||
import com.sun.source.doctree.StartElementTree;
|
||||
import com.sun.source.doctree.TextTree;
|
||||
import com.sun.source.util.SimpleDocTreeVisitor;
|
||||
import com.sun.tools.doclint.HtmlTag;
|
||||
import com.sun.tools.doclint.HtmlTag.Attr;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.DocFileElement;
|
||||
import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler;
|
||||
@ -51,15 +50,19 @@ import javax.lang.model.element.ModuleElement;
|
||||
import javax.lang.model.element.PackageElement;
|
||||
import javax.tools.FileObject;
|
||||
import javax.tools.JavaFileManager.Location;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
|
||||
public class DocFilesHandlerImpl implements DocFilesHandler {
|
||||
|
||||
public final Element element;
|
||||
public final Location location;
|
||||
public final DocPath source;
|
||||
public final HtmlConfiguration configuration;
|
||||
private Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor to construct the DocFilesWriter object.
|
||||
@ -171,14 +174,24 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
|
||||
String title = getWindowTitle(docletWriter, dfElement).trim();
|
||||
HtmlTree htmlContent = docletWriter.getBody(true, title);
|
||||
docletWriter.addTop(htmlContent);
|
||||
docletWriter.addNavLinks(true, htmlContent);
|
||||
PackageElement pkg = (PackageElement) element;
|
||||
this.navBar = new Navigation(pkg, configuration, docletWriter.fixedNavDiv,
|
||||
PageMode.DOCFILE, docletWriter.path);
|
||||
Content mdleLinkContent = docletWriter.getModuleLink(utils.elementUtils.getModuleOf(pkg),
|
||||
docletWriter.contents.moduleLabel);
|
||||
navBar.setNavLinkModule(mdleLinkContent);
|
||||
Content pkgLinkContent = docletWriter.getPackageLink(pkg, docletWriter.contents.packageLabel);
|
||||
navBar.setNavLinkPackage(pkgLinkContent);
|
||||
navBar.setUserHeader(docletWriter.getUserHeaderFooter(true));
|
||||
htmlContent.addContent(navBar.getContent(true));
|
||||
List<? extends DocTree> fullBody = utils.getFullBody(dfElement);
|
||||
Content bodyContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false);
|
||||
|
||||
docletWriter.addTagsInfo(dfElement, bodyContent);
|
||||
htmlContent.addContent(bodyContent);
|
||||
|
||||
docletWriter.addNavLinks(false, htmlContent);
|
||||
navBar.setUserFooter(docletWriter.getUserHeaderFooter(false));
|
||||
htmlContent.addContent(navBar.getContent(false));
|
||||
docletWriter.addBottom(htmlContent);
|
||||
docletWriter.printHtmlDocument(Collections.emptyList(), false, htmlContent);
|
||||
return true;
|
||||
@ -301,31 +314,5 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
|
||||
throw new AssertionError("unsupported element: " + e.getKind());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(pkg),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this package link.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkPackage() {
|
||||
Content linkContent = getPackageLink(pkg,
|
||||
contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.EnumConstantWriter;
|
||||
@ -273,37 +273,4 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
|
||||
String name = utils.getFullyQualifiedName(member) + "." + member.getSimpleName();
|
||||
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
if (typeElement == null) {
|
||||
return links.createLink(SectionName.ENUM_CONSTANT_SUMMARY,
|
||||
contents.navEnum);
|
||||
} else {
|
||||
return links.createLink(
|
||||
SectionName.ENUM_CONSTANTS_INHERITANCE,
|
||||
configuration.getClassName(typeElement), contents.navEnum);
|
||||
}
|
||||
} else {
|
||||
return contents.navEnum;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.ENUM_CONSTANT_DETAIL,
|
||||
contents.navEnum));
|
||||
} else {
|
||||
liNav.addContent(contents.navEnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
|
||||
@ -302,38 +302,4 @@ public class FieldWriterImpl extends AbstractMemberWriter
|
||||
String name = utils.getFullyQualifiedName(member) + "." + member.getSimpleName();
|
||||
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
if (typeElement == null) {
|
||||
return links.createLink(
|
||||
SectionName.FIELD_SUMMARY,
|
||||
contents.navField);
|
||||
} else {
|
||||
return links.createLink(
|
||||
SectionName.FIELDS_INHERITANCE,
|
||||
configuration.getClassName(typeElement), contents.navField);
|
||||
}
|
||||
} else {
|
||||
return contents.navField;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.FIELD_DETAIL,
|
||||
contents.navField));
|
||||
} else {
|
||||
liNav.addContent(contents.navField);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
@ -51,6 +53,8 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
|
||||
HtmlTree mainTree = HtmlTree.MAIN();
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor to construct HelpWriter object.
|
||||
* @param configuration the configuration
|
||||
@ -59,6 +63,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
public HelpWriter(HtmlConfiguration configuration,
|
||||
DocPath filename) {
|
||||
super(configuration, filename);
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.HELP, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +93,8 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(htmlTree);
|
||||
}
|
||||
@ -96,7 +102,8 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
htmlTree = HtmlTree.FOOTER();
|
||||
}
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmlTree);
|
||||
@ -428,15 +435,4 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
contentTree.addContent(divContent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the help label.
|
||||
*
|
||||
* @return a content tree for the help label
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkHelp() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.helpLabel);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -247,11 +247,11 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
|
||||
protected Set<Character> tagSearchIndexKeys;
|
||||
|
||||
protected final Contents contents;
|
||||
public final Contents contents;
|
||||
|
||||
protected final Messages messages;
|
||||
|
||||
protected DocPaths docPaths;
|
||||
public DocPaths docPaths;
|
||||
|
||||
/**
|
||||
* Creates an object to hold the configuration for a doclet.
|
||||
|
@ -69,13 +69,13 @@ import com.sun.source.util.SimpleDocTreeVisitor;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.DocType;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Script;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
@ -490,261 +490,6 @@ public class HtmlDocletWriter {
|
||||
htmlTree.addContent(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the navigation bar for the Html page at the top and and the bottom.
|
||||
*
|
||||
* @param header If true print navigation bar at the top of the page else
|
||||
* @param htmlTree the HtmlTree to which the nav links will be added
|
||||
*/
|
||||
protected void addNavLinks(boolean header, Content htmlTree) {
|
||||
if (!configuration.nonavbar) {
|
||||
Content tree = (configuration.allowTag(HtmlTag.NAV))
|
||||
? HtmlTree.NAV()
|
||||
: htmlTree;
|
||||
String allClassesId = "allclasses_";
|
||||
HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
|
||||
fixedNavDiv.setStyle(HtmlStyle.fixedNav);
|
||||
Content skipNavLinks = configuration.getContent("doclet.Skip_navigation_links");
|
||||
if (header) {
|
||||
fixedNavDiv.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
|
||||
navDiv.setStyle(HtmlStyle.topNav);
|
||||
allClassesId += "navbar_top";
|
||||
Content a = links.createAnchor(SectionName.NAVBAR_TOP);
|
||||
//WCAG - Hyperlinks should contain text or an image with alt text - for AT tools
|
||||
navDiv.addContent(a);
|
||||
Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav,
|
||||
links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks,
|
||||
skipNavLinks.toString(), ""));
|
||||
navDiv.addContent(skipLinkContent);
|
||||
} else {
|
||||
tree.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
|
||||
navDiv.setStyle(HtmlStyle.bottomNav);
|
||||
allClassesId += "navbar_bottom";
|
||||
Content a = links.createAnchor(SectionName.NAVBAR_BOTTOM);
|
||||
navDiv.addContent(a);
|
||||
Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav,
|
||||
links.createLink(SectionName.SKIP_NAVBAR_BOTTOM, skipNavLinks,
|
||||
skipNavLinks.toString(), ""));
|
||||
navDiv.addContent(skipLinkContent);
|
||||
}
|
||||
if (header) {
|
||||
navDiv.addContent(links.createAnchor(SectionName.NAVBAR_TOP_FIRSTROW));
|
||||
} else {
|
||||
navDiv.addContent(links.createAnchor(SectionName.NAVBAR_BOTTOM_FIRSTROW));
|
||||
}
|
||||
HtmlTree navList = new HtmlTree(HtmlTag.UL);
|
||||
navList.setStyle(HtmlStyle.navList);
|
||||
navList.addAttr(HtmlAttr.TITLE,
|
||||
configuration.getText("doclet.Navigation"));
|
||||
if (configuration.createoverview) {
|
||||
navList.addContent(getNavLinkContents());
|
||||
}
|
||||
if (configuration.showModules) {
|
||||
if (configuration.modules.size() == 1) {
|
||||
navList.addContent(getNavLinkModule(configuration.modules.first()));
|
||||
} else if (!configuration.modules.isEmpty()) {
|
||||
navList.addContent(getNavLinkModule());
|
||||
}
|
||||
}
|
||||
if (configuration.packages.size() == 1) {
|
||||
navList.addContent(getNavLinkPackage(configuration.packages.first()));
|
||||
} else if (!configuration.packages.isEmpty()) {
|
||||
navList.addContent(getNavLinkPackage());
|
||||
}
|
||||
navList.addContent(getNavLinkClass());
|
||||
if(configuration.classuse) {
|
||||
navList.addContent(getNavLinkClassUse());
|
||||
}
|
||||
if(configuration.createtree) {
|
||||
navList.addContent(getNavLinkTree());
|
||||
}
|
||||
if(!(configuration.nodeprecated ||
|
||||
configuration.nodeprecatedlist)) {
|
||||
navList.addContent(getNavLinkDeprecated());
|
||||
}
|
||||
if(configuration.createindex) {
|
||||
navList.addContent(getNavLinkIndex());
|
||||
}
|
||||
if (!configuration.nohelp) {
|
||||
navList.addContent(getNavLinkHelp());
|
||||
}
|
||||
navDiv.addContent(navList);
|
||||
Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header));
|
||||
navDiv.addContent(aboutDiv);
|
||||
if (header) {
|
||||
fixedNavDiv.addContent(navDiv);
|
||||
} else {
|
||||
tree.addContent(navDiv);
|
||||
}
|
||||
HtmlTree subDiv = new HtmlTree(HtmlTag.DIV);
|
||||
subDiv.setStyle(HtmlStyle.subNav);
|
||||
if (configuration.frames) {
|
||||
Content ulFrames = HtmlTree.UL(HtmlStyle.navList,
|
||||
getNavShowLists(), getNavHideLists(filename));
|
||||
subDiv.addContent(ulFrames);
|
||||
}
|
||||
HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex());
|
||||
ulAllClasses.addAttr(HtmlAttr.ID, allClassesId);
|
||||
subDiv.addContent(ulAllClasses);
|
||||
if (header && configuration.createindex) {
|
||||
String searchValueId = "search";
|
||||
String reset = "reset";
|
||||
HtmlTree inputText = HtmlTree.INPUT("text", searchValueId, searchValueId);
|
||||
HtmlTree inputReset = HtmlTree.INPUT(reset, reset, reset);
|
||||
Content searchTxt = configuration.getContent("doclet.search");
|
||||
HtmlTree liInput = HtmlTree.LI(HtmlTree.LABEL(searchValueId, searchTxt));
|
||||
liInput.addContent(inputText);
|
||||
liInput.addContent(inputReset);
|
||||
HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput);
|
||||
subDiv.addContent(ulSearch);
|
||||
}
|
||||
subDiv.addContent(getAllClassesLinkScript(allClassesId));
|
||||
addSummaryDetailLinks(subDiv);
|
||||
if (header) {
|
||||
subDiv.addContent(links.createAnchor(SectionName.SKIP_NAVBAR_TOP));
|
||||
fixedNavDiv.addContent(subDiv);
|
||||
fixedNavDiv.addContent(HtmlConstants.END_OF_TOP_NAVBAR);
|
||||
tree.addContent(fixedNavDiv);
|
||||
HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE);
|
||||
tree.addContent(paddingDiv);
|
||||
Script script = new Script(
|
||||
"<!--\n"
|
||||
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
|
||||
+ "//-->\n");
|
||||
tree.addContent(script.asContent());
|
||||
} else {
|
||||
subDiv.addContent(links.createAnchor(SectionName.SKIP_NAVBAR_BOTTOM));
|
||||
tree.addContent(subDiv);
|
||||
tree.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR);
|
||||
}
|
||||
if (configuration.allowTag(HtmlTag.NAV)) {
|
||||
htmlTree.addContent(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing. This is the default method.
|
||||
*/
|
||||
protected void addSummaryDetailLinks(Content navDiv) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get link to the "overview-summary.html" page.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkContents() {
|
||||
Content linkContent = links.createLink(pathToRoot.resolve(DocPaths.overviewSummary(configuration.frames)),
|
||||
contents.overviewLabel, "", "");
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get link to the module summary page for the module passed.
|
||||
*
|
||||
* @param mdle Module to which link will be generated
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkModule(ModuleElement mdle) {
|
||||
Content linkContent = getModuleLink(mdle, contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the word "Module", to indicate that link is not available here.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkModule() {
|
||||
Content li = HtmlTree.LI(contents.moduleLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get link to the "package-summary.html" page for the package passed.
|
||||
*
|
||||
* @param pkg Package to which link will be generated
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkPackage(PackageElement pkg) {
|
||||
Content linkContent = getPackageLink(pkg, contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the word "Package" , to indicate that link is not available here.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkPackage() {
|
||||
Content li = HtmlTree.LI(contents.packageLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the word "Use", to indicate that link is not available.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkClassUse() {
|
||||
Content li = HtmlTree.LI(contents.useLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "FRAMES" link, to switch to the frame version of the output.
|
||||
*
|
||||
* @param link File to be linked, "index.html"
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavShowLists(DocPath link) {
|
||||
DocLink dl = new DocLink(link, path.getPath(), null);
|
||||
Content framesContent = links.createLink(dl, contents.framesLabel, "", "_top");
|
||||
Content li = HtmlTree.LI(framesContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "FRAMES" link, to switch to the frame version of the output.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavShowLists() {
|
||||
return getNavShowLists(pathToRoot.resolve(DocPaths.INDEX));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "NO FRAMES" link, to switch to the non-frame version of the output.
|
||||
*
|
||||
* @param link File to be linked
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavHideLists(DocPath link) {
|
||||
Content noFramesContent = links.createLink(link, contents.noFramesLabel, "", "_top");
|
||||
Content li = HtmlTree.LI(noFramesContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "Tree" link in the navigation bar. If there is only one package
|
||||
* specified on the command line, then the "Tree" link will be to the
|
||||
* only "package-tree.html" file otherwise it will be to the
|
||||
* "overview-tree.html" file.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkTree() {
|
||||
List<PackageElement> packages = new ArrayList<>(configuration.getSpecifiedPackageElements());
|
||||
DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty()
|
||||
? pathString(packages.get(0), DocPaths.PACKAGE_TREE)
|
||||
: pathToRoot.resolve(DocPaths.OVERVIEW_TREE);
|
||||
return HtmlTree.LI(links.createLink(docPath, contents.treeLabel, "", ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the overview tree link for the main tree.
|
||||
*
|
||||
@ -758,91 +503,6 @@ public class HtmlDocletWriter {
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the word "Class", to indicate that class link is not available.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkClass() {
|
||||
Content li = HtmlTree.LI(contents.classLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "Deprecated" API link in the navigation bar.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkDeprecated() {
|
||||
Content linkContent = links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
|
||||
contents.deprecatedLabel, "", "");
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get link for generated index. If the user has used "-splitindex"
|
||||
* command line option, then link to file "index-files/index-1.html" is
|
||||
* generated otherwise link to file "index-all.html" is generated.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkClassIndex() {
|
||||
Content allClassesContent = links.createLink(pathToRoot.resolve(
|
||||
DocPaths.AllClasses(configuration.frames)),
|
||||
contents.allClassesLabel, "", "");
|
||||
Content li = HtmlTree.LI(allClassesContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get link for generated class index.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkIndex() {
|
||||
Content linkContent = links.createLink(pathToRoot.resolve(
|
||||
(configuration.splitindex
|
||||
? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
|
||||
: DocPaths.INDEX_ALL)),
|
||||
contents.indexLabel, "", "");
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get help file link. If user has provided a help file, then generate a
|
||||
* link to the user given file, which is already copied to current or
|
||||
* destination directory.
|
||||
*
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
protected Content getNavLinkHelp() {
|
||||
String helpfile = configuration.helpfile;
|
||||
DocPath helpfilenm;
|
||||
if (helpfile.isEmpty()) {
|
||||
helpfilenm = DocPaths.HELP_DOC;
|
||||
} else {
|
||||
DocFile file = DocFile.createFileForInput(configuration, helpfile);
|
||||
helpfilenm = DocPath.create(file.getName());
|
||||
}
|
||||
Content linkContent = links.createLink(pathToRoot.resolve(helpfilenm),
|
||||
contents.helpLabel, "", "");
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add gap between navigation bar elements.
|
||||
*
|
||||
* @param liNav the content tree to which the gap will be added
|
||||
*/
|
||||
protected void addNavGap(Content liNav) {
|
||||
liNav.addContent(Contents.SPACE);
|
||||
liNav.addContent("|");
|
||||
liNav.addContent(Contents.SPACE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get table caption.
|
||||
*
|
||||
|
@ -40,7 +40,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
||||
@ -424,37 +424,4 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
htmltree.addContent(Contents.SPACE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
if (typeElement == null) {
|
||||
return links.createLink(
|
||||
SectionName.METHOD_SUMMARY,
|
||||
contents.navMethod);
|
||||
} else {
|
||||
return links.createLink(
|
||||
SectionName.METHODS_INHERITANCE,
|
||||
configuration.getClassName(typeElement), contents.navMethod);
|
||||
}
|
||||
} else {
|
||||
return contents.navMethod;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.METHOD_DETAIL, contents.navMethod));
|
||||
} else {
|
||||
liNav.addContent(contents.navMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +227,8 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(tree);
|
||||
addNavLinks(true, tree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
tree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(tree);
|
||||
}
|
||||
@ -244,7 +245,8 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
||||
Content htmltree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
addNavLinks(false, htmltree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmltree.addContent(navBar.getContent(false));
|
||||
addBottom(htmltree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmltree);
|
||||
|
@ -50,13 +50,14 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
||||
|
||||
/**
|
||||
* Class to generate file for each module contents in the right-hand frame. This will list all the
|
||||
@ -171,6 +172,8 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
*/
|
||||
protected HtmlTree sectionTree = HtmlTree.SECTION();
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.
|
||||
*
|
||||
@ -181,6 +184,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
super(configuration, configuration.docPaths.moduleSummary(mdle));
|
||||
this.mdle = mdle;
|
||||
this.moduleMode = configuration.docEnv.getModuleMode();
|
||||
this.navBar = new Navigation(mdle, configuration, fixedNavDiv, PageMode.MODULE, path);
|
||||
computeModulesData();
|
||||
}
|
||||
|
||||
@ -196,7 +200,13 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment);
|
||||
navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules));
|
||||
navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages)
|
||||
|| display(indirectOpenPackages));
|
||||
navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees));
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -913,47 +923,6 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add summary details to the navigation bar.
|
||||
*
|
||||
* @param subDiv the content tree to which the summary detail links will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addSummaryDetailLinks(Content subDiv) {
|
||||
Content div = HtmlTree.DIV(getNavSummaryLinks());
|
||||
subDiv.addContent(div);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary links for navigation bar.
|
||||
*
|
||||
* @return the content tree for the navigation summary links
|
||||
*/
|
||||
protected Content getNavSummaryLinks() {
|
||||
Content li = HtmlTree.LI(contents.moduleSubNavLabel);
|
||||
li.addContent(Contents.SPACE);
|
||||
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
|
||||
Content liNav = new HtmlTree(HtmlTag.LI);
|
||||
liNav.addContent(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment
|
||||
? links.createLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
|
||||
: contents.navModuleDescription);
|
||||
addNavGap(liNav);
|
||||
liNav.addContent((display(requires) || display(indirectModules))
|
||||
? links.createLink(SectionName.MODULES, contents.navModules)
|
||||
: contents.navModules);
|
||||
addNavGap(liNav);
|
||||
liNav.addContent((display(packages)
|
||||
|| display(indirectPackages) || display(indirectOpenPackages))
|
||||
? links.createLink(SectionName.PACKAGES, contents.navPackages)
|
||||
: contents.navPackages);
|
||||
addNavGap(liNav);
|
||||
liNav.addContent((displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees))
|
||||
? links.createLink(SectionName.SERVICES, contents.navServices)
|
||||
: contents.navServices);
|
||||
ulNav.addContent(liNav);
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -975,7 +944,8 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: contentTree;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
contentTree.addContent(htmlTree);
|
||||
@ -1017,15 +987,4 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
li.addContent(deprDiv);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.moduleLabel);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import javax.lang.model.element.TypeElement;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
||||
@ -205,31 +205,4 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
||||
protected Content getDeprecatedLink(Element member) {
|
||||
return writer.getQualifiedClassLink(LinkInfoImpl.Kind.MEMBER, member);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
if (typeElement == null) {
|
||||
return links.createLink(
|
||||
SectionName.NESTED_CLASS_SUMMARY,
|
||||
contents.navNested);
|
||||
} else {
|
||||
return links.createLink(
|
||||
SectionName.NESTED_CLASSES_INHERITANCE,
|
||||
utils.getFullyQualifiedName(typeElement), contents.navNested);
|
||||
}
|
||||
} else {
|
||||
return contents.navNested;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,8 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(tree);
|
||||
addNavLinks(true, tree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
tree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(tree);
|
||||
}
|
||||
@ -226,7 +227,8 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
||||
Content tree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
addNavLinks(false, tree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
tree.addContent(navBar.getContent(false));
|
||||
addBottom(tree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(tree);
|
||||
|
@ -31,6 +31,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
@ -57,6 +59,8 @@ public class PackageTreeWriter extends AbstractTreeWriter {
|
||||
*/
|
||||
protected PackageElement packageElement;
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param configuration the configuration
|
||||
@ -67,6 +71,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
|
||||
super(configuration, path,
|
||||
new ClassTree(configuration.typeElementCatalog.allClasses(packageElement), configuration));
|
||||
this.packageElement = packageElement;
|
||||
this.navBar = new Navigation(packageElement, configuration, fixedNavDiv, PageMode.TREE, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,7 +123,8 @@ public class PackageTreeWriter extends AbstractTreeWriter {
|
||||
HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
addNavLinks(false, tree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
tree.addContent(navBar.getContent(false));
|
||||
addBottom(tree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(tree);
|
||||
@ -139,7 +145,11 @@ public class PackageTreeWriter extends AbstractTreeWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
|
||||
contents.moduleLabel);
|
||||
navBar.setNavLinkModule(linkContent);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -160,30 +170,4 @@ public class PackageTreeWriter extends AbstractTreeWriter {
|
||||
ul.addContent(getNavLinkMainTree(configuration.getText("doclet.All_Packages")));
|
||||
div.addContent(ul);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get link to the package summary page for the package of this tree.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkPackage() {
|
||||
Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
|
||||
contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.ClassUseMapper;
|
||||
@ -63,6 +64,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
||||
final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>();
|
||||
protected HtmlTree mainTree = HtmlTree.MAIN();
|
||||
final String packageUseTableSummary;
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -100,6 +102,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
||||
|
||||
packageUseTableSummary = resources.getText("doclet.Use_Table_Summary",
|
||||
resources.getText("doclet.packages"));
|
||||
this.navBar = new Navigation(packageElement, configuration, fixedNavDiv, PageMode.USE, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,7 +143,8 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
||||
HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
addNavLinks(false, tree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
tree.addContent(navBar.getContent(false));
|
||||
addBottom(tree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(tree);
|
||||
@ -249,7 +253,11 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
|
||||
contents.moduleLabel);
|
||||
navBar.setNavLinkModule(linkContent);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -267,54 +275,4 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
||||
}
|
||||
return bodyTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this package link.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkPackage() {
|
||||
Content linkContent = links.createLink(DocPaths.PACKAGE_SUMMARY,
|
||||
contents.packageLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the use link.
|
||||
*
|
||||
* @return a content tree for the use link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkClassUse() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.useLabel);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tree link.
|
||||
*
|
||||
* @return a content tree for the tree link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkTree() {
|
||||
Content linkContent = links.createLink(DocPaths.PACKAGE_TREE,
|
||||
contents.treeLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -40,12 +40,13 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
||||
|
||||
/**
|
||||
@ -79,6 +80,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
*/
|
||||
protected HtmlTree sectionTree = HtmlTree.SECTION();
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor to construct PackageWriter object and to generate
|
||||
* "package-summary.html" file in the respective package directory.
|
||||
@ -95,6 +98,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
configuration.docPaths.forPackage(packageElement)
|
||||
.resolve(DocPaths.PACKAGE_SUMMARY));
|
||||
this.packageElement = packageElement;
|
||||
this.navBar = new Navigation(packageElement, configuration, fixedNavDiv, PageMode.PACKAGE, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,7 +111,11 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
|
||||
contents.moduleLabel);
|
||||
navBar.setNavLinkModule(linkContent);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -346,7 +354,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: contentTree;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
contentTree.addContent(htmlTree);
|
||||
@ -361,55 +370,4 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement),
|
||||
true, contentTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "Use" link for this pacakge in the navigation bar.
|
||||
*
|
||||
* @return a content tree for the class use link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkClassUse() {
|
||||
Content useLink = links.createLink(DocPaths.PACKAGE_USE,
|
||||
contents.useLabel, "", "");
|
||||
Content li = HtmlTree.LI(useLink);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "Tree" link in the navigation bar. This will be link to the package
|
||||
* tree file.
|
||||
*
|
||||
* @return a content tree for the tree link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkTree() {
|
||||
Content useLink = links.createLink(DocPaths.PACKAGE_TREE,
|
||||
contents.treeLabel, "", "");
|
||||
Content li = HtmlTree.LI(useLink);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the module link.
|
||||
*
|
||||
* @return a content tree for the module link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkModule() {
|
||||
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
|
||||
contents.moduleLabel);
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Highlight "Package" in the navigation bar, as this is the package page.
|
||||
*
|
||||
* @return a content tree for the package link
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavLinkPackage() {
|
||||
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.packageLabel);
|
||||
return li;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
||||
@ -324,38 +324,4 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
||||
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member,
|
||||
utils.getFullyQualifiedName(member));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
|
||||
if (link) {
|
||||
if (typeElement == null) {
|
||||
return links.createLink(
|
||||
SectionName.PROPERTY_SUMMARY,
|
||||
contents.navProperty);
|
||||
} else {
|
||||
return links.createLink(
|
||||
SectionName.PROPERTIES_INHERITANCE,
|
||||
configuration.getClassName(typeElement), contents.navProperty);
|
||||
}
|
||||
} else {
|
||||
return contents.navProperty;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavDetailLink(boolean link, Content liNav) {
|
||||
if (link) {
|
||||
liNav.addContent(links.createLink(
|
||||
SectionName.PROPERTY_DETAIL,
|
||||
contents.navProperty));
|
||||
} else {
|
||||
liNav.addContent(contents.navProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.SerializedFormWriter;
|
||||
@ -59,12 +61,15 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
|
||||
*/
|
||||
private HtmlTree mainTree = HtmlTree.MAIN();
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* @param configuration the configuration data for the doclet
|
||||
*/
|
||||
public SerializedFormWriterImpl(HtmlConfiguration configuration) {
|
||||
super(configuration, DocPaths.SERIALIZED_FORM);
|
||||
visibleClasses = configuration.getIncludedTypeElements();
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.SERIALIZEDFORM, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -79,7 +84,8 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
@ -261,7 +267,8 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
|
||||
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: serializedTree;
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
serializedTree.addContent(htmlTree);
|
||||
|
@ -97,7 +97,8 @@ public class SingleIndexWriter extends AbstractIndexWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(htmlTree);
|
||||
}
|
||||
@ -123,7 +124,8 @@ public class SingleIndexWriter extends AbstractIndexWriter {
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
htmlTree = HtmlTree.FOOTER();
|
||||
}
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmlTree);
|
||||
|
@ -125,7 +125,8 @@ public class SplitIndexWriter extends AbstractIndexWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(htmlTree);
|
||||
}
|
||||
@ -145,7 +146,8 @@ public class SplitIndexWriter extends AbstractIndexWriter {
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
htmlTree = HtmlTree.FOOTER();
|
||||
}
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmlTree);
|
||||
|
@ -33,7 +33,8 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
|
||||
@ -68,6 +69,8 @@ public class TreeWriter extends AbstractTreeWriter {
|
||||
*/
|
||||
private final boolean classesOnly;
|
||||
|
||||
private final Navigation navBar;
|
||||
|
||||
/**
|
||||
* Constructor to construct TreeWriter object.
|
||||
*
|
||||
@ -79,6 +82,7 @@ public class TreeWriter extends AbstractTreeWriter {
|
||||
super(configuration, filename, classtree);
|
||||
packages = configuration.packages;
|
||||
classesOnly = packages.isEmpty();
|
||||
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.TREE, path);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,7 +131,8 @@ public class TreeWriter extends AbstractTreeWriter {
|
||||
} else {
|
||||
htmlTree = body;
|
||||
}
|
||||
addNavLinks(false, htmlTree);
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmlTree.addContent(navBar.getContent(false));
|
||||
addBottom(htmlTree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmlTree);
|
||||
@ -186,7 +191,8 @@ public class TreeWriter extends AbstractTreeWriter {
|
||||
? HtmlTree.HEADER()
|
||||
: bodyTree;
|
||||
addTop(htmlTree);
|
||||
addNavLinks(true, htmlTree);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
htmlTree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
bodyTree.addContent(htmlTree);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8185151
|
||||
* @bug 8185151 8196200
|
||||
* @summary test that navigation summary links are not linked when there are no dependencies
|
||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
@ -69,10 +69,10 @@ public class TestModuleServicesLink extends JavadocTester {
|
||||
checkExit(Exit.OK);
|
||||
|
||||
checkOutput("m/module-summary.html", true,
|
||||
"<a href=\"#module.description\">Description</a> |"
|
||||
+ " Modules |"
|
||||
+ " <a href=\"#packages.summary\">Packages</a> |"
|
||||
+ " <a href=\"#services.summary\">Services</a>");
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li>Modules | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li><a href=\"#services.summary\">Services</a></li>");
|
||||
|
||||
}
|
||||
|
||||
@ -93,10 +93,10 @@ public class TestModuleServicesLink extends JavadocTester {
|
||||
checkExit(Exit.OK);
|
||||
|
||||
checkOutput("m/module-summary.html", true,
|
||||
"<a href=\"#module.description\">Description</a> |"
|
||||
+ " Modules |"
|
||||
+ " <a href=\"#packages.summary\">Packages</a> |"
|
||||
+ " <a href=\"#services.summary\">Services</a>");
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li>Modules | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li><a href=\"#services.summary\">Services</a></li>");
|
||||
|
||||
}
|
||||
|
||||
@ -115,9 +115,10 @@ public class TestModuleServicesLink extends JavadocTester {
|
||||
checkExit(Exit.OK);
|
||||
|
||||
checkOutput("m/module-summary.html", true,
|
||||
"Description | Modules |"
|
||||
+ " <a href=\"#packages.summary\">Packages</a> |"
|
||||
+ " Services");
|
||||
"<li>Description | </li>\n"
|
||||
+ "<li>Modules | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li>Services</li>");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
|
||||
* 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
|
||||
* 8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
|
||||
8164407 8192007 8182765
|
||||
8164407 8192007 8182765 8196200
|
||||
* @summary Test modules support in javadoc.
|
||||
* @author bpatel
|
||||
* @library ../lib
|
||||
@ -940,9 +940,10 @@ public class TestModules extends JavadocTester {
|
||||
checkOutput("moduleA/module-summary.html", true,
|
||||
"<ul class=\"subNavList\">\n"
|
||||
+ "<li>Module: </li>\n"
|
||||
+ "<li><a href=\"#module.description\">Description</a> | <a "
|
||||
+ "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">"
|
||||
+ "Packages</a> | Services</li>\n"
|
||||
+ "<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li><a href=\"#modules.summary\">Modules</a> | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li>Services</li>\n"
|
||||
+ "</ul>",
|
||||
"<!-- ============ MODULES SUMMARY =========== -->\n"
|
||||
+ "<a id=\"modules.summary\">\n"
|
||||
@ -964,9 +965,10 @@ public class TestModules extends JavadocTester {
|
||||
+ "</td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB/module-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | Modules | "
|
||||
+ "<a href=\"#packages.summary\">Packages</a> | <a href=\"#services.summary\">"
|
||||
+ "Services</a></li>",
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li>Modules | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li><a href=\"#services.summary\">Services</a></li>",
|
||||
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
|
||||
+ "<a id=\"packages.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
@ -1180,8 +1182,10 @@ public class TestModules extends JavadocTester {
|
||||
+ " Package Link: <a href=\"moduletags/testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.<br></div>\n"
|
||||
+ "</td>");
|
||||
checkOutput("moduleA/module-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a href=\"#modules.summary\">"
|
||||
+ "Modules</a> | <a href=\"#packages.summary\">Packages</a> | Services</li>",
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li><a href=\"#modules.summary\">Modules</a> | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li>Services</li>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"../moduleB/module-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"><a href=\"../moduleB/testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n");
|
||||
checkOutput("moduleB/module-summary.html", true,
|
||||
@ -1189,8 +1193,10 @@ public class TestModules extends JavadocTester {
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">With a test description for uses.</div>\n</td>\n");
|
||||
checkOutput("moduletags/module-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a href=\"#modules.summary\">Modules"
|
||||
+ "</a> | <a href=\"#packages.summary\">Packages</a> | Services</li>",
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li><a href=\"#modules.summary\">Modules</a> | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li>Services</li>",
|
||||
"<table class=\"requiresSummary\">\n"
|
||||
+ "<caption><span>Indirect Requires</span><span class=\"tabEnd\"> </span></caption>",
|
||||
"<td class=\"colFirst\">transitive</td>\n"
|
||||
@ -1267,8 +1273,10 @@ public class TestModules extends JavadocTester {
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>");
|
||||
checkOutput("moduleB/module-summary.html", found,
|
||||
"<li><a href=\"#module.description\">Description</a> | Modules | "
|
||||
+ "<a href=\"#packages.summary\">Packages</a> | <a href=\"#services.summary\">Services</a></li>",
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li>Modules | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li><a href=\"#services.summary\">Services</a></li>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<table class=\"packagesSummary\">\n"
|
||||
@ -1329,8 +1337,10 @@ public class TestModules extends JavadocTester {
|
||||
+ "<td class=\"colSecond\">None</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>");
|
||||
checkOutput("moduleB/module-summary.html", found,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a href=\"#modules.summary\">"
|
||||
+ "Modules</a> | <a href=\"#packages.summary\">Packages</a> | <a href=\"#services.summary\">Services</a></li>",
|
||||
"<li><a href=\"#module.description\">Description</a> | </li>\n"
|
||||
+ "<li><a href=\"#modules.summary\">Modules</a> | </li>\n"
|
||||
+ "<li><a href=\"#packages.summary\">Packages</a> | </li>\n"
|
||||
+ "<li><a href=\"#services.summary\">Services</a></li>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
|
||||
+ "<td class=\"colSecond\">None</td>\n"
|
||||
+ "<td class=\"colSecond\">All Modules</td>\n"
|
||||
|
@ -24,24 +24,36 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 8182765
|
||||
* 8196200
|
||||
* @summary Make sure the Next/Prev Class links iterate through all types.
|
||||
* Make sure the navagation is 2 columns, not 3.
|
||||
* @author jamieh
|
||||
* @library ../lib
|
||||
* @library /tools/lib ../lib
|
||||
* @modules jdk.javadoc/jdk.javadoc.internal.tool
|
||||
* @build JavadocTester
|
||||
* @build toolbox.ToolBox JavadocTester
|
||||
* @run main TestNavigation
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import toolbox.*;
|
||||
|
||||
public class TestNavigation extends JavadocTester {
|
||||
|
||||
public final ToolBox tb;
|
||||
public static void main(String... args) throws Exception {
|
||||
TestNavigation tester = new TestNavigation();
|
||||
tester.runTests();
|
||||
tester.runTests(m -> new Object[] { Paths.get(m.getName()) });
|
||||
}
|
||||
|
||||
public TestNavigation() {
|
||||
tb = new ToolBox();
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
void test(Path ignore) {
|
||||
javadoc("-d", "out",
|
||||
"-overview", testSrc("overview.html"),
|
||||
"-sourcepath", testSrc,
|
||||
@ -96,7 +108,7 @@ public class TestNavigation extends JavadocTester {
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_html4() {
|
||||
void test_html4(Path ignore) {
|
||||
javadoc("-d", "out-html4",
|
||||
"-html4",
|
||||
"-overview", testSrc("overview.html"),
|
||||
@ -135,7 +147,7 @@ public class TestNavigation extends JavadocTester {
|
||||
|
||||
// Test for checking additional padding to offset the fixed navigation bar in HTML5.
|
||||
@Test
|
||||
void test1() {
|
||||
void test1(Path ignore) {
|
||||
javadoc("-d", "out-1",
|
||||
"-html5",
|
||||
"-sourcepath", testSrc,
|
||||
@ -167,7 +179,7 @@ public class TestNavigation extends JavadocTester {
|
||||
|
||||
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
|
||||
@Test
|
||||
void test2() {
|
||||
void test2(Path ignore) {
|
||||
javadoc("-d", "out-2",
|
||||
"-nonavbar",
|
||||
"-sourcepath", testSrc,
|
||||
@ -197,7 +209,7 @@ public class TestNavigation extends JavadocTester {
|
||||
|
||||
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
|
||||
@Test
|
||||
void test3() {
|
||||
void test3(Path ignore) {
|
||||
javadoc("-d", "out-3",
|
||||
"-html5",
|
||||
"-nonavbar",
|
||||
@ -227,4 +239,89 @@ public class TestNavigation extends JavadocTester {
|
||||
+ "</script>\n"
|
||||
+ "</nav>");
|
||||
}
|
||||
|
||||
@Test
|
||||
void test4(Path base) throws IOException {
|
||||
Path src = base.resolve("src");
|
||||
tb.writeJavaFiles(src,
|
||||
"package pkg1; public class A {\n"
|
||||
+ " /**\n"
|
||||
+ " * Class with members.\n"
|
||||
+ " */\n"
|
||||
+ " public static class X {\n"
|
||||
+ " /**\n"
|
||||
+ " * A ctor\n"
|
||||
+ " */\n"
|
||||
+ " public X() {\n"
|
||||
+ " }\n"
|
||||
+ " /**\n"
|
||||
+ " * A field\n"
|
||||
+ " */\n"
|
||||
+ " public int field;\n"
|
||||
+ " /**\n"
|
||||
+ " * A method\n"
|
||||
+ " */\n"
|
||||
+ " public void method() {\n"
|
||||
+ " }\n"
|
||||
+ " /**\n"
|
||||
+ " * An inner class\n"
|
||||
+ " */\n"
|
||||
+ " public static class IC {\n"
|
||||
+ " }\n"
|
||||
+ " }\n"
|
||||
+ " /**\n"
|
||||
+ " * Class with all inherited members.\n"
|
||||
+ " */\n"
|
||||
+ " public static class Y extends X {\n"
|
||||
+ " }\n"
|
||||
+ "}");
|
||||
|
||||
tb.writeJavaFiles(src,
|
||||
"package pkg1; public class C {\n"
|
||||
+ "}");
|
||||
|
||||
tb.writeJavaFiles(src,
|
||||
"package pkg1; public interface InterfaceWithNoMembers {\n"
|
||||
+ "}");
|
||||
|
||||
javadoc("-d", "out-4",
|
||||
"-sourcepath", src.toString(),
|
||||
"pkg1");
|
||||
checkExit(Exit.OK);
|
||||
|
||||
checkOrder("pkg1/A.X.html",
|
||||
"Summary",
|
||||
"<li><a href=\"#nested.class.summary\">Nested</a> | </li>",
|
||||
"<li><a href=\"#field.summary\">Field</a> | </li>",
|
||||
"<li><a href=\"#constructor.summary\">Constr</a> | </li>",
|
||||
"<li><a href=\"#method.summary\">Method</a></li>");
|
||||
|
||||
checkOrder("pkg1/A.Y.html",
|
||||
"Summary",
|
||||
"<li><a href=\"#nested.class.summary\">Nested</a> | </li>",
|
||||
"<li><a href=\"#field.summary\">Field</a> | </li>",
|
||||
"<li><a href=\"#constructor.summary\">Constr</a> | </li>",
|
||||
"<li><a href=\"#method.summary\">Method</a></li>");
|
||||
|
||||
checkOrder("pkg1/A.X.IC.html",
|
||||
"Summary",
|
||||
"<li>Nested | </li>",
|
||||
"<li>Field | </li>",
|
||||
"<li><a href=\"#constructor.summary\">Constr</a> | </li>",
|
||||
"<li><a href=\"#method.summary\">Method</a></li>");
|
||||
|
||||
checkOrder("pkg1/C.html",
|
||||
"Summary",
|
||||
"<li>Nested | </li>",
|
||||
"<li>Field | </li>",
|
||||
"<li><a href=\"#constructor.summary\">Constr</a> | </li>",
|
||||
"<li><a href=\"#method.summary\">Method</a></li>");
|
||||
|
||||
checkOrder("pkg1/InterfaceWithNoMembers.html",
|
||||
"Summary",
|
||||
"<li>Nested | </li>",
|
||||
"<li>Field | </li>",
|
||||
"<li>Constr | </li>",
|
||||
"<li>Method</li>");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user