Bug 4071 Format option loses place in editor (1GHQFU6)
If you select the Format option from the pop up menu in a Java Editor your current selection location is lost requiring you to search around for it again. STEPS 1) Open a relatively large .java file 2) Go near the bottom 3) Select format - you are sent back to the top. NOTES:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaFormattingStrategy.java
* @see IFormattingStrategy#formatterStarts(String)
	 */
	public void formatterStarts(String initialIndentation) {
		fInitialIndentation= initialIndentation;
	}
	
	/**
	 * @see IFormattingStrategy#formatterStops()
	 */
	public void formatterStops() {
	}
	
	/**
	 * @see IFormattingStrategy#format(String, boolean, String, int[])
	 */
	public String format(String content, boolean isLineStart, String indentation, int[] positions) {
		CodeFormatter formatter= new CodeFormatter(JavaCore.getOptions());
		
		IDocument doc= fViewer.getDocument();
		String lineDelimiter= StubUtility.getLineDelimiterFor(doc);
		formatter.options.setLineSeparator(lineDelimiter);
		formatter.setPositionsToMap(positions);
		int indent= 0;
		if (fInitialIndentation != null) {
			indent= TextUtilities.getIndent(fInitialIndentation, CodeFormatterPreferencePage.getTabSize());
		}
		formatter.setInitialIndentationLevel(indent);
		return formatter.formatSourceString(content);
	}	
}