Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Code Changes(Need help please)
Code Changes [message #705210] Fri, 29 July 2011 15:15 Go to next message
Eclipse UserFriend
Hi,

I am trying to use JDT SearchEngine API to find some code, e.g. methods or whatever, and I'd like to change source code based on found matches.
The problem is that I can't find a way to: based on a match, get its AST or something that allows me to change the code that was found.

Can anyone help? A hint, tutorial or solution would be welcome..

Thank you

[Updated on: Fri, 29 July 2011 15:16] by Moderator

Report message to a moderator

Re: Code Changes [message #707026 is a reply to message #705210] Mon, 01 August 2011 06:19 Go to previous messageGo to next message
Eclipse UserFriend
Search API returns a Java Model Element, which can be used to get the AST.
http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html and http://www.eclipse.org/articles/article.php?file=Article-JavaCodeManipulation_AST/index.html could be helpful.
Re: Code Changes [message #717084 is a reply to message #707026] Fri, 19 August 2011 09:02 Go to previous message
Eclipse UserFriend
Thanks a lot for the reply, the links have been very useful and I managed to solve that problem!
Previous Topic:Record Execution Trace
Next Topic: How to refresh Eclipse launch configurations programmatically?
Goto Forum:
  


Current Time: Mon Feb 10 21:13:22 GMT 2025

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

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

Back to the top