Package org.eclipse.jface.text.formatter

Examples of org.eclipse.jface.text.formatter.MultiPassContentFormatter


    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // super was unable to create a formatter, probably because
    // sourceViewer does not have document set yet, so just create a
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
      formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);

    MultiPassContentFormatter multiFormatter = (MultiPassContentFormatter) formatter;
    multiFormatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
    multiFormatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA);

    return formatter;
  }
View Full Code Here


    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // super was unable to create a formatter, probably because
    // sourceViewer does not have document set yet, so just create a
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
      formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);

    MultiPassContentFormatter multiFormatter = (MultiPassContentFormatter) formatter;
    multiFormatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
    multiFormatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA);

    return formatter;
  }
View Full Code Here

    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // super was unable to create a formatter, probably because
    // sourceViewer does not have document set yet, so just create a
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
      formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
    ((MultiPassContentFormatter) formatter).setMasterStrategy(new XMLFormattingStrategy());   
//    ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorXML()));

    return formatter;
  }
View Full Code Here

    return reconciler;
  }
 
  @Override
  public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    MultiPassContentFormatter formatter=
      new MultiPassContentFormatter(
          getConfiguredDocumentPartitioning(sourceViewer),
          IDocument.DEFAULT_CONTENT_TYPE);
   
    formatter.setMasterStrategy(new FitnesseFormattingStrategy());
   
    return formatter;
  }
View Full Code Here

        usedFormatter = (IContentFormatter) ecProxy.getObject();
      }
    }

    if (usedFormatter == null) {
      usedFormatter = new MultiPassContentFormatter(
          getConfiguredDocumentPartitioning(sourceViewer),
          IHTMLPartitions.HTML_DEFAULT);
      ((MultiPassContentFormatter) usedFormatter)
          .setMasterStrategy(new StructuredFormattingStrategy(
              new PhpFormatProcessorImpl()));
View Full Code Here

  public PHPCodeFormatterProxy() {
    final boolean licensed = true;
    if (licensed) {
      formatter = new PHPCodeFormatter();
    } else {
      formatter = new MultiPassContentFormatter(
          IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
          IHTMLPartitions.HTML_DEFAULT);
      ((MultiPassContentFormatter) formatter)
          .setMasterStrategy(new StructuredFormattingStrategy(
              new PhpFormatProcessorImpl()));
View Full Code Here

              element, formatterExtensionName);
          fActiveFormatter = (IContentFormatter) ecProxy.getObject();
        }
      }
      if (fActiveFormatter == null) {
        fActiveFormatter = new MultiPassContentFormatter(
            IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
            IHTMLPartitions.HTML_DEFAULT);
        ((MultiPassContentFormatter) fActiveFormatter)
            .setMasterStrategy(new StructuredFormattingStrategy(
                new PhpFormatProcessorImpl()));
View Full Code Here

        e.printStackTrace();
      }
    }
    if (phpFormatter == null) {

      phpFormatter = new MultiPassContentFormatter(
          IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
          IHTMLPartitions.HTML_DEFAULT);
      ((MultiPassContentFormatter) phpFormatter)
          .setMasterStrategy(new StructuredFormattingStrategy(
              new PhpFormatProcessorImpl()));
View Full Code Here

         return doc.get();
    }

  private static void format(FormattingPreferences prefs, IDocument doc, int indent) {

    MultiPassContentFormatter formatter = new MultiPassContentFormatter(
                //CFDocumentSetupParticipant.CFML_PARTITIONING,
        IDocumentExtension3.DEFAULT_PARTITIONING,
                IDocument.DEFAULT_CONTENT_TYPE);

        formatter.setMasterStrategy(new CFMLFormattingStrategy());
        formatter.format(doc, new Region(0, doc.getLength()));
  }
View Full Code Here

//        }

    SQLWordStrategy sqlStrategy = new SQLWordStrategy();
//    formatter.setFormattingStrategy(sqlStrategy, CFPartitionScanner.SQL);
   
    MultiPassContentFormatter formatter = new MultiPassContentFormatter(
        getConfiguredDocumentPartitioning(sourceViewer),
        IDocument.DEFAULT_CONTENT_TYPE);
   
    formatter.setMasterStrategy(new CFMLFormattingStrategy());
    if(formattingPreferences.formatSQL()) {     
      formatter.setSlaveStrategy(sqlStrategy, CFPartitionScanner.SQL);
    }
//    formatter.setSlaveStrategy(new XmlElementFormattingStrategy(), CFPartitionScanner.CF_SCRIPT);
    /*
     */
   
 
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.formatter.MultiPassContentFormatter

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.