-
Notifications
You must be signed in to change notification settings - Fork 14
Adding a new Java refactoring descriptor
Mohsen Vakilian edited this page Jan 7, 2014
·
5 revisions
Sometimes, the exact type of the refactoring is not known at the time of instrumentation (see issue #163, commits 9233b02edf15564a9ad2627f4dce8b115ec81e11
and a78e01f0331a9444df77e2b75653ce8dd7fb8fd3
). In such cases, you need to create a new kind of refactoring descriptor. Let the name of your new refactoring be "NewRe". To be able to deserialize the NewRe refactoring descriptor from the XML files, you need to configure your refactoring descriptor as follows.
- Add a constant string that is the ID of the new refactoring descriptor to the class
IJavaRefactorings
. - Create a new class called
NewReDescriptor
that extendsJavaRefactoringDescriptor
. - Add the following two factory methods to
RefactoringSignatureDescriptorFactory
.
public static NewReDescriptor createNewReDescriptor() {
return new NewReDescriptor();
}
public static NewReDescriptor createNewReDescriptor(String project, String description, String comment, Map arguments, int flags) {
return new NewReDescriptor(project, description, comment, arguments, flags);
}
- Add a new class called
NewReRefactoringContribution
that extendsJavaUIRefactoringContribution
. - Add the following node to the extension point
org.eclipse.ltk.core.refactoring.refactoringContributions
inorg.eclipse.jdt.ui/plugin.xml
.
<contribution class="<the fully qualified name of NewReRefactoringContribution>" id="<the string representing the ID of the NewRe refactoring>"/>