| [SOLVED] How to apply a org.eclipse.ltk.core.refactoring.Change object to another project [message #640301]
||Sat, 20 November 2010 08:27
| Kivanc Muslu
Registered: November 2010
Edit: I have solved this problem in high level. I couldn't find to apply a Change object created by Project1, to Project2, but here is a solution that makes the same thing:|
- Go through Project2 (the project you want to apply the changes), and retrieve IMarkers.
- Convert these markers to IProblemLocations.
- Give these problem locations (with context as their compilation unit) to the QuickFixProcessor to get the Changes specific to Project2.
- Since these changes are generated for Project2, they will be applicable to Project2.
I am new to the forums, excuse me if this is the wrong forum to ask this question.
I have a Change object that I got from QuickFixProcessor. As far as I understood the Change objects are associated with the project and files that create them (which is very logical normally). However, I have the following issue:
I copy the original project with a new name (in the same workspace) to a new project. The content is exactly the same, so in theory the Change object I get from the original project should be applicable to the copy project. However, I couldn't find an easy way to implement this in my plug-in. For now I am trying to reconstruct the Change (by going to its concrete instance) and trying to point to the copy project during this reconstruction. However, there are a lot of different changes, so the code is ugly and I am not sure if I cover the all cases.
In short, if there an easy way to apply a Change created by project 'x' to a project 'y' (which has exactly same content as x)?
Thanks in advance, please do ask if you need more information,
[Updated on: Wed, 16 February 2011 22:42]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.03111 seconds