Here's how to create a plugin for eclipse that adds a wizard new option to your 'File -> New' options.
It does nothing. The File -> Plugin Development -> Plugin has more working examples that actually do things.
This is just here to show you the framework. . First, create a new plugin project,
File -> New -> Other -> Plugin Development -> Plug-in Project
-> [Enter project name, accept defaults on this screen]
-> [Accept default on next screen]
-> [Unclick "Create a plugin using one of the templates"]
Now you have a blank plugin project.
You'll have a src directory with a Activator.java that deals with the lifecycle, that you can leave alone pretty much.
In META-INF/ there's a MANIFEST.MF file. 'Build-SymbolicName' to a singleton for plugin development and change the 'Require-Bundle' by adding some useful packages:
The final file you are given is build.properties. When you add new files or directories, you need to add them to the bin.includes values. Let's do that now, refering to a plugin.xml file we'll create below:
We're extending Wizard to give us a wizard when we open our plugin.
The init() method gives us a reference to a IStructuredSelection which is useful to get the selected directory, for example.
The adPages() method makes us create a new page, in this case we've just added a blank page -- we'd extend this obviously to include our UI.
Finally, performFinish() is called when the user presses the 'Finish' button in the wizard.
Now, if you right click on the plugin project, and run as Eclipse Application, you'll get a new instance of Eclipse with the plugin loaded.
Now create a new Java project. Then on the 'src' directory, for example, right click -> New -> Other. Now you can find your plugin.
It does nothing! Glorious!
You can export the plugin by right clicking on the project and exporting as plugin fragment. This will create a .jar file you can put in [eclipse path]/dropins that will become active once you restart eclipse.