I am new to eclipse plug-in development. I want to customize the renaming of a project. I need to validate the new name. So how can I override eclipse's rename/refactoring method?
I saw something related to RenameParticipant, but didn't understand clearly. It would be great if someone could explain me steps to override the renaming functionality.
Many Thanks, Ann
The rename refactoring has several processors that subclass
org.eclipse.ltk.core.refactoring.participants.RenameProcessor
and are responsible for renaming different elements. For example, there is a processor for renaming Java projectsorg.eclipse.jdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor
. A refactoring participant can participate in the condition checking and change creation of a refactoring processor. For example, to check some conditions during a rename refactoring, you should subclassorg.eclipse.ltk.core.refactoring.participants.RenameParticipant
, override the methodorg.eclipse.ltk.core.refactoring.participants.RefactoringParticipant.checkConditions(IProgressMonitor, CheckConditionsContext)
and register the participant via the extension pointorg.eclipse.ltk.core.refactoring.renameParticipants
. The participantorg.eclipse.jdt.internal.corext.refactoring.nls.NLSAccessorFieldRenameParticipant
gives you a good example of how to participate in a rename refactoring.When you declare your extension of the
org.eclipse.ltk.core.refactoring.renameParticipants
extension point, you should specify the element you'd like your participant to get notified about. For example, see how the following use of theorg.eclipse.ltk.core.refactoring.renameParticipants
extension point inorg.eclipse.jdt.ui/plugin.xml
involves the participant in renaming fields.