Package org.eclipse.jface.text.formatter

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


        this.scenarioAnnotationSearch = scenarioAnnotationSearch;
    }

    @Override
    public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
        MultiPassContentFormatter formatter = new MultiPassContentFormatter(IDocumentExtension3.DEFAULT_PARTITIONING,
            IDocument.DEFAULT_CONTENT_TYPE);

        CucumberFormatter cukeFormatter = new CucumberFormatter();
        formatter.setMasterStrategy(cukeFormatter);

        formatter.setSlaveStrategy(cukeFormatter, CucumberPartitionScanner.FEATURE);
        formatter.setSlaveStrategy(cukeFormatter, CucumberPartitionScanner.SCENARIO);

        return formatter;
    }
View Full Code Here


{
    @Override
    public void format(IDocument document, IRegion region)
    {
        if (isFormatFile()) {
            MultiPassContentFormatter pdtFormatter = new MultiPassContentFormatter(
                    IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
                    IHTMLPartitions.HTML_DEFAULT);
            pdtFormatter.setMasterStrategy(new StructuredFormattingStrategy(
                    new HTMLFormatProcessorImpl()));
            pdtFormatter.format(document, region);
        } else {
            StructuredTextMultiPassContentFormatter pdtFormatter = new StructuredTextMultiPassContentFormatter(
                    IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
                    IHTMLPartitions.HTML_DEFAULT);
            pdtFormatter.setMasterStrategy(new StructuredFormattingStrategy(
                    new TwigFormatProcessorImpl()));
            pdtFormatter.format(document, region);
            // pdtFormatter.format(document, region);
        }

    }
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.