Bug 4139 EC DCR: Code templates feature (1GIVMDV)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/CodeIndentator.java
store.set(text);
			
			ILineTracker tracker= new DefaultLineTracker();
			tracker.set(text);
			
			int size= tracker.getNumberOfLines();
			String result[]= new String[size];
			for (int i= 0; i < size; i++) {
				String lineDelimiter= null;
				try {
					lineDelimiter= tracker.getLineDelimiter(i);
				} catch (BadLocationException e) {}
				
				IRegion region= tracker.getLineInformation(i);
				
				if (lineDelimiter == null) {
					result[i]= store.get(region.getOffset(), region.getLength());
				} else {
					result[i]= store.get(region.getOffset(), region.getLength()) +
						lineDelimiter;
				}
			}
			return result;
		} catch (BadLocationException e) {
			return null;
		}
	}
	
}