Eclipse option development time for changing Java file source

I appreciate the possibility of developing an Eclipse plugin to modify the source code of some Java files.

The Eclipse plugin should:

  • add one menu option or context menu to start the change process.
  • add key binding
  • only changes the interface in such a way when the editor was opened in a Java file.
  • the modification process will not open a dialog or maybe very simple.
  • the modification process will go through the AST of the Java file and will modify it.

Given that we do not have experience with Eclipse plugins, and we need to spend time reading documents, how much time do you evaluate when developing this plugin?

Thanks in advance.

+5
eclipse code-generation eclipse-plugin
source share
3 answers

It's really not that difficult ... I had students in the design class who did this for the assignment (adding / removing javabean getters and seters)

See http://help.eclipse.org/ganymede/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_manip.htm

[ EDIT : added the following link to the article]

And an excellent article on it http://www.eclipse.org/articles/article.php?file=Article-JavaCodeManipulation_AST/index.html (since 2006 - there may be several API changes since then)

Yes, plugins are a bit used to writing, but also any API.

And you can change the AST - see the page above.

(I should note that the link above is linked using eclipse help, which can also be accessed via Help-> Help Contents in Eclipse - there is a lot of good information, but this is just a starting point)

+4
source share

You will probably spend quite a bit of time cursing the complexity of the eclipse plugin system. There are some examples of plugin development projects that can be very useful if they cover the area in which you work.

I would say that you look at 2-4 days of work, mostly getting acquainted with the platform - someone with a lot of experience writing plugins for eclipse will probably take no more than an hour.

However, your step 5 can be tricky. I do not know how easy it is to access and modify Java AST; my experience is based on developing an editor plugin for an exotic file format, not Java code.

+1
source share

Well, the first four points are easily achievable, even with monkey codes that look at the PDE eclipse documentation that comes with Eclipse. This can be achieved in 1 day of work, possibly 2.

The most difficult moment is really the fifth and kind of modification that you expect to make. Acting directly on the contents of the editor is simple, access to the editor inside the AST and its modification is really a big problem, and I doubt that this can be achieved in less than a week by inexperienced people (this may take longer, depending on which modification you want to apply).

0
source share

All Articles