Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [LTK Refactoring] How to control the order of Refactoring are executed
[LTK Refactoring] How to control the order of Refactoring are executed [message #821168] Thu, 15 March 2012 02:21 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 #821878 is a reply to message #821168] Thu, 15 March 2012 23:18 Go to previous messageGo to next 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
Re: [LTK Refactoring] How to control the order of Refactoring are executed [message #822155 is a reply to message #821168] Fri, 16 March 2012 08:27 Go to previous message
Harutyun Arzumanian is currently offline Harutyun ArzumanianFriend
Messages: 35
Registered: February 2012
Member
Hi Harshana,
A brilliant job you did there, congrats!
Can you please provide me the source code so that I will get good examples on JDT classes extensions, because I needed these evaluations since a long time. I will extend other parts on it and will give to someone else maybe he'd get plenty of benefits and he'd extend it also and give to someone else and so on... it will be a great contribution from you to the Major Eclipse Contributions Team.
Previous Topic:Does Eclipse support GlassFish?
Next Topic:help on getting binding information in AST
Goto Forum:
  


Current Time: Fri Apr 19 01:07:12 GMT 2024

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

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

Back to the top