| [LTK Refactoring] How to control the order of Refactoring are executed [message #821169] |
Wed, 14 March 2012 22:22  |
Harshana Martin Messages: 4 Registered: December 2011 |
Junior Member |
|
|
Hi All,
I have implemented a refactoring by extending rename participant and it suppose to do some modifications to a file reside in a project (metadata file) upon renaming that project.
But the issue I'm facing is, by the time my factoring get executed, refactoring contributed from org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceRefactoringContribution is already executed and hence the original project name is now changed to the new one. Hence my refactoring implementation throws exceptions and fails.
Therefore is there any mechanism in place to control the order of the refactoring contributions and participants are executed?
Thanks and Regards,
Harshana
[Updated on: Wed, 14 March 2012 23:07] Report message to a moderator
|
|
|
| Re: [LTK Refactoring] How to control the order of Refactoring are executed [message #821879 is a reply to message #821169] |
Thu, 15 March 2012 19:18  |
Harshana Martin Messages: 4 Registered: December 2011 |
Junior Member |
|
|
Hi All,
I figured out the solution.
In the rename participant class we have 2 methods as following.
1. createPreChange
2. createChange
Here, if we you need to execute a change before refactoring occurs , for example to update a metadata file, you need to implement your change in createPreChange method. createPreChange method is executed before carrying out actual refactoring.
On the other hand if you want to make some change to the refactored target, then you can use createChange to define the changes to be carried out after the refactoring. createChange is executed after actual refactoring taken place.
Hope this helps to everyone who got in to the same issue!
Thanks and Regards,
Harshana
|
|
|
Powered by
FUDForum. Page generated in 0.01673 seconds