Bug 115513 [quick assist] Surround with template
Version: 3.2.0 Build id: I20051102-1600 Surround with template is an enhancement of surround with runnable. It adds logic to the 'surround with' templates. Users can define there own templates to surround code with (i.e. 'surround with ISafeRunnable').
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SurroundWithRunnableProposal.java
* @return The root of the new code.
	 */
	private Statement generateCodeSkeleton(Block newBody, ASTRewrite rewrite) {
		AST ast= getAst();
		
		MethodDeclaration runMethod= ast.newMethodDeclaration();
		runMethod.setName(ast.newSimpleName(METHOD_NAME));
		runMethod.modifiers().add(ast.newModifier(ModifierKeyword.PUBLIC_KEYWORD));
		runMethod.setBody(newBody);
		
		AnonymousClassDeclaration runnableClassDeclaration= ast.newAnonymousClassDeclaration();
		runnableClassDeclaration.bodyDeclarations().add(runMethod);
		
		ClassInstanceCreation runnableInstanziator= ast.newClassInstanceCreation();
		runnableInstanziator.setType(ast.newSimpleType(ast.newName(TYPE_NAME)));
		runnableInstanziator.setAnonymousClassDeclaration(runnableClassDeclaration);
		
		VariableDeclarationFragment variableDeclarationFragment= ast.newVariableDeclarationFragment();
		SimpleName variableName= ast.newSimpleName(PROPOSED_RUNNABLE_VAR_NAME);
		variableDeclarationFragment.setName(variableName);
		variableDeclarationFragment.setInitializer(runnableInstanziator);
		addLinkedPosition(rewrite.track(variableName), true, variableName.getFullyQualifiedName());
		
		VariableDeclarationStatement variableDeclaration= ast.newVariableDeclarationStatement(variableDeclarationFragment);
		variableDeclaration.setType(ast.newSimpleType(ast.newName(TYPE_NAME)));
		
		return variableDeclaration;
	}
	
	/**