12.6. Writing a Plug-in from a Skeleton

Problem

You want to develop the code for a plug-in yourself, from scratch.

Solution

You can create a skeletal plug-in project in the Plug-in Code Generators pane by selecting Default Plug-In Structure. We’ll do that here and develop the rest of the plug-in from that starting point.

Discussion

As an example, we’ll create the plug-in created earlier in this chapter that displayed menus, but this time, we’ll do the work ourselves instead of relying entirely on a wizard. We will use a wizard to get started, however, so select File New Project. In the New Project dialog, select Plug-in Development in the left box and Plug-in Project in the right box, and click Next. In the next pane, enter the new project’s name, org.cookbook.ch12.MenuPlugInFromScratch, and click Next to open the Plug-in Project Structure pane. Click Next again to accept the defaults.

In the Plug-in Code Generators pane, select Default Plug-In Structure, as shown in Figure 12-13, and click Next.

Selecting a plug-in wizard

Figure 12-13. Selecting a plug-in wizard

The next dialog enables you to set the provider name, which we’ll set to Eclipse Cookbook. Because we’ll be writing our own code here, uncheck the items in the “Plug-in code generation options” box, as shown in Figure 12-14, and click Finish.

Setting the provider name

Figure 12-14. Setting ...

Get Eclipse Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.