Palettes
A palette is a collection of resources (such as images, static or dynamic HTML elements, and components). You can drag elements from a palette to a component to use them. You can also drag elements from a component to a palette to store them.Palettes appear in WebObjects Builder's palette window. To open the palette window, click on the toolbar or choose Tools Palette.
The icons at the top of the palette window show the available palettes. To select a palette, click its icon. Two pre-configured palettes are provided: Java client-side components and components from the WOExtensions framework.
You can create your own palettes to store frequently-used items, such as custom forms, tables, or images, and you can load palettes created by someone else.
To create a new palette, choose Palettes New Palette. A panel appears, asking you to specify a location to save the palette. (A palette is represented on disk as a folder with the extension .wbpalette.) The palette appears in the palette window with the default palette icon . To change the palette's icon, see "Changing a Palette Icon".
To add an existing palette to the palette window:
To remove a palette from the palette window:Creating and Using Palette Items
To add an item from a component to a palette:- Make the palette editable.
- In the component window, select the element or elements that you want to add to the palette.
- Hold down the Alt key and drag the selection to the palette.
If the palette's background is gray, you can't make any changes to it. To enable editing, choose Palettes Make Editable. The palette's background changes to white and its title says "Alt-drag to insert item." Note: When you first create a palette, it is editable until you save it.
The cursor changes to and displays in the palette when you are done dragging. You can change the title of the item by selecting its name and typing. To change the item's icon, see "Changing a Palette Icon".
- Make the palette editable.
- Locate the item in the file system.
- Drag the item onto the palette.
For example, to add a component to a palette, you would drag its .wo folder to the palette.
Note: On Windows NT, you can't drag an item directly to the palette, because the palette window doesn't appear unless a WebObjects Builder window is in the foreground. Therefore, you must drag the item to WebObjects Builder's icon in the taskbar at the bottom of the screen and hold it until the palette window appears. With the mouse button still down, drag the item to the palette.
To copy an item from a palette to the component window:
- Make sure the palette is not editable (if its background is white, choose Palettes Make Editable).
- Drag the item from the palette to the location in the component window where you want it to appear.
Note: If the palette is editable, you can drag the item to the window, but it will disappear from the palette.
Changing a Palette Icon
You can replace the icon of any palette, or any item in a palette, with an image of your own choosing. To do so:- Open the palette window and select the palette whose icon you want to change.
- Make the palette editable.
- Drag an image from the file system onto the palette's icon.
- Save the palette.
You can use any image file recognized by WebObjects Builder (such as a .gif, .tif or .jpg file) to change the icon of a palette or of any item in the palette.
Note: The same caveat for dragging items to the palette on Windows NT applies (see "Creating and Using Palette Items").