Package jp.aonir.fuzzyxml.internal

Examples of jp.aonir.fuzzyxml.internal.RenderContext


    _idToNodeMap = new HashMap<String, FuzzyXMLNode>();
    _nodeToIDMap = new HashMap<FuzzyXMLNode, String>();

    try {
      WodParserCache cache = _editor.getParserCache();
      RenderContext renderContext = new RenderContext(true);
      FuzzyXMLElement documentElement = _doc.getDocumentElement();
      StringBuffer documentContentsBuffer = new StringBuffer();
      renderHeader(documentContentsBuffer);
      renderElement(documentElement, renderContext, documentContentsBuffer, cache);
      renderFooter(documentContentsBuffer);
View Full Code Here


    String documentContents = editDocument.get();

    try {
      WodParserCache cache = ((TemplateEditor) _editorInteraction.getHtmlDocumentProvider()).getSourceEditor().getParserCache();
      FuzzyXMLDocument htmlDocument = cache.getHtmlEntry().getModel();
      RenderContext renderContext = new RenderContext(true);
      renderContext.setDelegate(new PreviewRenderDelegate(cache));
      FuzzyXMLElement documentElement = htmlDocument.getDocumentElement();
      documentContents = documentElement.toXMLString(renderContext);
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

        return sb.toString();
      }
    }

    if (element.getChildren().length == 0) {
      sb.append(element.toXMLString(new RenderContext(true)));
    }
    else {
      sb.append(element2startTag(element));
      FuzzyXMLNode[] node = element.getChildren();
      for (int i = 0; i < node.length; i++) {
        if (node[i] instanceof FuzzyXMLElement) {
          sb.append(processElement((FuzzyXMLElement) node[i], info));
        }
        else {
          sb.append(node[i].toXMLString(new RenderContext(true)));
        }
      }
      sb.append(element2closeTag(element));
    }
View Full Code Here

          assertOnlyAttribute(woElement2, "name", "AnotherWO");
        }
        assertText(divElement, 1, "this is a div");
      }
    }
    RenderContext renderContext = new RenderContext(true);
    String xml = docElement.toXMLString(renderContext);
    assertEquals("<document><div id=\"<webobject name=SomeWO/>\" class=\"<webobject name=AnotherWO/>\">this is a div</div></document>", xml);
  }
View Full Code Here

      FuzzyXMLElement preElement = docElement.getChildElement(0);
      assertChildCount(preElement, 2);
      assertText(preElement, 0, "This is inside\nof a pre-tag.");
      assertText(preElement, 1, "Another.");
    }
    RenderContext renderContext = new RenderContext(true);
    String xml = docElement.toXMLString(renderContext);
    assertEquals("<document><pre>This is inside\nof a pre-tag.<br/>Another.</pre></document>", xml); // MS: How the heck is this possible?  Where did the <br/> go??!
  }
View Full Code Here

        String xmlString = xmlDocument.get();
        FuzzyXMLDocument htmlModel = new FuzzyXMLParser(false, false).parse(xmlString);
        FuzzyXMLElement documentElement = htmlModel.getDocumentElement();

        IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
        RenderContext renderContext = new RenderContext(true);
        renderContext.setShowNewlines(true);
        renderContext.setIndentSize(prefs.getInt(PreferenceConstants.INDENT_SIZE));
        renderContext.setIndentTabs(prefs.getBoolean(PreferenceConstants.INDENT_TABS));
        renderContext.setTrim(true);
        renderContext.setLowercaseAttributes(prefs.getBoolean(PreferenceConstants.LOWERCASE_ATTRIBUTES));
        renderContext.setLowercaseTags(prefs.getBoolean(PreferenceConstants.LOWERCASE_TAGS));
        renderContext.setSpacesAroundEquals(prefs.getBoolean(PreferenceConstants.SPACES_AROUND_EQUALS));
        renderContext.setSpaceInEmptyTags(true);
        renderContext.setAddMissingQuotes(true);
        renderContext.setDelegate(new WOHTMLRenderDelegate(prefs.getBoolean(PreferenceConstants.STICKY_WOTAGS)));

        StringBuffer xmlBuffer = new StringBuffer();
        FuzzyXMLDocType docType = htmlModel.getDocumentType();
        if (docType != null) {
          docType.toXMLString(renderContext, xmlBuffer);
View Full Code Here

      }
      else if (children[i] instanceof FuzzyXMLElement) {
        sb.append(JSPPreviewConverter.processElement((FuzzyXMLElement) children[i], info));
      }
      else {
        sb.append(children[i].toXMLString(new RenderContext(true)));
      }
    }
    return sb.toString();
  }
View Full Code Here

      FuzzyXMLDocument htmlModel = _cache.getHtmlEntry().getModel();
      FuzzyXMLElement documentElement = htmlModel.getDocumentElement();
      IDocument htmlDocument = _cache.getHtmlEntry().getDocument();

      IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
      RenderContext renderContext = new RenderContext(true);
      renderContext.setShowNewlines(true);
      renderContext.setIndentSize(prefs.getInt(PreferenceConstants.INDENT_SIZE));
      renderContext.setIndentTabs(prefs.getBoolean(PreferenceConstants.INDENT_TABS));
      renderContext.setTrim(true);
      renderContext.setLowercaseAttributes(prefs.getBoolean(PreferenceConstants.LOWERCASE_ATTRIBUTES));
      renderContext.setLowercaseTags(prefs.getBoolean(PreferenceConstants.LOWERCASE_TAGS));
      renderContext.setSpacesAroundEquals(prefs.getBoolean(PreferenceConstants.SPACES_AROUND_EQUALS));
      renderContext.setSpaceInEmptyTags(true);
      renderContext.setAddMissingQuotes(true);
      renderContext.setDelegate(new WOHTMLRenderDelegate(prefs.getBoolean(PreferenceConstants.STICKY_WOTAGS)));

      StringBuffer htmlBuffer = new StringBuffer();
      FuzzyXMLDocType docType = htmlModel.getDocumentType();
      for (FuzzyXMLNode node : documentElement.getChildren()) {
        if (docType != null) {
View Full Code Here

TOP

Related Classes of jp.aonir.fuzzyxml.internal.RenderContext

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.