Problem writting source code in a .java file [message #210454] |
Thu, 21 July 2005 04:19  |
Eclipse User |
|
|
|
Originally posted by: david.nitenberg.gmail.com
Hi,
I am realizing a plugin that needs to parse an existing .java file in the
workspace, but I am having trouble to do it. One of my goals is to be able
to automatically generate the getters and setters in this .java file (I
don't want to go through the window that proposes which getters and
setters to generate; I want it to be transparent for the user).
I tried to call directly the AddGetterSetterOperation but it won't work.
So I thought I could just parse the .java file and generate the getters
setters by myself, but I don't know how to create an ASTParser for an
ICompilationUnit.
In fact, my problem is that I don't know how to write in a .java file to
add source code.
I hope my problem is clear :-)
Could anyone guide/help me in this objective, please ?
thanx in advance
|
|
|
|
|
|
|
Re: Problem writting source code in a .java file [message #210748 is a reply to message #210627] |
Sun, 24 July 2005 22:17  |
Eclipse User |
|
|
|
IJavaProject.getPackageFragmentRoot(String jarPath);
This method is getting the jar file which have the given name, so your
code is getting the "src" jar file, not "src" folder.
David wrote:
> Thanx a lot eddie, it finally worked :-)
> Could you tell me why my source code didn't work and yours does ?
>
|
|
|
Powered by
FUDForum. Page generated in 0.42121 seconds