コード例 #1
0
 /**
  * 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, int type, Content liNav) {
   AbstractMemberWriter writer = ((AbstractMemberWriter) builder.getMemberSummaryWriter(type));
   if (writer == null) {
     liNav.addContent(getResource(label));
   } else {
     liNav.addContent(
         writer.getNavSummaryLink(null, !builder.getVisibleMemberMap(type).noVisibleMembers()));
   }
 }
コード例 #2
0
 /**
  * Get detail links for the navigation bar.
  *
  * @return the content tree for the detail links
  */
 protected Content getNavDetailLinks() throws Exception {
   Content li = HtmlTree.LI(detailLabel);
   li.addContent(getSpace());
   Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   MemberSummaryBuilder memberSummaryBuilder =
       (MemberSummaryBuilder) configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   AbstractMemberWriter writerField =
       ((AbstractMemberWriter)
           memberSummaryBuilder.getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_FIELDS));
   AbstractMemberWriter writerOptional =
       ((AbstractMemberWriter)
           memberSummaryBuilder.getMemberSummaryWriter(
               VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL));
   AbstractMemberWriter writerRequired =
       ((AbstractMemberWriter)
           memberSummaryBuilder.getMemberSummaryWriter(
               VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED));
   Content liNavField = new HtmlTree(HtmlTag.LI);
   if (writerField != null) {
     writerField.addNavDetailLink(annotationType.fields().length > 0, liNavField);
   } else {
     liNavField.addContent(getResource("doclet.navField"));
   }
   addNavGap(liNavField);
   ulNav.addContent(liNavField);
   if (writerOptional != null) {
     Content liNavOpt = new HtmlTree(HtmlTag.LI);
     writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt);
     ulNav.addContent(liNavOpt);
   } else if (writerRequired != null) {
     Content liNavReq = new HtmlTree(HtmlTag.LI);
     writerRequired.addNavDetailLink(annotationType.elements().length > 0, liNavReq);
     ulNav.addContent(liNavReq);
   } else {
     Content liNav = HtmlTree.LI(getResource("doclet.navAnnotationTypeMember"));
     ulNav.addContent(liNav);
   }
   return ulNav;
 }