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

Examples of org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument


        }
      }
    } catch (BadLocationException e) {
      PHPUiPlugin.log(e);
    }
    JobSafeStructuredDocument newdocument = new JobSafeStructuredDocument(
        new PhpSourceParser());
    String start = "<?php"; //$NON-NLS-1$
    newdocument.set(start + newline + tempsb.toString());
    PhpFormatter formatter = new PhpFormatter(0, newdocument.getLength(),
        true, indentationObject);
    formatter.format(newdocument.getFirstStructuredDocumentRegion());

    List<String> list = new ArrayList<String>();
    try {
      int lineNumber = newdocument.getNumberOfLines();
      for (int i = 0; i < lineNumber; i++) {
        if (i == 0) {
          continue;
        }
        IRegion region = newdocument.getLineInformation(i);
        String line = newdocument.get(region.getOffset(),
            region.getLength());
        list.add(line);
      }
    } catch (BadLocationException e) {
    }
View Full Code Here


                tempsb.append(tempdocument.get(region.getOffset(),
                        region.getLength()).trim());
            }
        } catch (BadLocationException e) {
        }
        JobSafeStructuredDocument newdocument = new JobSafeStructuredDocument(
                new TwigSourceParser());
        String start = "<?php";
        newdocument.set(start + tempsb.toString());
        TwigFormatter formatter = new TwigFormatter(0, newdocument.getLength());
        formatter.format(newdocument.getFirstStructuredDocumentRegion());

        List<String> list = new ArrayList<String>();
        try {
            int lineNumber = newdocument.getNumberOfLines();
            for (int i = 0; i < lineNumber; i++) {
                IRegion region = newdocument.getLineInformation(i);
                String line = newdocument.get(region.getOffset(),
                        region.getLength());
                if (list.isEmpty()) {
                    line = line.substring(start.length()).trim();
                }
                list.add(line);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument

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.