Package net.sf.gluebooster.java.booster.basic.container

Examples of net.sf.gluebooster.java.booster.basic.container.BoostedNode


            DocumentationResourcesId.DOCUMENTATION_USER_INSTANCE_DESCRIPTION,
            documentationParent, context);
      }
    } else if (DocumentationResourcesId.DOCUMENTATION_USER_INSTANCE_DESCRIPTION
        .equals(type)) {
      BoostedNode chapter = BookBoostUtils.createChapter(
          documentationParent, "Transformation Graph Description");
      BookBoostUtils
          .createText(
              chapter,
              "The graphic displays an overview of the graph, containing only the top-level-nodes.");
View Full Code Here


      /*Element chapter = */DomBoostUtils.appendElement(doc, parentElement, tag, null, chapterNode.getAttributes().getName());
    }
   
    int chapterCount = 0;
    for (BoostedNode zoomInFocusPoint: chapterNode.getAllZoomInFocus()){
      BoostedNode zoomInNode = chapterNode.getZoomIn(zoomInFocusPoint, null);
      Object type = zoomInNode.getAttributes().getType();
     
      if (DocumentationResourcesId.CHAPTER.equals(type)) {
        BookContext newBookContext = (BookContext) bookContext.clone();
        newBookContext.setChapterBreadcrumb(Arrays.copyOf(newBookContext.getChapterBreadcrumb(), newBookContext.getChapterBreadcrumb().length + 1) );
        newBookContext.getChapterBreadcrumb()[bookContext.getChapterBreadcrumb().length] = chapterCount++;
        fillBookChapter(zoomInNode, newBookContext, doc, parentElement, true);
      }else if (HTML.Tag.DIV.equals(type)){
         Element div = DomBoostUtils.appendElement(doc, parentElement, HTML.Tag.DIV);
         fillBookChapter(zoomInNode, bookContext, doc, div, false);
      } else if (TextBoostUtils.TEXT.equals(type)) {
        DomBoostUtils.appendText(doc, parentElement, zoomInNode.getAttributes().getValue());
      }else if (GeneralConstants.RAW.equals(type)){
        DomBoostUtils.appendRaw(doc, parentElement, zoomInNode.getAttributes().getValue());
      }else if (GuiBoostUtils.TYPE_IMAGE.equals(type)){

        String filename = (String) zoomInNode.getAttributes()
            .getFromAttributes(ScriptEngine.FILENAME);
        if (filename == null) {
          ThreadBoostUtils.sleep(2);// to get a new time
          filename = "images/file"
              + System.currentTimeMillis()
              + "."
              + zoomInNode.getAttributes().getFromAttributes(
                  GeneralConstants.FORMAT);
          zoomInNode.getAttributes().setAttribute(
              ScriptEngine.FILENAME, filename);
        }

        Element img = DomBoostUtils.appendElement(doc, parentElement,
            HTML.Tag.IMG, ContainerBoostUtils.createMap(
                HTML.Attribute.SRC,
"../"
                + filename));// the
                                        // ..
                                        // because
                                        // the
                                        // book
                                        // is
                                        // in
                                        // a
                                        // separate
                                        // subdirectory.
                                        // Go
                                        // up
                                        // to
                                        // the
                                        // main
        DocumentationContext documentationContext = getDocumentationContext(zoomInNode);
        String documentationTargetDirname = (String) documentationContext
            .getFromAttributesMap(DocumentationContext.DOCUMENTATION_TARGET_PARAMETER);
        if (documentationTargetDirname == null)
          throw new IllegalStateException(
              "no documentationTargetDirname");

        File documentationTargetDir = new File(
            documentationTargetDirname);

        if (filename == null)
          throw new IllegalStateException("no filename");

        FileUtils.writeByteArrayToFile(new File(documentationTargetDir,
            filename), (byte[]) zoomInNode.getAttributes()
            .getValue());
       
      }else {
        warningHandler.handleThrowable(new UnsupportedDataTypeException("type " + type ));
      }
View Full Code Here

public void fillDocumentation(Object type, BoostedNode documentationRoot,
    DocumentationContext context) {
 
    if (DocumentationResourcesId.DOCUMENTATION_TECHNICAL
        .equals(type)) {
    BoostedNode div = BookBoostUtils.createDiv(documentationRoot);
    BookBoostUtils.createText(div, "The class that fetches the resource is " + resourceGettingClass.getSimpleName() + ". The resource is '" + resourceName + "'");
  }
 
 
}
View Full Code Here

      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)
View Full Code Here

      if (context.getDocumentationTarget() == null)
        context.setDefaultDocumentationTarget();
    }

   
    BoostedNode root = createSoftwareDocumentationSlipcase(content, context, closeRoot);
    if (closeRoot)
      root.close();
   
    log.debug("beginn creating documentation ended");
    return root;
   
    
View Full Code Here

  public static BoostedNode createSoftwareDocumentationSlipcase(HasDocumentation content, DocumentationContext context, boolean close) throws Exception{

    log.debug("createSoftwareDocumentationSlipcase");
    ChangeListener listener = (ChangeListener) context.getAttributes().getAttributes().get(ChangeListener.class);
   
    BoostedNode slipcase = createSlipcase(
        null,
        listener,
        getDocumentationResourcesTranslation(context,
            DocumentationResourcesId.SOFTWARE_DOCUMENTATION));
    
    for (Object documentationType: SOFTWARE_DOCUMENTATION_TYPES){
      log.debug("creating book " , documentationType);
      BoostedNode bookNode = newZoomInBook(slipcase, documentationType, content, context, listener, close);
      context.getDocumentationTypeMap(documentationType, true).put(
          BookBoostUtils.BOOK, bookNode);
     
     
      if (context.getAttributes().getFromAttributes(DocumentationContext.DOCUMENTATION_CONTENT_GENERATORS) != null){
View Full Code Here

      DocumentationContext context, ChangeListener listener,
      boolean closeRoot) throws Exception {

    Check.notNull(context.getLocale(), "context.locale");

    BoostedNode book = BoostedNodeUtils
        .createZoomInNode(
            parent,
            listener,
            getDocumentationResourcesTranslation(context,
                documentationType), null);
    book.getAttributes().setType(BookBoostUtils.BOOK);
    //book.getAttributes().setName(getDocumentationResourcesTranslation(context).getString(documentationType.toString()));
    //todo create heading, title, etc.
   
    // if (DocumentationResourcesId.DOCUMENTATION_DEVELOPER
    // .equals(documentationType)) {
    // createDiv(book,
    // "The application may be created using the following steps.");
    // }
    
    content.fillDocumentation(documentationType, book, context);
    //todo create index etc
    if (closeRoot)
      book.close();//the book is complete
   
    return book;
    
  }
View Full Code Here

   *
   * @return the created slipcase node.
   */
  @SuppressWarnings("unchecked")
  public static BoostedNode createSlipcase(BoostedNode parent, ChangeListener listener, Object name){
    BoostedNode slipcase = BoostedNodeUtils.createZoomInNode(parent, listener, name, null);
   
    slipcase.getAttributes().setType(SLIPCASE);
    //slipcase.getAttributes().setName(name);
   
    return slipcase;
  }
View Full Code Here

   *
   * @return the created book node.
   */
  @SuppressWarnings("unchecked")
  public static BoostedNode createBook(BoostedNode parent, ChangeListener listener, Object name){
    BoostedNode slipcase = BoostedNodeUtils.createZoomInNode(parent, listener, name, null);
   
    slipcase.getAttributes().setType(BOOK);
    //slipcase.getAttributes().setName(name);
   
    return slipcase;
 
View Full Code Here

  @SuppressWarnings("unchecked")
  public static BoostedNode createChapter(BoostedNode parent, Object name, BoostedNode addBeforeThisPoint){
    Check.notNull(parent, "parent");
    Check.notNull(name, "name");

    BoostedNode chapter = BoostedNodeUtils.createZoomInNodeUseParentListener(parent, name, addBeforeThisPoint);
   
    chapter.getAttributes().setType(DocumentationResourcesId.CHAPTER);
    //chapter.getAttributes().setName(name);
   
    return chapter;
  }
View Full Code Here

TOP

Related Classes of net.sf.gluebooster.java.booster.basic.container.BoostedNode

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.