Chapter 5. JBoss Tools Palette

The JBoss Tools Palette allows you to:

The JBoss Tools Palette provides possibility to add any tag libraries to it. Or you can choose a necessary one from the list of already existent tag libraries:

Pallete Editor

Figure 5.1. Pallete Editor


5.1. Using the Palette

5.1.1. JBoss Tools Palette

In the Palette Editor window(Figure 5.1. "Palette Editor") we can see that every group contains its own subgroups. For example, JSF includes Core, Facelets, HTML. So, in the Palette every group has the next view: <Group name> <Subgroup name>.

JBoss Tools Palette

Figure 5.2. JBoss Tools Palette


By default the Palette is represented in Web Development Perspective with four groups(Figure 5.2. "JBoss Tools Palette"). If you can't see it, select Window > Show View Other... > JBoos Tools Web > JBoss Tools Palette from the menu bar.

By using Show/Hide button you can add any predefined group of tag libraries. It's also possible to create your own group.

5.1.2. Inserting Tags into a JSP File

A new tag can be added into any text file including jsp, xhtml и htm(l).

It's very simple to do this. Place the cursor in the JSP page where you want to add a tag and then click the tag in the palette. In the example below, the commandButton tag has been inserted. Notice also that if you place the cursor over any tag, a balloon tip is shown with all the "tag" attributes.

Inserting Tag

Figure 5.3. Inserting Tag


The cursor position after adding a tag into a file is specified by "|" symbol in the tag template on the right in the Palette Editor window.

Palette Editor

Figure 5.4. Palette Editor


Above you can see where the cursor position for HTML/Form/input is set. So, after adding this tag into your file the cursor will be in the attribute "type". Then, you can straight use the combination of buttons Ctrl + Space to inquire about a prompting.

Cursor position

Figure 5.5. Cursor position


5.1.3. Adding Custom JSF Tags to the JBoss Tools Palette

There are two ways to add any custom or 3rd party tag library to the JBoss Tools Palette:

  • Drag-and-drop from the Web Projects view

  • The Import button on the JBoss Tools Palette

Before you can add your custom component library, you need to make sure it is included in your project. Either place the ".tld" file or the ".jar" that includes your tag library under the lib folder in your project.

5.1.4. Drag-and-Drop

Switch to the Web Projects view and expand the Tag Libraries folder. If the view not active, select Window > Show View > Web Projects from the menu bar.

Web Projects View

Figure 5.6. Web Projects View


Also make sure that the JBoss Tools Palette is open. Select the tag library that you want to add and simply drag-and-drop it on to the JBoss Tools Palette.

You will see the following dialog window. As you can see JBoss Developer Studio takes care of all the details. You just need to set the Group name to which to add this tag library. You can either add this tag library to an existing Group or just create a new one.

Import Tags From TLD File Form

Figure 5.7. Import Tags From TLD File Form


Once you are finished, you will see the new tag library added to the JBoss Tools Palette.

JBoss Tools Palette with New Tag Library

Figure 5.8. JBoss Tools Palette with New Tag Library


5.1.5. Import Button

The same you can do with Import button.

Import Button

Figure 5.9. Import Button


On this screen you can select Browse to locate the tag library that you want to add.

Import Tags From TLD File Form

Figure 5.10. Import Tags From TLD File Form


Now select the TLD file you want to be added:

Select TLD File

Figure 5.11. Select TLD File


5.2. Palette Options

There is possibility to configure the JBoss Tools Palette:

  • to edit the palette content by adding, removing or changing the palette elements

  • to show/hide groups, subgroups

  • to import groups, subgroups

Palette Buttons

Figure 5.12. Palette Buttons


5.2.1. Palette Editor

To edit the Pallete view use Edit button. The Palette Editor provides following possibilities:

  • to work with set of icons.

    Creating a set of icons

    Figure 5.13. Creating a set of icons


  • to edit icons in the chosen set

    Editing icons

    Figure 5.14. Editing icons


  • to edit a group

    Editing a group

    Figure 5.15. Editing a group


  • to edit a subgroup

    Editing a subgroup

    Figure 5.16. Editing a subgroup


  • to edit a subgroup content

    Editing a subgroup content

    Figure 5.17. Editing a subgroup content


  • to edit the Palette element or macro

    Editing the Palette element

    Figure 5.18. Editing the Palette element


    Parameters of the Palette element are put into the table on the right. Table cells are provided with editors and modal dialogue windows for choosing necessary icons. For 'start text' and 'end text'(or macro) there is possibility to control the cursor position by using "|" symbol.

    Parameters of the Palette element

    Figure 5.19. Parameters of the Palette element


5.2.2. Show/Hide

Show/Hide is a very useful feature that allows you to control the number of tag groups that are shown on the palette.

  • Click Show/Hide button

Show/Hide Button

Figure 5.20. Show/Hide Button


  • In the dialog Show/Hide Drawers check the groups you want to be shown on the palette:

Show/Hide Drawers

Figure 5.21. Show/Hide Drawers


  • Click OK . The new groups will now be displayed on the palette:

New Added Groups

Figure 5.22. New Added Groups


5.2.3. Import

The Import button lets you add a custom or 3rd party tag library to JBoss Tools Palette. See here how to add.

5.3. Rich Faces Support

JBoss Developer Studio comes with a tight integration with Rich Faces component framework. After installing JBDS Rich Faces components as well as Ajax4jsf ones are already on the JBoss Tools Palette:

Rich Faces Components

Figure 5.23. Rich Faces Components