I am trying to write an Eclipse plugin. It will have RCP dependencies for the base material and JDT for generating Java code. It consists of a Wizard / WizardPage that requests a package and several class names. When the user clicks Finish, I want the wizard to create classes that match the entered values in the current Java project.
I have a main user interface. I cannot figure out how to create the appropriate class code. The Eclipse documentation is a bit complicated. From what I can learn, I first need to get IJavaProject from the workspace, from it IPackageFragment, and from this I can call createCompilationUnit () to create the class.
What I cannot do is find working examples. I suppose that somehow I can go from the root of the workspace to where I need to be and create a block.
Can anyone suggest some pointers to simple working code?
locka source
share