Search in sources :

Example 1 with RenameLocalVariableProcessor

use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor in project che by eclipse.

the class RenameLocalVariableRefactoringContribution method createRefactoring.

/**
	 * {@inheritDoc}
	 */
@Override
public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) {
    JavaRefactoringArguments arguments = new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor));
    RenameLocalVariableProcessor processor = new RenameLocalVariableProcessor(arguments, status);
    return new RenameRefactoring(processor);
}
Also used : JavaRefactoringArguments(org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments) RenameRefactoring(org.eclipse.ltk.core.refactoring.participants.RenameRefactoring) RenameLocalVariableProcessor(org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor)

Example 2 with RenameLocalVariableProcessor

use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor in project che by eclipse.

the class RenameSupport method create.

/**
	 * Creates a new rename support for the given {@link ILocalVariable}.
	 *
	 * @param variable the {@link ILocalVariable} to be renamed.
	 * @param newName the variable's new name. <code>null</code> is a valid value
	 * indicating that no new name is provided.
	 * @param flags flags controlling additional parameters. Valid flags are
	 * <code>UPDATE_REFERENCES</code>, or <code>NONE</code>.
	 * @return the {@link RenameSupport}.
	 * @throws CoreException if an unexpected error occurred while creating
	 * the {@link RenameSupport}.
	 * @since 3.1
	 */
public static RenameSupport create(ILocalVariable variable, String newName, int flags) throws CoreException {
    RenameLocalVariableProcessor processor = new RenameLocalVariableProcessor(variable);
    processor.setUpdateReferences(updateReferences(flags));
    return new RenameSupport(processor, newName, flags);
}
Also used : RenameLocalVariableProcessor(org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor)

Aggregations

RenameLocalVariableProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor)2 JavaRefactoringArguments (org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments)1 RenameRefactoring (org.eclipse.ltk.core.refactoring.participants.RenameRefactoring)1