}
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) {
}
StringBuffer sb = new StringBuffer();
for (int i = 0; i < startingEmptyLines; i++) {
String lineDelimiter = newline;
try {
lineDelimiter = tempdocument.getLineDelimiter(i);
} catch (BadLocationException e) {
}
sb.append(lineDelimiter);
}
for (int i = 0; i < list.size(); i++) {
if (!formatter.getIgnoreLines().contains(i + 1)) {
sb.append(helpBuffer.toString());
}
sb.append(list.get(i));
if (i == list.size() - 1) {
} else {