views:

28

answers:

2

I would like to write an Eclipse plug-in that is able to import existing documentation into JavaDoc comments of existing Java code.

Background: I've generated Java code to communicate with an third party (native) program. Now I would like to import the documentation of the third party program into my generated code.

What I've already done: I have developed an Eclipse "QuickAssist" by implementing "IJavaCompletionProposalComputer" that does the trick already for a single Java method or static field.

Now I would like to write a plug-in that triggers my implementation for every method or field within some selected source code.

I'm not so familiar with the Eclipse SDK. Can someone give me a hint where to start or which interface(s) I need to implement to archive this?

Thanks in advance.

A: 

There is a site focused on this subject: Eclipse Plugin Site.

There you can find a brief tutorial on how to create a new plugin project, and how to test it.

There's also documentation on SWT, and on the different kinds of components wich can be included on your plugin (Perspectives, Views, Editors, Properties, Actions, Builders, etc), and how to implement them.

Good luck.

Tomas Narros
Thank you for your answer. Since I already have a plug-in project (the completion proposal) I do not need to create a new plug-in. But probably an "Action" is what I need. I'll look into it.
niks
A: 

You could traverse the Java Object Model, and during the traversal you could apply your code. See the tutorial of vogella.de for the basics - I think, you could adapt it to use your code.

Zoltán Ujhelyi
Yes this is what I like to do. Actually this is what I'm already doing. I use the JavaContentAssistInvocationContext to retrieve the IJavaElement of the method and the class. I use the method and class name to retrieve the correct documentation and insert it at the cursors position. But I do not want to trigger this for every method by hand (there are thousands by now...). I would like to trigger the insertion for all methods and fields in all selected Java files...
niks
Then create a Command (Workbench Command framework) for the project (or selected files, as you like), then starting from the project you can manually traverse the DOM and find all mentioned methods as insertion points.
Zoltán Ujhelyi