I am writing a code generator that targets projects which include a
directory:
/project/structures
this directory is designated as a source entry (using
JavaCore.newSourceEntry)... that all seems fine, but:
1. I get a target package fragment using
IJavaProject.findPackageFragment(new Path("/project/structures"));
2. then I create an ICompilationUnit myNewClass that includes the
declaration "packages structures;" within that package fragment,
3. and Eclipse puts the resulting source code in the correct file system
location /project/structures/myNewClass.java,
4. but... the compiler thinks myNewClass is in the default package.
How do I programatically designate the new class' package (at the level of
the JavaModel, not the file system?)
(thanks)