This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am just starting out creating my own plug-in for Eclipse. The plug-in I want to develop will allow a user to create a new project from the Eclipse wizard (File->New->Custom Project). The project will be an EJB project, with some additional customization.
So far I have been able to develop the plug-in so that it appears in the wizard, I can enter configuration information and select finish. On finish the plugin generates a Java Project. I can also add my custom package and files to the project, as well as .classpath and .project file.
The bit I can't figure out how to do is add a ".settings" directory and all of the required files. Without this the project is not recognised as an EJB project (ie. missing the facet information). When I create an EJB project using the standard EJB wizard it creates a .settings directory and populates it with four files, "org.eclipse.jdt.core.prefs", "org.eclipse.jst.common.project.facet.core.prefs", "org.eclipse.wst.common.component" and "org.eclipse.wst.common.project.facet.core.xml". I can manually create a ".settings" folder using standard folder creation methods, but as this is an Eclipse specific directory I am assuming there is an API based standard to manage this.
Is there API functionality which will manage this directory and files and populate the contents with defaults, or at least provide me with methods to configure values? Or is it simply a case of creating each file manually? It doesn't feel right to create each file manually, as the files seem quite tightly bound to Eclipse and I am worried how much would need to be re-written when upgrading.
I'd appreciate any help with this. I'm not terribly bright, so some code snippets would be ideal ;o)