use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameEnumConstProcessor in project che by eclipse.
the class RenameSupport method create.
/**
* Creates a new rename support for the given {@link IField}.
*
* @param field the {@link IField} to be renamed.
* @param newName the field'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>, <code>UPDATE_TEXTUAL_MATCHES</code>,
* <code>UPDATE_GETTER_METHOD</code>, and <code>UPDATE_SETTER_METHOD</code>,
* or their bitwise OR, or <code>NONE</code>.
* @return the {@link RenameSupport}.
* @throws CoreException if an unexpected error occurred while creating
* the {@link RenameSupport}.
*/
public static RenameSupport create(IField field, String newName, int flags) throws CoreException {
if (JdtFlags.isEnum(field))
return new RenameSupport(new RenameEnumConstProcessor(field), newName, flags);
else {
final RenameFieldProcessor processor = new RenameFieldProcessor(field);
processor.setRenameGetter(updateGetterMethod(flags));
processor.setRenameSetter(updateSetterMethod(flags));
return new RenameSupport(processor, newName, flags);
}
}
use of org.eclipse.jdt.internal.corext.refactoring.rename.RenameEnumConstProcessor in project che by eclipse.
the class RenameEnumConstRefactoringContribution method createRefactoring.
/**
* {@inheritDoc}
*/
@Override
public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) {
JavaRefactoringArguments arguments = new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor));
RenameEnumConstProcessor processor = new RenameEnumConstProcessor(arguments, status);
return new RenameRefactoring(processor);
}
Aggregations