Calling Refactorings Programmatically [message #245512] |
Wed, 11 July 2007 13:43  |
Eclipse User |
|
|
|
I want to use Eclipse refactorings programmatically. As far as I can see
the only way to do this is to use internal classes.
For example to rename a compilation unit I would need to use
org.eclipse.jdt.internal.corext.refactoring.rename.RenameCom pilationUnitProcessor
Is this correct? That I can only use the refactorings that Eclipse ships
by using internal classes?
If so does this break the guidelines for using the Eclipse API as outlined
on this page?
http://www.eclipse.org/articles/article.php?file=Article-API -Use/index.html
If so, does this mean that one cannot safely use Eclipse refactorings
programmatically?
On a related note, with regards developing custom refactorings I see even
Tobias Widmer in his article "Unleashing the Power of Refactoring"
http://www.eclipse.org/articles/article.php?file=Article-Unl eashing-the-Power-of-Refactoring/index.html
uses internal classes (org.eclipse.jdt.internal.corext.dom.NodeFinder) in
order to develop his custom refactoring.
Once again, is this not bad practice at a minimum and unsafe with regards
it breaking when running against future releases of Eclipse due to
dependencies on internal API?
I want to develop some custom refactorings - is it just the case that in
order to develop custom refactorings I will more than likely need to use
some internal classes? And the best I can do is to request any internal
API I use to be put into the published API in the future and fix things
down the line, whilst in the meantime dealing with any breakage in the
code between Eclipse releases due to dependencies on internal API?
Any help greatly appreciated,
Thanks,
Máirtín
|
|
|
|
|
|
|
|
Re: Calling Refactorings Programmatically [message #749370 is a reply to message #246998] |
Tue, 25 October 2011 03:18  |
Eclipse User |
|
|
|
Hi all, Máirtín
As you Máirtín I want to program some custom refactorings.
I read the paper of Tobias Widmer and also the blog from Anulfor Rodriguez.
But I have still some general questions
1) Is there a more recent document on ingineering refactoring in Eclipse ?
(the Java doc is not the best to understand the global process).
2) How to easily reuse and extend or specialise the existing JDT refactoring?
Is there an another way than using org.eclipse.jdt.ui.refactoring.*Descriptors ?
3) I need to pipe several refactoring actions, How to do that efficiently
with the change mechanism ?
(the existing scripting mechanism does not seem adequate)
any help is welcome
regards
|
|
|
Powered by
FUDForum. Page generated in 0.53453 seconds