Plug-in - NetBeans

netbeans.org

Plug-in - NetBeans

Plug-in Module Quick Start

NetBeans API List (see links) to continue

developing the module.

Using the Action Wizard

In the Projects window, right-click the

project node and choose New>File/Folder.

In the New File wizard, choose NetBeans

Module Development under Categories,

and Action under File Types. Click Next.

In the Action Type panel, accept the

defaults and again click Next. In the GUI

Registration panel, select Global Menu

Item, and then Global Toolbar Button. Set

the following values:

• Category: Tools

• Menu: Tools

• Position: Tools - HERE -

• Toolbar: Build

• Position: Run Main Project - HERE

- Debug Main Project

Select Separator Before and Separator

After in the Global Menu Item section. You

should now see Figure 2.

Note the following about the sections in

the GUI Registration panel:

A 2

• Category. Specifies where the action will be

located in the Keymap section of the Options

window.

• Global Menu Item. Specifies the menu where

the action will be registered as a menu item. The

position of the menu item within the existing items

in the menu can also be set here.

• Global Toolbar Button. Specifies the toolbar

where the action will be registered as a button.

The position of the toolbar button within the existing

buttons in the toolbar can also be set in this

section.

• Global Keyboard Shortcut. Specifies a key

stroke that will invoke the action.

• File Type Context Menu Item. Specifies the

MIME type of the file type where the menu item will appear.

The position of the menu item within the existing menu items and its

separators can also be set here.

• Editor Context Menu Item. Specifies the MIME type for the

editor where the menu item will appear. You can also set here the

position of the menu item within the existing menu items and

its separators.

Click Next. In the Name, Icon, and Location panel,

type “MyFirstAction” in Class Name and type “My

First Action” in Display Name. In Icon, browse to

a 16x16 pixel icon in your filesystem. For

example, you can find some

16x16 pixel icons at the following

location within your

NetBeans IDE 5.0 installation

directory:

enterprise2\jakarta-tomcat-5.5.9\

server\webapps\admin\images

Click Finish. The IDE

creates MyFirstAction.java in

org.myorg.myfirstmodule and

opens it in the Source Editor.

Listing 1 shows what you

should see.

A

Figure 2

Plug-in

module GUI

Registration

First Edition N 55

More magazines by this user
Similar magazines