Package com.sun.tools.doclets.formats.html

Examples of com.sun.tools.doclets.formats.html.HtmlDocletWriter


  @Override
  protected void generateOtherFiles(RootDoc rootDoc, ClassTree classTree)
      throws Exception {
    super.generateOtherFiles(rootDoc, classTree);
    HtmlDocletWriter writer = new HtmlDocletWriter(configuration, "jsdoc.html");

    writer.html();
    writer.head();
    writer.link("rel='stylesheet' type='text/css' href='jsdoc.css'");
    writer.headEnd();
    writer.body("white", true);

    writer.h1("Exported JavaScript-API: Index of Classes");
    writer.ul();
   
    ClassDoc[] classes = rootDoc.classes();
    Arrays.sort(classes);
    for (ClassDoc clz : classes) {
      if (isExportable(clz) && hasMethods(clz) && ! isExportedClosure(clz.methods()[0])) {
        String className = getExportedName(clz, false);
        writer.li();
        writer.println("<a href=#" + className + ">" + className + "</a>");
      }
    }
    writer.ulEnd();
   
    for (ClassDoc clz : classes) {
      if (isExportable(clz) && hasMethods(clz) && ! isExportedClosure(clz.methods()[0])) {
        String className = getExportedName(clz, false);
        writer.h2("<div id=" + className + ">"+ getExportedPackage(clz) + "." + className + "</div>");
        writer.println("<div class=jsdocText>" + filter(clz.commentText()) + "</div>");
        writer.table(1, "100%", 0, 0);

        boolean firstcon = true;
        for (ConstructorDoc cd : clz.constructors()) {
          if (isExportable(cd)) {
            if (firstcon) {
              writer.tr();
              writer.tdColspanBgcolorStyle(2, "", "jsdocHeader");
              writer.print("Constructors");
              firstcon = false;
              writer.tdEnd();
              writer.trEnd();
            }
            writer.tr();
            writer.tdVAlignClass("top", "jsdocRetType");
            writer.print("&nbsp");
            writer.tdEnd();
            writer.tdVAlignClass("top", "jsdocMethod");
            writer.print("<span class=jsdocMethodName>" + cd.name() + "</span>(");
            writeParameters(writer, cd.parameters());
            writer.print(")");
            writer.br();
            writer.print("<span class=jsdocComment>"
                + filter(cd.commentText()) + "</span>");

            writer.tdEnd();
            writer.trEnd();
          }
        }
       
        firstcon = true;
        for (MethodDoc cd : clz.methods()) {
          if (isExportable(cd)) {
            if (firstcon) {
              writer.tr();
              writer.tdColspanBgcolorStyle(2, "", "jsdocHeader");
              writer.print("Methods");
              firstcon = false;
              writer.tdEnd();
              writer.trEnd();
            }
            writer.tr();
            writer.tdVAlignClass("top", "jsdocRetType");
            writer.print(getExportedName(cd.returnType(), true));

            writer.tdEnd();
            writer.tdVAlignClass("top", "jsdocMethod");
            writer.print(
                "<b class=jsdocMethodName>" + getExportedName(cd) + "</b>"
                    + "(");
            writeParameters(writer, cd.parameters());
            writer.print(")");
            writer.br();
            writer.print("<span class=jsdocComment>"
                + filter(cd.commentText()) + "</span>");
            writer.tdEnd();
            writer.trEnd();
          }
        }

        writer.tableEnd();
        writer.br();
        writer.hr();
      }
    }
    writer.bodyEnd();
    writer.htmlEnd();
    writer.flush();
    writer.close();
    generateGss(rootDoc, classTree);
    generateGssWiki(rootDoc, classTree);
  }
View Full Code Here


    return false;
  }

  protected void generateGss(RootDoc rootDoc, ClassTree classTree)
      throws Exception {
    final HtmlDocletWriter writer = new HtmlDocletWriter(configuration,
        "gssdoc.html");
    GssDocGenerator gss = new GssDocGenerator() {
      @Override
      protected void p(String str) {
        writer.write(str);
      }
    };
    gss.generateGssDocs();
    writer.flush();
    writer.close();
  }
View Full Code Here

    writer.close();
  }

  protected void generateGssWiki(RootDoc rootDoc, ClassTree classTree)
      throws Exception {
    final HtmlDocletWriter writer = new HtmlDocletWriter(configuration,
        "gssdoc.wiki");
    GssWikiDocGenerator gss = new GssWikiDocGenerator() {
      @Override
      protected void p(String str) {
        writer.write(str);
      }
    };
    gss.generateGssDocs();
    writer.flush();
    writer.close();
  }
View Full Code Here

  @Override
  protected void generateOtherFiles(RootDoc rootDoc, ClassTree classTree)
      throws Exception {
    super.generateOtherFiles(rootDoc, classTree);
    HtmlDocletWriter writer = new HtmlDocletWriter(configuration, "jsdoc.html");

    writer.html();
    writer.body("white", true);
    for (ClassDoc clz : rootDoc.classes()) {
      if (isExportable(clz)) {
        int countExportedMethods = 0;
        for (ConstructorDoc cd : clz.constructors()) {
          if (isExportable(cd)) {
            countExportedMethods++;
          }
        }

        for (MethodDoc md : clz.methods()) {
          if (isExportable(md)) {
            countExportedMethods++;
          }
        }

        if (countExportedMethods == 0 || isExportedClosure(clz.methods()[0])) {
          continue;
        }

        writer.h3("Package: " + getExportedPackage(clz));
        writer.h2("Class " + getExportedName(clz));
        writer.println(filter(clz.commentText()));
        writer.br();
        writer.br();

        writer.table(1, "100%", 0, 0);

        boolean firstcon = true;

        for (ConstructorDoc cd : clz.constructors()) {
          if (isExportable(cd)) {
            if (firstcon) {
              writer.tr();
              writer.tdColspanBgcolorStyle(2, "lightblue", "jsdocHeader");
              writer.print("Constructors");
              firstcon = false;
              writer.tdEnd();
              writer.trEnd();
            }
            writer.tr();
            writer.td();
            writer.tdEnd();
            writer.tdVAlignClass("top", "jsdocMethod");
            writer.print("<b class=jsdocMethodName>" + cd.name() + "</b>(");
            writeParameters(writer, cd.parameters());
            writer.print(")");
            writer.br();
            writer.print("&nbsp;&nbsp;&nbsp;&nbsp;<span class=jsdocComment>"
                + filter(cd.commentText()) + "</span>");

            writer.tdEnd();
            writer.trEnd();
          }
        }

        for (MethodDoc cd : clz.methods()) {
          if (isExportable(cd)) {
            if (firstcon) {
              writer.tr();
              writer.tdColspanBgcolorStyle(2, "lightblue", "jsdocHeader");
              writer.print("Methods");
              firstcon = false;
              writer.tdEnd();
              writer.trEnd();
            }
            writer.tr();
            writer.tdVAlignClass("top", "jsdocRetType");
            writer.print(getExportedName(cd.returnType()));
            writer.tdEnd();
            writer.tdVAlignClass("top", "jsdocMethod");
            writer.print(
                "<b class=jsdocMethodName>" + getExportedName(cd) + "</b>"
                    + "(");
            writeParameters(writer, cd.parameters());
            writer.print(")");
            writer.br();
            writer.print("&nbsp;&nbsp;&nbsp;&nbsp;<span class=jsdocComment>"
                + filter(cd.commentText()) + "</span>");
            writer.tdEnd();
            writer.trEnd();
          }
        }

        writer.tableEnd();
        writer.br();
        writer.hr();
      }
    }
    writer.bodyEnd();
    writer.htmlEnd();
    writer.flush();
    writer.close();
  }
View Full Code Here

    super(configuration, getWriter(configuration, jaxbClass), jaxbClass);
  }

  private static HtmlDocletWriter getWriter(JAXConfiguration configuration, JAXBClass jaxbClass) {
    try {
      return new HtmlDocletWriter(configuration.parentConfiguration, Utils.classToPath(jaxbClass), jaxbClass.getShortClassName() + ".html",
          Utils.classToRoot(jaxbClass));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    this.registry = registry;
  }

  private static HtmlDocletWriter getWriter(JAXConfiguration configuration) {
    try {
      return new HtmlDocletWriter(configuration.parentConfiguration, "", "index.html", "");
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    this.registry = registry;
  }

  private static HtmlDocletWriter getWriter(JAXConfiguration configuration) {
    try {
      return new HtmlDocletWriter(configuration.parentConfiguration, "", "package-list", "");
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    this.registry = registry;
  }

  private static HtmlDocletWriter getWriter(JAXConfiguration configuration) {
    try {
      return new HtmlDocletWriter(configuration.parentConfiguration, "", "graph-data.js", "");
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    this.registry = registry;
  }

  private static HtmlDocletWriter getWriter(JAXConfiguration configuration) {
    try {
      return new HtmlDocletWriter(configuration.parentConfiguration, "", "index.html", "");
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    super(configuration, getWriter(configuration));
  }

  private static HtmlDocletWriter getWriter(JAXConfiguration configuration) {
    try {
      return new HtmlDocletWriter(configuration.parentConfiguration, "", "graph.html", "");
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.sun.tools.doclets.formats.html.HtmlDocletWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.