Examples of DocumentationContext


Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

    if (BookBoostUtils.BOOK.equals(type) || BookBoostUtils.SLIPCASE.equals(type)
        || BookBoostUtils.BOOKSHELF.equals(type)) {
      // these types may have separate files or directories.

      DocumentationContext docContext = getDocumentationContext(documentationNode);

      File file = docContext.getFromAttributesMap(File.class);

      if (file == null) {

        BoostedNode parent = documentationNode.getZoomOut(null)
            .getLeft();
        if (parent == null) {
          String filename = (String) context
              .getFromAttributesMap(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
          if (filename == null)
            throw new IllegalStateException(
                "No filename in documentation context for key "
                    + DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
          Object name = documentationNode.getAttributes().getName();
          if (name == null)
            throw new IllegalStateException(
                "Name not defined in node of type " + type);
          file = new File(filename, name.toString());
        } else {
          setOutputFile(parent);
          file = getDocumentationContext(parent)
              .getFromAttributesMap(File.class);
          Object name = documentationNode.getAttributes().getName();
          if (name == null)
            throw new IllegalStateException(
                "Name not defined in node of type " + type);
          file = new File(file, name.toString()); // todo
                              // internationalization?
        }

        docContext.getAttributes().getAttributes().put(File.class, file);
      }

    }

  }
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

   * @return the context
   */
  @SuppressWarnings("unchecked")
  private DocumentationContext getDocumentationContext(
      BoostedNode documentationNode) throws Exception {
    DocumentationContext docContext = (DocumentationContext) documentationNode
        .getAttributes().getFromAttributes(HtmlDocumentationWriter.class);
    if (docContext == null) {
      docContext = (DocumentationContext) context.clone(); //use the default context
      documentationNode.getAttributes().getAttributes()
          .put(HtmlDocumentationWriter.class, docContext);
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

  }


  @Override
  public void createDocumentation() throws Exception {
    DocumentationContext documentationContext = new DocumentationContext();
    documentationContext.setLocale(Locale.GERMAN);
    documentationContext.setDocumentationTarget(SwingBoostUtils
        .chooseDirectory("Parent directory of software documentation",
            true).getCanonicalPath());

    SoftwareDocumentationBoostUtils.createSoftwareDocumentation(this,
        documentationContext, true, true);
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

  }

  public void createDocumentation(HasDocumentation toBeDocumented,
      File directory) throws Exception {

      DocumentationContext documentationContext = new DocumentationContext();
      documentationContext.setLocale(Locale.ENGLISH);
      File englishDocumentationDirectory = new File(directory,"english");
      documentationContext.setDocumentationTarget(englishDocumentationDirectory.getCanonicalPath());
      SoftwareDocumentationBoostUtils.createSoftwareDocumentation(
          toBeDocumented, documentationContext, true, true);
      checkCreatedDocumentation(englishDocumentationDirectory,
          documentationContext.getLocale());

      documentationContext = new DocumentationContext();
      documentationContext.setLocale(Locale.GERMAN);
      File germanDocumentationDirectory = new File(directory,"deutsch");
      documentationContext.setDocumentationTarget(germanDocumentationDirectory.getCanonicalPath());
      SoftwareDocumentationBoostUtils.createSoftwareDocumentation(
          toBeDocumented, documentationContext, true, true);

      getLog().debug("created documentation in ", directory);
      checkCreatedDocumentation(germanDocumentationDirectory,
          documentationContext.getLocale());
  }
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

    JFrame frame = (JFrame) graph[0];
    JButton stepButton = (JButton) graph[1];
    TransformationGraph trafo = (TransformationGraph) graph[2];

    File docuDir = createTempDirectory("sampleGraph");
    DocumentationContext context = DocumentationContext
        .createDefaultHtmlContext(docuDir.getCanonicalPath(),
            Locale.ENGLISH);
    BoostedNode bookNode = SoftwareDocumentationBoostUtils
        .newZoomInBook(
            DocumentationResourcesId.DOCUMENTATION_USER_INSTANCE_DESCRIPTION,
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

  @Test
  public void testWriting() throws Exception{
    String ROOT = "root";
   
    MemoryResourceSystem resources = new MemoryResourceSystem();
    DocumentationContext documentationContext = new DocumentationContext();
    documentationContext.setLocale(Locale.GERMAN);
    documentationContext.setAttribute(ResourceSystem.class, resources);
    documentationContext.setAttribute(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER, ROOT);
   
    SoftwareDocumentationBoostUtils.createSoftwareDocumentation(this,
        documentationContext, true, true);
    
    //check whether a h2 is present (the chapter hierarchy is ok)
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

                    DocumentationResourcesId.DOCUMENTATION_DEVELOPER)
            + "/index.html");
  }

  private static DocumentationContext createDocumentationContext(Locale locale) {
    DocumentationContext context = new DocumentationContext();
    context.setLocale(locale);
    return context;
  }
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

    // Store the documentation in this directory
    File docuDir = createTempDirectory("SoftwareDocuBook1");

    // Create the documentation
    DocumentationContext context = DocumentationContext
        .createDefaultHtmlContext(docuDir.getCanonicalPath(),
            Locale.ENGLISH);
    BoostedNode bookNode = SoftwareDocumentationBoostUtils
        .newZoomInBook(
            DocumentationResourcesId.DOCUMENTATION_USER_INSTANCE_DESCRIPTION,
View Full Code Here

Examples of net.sf.gluebooster.java.booster.basic.meta.DocumentationContext

                + "/index.html'>English documentation</a></h1><h1><a href='"
                + GERMAN
                + "/index.html'>Deutsche Dokumentation</a></h1></body></html>");

    // [gb:useInDocumentation]
    DocumentationContext documentationContext = new DocumentationContext();
    documentationContext.setLocale(Locale.ENGLISH);
    File englishDocumentationDirectory = new File(directory, ENGLISH);
    documentationContext
        .setDocumentationTarget(englishDocumentationDirectory
            .getCanonicalPath());
    BoostedNode slipcase = SoftwareDocumentationBoostUtils
        .createSoftwareDocumentation(
        toBeDocumented, documentationContext, true, true);
    // [/gb:useInDocumentation]
    FileUtils
        .write(new File(englishDocumentationDirectory, "index.html"),
            "<html><body><h1><a href='"
            + slipcase.getAttributes().getName()
            + "/index.html'>index</a></h1><h1></body></html>");

    // [gb:useInDocumentation]
    documentationContext = new DocumentationContext();
    documentationContext.setLocale(Locale.GERMAN);
    File germanDocumentationDirectory = new File(directory, GERMAN);
    documentationContext
        .setDocumentationTarget(germanDocumentationDirectory
            .getCanonicalPath());
    slipcase = SoftwareDocumentationBoostUtils.createSoftwareDocumentation(
        toBeDocumented, documentationContext, true, true);
    // [/gb:useInDocumentation]
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.