8222669: Create and use new html.Entity class
Reviewed-by: hannesw
This commit is contained in:
parent
baf1349a2f
commit
761466699c
@ -40,12 +40,16 @@ import javax.lang.model.type.TypeVariable;
|
|||||||
import javax.lang.model.util.SimpleTypeVisitor9;
|
import javax.lang.model.util.SimpleTypeVisitor9;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTree;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
|
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
|
||||||
|
|
||||||
import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.*;
|
import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM;
|
||||||
|
import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.MEMBER;
|
||||||
|
import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS;
|
||||||
|
import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.RECEIVER_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print method and constructor info.
|
* Print method and constructor info.
|
||||||
@ -79,7 +83,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
|||||||
Content typeParameters = getTypeParameters(member);
|
Content typeParameters = getTypeParameters(member);
|
||||||
if (!typeParameters.isEmpty()) {
|
if (!typeParameters.isEmpty()) {
|
||||||
htmltree.add(typeParameters);
|
htmltree.add(typeParameters);
|
||||||
htmltree.add(Contents.SPACE);
|
htmltree.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +111,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
|||||||
}
|
}
|
||||||
String signature = utils.flatSignature((ExecutableElement) member);
|
String signature = utils.flatSignature((ExecutableElement) member);
|
||||||
if (signature.length() > 2) {
|
if (signature.length() > 2) {
|
||||||
deprecatedLinkContent.add(Contents.ZERO_WIDTH_SPACE);
|
deprecatedLinkContent.add(Entity.ZERO_WIDTH_SPACE);
|
||||||
}
|
}
|
||||||
deprecatedLinkContent.add(signature);
|
deprecatedLinkContent.add(signature);
|
||||||
|
|
||||||
@ -160,7 +164,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
|||||||
param.asType()).varargs(isVarArg));
|
param.asType()).varargs(isVarArg));
|
||||||
tree.add(link);
|
tree.add(link);
|
||||||
if(name(param).length() > 0) {
|
if(name(param).length() > 0) {
|
||||||
tree.add(Contents.SPACE);
|
tree.add(Entity.NO_BREAK_SPACE);
|
||||||
tree.add(name(param));
|
tree.add(name(param));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,11 +180,11 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
|||||||
protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType,
|
protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType,
|
||||||
List<? extends AnnotationMirror> annotationMirrors, Content tree) {
|
List<? extends AnnotationMirror> annotationMirrors, Content tree) {
|
||||||
writer.addReceiverAnnotationInfo(member, rcvrType, annotationMirrors, tree);
|
writer.addReceiverAnnotationInfo(member, rcvrType, annotationMirrors, tree);
|
||||||
tree.add(Contents.SPACE);
|
tree.add(Entity.NO_BREAK_SPACE);
|
||||||
tree.add(utils.getTypeName(rcvrType, false));
|
tree.add(utils.getTypeName(rcvrType, false));
|
||||||
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, RECEIVER_TYPE, rcvrType);
|
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, RECEIVER_TYPE, rcvrType);
|
||||||
tree.add(writer.getTypeParameterLinks(linkInfo));
|
tree.add(writer.getTypeParameterLinks(linkInfo));
|
||||||
tree.add(Contents.SPACE);
|
tree.add(Entity.NO_BREAK_SPACE);
|
||||||
tree.add("this");
|
tree.add("this");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +258,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
|||||||
if (paramTree.isEmpty()) {
|
if (paramTree.isEmpty()) {
|
||||||
htmltree.add("()");
|
htmltree.add("()");
|
||||||
} else {
|
} else {
|
||||||
htmltree.add(Contents.ZERO_WIDTH_SPACE);
|
htmltree.add(Entity.ZERO_WIDTH_SPACE);
|
||||||
htmltree.add("(");
|
htmltree.add("(");
|
||||||
htmltree.add(paramTree);
|
htmltree.add(paramTree);
|
||||||
paramTree.add(")");
|
paramTree.add(")");
|
||||||
|
@ -25,9 +25,13 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.io.OutputStream;
|
||||||
import java.util.zip.*;
|
import java.io.Writer;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
import javax.lang.model.element.Element;
|
import javax.lang.model.element.Element;
|
||||||
import javax.lang.model.element.ExecutableElement;
|
import javax.lang.model.element.ExecutableElement;
|
||||||
@ -37,6 +41,7 @@ import javax.lang.model.element.TypeElement;
|
|||||||
import javax.lang.model.util.SimpleElementVisitor9;
|
import javax.lang.model.util.SimpleElementVisitor9;
|
||||||
|
|
||||||
import com.sun.source.doctree.DocTree;
|
import com.sun.source.doctree.DocTree;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -338,7 +343,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
|
|||||||
dlTree.add(dt);
|
dlTree.add(dt);
|
||||||
Content dd = new HtmlTree(HtmlTag.DD);
|
Content dd = new HtmlTree(HtmlTag.DD);
|
||||||
if (sii.getDescription().isEmpty()) {
|
if (sii.getDescription().isEmpty()) {
|
||||||
dd.add(Contents.SPACE);
|
dd.add(Entity.NO_BREAK_SPACE);
|
||||||
} else {
|
} else {
|
||||||
dd.add(sii.getDescription());
|
dd.add(sii.getDescription());
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
import java.util.ArrayList;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.*;
|
import java.util.TreeSet;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.lang.model.element.Element;
|
import javax.lang.model.element.Element;
|
||||||
@ -39,18 +39,26 @@ import javax.lang.model.element.TypeParameterElement;
|
|||||||
import javax.lang.model.type.TypeMirror;
|
import javax.lang.model.type.TypeMirror;
|
||||||
|
|
||||||
import com.sun.source.doctree.DocTree;
|
import com.sun.source.doctree.DocTree;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
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.Links;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.taglets.DeprecatedTaglet;
|
import jdk.javadoc.internal.doclets.toolkit.taglets.DeprecatedTaglet;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
|
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
|
||||||
|
|
||||||
import static javax.lang.model.element.Modifier.*;
|
import static javax.lang.model.element.Modifier.ABSTRACT;
|
||||||
|
import static javax.lang.model.element.Modifier.NATIVE;
|
||||||
|
import static javax.lang.model.element.Modifier.PUBLIC;
|
||||||
|
import static javax.lang.model.element.Modifier.STRICTFP;
|
||||||
|
import static javax.lang.model.element.Modifier.SYNCHRONIZED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base class for member writers.
|
* The base class for member writers.
|
||||||
@ -256,7 +264,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
|||||||
if (!set.isEmpty()) {
|
if (!set.isEmpty()) {
|
||||||
String mods = set.stream().map(Modifier::toString).collect(Collectors.joining(" "));
|
String mods = set.stream().map(Modifier::toString).collect(Collectors.joining(" "));
|
||||||
htmltree.add(mods);
|
htmltree.add(mods);
|
||||||
htmltree.add(Contents.SPACE);
|
htmltree.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +292,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
|||||||
addModifier(member, code);
|
addModifier(member, code);
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
code.add(utils.isClass(member) ? "class" : "interface");
|
code.add(utils.isClass(member) ? "class" : "interface");
|
||||||
code.add(Contents.SPACE);
|
code.add(Entity.NO_BREAK_SPACE);
|
||||||
} else {
|
} else {
|
||||||
List<? extends TypeParameterElement> list = utils.isExecutableElement(member)
|
List<? extends TypeParameterElement> list = utils.isExecutableElement(member)
|
||||||
? ((ExecutableElement)member).getTypeParameters()
|
? ((ExecutableElement)member).getTypeParameters()
|
||||||
@ -297,7 +305,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
|||||||
if (typeParameters.charCount() > 10) {
|
if (typeParameters.charCount() > 10) {
|
||||||
code.add(new HtmlTree(HtmlTag.BR));
|
code.add(new HtmlTree(HtmlTag.BR));
|
||||||
} else {
|
} else {
|
||||||
code.add(Contents.SPACE);
|
code.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
code.add(
|
code.add(
|
||||||
writer.getLink(new LinkInfoImpl(configuration,
|
writer.getLink(new LinkInfoImpl(configuration,
|
||||||
|
@ -31,6 +31,7 @@ import javax.lang.model.element.TypeElement;
|
|||||||
import javax.lang.model.type.TypeMirror;
|
import javax.lang.model.type.TypeMirror;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -138,7 +139,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
|
|||||||
writer.getLink(new LinkInfoImpl(configuration,
|
writer.getLink(new LinkInfoImpl(configuration,
|
||||||
LinkInfoImpl.Kind.MEMBER, getType(member)));
|
LinkInfoImpl.Kind.MEMBER, getType(member)));
|
||||||
pre.add(link);
|
pre.add(link);
|
||||||
pre.add(Contents.SPACE);
|
pre.add(Entity.NO_BREAK_SPACE);
|
||||||
if (configuration.linksource) {
|
if (configuration.linksource) {
|
||||||
Content memberName = new StringContent(name(member));
|
Content memberName = new StringContent(name(member));
|
||||||
writer.addSrcLink(member, memberName, pre);
|
writer.addSrcLink(member, memberName, pre);
|
||||||
|
@ -31,6 +31,7 @@ import javax.lang.model.element.TypeElement;
|
|||||||
import javax.lang.model.type.TypeMirror;
|
import javax.lang.model.type.TypeMirror;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -142,7 +143,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
|
|||||||
writer.getLink(new LinkInfoImpl(configuration,
|
writer.getLink(new LinkInfoImpl(configuration,
|
||||||
LinkInfoImpl.Kind.MEMBER, getType(member)));
|
LinkInfoImpl.Kind.MEMBER, getType(member)));
|
||||||
pre.add(link);
|
pre.add(link);
|
||||||
pre.add(Contents.SPACE);
|
pre.add(Entity.NO_BREAK_SPACE);
|
||||||
if (configuration.linksource) {
|
if (configuration.linksource) {
|
||||||
Content memberName = new StringContent(name(member));
|
Content memberName = new StringContent(name(member));
|
||||||
writer.addSrcLink(member, memberName, pre);
|
writer.addSrcLink(member, memberName, pre);
|
||||||
|
@ -32,6 +32,7 @@ import javax.lang.model.element.PackageElement;
|
|||||||
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.TypeElement;
|
||||||
|
|
||||||
import com.sun.source.doctree.DocTree;
|
import com.sun.source.doctree.DocTree;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -101,7 +102,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
|||||||
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType);
|
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType);
|
||||||
Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
|
Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
|
||||||
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel);
|
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel);
|
||||||
moduleNameDiv.add(Contents.SPACE);
|
moduleNameDiv.add(Entity.NO_BREAK_SPACE);
|
||||||
moduleNameDiv.add(getModuleLink(mdle, new StringContent(mdle.getQualifiedName())));
|
moduleNameDiv.add(getModuleLink(mdle, new StringContent(mdle.getQualifiedName())));
|
||||||
div.add(moduleNameDiv);
|
div.add(moduleNameDiv);
|
||||||
}
|
}
|
||||||
@ -109,7 +110,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
|||||||
if (!pkg.isUnnamed()) {
|
if (!pkg.isUnnamed()) {
|
||||||
Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
|
Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
|
||||||
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel);
|
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel);
|
||||||
pkgNameDiv.add(Contents.SPACE);
|
pkgNameDiv.add(Entity.NO_BREAK_SPACE);
|
||||||
Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
|
Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
|
||||||
pkgNameDiv.add(pkgNameContent);
|
pkgNameDiv.add(pkgNameContent);
|
||||||
div.add(pkgNameDiv);
|
div.add(pkgNameDiv);
|
||||||
|
@ -25,7 +25,11 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.SortedSet;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import javax.lang.model.element.AnnotationMirror;
|
import javax.lang.model.element.AnnotationMirror;
|
||||||
import javax.lang.model.element.Element;
|
import javax.lang.model.element.Element;
|
||||||
@ -36,6 +40,7 @@ import javax.lang.model.type.TypeMirror;
|
|||||||
import javax.lang.model.util.SimpleElementVisitor8;
|
import javax.lang.model.util.SimpleElementVisitor8;
|
||||||
|
|
||||||
import com.sun.source.doctree.DocTree;
|
import com.sun.source.doctree.DocTree;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -122,7 +127,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
|||||||
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(typeElement);
|
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(typeElement);
|
||||||
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
|
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
|
||||||
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
|
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
|
||||||
moduleNameDiv.add(Contents.SPACE);
|
moduleNameDiv.add(Entity.NO_BREAK_SPACE);
|
||||||
moduleNameDiv.add(getModuleLink(mdle,
|
moduleNameDiv.add(getModuleLink(mdle,
|
||||||
new StringContent(mdle.getQualifiedName())));
|
new StringContent(mdle.getQualifiedName())));
|
||||||
div.add(moduleNameDiv);
|
div.add(moduleNameDiv);
|
||||||
@ -131,7 +136,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
|||||||
if (!pkg.isUnnamed()) {
|
if (!pkg.isUnnamed()) {
|
||||||
Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
|
Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
|
||||||
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
|
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
|
||||||
pkgNameDiv.add(Contents.SPACE);
|
pkgNameDiv.add(Entity.NO_BREAK_SPACE);
|
||||||
Content pkgNameContent = getPackageLink(pkg,
|
Content pkgNameContent = getPackageLink(pkg,
|
||||||
new StringContent(utils.getPackageName(pkg)));
|
new StringContent(utils.getPackageName(pkg)));
|
||||||
pkgNameDiv.add(pkgNameContent);
|
pkgNameDiv.add(pkgNameContent);
|
||||||
|
@ -25,10 +25,8 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
import java.util.Collection;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
import java.util.Set;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.lang.model.element.Modifier;
|
import javax.lang.model.element.Modifier;
|
||||||
import javax.lang.model.element.PackageElement;
|
import javax.lang.model.element.PackageElement;
|
||||||
@ -36,12 +34,15 @@ import javax.lang.model.element.TypeElement;
|
|||||||
import javax.lang.model.element.VariableElement;
|
import javax.lang.model.element.VariableElement;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
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;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.ConstantsSummaryWriter;
|
import jdk.javadoc.internal.doclets.toolkit.ConstantsSummaryWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||||
@ -265,7 +266,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
|
|||||||
for (Modifier mod : member.getModifiers()) {
|
for (Modifier mod : member.getModifiers()) {
|
||||||
Content modifier = new StringContent(mod.toString());
|
Content modifier = new StringContent(mod.toString());
|
||||||
code.add(modifier);
|
code.add(modifier);
|
||||||
code.add(Contents.SPACE);
|
code.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
Content type = getLink(new LinkInfoImpl(configuration,
|
Content type = getLink(new LinkInfoImpl(configuration,
|
||||||
LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.asType()));
|
LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.asType()));
|
||||||
|
@ -33,6 +33,7 @@ import javax.lang.model.element.ExecutableElement;
|
|||||||
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.TypeElement;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -297,7 +298,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
} else if (utils.isPrivate(member)) {
|
} else if (utils.isPrivate(member)) {
|
||||||
code.add("private ");
|
code.add("private ");
|
||||||
} else if (utils.isPublic(member)) {
|
} else if (utils.isPublic(member)) {
|
||||||
code.add(Contents.SPACE);
|
code.add(Entity.NO_BREAK_SPACE);
|
||||||
} else {
|
} else {
|
||||||
code.add(
|
code.add(
|
||||||
resources.getText("doclet.Package_private"));
|
resources.getText("doclet.Package_private"));
|
||||||
|
@ -32,8 +32,8 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Comment;
|
import jdk.javadoc.internal.doclets.formats.html.markup.Comment;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.FixedStringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.FixedStringContent;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
||||||
@ -52,8 +52,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
|
|||||||
* only created once per doclet-instance, instead of once per generated page.
|
* only created once per doclet-instance, instead of once per generated page.
|
||||||
*/
|
*/
|
||||||
public class Contents {
|
public class Contents {
|
||||||
public static final Content SPACE = RawHtml.nbsp;
|
|
||||||
public static final Content ZERO_WIDTH_SPACE = RawHtml.zws;
|
|
||||||
|
|
||||||
public final Content allClassesLabel;
|
public final Content allClassesLabel;
|
||||||
public final Content allImplementedInterfacesLabel;
|
public final Content allImplementedInterfacesLabel;
|
||||||
@ -400,7 +398,7 @@ public class Contents {
|
|||||||
int p;
|
int p;
|
||||||
while ((p = text.indexOf(" ", start)) != -1) {
|
while ((p = text.indexOf(" ", start)) != -1) {
|
||||||
c.add(text.substring(start, p));
|
c.add(text.substring(start, p));
|
||||||
c.add(RawHtml.nbsp);
|
c.add(Entity.NO_BREAK_SPACE);
|
||||||
start = p + 1;
|
start = p + 1;
|
||||||
}
|
}
|
||||||
c.add(text.substring(start));
|
c.add(text.substring(start));
|
||||||
|
@ -33,6 +33,7 @@ import javax.lang.model.element.TypeElement;
|
|||||||
import javax.lang.model.element.VariableElement;
|
import javax.lang.model.element.VariableElement;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -248,7 +249,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
|
|||||||
}
|
}
|
||||||
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
|
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
|
||||||
label);
|
label);
|
||||||
labelHeading.add(Contents.SPACE);
|
labelHeading.add(Entity.NO_BREAK_SPACE);
|
||||||
labelHeading.add(classLink);
|
labelHeading.add(classLink);
|
||||||
inheritedTree.add(labelHeading);
|
inheritedTree.add(labelHeading);
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,13 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Head;
|
import java.util.ArrayList;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
|
import java.util.LinkedList;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
import java.util.List;
|
||||||
|
import java.util.ListIterator;
|
||||||
import java.util.*;
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@ -69,8 +71,10 @@ import com.sun.source.doctree.SummaryTree;
|
|||||||
import com.sun.source.doctree.SystemPropertyTree;
|
import com.sun.source.doctree.SystemPropertyTree;
|
||||||
import com.sun.source.doctree.TextTree;
|
import com.sun.source.doctree.TextTree;
|
||||||
import com.sun.source.util.SimpleDocTreeVisitor;
|
import com.sun.source.util.SimpleDocTreeVisitor;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Head;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocument;
|
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.HtmlStyle;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||||
@ -79,6 +83,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.Links;
|
|||||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
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.Script;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
|
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
|
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
@ -97,7 +102,12 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
|
|||||||
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
|
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
|
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
|
||||||
|
|
||||||
import static com.sun.source.doctree.DocTree.Kind.*;
|
import static com.sun.source.doctree.DocTree.Kind.CODE;
|
||||||
|
import static com.sun.source.doctree.DocTree.Kind.COMMENT;
|
||||||
|
import static com.sun.source.doctree.DocTree.Kind.LINK;
|
||||||
|
import static com.sun.source.doctree.DocTree.Kind.LINK_PLAIN;
|
||||||
|
import static com.sun.source.doctree.DocTree.Kind.SEE;
|
||||||
|
import static com.sun.source.doctree.DocTree.Kind.TEXT;
|
||||||
import static jdk.javadoc.internal.doclets.toolkit.util.CommentHelper.SPACER;
|
import static jdk.javadoc.internal.doclets.toolkit.util.CommentHelper.SPACER;
|
||||||
|
|
||||||
|
|
||||||
@ -502,7 +512,7 @@ public class HtmlDocletWriter {
|
|||||||
*/
|
*/
|
||||||
public Content getTableCaption(Content title) {
|
public Content getTableCaption(Content title) {
|
||||||
Content captionSpan = HtmlTree.SPAN(title);
|
Content captionSpan = HtmlTree.SPAN(title);
|
||||||
Content space = Contents.SPACE;
|
Content space = Entity.NO_BREAK_SPACE;
|
||||||
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space);
|
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space);
|
||||||
Content caption = HtmlTree.CAPTION(captionSpan);
|
Content caption = HtmlTree.CAPTION(captionSpan);
|
||||||
caption.add(tabSpan);
|
caption.add(tabSpan);
|
||||||
@ -1226,7 +1236,7 @@ public class HtmlDocletWriter {
|
|||||||
htmltree.add(div);
|
htmltree.add(div);
|
||||||
}
|
}
|
||||||
if (tags.isEmpty()) {
|
if (tags.isEmpty()) {
|
||||||
htmltree.add(Contents.SPACE);
|
htmltree.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ import javax.lang.model.type.DeclaredType;
|
|||||||
import javax.lang.model.type.TypeMirror;
|
import javax.lang.model.type.TypeMirror;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
|
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
||||||
@ -162,7 +163,7 @@ public class LinkFactoryImpl extends LinkFactory {
|
|||||||
for (TypeMirror t : vars) {
|
for (TypeMirror t : vars) {
|
||||||
if (many) {
|
if (many) {
|
||||||
links.add(",");
|
links.add(",");
|
||||||
links.add(Contents.ZERO_WIDTH_SPACE);
|
links.add(Entity.ZERO_WIDTH_SPACE);
|
||||||
}
|
}
|
||||||
links.add(getTypeParameterLink(linkInfo, t));
|
links.add(getTypeParameterLink(linkInfo, t));
|
||||||
many = true;
|
many = true;
|
||||||
|
@ -34,6 +34,7 @@ import javax.lang.model.element.TypeElement;
|
|||||||
import javax.lang.model.type.TypeMirror;
|
import javax.lang.model.type.TypeMirror;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -190,7 +191,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
utils.isClass(holder)
|
utils.isClass(holder)
|
||||||
? contents.descfrmClassLabel
|
? contents.descfrmClassLabel
|
||||||
: contents.descfrmInterfaceLabel);
|
: contents.descfrmInterfaceLabel);
|
||||||
descfrmLabel.add(Contents.SPACE);
|
descfrmLabel.add(Entity.NO_BREAK_SPACE);
|
||||||
descfrmLabel.add(codelLink);
|
descfrmLabel.add(codelLink);
|
||||||
methodDocTree.add(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
methodDocTree.add(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
||||||
writer.addInlineComment(method, methodDocTree);
|
writer.addInlineComment(method, methodDocTree);
|
||||||
@ -297,7 +298,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
}
|
}
|
||||||
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
|
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
|
||||||
label);
|
label);
|
||||||
labelHeading.add(Contents.SPACE);
|
labelHeading.add(Entity.NO_BREAK_SPACE);
|
||||||
labelHeading.add(classLink);
|
labelHeading.add(classLink);
|
||||||
inheritedTree.add(labelHeading);
|
inheritedTree.add(labelHeading);
|
||||||
}
|
}
|
||||||
@ -353,9 +354,9 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
.where(writer.links.getName(writer.getAnchor(method))).label(method.getSimpleName()));
|
.where(writer.links.getName(writer.getAnchor(method))).label(method.getSimpleName()));
|
||||||
Content codeMethLink = HtmlTree.CODE(methlink);
|
Content codeMethLink = HtmlTree.CODE(methlink);
|
||||||
Content dd = HtmlTree.DD(codeMethLink);
|
Content dd = HtmlTree.DD(codeMethLink);
|
||||||
dd.add(Contents.SPACE);
|
dd.add(Entity.NO_BREAK_SPACE);
|
||||||
dd.add(writer.contents.inClass);
|
dd.add(writer.contents.inClass);
|
||||||
dd.add(Contents.SPACE);
|
dd.add(Entity.NO_BREAK_SPACE);
|
||||||
dd.add(codeOverridenTypeLink);
|
dd.add(codeOverridenTypeLink);
|
||||||
dl.add(dd);
|
dl.add(dd);
|
||||||
}
|
}
|
||||||
@ -389,9 +390,9 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
implementedMeth.getSimpleName(), false);
|
implementedMeth.getSimpleName(), false);
|
||||||
Content codeMethLink = HtmlTree.CODE(methlink);
|
Content codeMethLink = HtmlTree.CODE(methlink);
|
||||||
Content dd = HtmlTree.DD(codeMethLink);
|
Content dd = HtmlTree.DD(codeMethLink);
|
||||||
dd.add(Contents.SPACE);
|
dd.add(Entity.NO_BREAK_SPACE);
|
||||||
dd.add(contents.inInterface);
|
dd.add(contents.inInterface);
|
||||||
dd.add(Contents.SPACE);
|
dd.add(Entity.NO_BREAK_SPACE);
|
||||||
dd.add(codeIntfacLink);
|
dd.add(codeIntfacLink);
|
||||||
dl.add(dd);
|
dl.add(dd);
|
||||||
}
|
}
|
||||||
@ -409,7 +410,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
Content linkContent = writer.getLink(
|
Content linkContent = writer.getLink(
|
||||||
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
|
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
|
||||||
htmltree.add(linkContent);
|
htmltree.add(linkContent);
|
||||||
htmltree.add(Contents.SPACE);
|
htmltree.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,6 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -46,6 +43,7 @@ import javax.lang.model.util.ElementFilter;
|
|||||||
import com.sun.source.doctree.DocTree;
|
import com.sun.source.doctree.DocTree;
|
||||||
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
|
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -53,6 +51,8 @@ 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.Navigation.PageMode;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
|
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||||
@ -209,7 +209,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
|||||||
? contents.openModuleLabel : contents.moduleLabel;
|
? contents.openModuleLabel : contents.moduleLabel;
|
||||||
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
|
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
|
||||||
HtmlStyle.title, label);
|
HtmlStyle.title, label);
|
||||||
tHeading.add(Contents.SPACE);
|
tHeading.add(Entity.NO_BREAK_SPACE);
|
||||||
Content moduleHead = new RawHtml(heading);
|
Content moduleHead = new RawHtml(heading);
|
||||||
tHeading.add(moduleHead);
|
tHeading.add(moduleHead);
|
||||||
div.add(tHeading);
|
div.add(tHeading);
|
||||||
@ -534,7 +534,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
|||||||
* Add the list of modules.
|
* Add the list of modules.
|
||||||
*
|
*
|
||||||
* @param mdleMap map of modules and modifiers
|
* @param mdleMap map of modules and modifiers
|
||||||
* @param tbody the content tree to which the list will be added
|
* @param table the table to which the list will be added
|
||||||
*/
|
*/
|
||||||
private void addModulesList(Map<ModuleElement, Content> mdleMap, Table table) {
|
private void addModulesList(Map<ModuleElement, Content> mdleMap, Table table) {
|
||||||
for (ModuleElement m : mdleMap.keySet()) {
|
for (ModuleElement m : mdleMap.keySet()) {
|
||||||
@ -776,7 +776,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
|||||||
addSummaryComment(t, summary);
|
addSummaryComment(t, summary);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
summary.add(Contents.SPACE);
|
summary.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
table.addRow(typeLinkContent, summary);
|
table.addRow(typeLinkContent, summary);
|
||||||
}
|
}
|
||||||
@ -802,9 +802,9 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
|||||||
description = providesTrees.get(srv);
|
description = providesTrees.get(srv);
|
||||||
desc.add((description != null && !description.isEmpty())
|
desc.add((description != null && !description.isEmpty())
|
||||||
? HtmlTree.DIV(HtmlStyle.block, description)
|
? HtmlTree.DIV(HtmlStyle.block, description)
|
||||||
: Contents.SPACE);
|
: Entity.NO_BREAK_SPACE);
|
||||||
} else {
|
} else {
|
||||||
desc.add(Contents.SPACE);
|
desc.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
// Only display the implementation details in the "all" mode.
|
// Only display the implementation details in the "all" mode.
|
||||||
if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) {
|
if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) {
|
||||||
@ -812,7 +812,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
|||||||
desc.add("(");
|
desc.add("(");
|
||||||
HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation);
|
HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation);
|
||||||
desc.add(implSpan);
|
desc.add(implSpan);
|
||||||
desc.add(Contents.SPACE);
|
desc.add(Entity.NO_BREAK_SPACE);
|
||||||
String sep = "";
|
String sep = "";
|
||||||
for (TypeElement impl : implSet) {
|
for (TypeElement impl : implSet) {
|
||||||
desc.add(sep);
|
desc.add(sep);
|
||||||
|
@ -32,6 +32,7 @@ import javax.lang.model.element.Element;
|
|||||||
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.TypeElement;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTree;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
@ -154,7 +155,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
|||||||
: resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
|
: resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
|
||||||
}
|
}
|
||||||
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, label);
|
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, label);
|
||||||
labelHeading.add(Contents.SPACE);
|
labelHeading.add(Entity.NO_BREAK_SPACE);
|
||||||
labelHeading.add(classLink);
|
labelHeading.add(classLink);
|
||||||
inheritedTree.add(labelHeading);
|
inheritedTree.add(labelHeading);
|
||||||
}
|
}
|
||||||
|
@ -25,21 +25,24 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
import java.util.Set;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
import java.util.SortedMap;
|
||||||
|
import java.util.TreeMap;
|
||||||
import java.util.*;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import javax.lang.model.element.PackageElement;
|
import javax.lang.model.element.PackageElement;
|
||||||
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.TypeElement;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
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;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.ClassUseMapper;
|
import jdk.javadoc.internal.doclets.toolkit.util.ClassUseMapper;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||||
@ -180,7 +183,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
|||||||
if (pkg != null && !pkg.isUnnamed()) {
|
if (pkg != null && !pkg.isUnnamed()) {
|
||||||
addSummaryComment(pkg, summary);
|
addSummaryComment(pkg, summary);
|
||||||
} else {
|
} else {
|
||||||
summary.add(Contents.SPACE);
|
summary.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
table.addRow(packageLink, summary);
|
table.addRow(packageLink, summary);
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,8 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
import java.util.List;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
import java.util.SortedSet;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.lang.model.element.ModuleElement;
|
import javax.lang.model.element.ModuleElement;
|
||||||
import javax.lang.model.element.PackageElement;
|
import javax.lang.model.element.PackageElement;
|
||||||
@ -36,12 +34,15 @@ import javax.lang.model.element.TypeElement;
|
|||||||
|
|
||||||
import com.sun.source.doctree.DocTree;
|
import com.sun.source.doctree.DocTree;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
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;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
|
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||||
@ -120,7 +121,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
|||||||
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(packageElement);
|
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(packageElement);
|
||||||
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInPackage, contents.moduleLabel);
|
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInPackage, contents.moduleLabel);
|
||||||
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
|
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
|
||||||
moduleNameDiv.add(Contents.SPACE);
|
moduleNameDiv.add(Entity.NO_BREAK_SPACE);
|
||||||
moduleNameDiv.add(getModuleLink(mdle,
|
moduleNameDiv.add(getModuleLink(mdle,
|
||||||
new StringContent(mdle.getQualifiedName().toString())));
|
new StringContent(mdle.getQualifiedName().toString())));
|
||||||
div.add(moduleNameDiv);
|
div.add(moduleNameDiv);
|
||||||
@ -130,7 +131,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
|||||||
div.add(annotationContent);
|
div.add(annotationContent);
|
||||||
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
|
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
|
||||||
HtmlStyle.title, contents.packageLabel);
|
HtmlStyle.title, contents.packageLabel);
|
||||||
tHeading.add(Contents.SPACE);
|
tHeading.add(Entity.NO_BREAK_SPACE);
|
||||||
Content packageHead = new StringContent(heading);
|
Content packageHead = new StringContent(heading);
|
||||||
tHeading.add(packageHead);
|
tHeading.add(packageHead);
|
||||||
div.add(tHeading);
|
div.add(tHeading);
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
|
|
||||||
import javax.lang.model.element.Element;
|
import javax.lang.model.element.Element;
|
||||||
import javax.lang.model.element.ExecutableElement;
|
import javax.lang.model.element.ExecutableElement;
|
||||||
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.TypeElement;
|
||||||
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -41,7 +41,6 @@ import jdk.javadoc.internal.doclets.toolkit.Content;
|
|||||||
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
|
import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes property documentation in HTML format.
|
* Writes property documentation in HTML format.
|
||||||
*
|
*
|
||||||
@ -161,7 +160,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
|||||||
utils.isClass(holder)
|
utils.isClass(holder)
|
||||||
? contents.descfrmClassLabel
|
? contents.descfrmClassLabel
|
||||||
: contents.descfrmInterfaceLabel);
|
: contents.descfrmInterfaceLabel);
|
||||||
descfrmLabel.add(Contents.SPACE);
|
descfrmLabel.add(Entity.NO_BREAK_SPACE);
|
||||||
descfrmLabel.add(codeLink);
|
descfrmLabel.add(codeLink);
|
||||||
propertyDocTree.add(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
propertyDocTree.add(HtmlTree.DIV(HtmlStyle.block, descfrmLabel));
|
||||||
writer.addInlineComment(property, propertyDocTree);
|
writer.addInlineComment(property, propertyDocTree);
|
||||||
@ -263,7 +262,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
|||||||
}
|
}
|
||||||
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
|
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
|
||||||
label);
|
label);
|
||||||
labelHeading.add(Contents.SPACE);
|
labelHeading.add(Entity.NO_BREAK_SPACE);
|
||||||
labelHeading.add(classLink);
|
labelHeading.add(classLink);
|
||||||
inheritedTree.add(labelHeading);
|
inheritedTree.add(labelHeading);
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,11 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.TypeElement;
|
||||||
|
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -121,7 +122,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
|
|||||||
public Content getPackageHeader(String packageName) {
|
public Content getPackageHeader(String packageName) {
|
||||||
Content heading = HtmlTree.HEADING(Headings.SerializedForm.PACKAGE_HEADING, true,
|
Content heading = HtmlTree.HEADING(Headings.SerializedForm.PACKAGE_HEADING, true,
|
||||||
contents.packageLabel);
|
contents.packageLabel);
|
||||||
heading.add(Contents.SPACE);
|
heading.add(Entity.NO_BREAK_SPACE);
|
||||||
heading.add(packageName);
|
heading.add(packageName);
|
||||||
return heading;
|
return heading;
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,10 @@
|
|||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html;
|
package jdk.javadoc.internal.doclets.formats.html;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Set;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -140,13 +142,13 @@ public class SingleIndexWriter extends AbstractIndexWriter {
|
|||||||
contentTree.add(
|
contentTree.add(
|
||||||
links.createLink(getNameForIndex(unicode),
|
links.createLink(getNameForIndex(unicode),
|
||||||
new StringContent(unicode)));
|
new StringContent(unicode)));
|
||||||
contentTree.add(Contents.SPACE);
|
contentTree.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
contentTree.add(new HtmlTree(HtmlTag.BR));
|
contentTree.add(new HtmlTree(HtmlTag.BR));
|
||||||
contentTree.add(links.createLink(DocPaths.ALLCLASSES_INDEX,
|
contentTree.add(links.createLink(DocPaths.ALLCLASSES_INDEX,
|
||||||
contents.allClassesLabel));
|
contents.allClassesLabel));
|
||||||
if (!configuration.packages.isEmpty()) {
|
if (!configuration.packages.isEmpty()) {
|
||||||
contentTree.add(Contents.SPACE);
|
contentTree.add(Entity.NO_BREAK_SPACE);
|
||||||
contentTree.add(links.createLink(DocPaths.ALLPACKAGES_INDEX,
|
contentTree.add(links.createLink(DocPaths.ALLPACKAGES_INDEX,
|
||||||
contents.allPackagesLabel));
|
contents.allPackagesLabel));
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import java.util.ListIterator;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
|
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
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.HtmlTag;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||||
@ -163,13 +164,13 @@ public class SplitIndexWriter extends AbstractIndexWriter {
|
|||||||
int j = i + 1;
|
int j = i + 1;
|
||||||
contentTree.add(links.createLink(DocPaths.indexN(j),
|
contentTree.add(links.createLink(DocPaths.indexN(j),
|
||||||
new StringContent(indexElements.get(i).toString())));
|
new StringContent(indexElements.get(i).toString())));
|
||||||
contentTree.add(Contents.SPACE);
|
contentTree.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
contentTree.add(new HtmlTree(HtmlTag.BR));
|
contentTree.add(new HtmlTree(HtmlTag.BR));
|
||||||
contentTree.add(links.createLink(pathToRoot.resolve(DocPaths.ALLCLASSES_INDEX),
|
contentTree.add(links.createLink(pathToRoot.resolve(DocPaths.ALLCLASSES_INDEX),
|
||||||
contents.allClassesLabel));
|
contents.allClassesLabel));
|
||||||
if (!configuration.packages.isEmpty()) {
|
if (!configuration.packages.isEmpty()) {
|
||||||
contentTree.add(Contents.SPACE);
|
contentTree.add(Entity.NO_BREAK_SPACE);
|
||||||
contentTree.add(links.createLink(pathToRoot.resolve(DocPaths.ALLPACKAGES_INDEX),
|
contentTree.add(links.createLink(pathToRoot.resolve(DocPaths.ALLPACKAGES_INDEX),
|
||||||
contents.allPackagesLabel));
|
contents.allPackagesLabel));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package jdk.javadoc.internal.doclets.formats.html.markup;
|
||||||
|
|
||||||
|
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Writer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A representation of HTML entities.
|
||||||
|
*/
|
||||||
|
public class Entity extends Content {
|
||||||
|
public static final Entity LESS_THAN = new Entity("<");
|
||||||
|
public static final Entity GREATER_THAN = new Entity(">");
|
||||||
|
public static final Entity AMPERSAND = new Entity("&");
|
||||||
|
public static final Entity NO_BREAK_SPACE = new Entity(" ");
|
||||||
|
public static final Entity ZERO_WIDTH_SPACE = new Entity("​") {
|
||||||
|
@Override
|
||||||
|
public int charCount() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public final String text;
|
||||||
|
|
||||||
|
private Entity(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(Content content) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(CharSequence stringContent) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean write(Writer writer, boolean atNewline) throws IOException {
|
||||||
|
writer.write(text);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int charCount() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escapes the special HTML characters in a given string using the appropriate
|
||||||
|
* entities.
|
||||||
|
*
|
||||||
|
* @param s the string to escape
|
||||||
|
* @return the string with all of the HTML characters escaped
|
||||||
|
*/
|
||||||
|
static String escapeHtmlChars(CharSequence s) {
|
||||||
|
for (int i = 0; i < s.length(); i++) {
|
||||||
|
char ch = s.charAt(i);
|
||||||
|
switch (ch) {
|
||||||
|
// only start building a new string if we need to
|
||||||
|
case '<': case '>': case '&':
|
||||||
|
StringBuilder sb = new StringBuilder(s.subSequence(0, i));
|
||||||
|
escapeHtmlChars(s, i, sb);
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escapes the special HTML characters in a given string using the appropriate
|
||||||
|
* entities, appending the results into a string builder.
|
||||||
|
*
|
||||||
|
* @param s the string
|
||||||
|
* @param sb the string builder
|
||||||
|
*/
|
||||||
|
static void escapeHtmlChars(CharSequence s, StringBuilder sb) {
|
||||||
|
escapeHtmlChars(s, 0, sb);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void escapeHtmlChars(CharSequence s, int start, StringBuilder sb) {
|
||||||
|
for (int i = start ; i < s.length(); i++) {
|
||||||
|
char ch = s.charAt(i);
|
||||||
|
switch (ch) {
|
||||||
|
case '<': sb.append(Entity.LESS_THAN.text); break;
|
||||||
|
case '>': sb.append(Entity.GREATER_THAN.text); break;
|
||||||
|
case '&': sb.append(Entity.AMPERSAND.text); break;
|
||||||
|
default: sb.append(ch); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -47,9 +47,7 @@ public class FixedStringContent extends Content {
|
|||||||
* @param content content for the object
|
* @param content content for the object
|
||||||
*/
|
*/
|
||||||
public FixedStringContent(CharSequence content) {
|
public FixedStringContent(CharSequence content) {
|
||||||
string = needEscape(content)
|
string = Entity.escapeHtmlChars(content);
|
||||||
? escape(content)
|
|
||||||
: content.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,29 +103,4 @@ public class FixedStringContent extends Content {
|
|||||||
return string.endsWith(DocletConstants.NL);
|
return string.endsWith(DocletConstants.NL);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean needEscape(CharSequence cs) {
|
|
||||||
for (int i = 0; i < cs.length(); i++) {
|
|
||||||
switch (cs.charAt(i)) {
|
|
||||||
case '<':
|
|
||||||
case '>':
|
|
||||||
case '&':
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
private String escape(CharSequence s) {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
for (int i = 0; i < s.length(); i++) {
|
|
||||||
char ch = s.charAt(i);
|
|
||||||
switch (ch) {
|
|
||||||
case '<': sb.append("<"); break;
|
|
||||||
case '>': sb.append(">"); break;
|
|
||||||
case '&': sb.append("&"); break;
|
|
||||||
default: sb.append(ch); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public class HtmlTree extends Content {
|
|||||||
public HtmlTree put(HtmlAttr attrName, String attrValue) {
|
public HtmlTree put(HtmlAttr attrName, String attrValue) {
|
||||||
if (attrs.isEmpty())
|
if (attrs.isEmpty())
|
||||||
attrs = new LinkedHashMap<>(3);
|
attrs = new LinkedHashMap<>(3);
|
||||||
attrs.put(nullCheck(attrName), escapeHtmlChars(attrValue));
|
attrs.put(nullCheck(attrName), Entity.escapeHtmlChars(attrValue));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,35 +188,6 @@ public class HtmlTree extends Content {
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Given a string, escape all special HTML characters and
|
|
||||||
* return the result.
|
|
||||||
*
|
|
||||||
* @param s The string to check.
|
|
||||||
* @return the original string with all of the HTML characters escaped.
|
|
||||||
*/
|
|
||||||
private static String escapeHtmlChars(String s) {
|
|
||||||
for (int i = 0; i < s.length(); i++) {
|
|
||||||
char ch = s.charAt(i);
|
|
||||||
switch (ch) {
|
|
||||||
// only start building a new string if we need to
|
|
||||||
case '<': case '>': case '&':
|
|
||||||
StringBuilder sb = new StringBuilder(s.substring(0, i));
|
|
||||||
for ( ; i < s.length(); i++) {
|
|
||||||
ch = s.charAt(i);
|
|
||||||
switch (ch) {
|
|
||||||
case '<': sb.append("<"); break;
|
|
||||||
case '>': sb.append(">"); break;
|
|
||||||
case '&': sb.append("&"); break;
|
|
||||||
default: sb.append(ch); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The sets of ASCII URI characters to be left unencoded.
|
* The sets of ASCII URI characters to be left unencoded.
|
||||||
* See "Uniform Resource Identifier (URI): Generic Syntax"
|
* See "Uniform Resource Identifier (URI): Generic Syntax"
|
||||||
|
@ -429,7 +429,7 @@ public class Navigation {
|
|||||||
}
|
}
|
||||||
if (!listContents.isEmpty()) {
|
if (!listContents.isEmpty()) {
|
||||||
Content li = HtmlTree.LI(contents.summaryLabel);
|
Content li = HtmlTree.LI(contents.summaryLabel);
|
||||||
li.add(Contents.SPACE);
|
li.add(Entity.NO_BREAK_SPACE);
|
||||||
tree.add(li);
|
tree.add(li);
|
||||||
addListToNav(listContents, tree);
|
addListToNav(listContents, tree);
|
||||||
}
|
}
|
||||||
@ -461,7 +461,7 @@ public class Navigation {
|
|||||||
}
|
}
|
||||||
if (!listContents.isEmpty()) {
|
if (!listContents.isEmpty()) {
|
||||||
Content li = HtmlTree.LI(contents.moduleSubNavLabel);
|
Content li = HtmlTree.LI(contents.moduleSubNavLabel);
|
||||||
li.add(Contents.SPACE);
|
li.add(Entity.NO_BREAK_SPACE);
|
||||||
tree.add(li);
|
tree.add(li);
|
||||||
addListToNav(listContents, tree);
|
addListToNav(listContents, tree);
|
||||||
}
|
}
|
||||||
@ -665,7 +665,7 @@ public class Navigation {
|
|||||||
}
|
}
|
||||||
if (!listContents.isEmpty()) {
|
if (!listContents.isEmpty()) {
|
||||||
Content li = HtmlTree.LI(contents.detailLabel);
|
Content li = HtmlTree.LI(contents.detailLabel);
|
||||||
li.add(Contents.SPACE);
|
li.add(Entity.NO_BREAK_SPACE);
|
||||||
tree.add(li);
|
tree.add(li);
|
||||||
addListToNav(listContents, tree);
|
addListToNav(listContents, tree);
|
||||||
}
|
}
|
||||||
@ -801,9 +801,9 @@ public class Navigation {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
for (Content liContent : listContents) {
|
for (Content liContent : listContents) {
|
||||||
if (count < listContents.size() - 1) {
|
if (count < listContents.size() - 1) {
|
||||||
liContent.add(Contents.SPACE);
|
liContent.add(Entity.NO_BREAK_SPACE);
|
||||||
liContent.add("|");
|
liContent.add("|");
|
||||||
liContent.add(Contents.SPACE);
|
liContent.add(Entity.NO_BREAK_SPACE);
|
||||||
}
|
}
|
||||||
tree.add(liContent);
|
tree.add(liContent);
|
||||||
count++;
|
count++;
|
||||||
@ -1005,7 +1005,7 @@ public class Navigation {
|
|||||||
fixedNavDiv.add(queue.poll());
|
fixedNavDiv.add(queue.poll());
|
||||||
fixedNavDiv.add(Position.TOP.endOfNav());
|
fixedNavDiv.add(Position.TOP.endOfNav());
|
||||||
tree.add(fixedNavDiv);
|
tree.add(fixedNavDiv);
|
||||||
HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE);
|
HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Entity.NO_BREAK_SPACE);
|
||||||
tree.add(paddingDiv);
|
tree.add(paddingDiv);
|
||||||
addFixedNavScript(tree);
|
addFixedNavScript(tree);
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,10 +45,6 @@ public class RawHtml extends Content {
|
|||||||
|
|
||||||
private final String rawHtmlContent;
|
private final String rawHtmlContent;
|
||||||
|
|
||||||
public static final Content nbsp = new RawHtml(" ");
|
|
||||||
|
|
||||||
public static final Content zws = new RawHtml("​");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor to construct a RawHtml object.
|
* Constructor to construct a RawHtml object.
|
||||||
*
|
*
|
||||||
|
@ -59,7 +59,7 @@ public class StringContent extends Content {
|
|||||||
*/
|
*/
|
||||||
public StringContent(CharSequence initialContent) {
|
public StringContent(CharSequence initialContent) {
|
||||||
stringContent = new StringBuilder();
|
stringContent = new StringBuilder();
|
||||||
appendChars(initialContent);
|
Entity.escapeHtmlChars(initialContent, stringContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,7 +81,7 @@ public class StringContent extends Content {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(CharSequence strContent) {
|
public void add(CharSequence strContent) {
|
||||||
appendChars(strContent);
|
Entity.escapeHtmlChars(strContent, stringContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -114,16 +114,4 @@ public class StringContent extends Content {
|
|||||||
out.write(s);
|
out.write(s);
|
||||||
return s.endsWith(DocletConstants.NL);
|
return s.endsWith(DocletConstants.NL);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appendChars(CharSequence s) {
|
|
||||||
for (int i = 0; i < s.length(); i++) {
|
|
||||||
char ch = s.charAt(i);
|
|
||||||
switch (ch) {
|
|
||||||
case '<': stringContent.append("<"); break;
|
|
||||||
case '>': stringContent.append(">"); break;
|
|
||||||
case '&': stringContent.append("&"); break;
|
|
||||||
default: stringContent.append(ch); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -531,6 +531,6 @@ public class Table {
|
|||||||
private HtmlTree getCaption(Content title) {
|
private HtmlTree getCaption(Content title) {
|
||||||
return new HtmlTree(HtmlTag.CAPTION,
|
return new HtmlTree(HtmlTag.CAPTION,
|
||||||
HtmlTree.SPAN(title),
|
HtmlTree.SPAN(title),
|
||||||
HtmlTree.SPAN(tabEnd, Contents.SPACE));
|
HtmlTree.SPAN(tabEnd, Entity.NO_BREAK_SPACE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user