Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [LTK Refactoring] How to control the order of Refactoring are executed({Repost to platform from tools.jdt})
[LTK Refactoring] How to control the order of Refactoring are executed [message #821169] Thu, 15 March 2012 02:22 Go to next message
Harshana Martin is currently offline Harshana MartinFriend
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: Thu, 15 March 2012 03: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 23:18 Go to previous message
Harshana Martin is currently offline Harshana MartinFriend
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
Previous Topic:Eclipse customization
Next Topic:Console with prompt
Goto Forum:
  


Current Time: Fri Apr 26 13:23:45 GMT 2024

Powered by FUDForum. Page generated in 0.03172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top