[RSS]

Mozilla application Addons Development in Netbeans

Doc Contributor: Cydey



Introduction


We can easily setup Netbeans so that we are able to create no only Firefox Addons but also addons for the following:
  • Mozilla Firefox
  • Mozilla Thunderbird
  • Mozilla Suite 1.x
  • Netscape
  • SeaMonkey
  • Flock
  • Sunbird
  • Nvu
This can be achieved using the foxbeans module for Netbeans available at http://plugins.netbeans.org website.

Downloading Foxbeans Netbeans Module


Browse to the requisite page

  • Click the download link to download the module as a .nbm file. A pop-up window would open up asking for where to download. You can create a separate folder which would contain all the netbeans modules you wish to install.

Choose where to download

Installing Foxbeans Netbeans Plugin


1. Open the Netbeans IDE. (Netbeans 6.0 used in the images)

Netbeans Loading

2. On the Menu Bar choose Tools and further choose the 2nd last option Plugins from the submenu.

Plugin Manager

3. The Plugin manager by default opens up the Update Tab; change the tab to Downloaded.

Plugin Manager

4. Click the Add Plugins button; A window pops up; navigate to the directory where you downloaded the plugin and add it. It shows up as visible in the figure.

Install the Plugin

Install the Plugin

5. Click the install button on the Bottom-left corner of the window.

Install the Plugin

6. A confirmation window pops up; click Next to continue the installation.

Accrpt the licence agreement

7. Next you need to read the license agreement and accept it. The plugin is licensed under CDDL.

Accept the licence agreement

8. Since the plugin is designed by a windli it is not digitally signed and you would need to ignore and continue inspite of the Validation Warning.

Ignore the Warning

9. The plugin would install automatically; Once the installation is finished the window would show an option to restart the IDE. Please do so to complete the installation.

Restart to complete Installation

Creating a Sample Mozilla Addon


1. When the Netbeans IDE restarts, click on the New Project Menu item to start creation of a New Project.

Create New Project

2. Choose the first option of Mozilla Addons and create a Mozilla Addon Project

Create Mozilla Addon Project

3. Specify a Project name and click Next.

Specify Project Name

5. Next we have to enter Addon settings. Choose a Mozilla application to associate the addon to and consequently browse to the application as shown. Presently, we are going for Mozilla Firefox.

Creating Project

Creating Project

Creating Project

6. Finally, finish and create the New Project.

Creating Project

Compiling and Testing the Addon


1. Now, you can see the basic Addon Project structure consisting of build.xml and other directories. I will not go into details of how to build an addon. However, now we have set up a platform where we can develop addons for any Mozilla application be it
  • Mozilla Firefox
  • Mozilla Thunderbird
  • Mozilla Suite 1.x
  • Netscape
  • SeaMonkey
  • Flock
  • Sunbird
  • Nvu

Directory Structure

2. Next, we can compile and run the project to test that all settings have been correctly configured. Just Click on the Run Project button and find yourself with a new window of firefox which contains the sample addon.

Existing build.xml

Run Main Project

3. Mozilla Firefox window opens up. If you observe carefully you will observe that My First Addon menu item under Tools. You can click the same to test that the sample addon works.

Firefox

Firefox

Firefox

References

1. http://www.rietta.com/firefox/Tutorial/overview.html

2. http://developer.mozilla.org/en/docs/Extensions

Attachments

Code1.png Info on Code1.png 96551 bytes
Code2.png Info on Code2.png 56444 bytes
Code3.png Info on Code3.png 13253 bytes
Download1.png Info on Download1.png 98322 bytes
Download2.png Info on Download2.png 15139 bytes
Download3.png Info on Download3.png 140725 bytes
Install1.png Info on Install1.png 135203 bytes
Install2.png Info on Install2.png 273185 bytes
Install3.png Info on Install3.png 59158 bytes
Install4.png Info on Install4.png 292740 bytes
Install5.png Info on Install5.png 259248 bytes
Install6.png Info on Install6.png 304908 bytes
Install7.png Info on Install7.png 123145 bytes
Install8.png Info on Install8.png 228968 bytes
Install9.png Info on Install9.png 303141 bytes
Project1.png Info on Project1.png 95574 bytes
Project10.png Info on Project10.png 287780 bytes
Project2.png Info on Project2.png 181167 bytes
Project3.png Info on Project3.png 421008 bytes
Project4.png Info on Project4.png 290773 bytes
Project5.png Info on Project5.png 64316 bytes
Project6.png Info on Project6.png 288782 bytes
Project7.png Info on Project7.png 300846 bytes
Project8.png Info on Project8.png 272486 bytes
Project9.png Info on Project9.png 419332 bytes
firefox1.png Info on firefox1.png 50688 bytes
firefox2.png Info on firefox2.png 12700 bytes
firefox3.png Info on firefox3.png 11220 bytes
install4.png Info on install4.png 292740 bytes