JBoss.orgCommunity Documentation

Chapter 5. JBoss Tools Palette

5.1. Palette Options
5.1.1. Palette Editor
5.1.2. Show/Hide
5.1.3. Import
5.2. Using the Palette
5.2.1. Inserting Tags into a JSP File
5.2.2. Adding Custom JSF Tags to the JBoss Tools Palette

This chapter will introduce you to the functionality provided by JBoss Tools Palette. The Palette allows you to quickly and easily create your JSP or JSF pages.

The JBoss Tools Palette allows you to:

The JBoss Tools Palette contains a developer's project tag libraries and provides possibility to add any tag libraries to it. Also you can choose a necessary one from the list of already existing tag libraries:

Default View of The JBoss Tools Palette

Figure 5.1. Default View of The JBoss Tools Palette

By default the JBoss Tools Palette is not displayed. If you want to use it select WindowShow View Other...JBoss Tools WebJBoss Tools Palette from the menu bar.

The standard Eclipse Palette is displayed by default in both Web Development and Seam perspectives. Now the standard Eclipse Palette is featured with all JBoss Tools Palette options and capabilities.

To open the standard Eclipse Palette navigate to WindowShow ViewOthersGeneralPalette.

The differences between the two palettes are as follows:

  • The standard Eclipse Palette is blank by default. Content of the palette is available only if Visual Page Editor is open and active, while JBoss Tools Palette always contains a predefined set of components.

  • The Expanded/Collapsed state of components in the standard Eclipse Palette is not global as in JBoss Tools Palette. State is associated with an instance of Visual Page Editor. It means that the state can be different for various files and each new file opened in Visual Page Editor will have the default state of Palette with all components collapsed.

The Palette can be customized by using the following buttons on the Palette toolbar, which provide the following functionality:

The JBoss Tools Palette contains existing libraries of tags, and the Palette editor provides a way to add a new library, or edit existing libraries.

To open the editor, click on the Palette Editor icon ( ).

The window has two parts. There is a reflected grouped list of components on the left side of the palette editor. Each group is divided into multiple groups, each of which is a tag library. To the right side of the palette editor is an editing window where it is possible to change values of group or tag library attributes that you have chosen on the left part of the window.

It can also be done by right click and using Edit… option.

For example, JSF group consists of Core, Facelets, HTML tag libraries and the attributes as name, description and hidden which are available for editing:

The Palette Editor provides the following functionality when working with existing tags or icons:

If you have changed any object in the tree view and you don't like the final result you can always use the Restore Defaults button. Clicking this button will restore defaults for the object selected and for its children elements. Please remember that the button will only restore data for objects defined in the default palette. If selected object is created by you, the button will be disabled. Child objects added by you will not be removed.

When updating JBoss Tools the palette content is not updated.

There are two ways to add any custom (including custom Facelets libraries) or 3rd party tag library to the JBoss Tools Palette:

Before you add your custom component library, you need to make sure it is included in your project. You need to either place the TLD file or the JAR that includes your tag library under the lib folder in your project. Or you can just add TLD or JAR file to the classpath and the library will be added to the Tag Library List in Web Projects View.

Tag libraries can also be imported with the Import button ( ). This button is found at the top right side of the JBoss Tools Palette.

By clicking on the Import button you will see the Import Tag window a similar like in the Drag-and-Drop method (see Section, “Drag-and-Drop”). Set the name and prefix of the library and Library URL. You also need to set the Group name to which you'd like to add your tag library.

Like in the previous method you can add it to an existing Group or create a new one. On this Import Tag form you can use Browse... button to locate the tag library that you want to add: