Developer’s Guide for eclipse plug-ins

eclipse plugin how to write, write how to import.

eclipse plug-in development:

The following are the steps to create a simple plug-in.

(1) Run Eclipse.

Click Eclipse’s “File” ¡ú “New” ¡ú “Other” menu item, in the pop-up dialog box. menu item, in the pop-up dialog box, select the Select dialog box on the left side of the Plug-inDevelopment Wizard. As shown in Figure 1, select Plug-inProject.

(2) Click the “Next” button to bring up the New dialog box, enter the project name. Here we use “com.test.helloworld”. Click the “Next” button to bring up the New dialog box page, as shown in Figure 2, the plug-in logo is the same as the project name. Using the project name as the plug-in identifier minimizes the chance that the plug-in will conflict with the name of another plug-in.

(3) Click the “Next” button, select “Hello,world”, as shown in Figure 3.

(4) Click the “Finish” button to create the plug-in that the user wants to build.

The above example through the Plug-in Creation Wizard to create a “Hello, world plug-in”, through the Eclipse Plug-in Creation Wizard is also able to create other extensions to the point of plug-in creation.

Create your first Eclipse plugin project

Familiar interface, right?

And then click next, you will see:

2.Options

Default check Generateanactivator, this is a java class used to control the plug-in life cycle, here is to give it to the check box, of course, you can also edit its class name.

The second checkbox should also be checked by default. No need to ask

3. RichClientApplication

This is a rich client application here for the time being do not care, because we do not need, so choose no on it.

Then go to the next step there are a number of available templates to help you quickly build plug-in applications:

Don’t see HelloWorld inside the first hand we do not choose then this, do not ask why because I’m a novice we have to follow the tutorial step by step. Here we choose Plug-inwithaview template, and then click on the next step:

The wizard interface you see above describes some basic information about the view template we have chosen. There is the package name, trying to class name, view name, view category Id, view category name and let you choose whether the view is a list or treeview which should be easy to understand. If you choose Tableviewer then the contents of the view is a simple list structure, if it is treeviewer then the contents of a tree structure. The remaining three checkboxes are checked by default here also checked, do not need to do much change, see its description is very easy to understand. Then we click Finish, so a simple plug-in project template has been created.

We can see in this project structure we have just created two classes, one is SampleView another is the Activator class, and icons directory, which stores the plug-in needs all the icons. META-INF directory is stored in the plug-in’s list of files, this file is very important in the back of the development of the We will often touch. Now let’s open the manifest

Eclipse will open a PDE for us, the PDE provides a form-based multi-page plug-in manifest editor, in the figure above we see that the manifest editor consists of nine pages, the first six pages are visualization pages, the last three pages are specific text editor.

How to use Eclipse plug-ins

Eclipse as an integrated IDE development tools for our software development provides a convenient , eclipse in addition to its own powerful features , but also supports feature-rich plug-ins . Today we will look at eclipse how to install plug-ins it.

Tools/Materials

eclipse

windows

Methods/Steps

Installing plug-ins First you must have an installed eclipse development environment. See Figure 1 for an example. Click on the help menu and check the installnewsoftware option. Specifically see the red box symbol in figure 1.

After that, the screen shown below will pop up. Just enter the address of the plugin in the red box.

The following figure shows the plug-in I want to install, enter the address in the geological column, in the following will be able to parse out the plug-in to be installed. Note that the plugin demonstrated in this article my eclipse has already been installed, so the prompt is allitemsareinstalled. so next option is not clickable, to avoid repeated installation.

eclipse a lot of practical plug-ins need to study their own, try it more

.