use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor in project che by eclipse.
the class RenameMethodInInterfaceTest method helper1_not_available.
private void helper1_not_available(String methodName, String[] signatures) throws Exception {
ICompilationUnit cu = createCUfromTestFile(getPackageP(), "A");
IType interfaceI = getType(cu, "I");
RenameProcessor processor = new RenameVirtualMethodProcessor(interfaceI.getMethod(methodName, signatures));
RenameRefactoring ref = new RenameRefactoring(processor);
assertTrue(!ref.isApplicable());
}
use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor in project che by eclipse.
the class RenameVirtualMethodInClassTest method helper1_0.
private void helper1_0(String methodName, String newMethodName, String[] signatures) throws Exception {
IType classA = getType(createCUfromTestFile(getPackageP(), "A"), "A");
RenameMethodProcessor processor = new RenameVirtualMethodProcessor(classA.getMethod(methodName, signatures));
RenameRefactoring ref = new RenameRefactoring(processor);
processor.setNewElementName(newMethodName);
RefactoringStatus result = performRefactoring(ref);
assertNotNull("precondition was supposed to fail", result);
}
use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor in project che by eclipse.
the class RenameVirtualMethodInClassTest method helper1_not_available.
private void helper1_not_available(String methodName, String[] signatures) throws Exception {
IType classA = getType(createCUfromTestFile(getPackageP(), "A"), "A");
RenameMethodProcessor processor = new RenameVirtualMethodProcessor(classA.getMethod(methodName, signatures));
RenameRefactoring ref = new RenameRefactoring(processor);
assertTrue(!ref.isApplicable());
}
use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor 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);
}
Aggregations