Package org.eclipse.wst.sse.core.internal.format

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatter


    return fInstance;
  }

  protected IStructuredFormatter createFormatter(Node node,
      IStructuredFormatPreferences formatPreferences) {
    IStructuredFormatter formatter = null;

    switch (node.getNodeType()) {
    case Node.ELEMENT_NODE:
      formatter = new HTMLElementFormatterForPhpCode();
      break;
    case Node.TEXT_NODE:
      if (isEmbeddedCSS(node)) {
        formatter = new EmbeddedCSSFormatterForPhpCode();
      } else {
        formatter = new HTMLTextFormatterForPhpCode();
      }
      break;
    default:
      formatter = new HTMLFormatter();
      break;
    }

    // init FormatPreferences
    formatter.setFormatPreferences(formatPreferences);

    return formatter;
  }
View Full Code Here


      if (insertBreak && canInsertBreakBefore(child)) {
        insertBreakBefore(child, contraints);
      }

      IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
          .getInstance().createFormatter(child,
              getFormatPreferences());
      if (formatter != null) {
        if (formatter instanceof HTMLFormatter) {
          HTMLFormatterNoPHP htmlFormatter = (HTMLFormatterNoPHP) formatter;
          htmlFormatter.formatNode(child, contraints);
        } else {
          formatter.format(child);
        }
      }

      if (canInsertBreakAfter(child)) {
        insertBreakAfter(child, contraints);
View Full Code Here

      // use parent indent for the end tag
      spaces = getBreakSpaces(parent);
    } else if (next.getNodeType() == Node.TEXT_NODE) {
      if (contraints != null && contraints.getFormatWithSiblingIndent()) {
        IDOMNode text = (IDOMNode) next;
        IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
            .getInstance().createFormatter(text,
                getFormatPreferences());
        if (formatter instanceof HTMLTextFormatterNoPHP) {
          HTMLTextFormatterNoPHP textFormatter = (HTMLTextFormatterNoPHP) formatter;
          textFormatter.formatText(text, contraints,
View Full Code Here

    String spaces = null;
    if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
      if (contraints != null && contraints.getFormatWithSiblingIndent()) {
        IDOMNode text = (IDOMNode) prev;
        IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
            .getInstance().createFormatter(text,
                getFormatPreferences());
        if (formatter instanceof HTMLTextFormatterNoPHP) {
          HTMLTextFormatterNoPHP textFormatter = (HTMLTextFormatterNoPHP) formatter;
          textFormatter.formatText(text, contraints,
View Full Code Here

      if (insertBreak && canInsertBreakBefore(child)) {
        insertBreakBefore(child, contraints);
      }

      IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
          .getInstance().createFormatter(child,
              getFormatPreferences());
      if (formatter != null) {
        if (formatter instanceof HTMLFormatterNoPHP) {
          HTMLFormatterNoPHP htmlFormatter = (HTMLFormatterNoPHP) formatter;
          htmlFormatter.formatNode(child, contraints);
        } else {
          formatter.format(child);
        }
      }

      if (canInsertBreakAfter(child)) {
        insertBreakAfter(child, contraints);
View Full Code Here

      // use parent indent for the end tag
      spaces = getBreakSpaces(parent);
    } else if (next.getNodeType() == Node.TEXT_NODE) {
      if (contraints != null && contraints.getFormatWithSiblingIndent()) {
        IDOMNode text = (IDOMNode) next;
        IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
            .getInstance().createFormatter(text,
                getFormatPreferences());
        if (formatter instanceof HTMLTextFormatterNoPHP) {
          HTMLTextFormatterNoPHP textFormatter = (HTMLTextFormatterNoPHP) formatter;
          textFormatter.formatText(text, contraints,
View Full Code Here

    String spaces = null;
    if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
      if (contraints != null && contraints.getFormatWithSiblingIndent()) {
        IDOMNode text = (IDOMNode) prev;
        IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
            .getInstance().createFormatter(text,
                getFormatPreferences());
        if (formatter instanceof HTMLTextFormatterNoPHP) {
          HTMLTextFormatterNoPHP textFormatter = (HTMLTextFormatterNoPHP) formatter;
          textFormatter.formatText(text, contraints,
View Full Code Here

    return fInstance;
  }

  public IStructuredFormatter createFormatter(Node node,
      IStructuredFormatPreferences formatPreferences) {
    IStructuredFormatter formatter = null;

    switch (node.getNodeType()) {
    case Node.ELEMENT_NODE:
      if (node instanceof ElementImplForPhp
          && ((ElementImplForPhp) node).isPhpTag()) {
        formatter = new PhpFormatter(start, length);

      } else {
        formatter = new HTMLElementFormatterNoPHP();
      }

      break;
    case Node.TEXT_NODE:
      if (isEmbeddedCSS(node)) {
        formatter = new EmbeddedCSSFormatterNoPHP();
      } else {
        formatter = new HTMLTextFormatterNoPHP();
      }
      break;
    default:
      formatter = new HTMLFormatterNoPHP();
      break;
    }

    // init FormatPreferences
    formatter.setFormatPreferences(formatPreferences);

    return formatter;
  }
View Full Code Here

      if (insertBreak && canInsertBreakBefore(child)) {
        insertBreakBefore(child, contraints);
      }

      IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
          .getInstance().createFormatter(child,
              getFormatPreferences());
      if (formatter != null) {
        if (formatter instanceof HTMLFormatterNoPHP) {
          HTMLFormatterNoPHP htmlFormatter = (HTMLFormatterNoPHP) formatter;
          htmlFormatter.formatNode(child, contraints);
        } else {
          formatter.format(child);
        }
      }

      if (canInsertBreakAfter(child)) {
        insertBreakAfter(child, contraints);
View Full Code Here

      // use parent indent for the end tag
      spaces = getBreakSpaces(parent);
    } else if (next.getNodeType() == Node.TEXT_NODE) {
      if (contraints != null && contraints.getFormatWithSiblingIndent()) {
        IDOMNode text = (IDOMNode) next;
        IStructuredFormatter formatter = HTMLFormatterNoPHPFactory
            .getInstance().createFormatter(text,
                getFormatPreferences());
        if (formatter instanceof HTMLTextFormatterNoPHP) {
          HTMLTextFormatterNoPHP textFormatter = (HTMLTextFormatterNoPHP) formatter;
          textFormatter.formatText(text, contraints,
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.core.internal.format.IStructuredFormatter

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.