int line= buffer.getLineOfOffset(start); String delimiter= buffer.getLineDelimiter(line); int indent= TextUtilities.getIndent(buffer.getLineContentOfOffset(start), fTabWidth); setText(computeNewMethod(buffer, line, TextUtilities.createIndentString(indent), delimiter));
int startLine= buffer.getLineOfOffset(methodStart); int endLine= buffer.getLineOfOffset(methodEnd); String delimiter= buffer.getLineDelimiter(startLine); int indent= TextUtilities.getIndent(buffer.getLineContentOfOffset(methodStart), fTabWidth); setText(computeNewMethod(buffer, endLine, TextUtilities.createIndentString(indent), delimiter));
	public IChange createChange(IProgressMonitor pm) throws JavaModelException {		if (fMethodName == null)			return null;					ITextBufferChange result= fTextBufferChangeCreator.create("Extract Method", fCUnit);						AbstractMethodDeclaration method= fStatementAnalyzer.getEnclosingMethod();				final int start= method.declarationSourceStart;		final int end= method.declarationSourceEnd;					final int insertPosition= end + 1;				// Inserting the new method		result.addSimpleTextChange(new SimpleReplaceTextChange("Extracted method", insertPosition) {			public SimpleTextChange[] adjust(ITextBuffer buffer) {				int line= buffer.getLineOfOffset(start);				String delimiter= buffer.getLineDelimiter(line);				int indent= TextUtilities.getIndent(buffer.getLineContentOfOffset(start), fTabWidth);					setText(computeNewMethod(buffer, line, TextUtilities.createIndentString(indent), delimiter));				return null;			}		});				// Replacing the old statements with the new method call.		result.addSimpleTextChange(new SimpleReplaceTextChange("Changed method", fSelectionStart, fSelectionLength, null) {			public SimpleTextChange[] adjust(ITextBuffer buffer) {				String delimiter= buffer.getLineDelimiter(buffer.getLineOfOffset(start));				int indent= TextUtilities.getIndent(buffer.getLineContentOfOffset(start), fTabWidth);					setText(computeCall(buffer, delimiter));				return null;			}		});				return result;	}