Hard coded in the dialog box are about 15 different labels and 5 different icons. The user selects one of each and tweaks the selected HTML tags, if necessary. Then the user clicks OK. Immediately the HTML category of the HTML Palette contains the new palette item:
And now, the user can drag that item and drop it in an HTML file. When he/she does so, the HTML selection made at the start is dropped in the HTML file.
And how is this possible? All because when the user clicked OK in the dialog box, the following XML file (called "header_1.xml", in the example above) was created in the user directory's HTMLPalette/HTML folder:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE editor_palette_item PUBLIC "-//NetBeans//Editor Palette Item 1.0//EN"
<icon16 urlvalue="org/netbeans/modules/extendhtmlpalette/Datasource16.png" />
<icon32 urlvalue="org/netbeans/modules/extendhtmlpalette/Datasource32.png" />
Because of the DTD and root element, the Component Palette recognizes it as a palette item and displays it. The IDE also allows the user to drag and drop the tags in this file into the Source Editor. Handy, right? If you're interested in this module, you can download the NBM file here (created and built in NetBeans IDE 5.5 RC1):