< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java

Print this page

        

@@ -30,10 +30,11 @@
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.element.VariableElement;
 
 import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
 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.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;

@@ -90,13 +91,13 @@
             Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_ENUM_CONSTANT_DETAILS);
         Content enumConstantsDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.enumConstantDetailLabel);
+        enumConstantsDetailsTree.add(heading);
         enumConstantsDetailsTree.add(links.createAnchor(
                 SectionName.ENUM_CONSTANT_DETAIL));
-        enumConstantsDetailsTree.add(heading);
         return enumConstantsDetailsTree;
     }
 
     /**
      * {@inheritDoc}

@@ -104,23 +105,35 @@
     @Override
     public Content getEnumConstantsTreeHeader(VariableElement enumConstant,
             Content enumConstantsDetailsTree) {
         Content enumConstantsTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
-        heading.add(links.createAnchor(name(enumConstant), new StringContent(name(enumConstant))));
+        heading.add(name(enumConstant));
         enumConstantsTree.add(heading);
+        enumConstantsTree.add(links.createAnchor(name(enumConstant)));
         return HtmlTree.SECTION(HtmlStyle.detail, enumConstantsTree);
     }
 
     /**
      * {@inheritDoc}
      */
     @Override
     public Content getSignature(VariableElement enumConstant) {
-        return new MemberSignature(enumConstant)
-                .addType(enumConstant.asType())
-                .toContent();
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(enumConstant, pre);
+        addModifiers(enumConstant, pre);
+        Content enumConstantLink = writer.getLink(new LinkInfoImpl(
+                configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.asType()));
+        pre.add(enumConstantLink);
+        pre.add(" ");
+        if (configuration.linksource) {
+            Content enumConstantName = new StringContent(name(enumConstant));
+            writer.addSrcLink(enumConstant, enumConstantName, pre);
+        } else {
+            addName(name(enumConstant), pre);
+        }
+        return pre;
     }
 
     /**
      * {@inheritDoc}
      */

@@ -158,12 +171,13 @@
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public Content getEnumConstants(Content enumConstantsTree) {
-        return getMemberTree(enumConstantsTree);
+    public Content getEnumConstants(Content enumConstantsTree,
+            boolean isLastContent) {
+        return getMemberTree(enumConstantsTree, isLastContent);
     }
 
     /**
      * {@inheritDoc}
      */
< prev index next >