Search in sources :

Example 1 with JavaRefactoringArguments

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

the class RenameFieldRefactoringContribution method createRefactoring.

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

Example 2 with JavaRefactoringArguments

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

the class RenameMethodRefactoringContribution method createRefactoring.

/**
	 * {@inheritDoc}
	 */
@Override
public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) throws JavaModelException {
    JavaRefactoringArguments arguments = new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor));
    String input = arguments.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);
    IMethod method = (IMethod) JavaRefactoringDescriptorUtil.handleToElement(arguments.getProject(), input);
    if (method == null) {
        status.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoringContribution_could_not_create, new Object[] { BasicElementLabels.getResourceName(arguments.getProject()), input }));
        return null;
    }
    JavaRenameProcessor processor;
    if (MethodChecks.isVirtual(method)) {
        processor = new RenameVirtualMethodProcessor(method, arguments, status);
    } else {
        processor = new RenameNonVirtualMethodProcessor(method, arguments, status);
    }
    return new RenameRefactoring(processor);
}
Also used : JavaRefactoringArguments(org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments) RenameNonVirtualMethodProcessor(org.eclipse.jdt.internal.corext.refactoring.rename.RenameNonVirtualMethodProcessor) RenameVirtualMethodProcessor(org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor) RenameRefactoring(org.eclipse.ltk.core.refactoring.participants.RenameRefactoring) JavaRenameProcessor(org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor) IMethod(org.eclipse.jdt.core.IMethod)

Example 3 with JavaRefactoringArguments

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

the class RenamePackageRefactoringContribution method createRefactoring.

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

Example 4 with JavaRefactoringArguments

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

the class RenameCompilationUnitRefactoringContribution method createRefactoring.

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

Example 5 with JavaRefactoringArguments

use of org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments 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)

Aggregations

JavaRefactoringArguments (org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments)8 RenameRefactoring (org.eclipse.ltk.core.refactoring.participants.RenameRefactoring)8 IMethod (org.eclipse.jdt.core.IMethod)1 JavaRenameProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor)1 RenameCompilationUnitProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor)1 RenameEnumConstProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameEnumConstProcessor)1 RenameFieldProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor)1 RenameLocalVariableProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor)1 RenameNonVirtualMethodProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameNonVirtualMethodProcessor)1 RenamePackageProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor)1 RenameTypeParameterProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeParameterProcessor)1 RenameTypeProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor)1 RenameVirtualMethodProcessor (org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor)1