Examples of IStructuredFormatter


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

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

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

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

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

            // 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 = HTMLFormatterNoTwigFactory
                        .getInstance().createFormatter(text,
                                getFormatPreferences());
                if (formatter instanceof HTMLTextFormatterNoTwig) {
                    HTMLTextFormatterNoTwig textFormatter = (HTMLTextFormatterNoTwig) formatter;
                    textFormatter.formatText(text, contraints,
View Full Code Here

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

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

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

    }

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

        switch (node.getNodeType()) {
            case Node.ELEMENT_NODE :
                if (node instanceof ElementImplForTwig
                        && ((ElementImplForTwig) node).isTwigTag()) {
                    formatter = new TwigFormatter(start, length);

                } else {
                    formatter = new HtmlElementFormatterNoTwig();
                }

                break;
            case Node.TEXT_NODE :
                if (isEmbeddedCSS(node)) {
                    formatter = new EmbeddedCSSFormatterNoTwig();
                } else {
                    formatter = new HTMLTextFormatterNoTwig();
                }
                break;
            default :
                formatter = new HTMLFormatterNoTwig();
                break;
        }

        // init FormatPreferences
        formatter.setFormatPreferences(formatPreferences);

        return formatter;
    }
View Full Code Here

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

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

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

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

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

            // 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 = HTMLFormatterNoTwigFactory
                        .getInstance().createFormatter(text,
                                getFormatPreferences());
                if (formatter instanceof HTMLTextFormatter) {
                    HTMLTextFormatterNoTwig textFormatter = (HTMLTextFormatterNoTwig) formatter;
                    textFormatter.formatText(text, contraints,
View Full Code Here

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

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

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

@SuppressWarnings("restriction")
public class ShallowFormatProcessorXML extends FormatProcessorXML {

  @Override
  protected IStructuredFormatter getFormatter(Node node) {
    IStructuredFormatter formatter = null;
    if (node != null) {
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        formatter = new ShallowElementNodeFormatter();
      }
      if (node.getNodeType() == Node.DOCUMENT_NODE) {
        formatter = new ShallowDocumentNodeFormatter();
      }
    }

    if (formatter != null) {
      formatter.setFormatPreferences(getFormatPreferences());
      formatter.setProgressMonitor(fProgressMonitor);
      return formatter;
    }
    return super.getFormatter(node);
  }
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.