< prev index next >

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

Print this page

        

@@ -33,10 +33,11 @@
 import javax.lang.model.element.VariableElement;
 
 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.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;

@@ -94,36 +95,48 @@
     public Content getFieldDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_FIELD_DETAILS);
         Content fieldDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.fieldDetailsLabel);
+        fieldDetailsTree.add(heading);
         fieldDetailsTree.add(links.createAnchor(
                 SectionName.FIELD_DETAIL));
-        fieldDetailsTree.add(heading);
         return fieldDetailsTree;
     }
 
     /**
      * {@inheritDoc}
      */
     @Override
     public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) {
         Content fieldTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
-        heading.add(links.createAnchor(name(field), new StringContent(name(field))));
+        heading.add(name(field));
         fieldTree.add(heading);
+        fieldTree.add(links.createAnchor(name(field)));
         return HtmlTree.SECTION(HtmlStyle.detail, fieldTree);
     }
 
     /**
      * {@inheritDoc}
      */
     @Override
     public Content getSignature(VariableElement field) {
-        return new MemberSignature(field)
-                .addType(field.asType())
-                .toContent();
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(field, pre);
+        addModifiers(field, pre);
+        Content fieldlink = writer.getLink(new LinkInfoImpl(
+                configuration, LinkInfoImpl.Kind.MEMBER, field.asType()));
+        pre.add(fieldlink);
+        pre.add(" ");
+        if (configuration.linksource) {
+            Content fieldName = new StringContent(name(field));
+            writer.addSrcLink(field, fieldName, pre);
+        } else {
+            addName(name(field), pre);
+        }
+        return pre;
     }
 
     /**
      * {@inheritDoc}
      */

@@ -161,12 +174,13 @@
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public Content getFieldDoc(Content fieldTree) {
-        return getMemberTree(fieldTree);
+    public Content getFieldDoc(Content fieldTree,
+            boolean isLastContent) {
+        return getMemberTree(fieldTree, isLastContent);
     }
 
     /**
      * {@inheritDoc}
      */
< prev index next >