Eclipse plugins are Java libraries that are running by Eclipse and can use Eclipse IDE APIs to extend Eclipse's functionality via many different ways.
Plugins allow you to realize your own menus and toolbar items, new features to code editor, new project and item templates, and your own WYSIWYG editor on Eclipse IDE base. Eclipse IDE + Your Plugins = Your Own IDE.
- Eclipse IDE + ADT Plugin = Eclipse+ADT, IDE for Android applications
- Eclipse IDE + Blackberry Plugins = Momentics IDE, IDE for BlackBerry applications
- Eclipse IDE + Titanium Plugins = Titanium IDE, IDE for mobile applications
Let's start writing Eclipse plugins today! At first, let's write a simple plugin that adds a few menu items and subitems.
1. Tools Preparation
At first, you should check if Eclipse contains PDE plugin = allows plugin development.
- Run the Eclipse.
- Go to File -> New -> Projects...
- Check if there is a Plug-In development group. If there is none, you should firstly install PDE plugin into Eclipse.
Go to Help menu. If there are no "Eclipse Marketplace..." items, you at first must install Marketplace client. Else, you can go to PDE plugin installation.
Marketplace Client Installation
- Go to Help -> Install New Software...
- Click Add...
- Set Location field to http://download.eclipse.org/releases/indigo and press OK. Wait while Eclipse will fetch an Indigo repository items.
- Expand the General Purpose Tools group and check Marketplace Client. Press Next.
- And Next, again.
- Accept license terms, and press Finish.
- Wait while Marketplace is being installed... And restart the Eclipse. Now, you can go to install PDE plugin.
PDE Plugin Installation
- Go to Help -> Eclipse Marketplace...
- Print PDE to Find field, and press Enter.
- Press the Install button on "Eclipse PDE" item.
- Press Next.
- Accept license terms and press Finish.
- Wait while PDE is being installed... And restart the Eclipse. Now, you can go to create your own plugin.
2. Create a Plugin
- Run the Eclipse.
- Go to File -> New -> Project...
- Go to Plug-In development -> Plug-in Project. Press Next.
- Type some project name. It's recommended to use org.*.* format, i.e. org.plugin.helloworld.
- (Optionally) Specify Plug-In Provider Name (print your brend nick or your company brand), and Plug-In Name. Press Next.
- Select a "Hello, World" plug-in template. Press Finish.
3. Debug your Plugin
Press a Run button. You'll see a new Eclipse window with "Sample Menu" with "Sample Action" item.
Click this item, and you'll see a message box with "
Hello, Eclipse world".
4. Install your Plugin to Eclipse
- Right-click your plugin project in Package Explorer window.
- Press Export... in shown context menu.
- Select Plug-In Development -> Deployable plug-ins and fragments (or Deployable plug-ins and fragments directly in old Eclipses).
- Use it to get plugin JAR file, i.e. org.plugin.helloworld_126.96.36.199504042200.jar
- Close Eclipse. Copy this JAR to eclipse/plugins/ path. Run Eclipse again.
- Now you'll see "Sample Menu" with "Sample Action" item on ever Eclipse run.
Note: You can write an automatic installer for your plugin for Windows users, or publish your plugin to... the Eclipse Marketplace! :))