Overview

# Introduction

This document lists changes made to the Palette API/SPI.

# Index of APIs

- Palette API

# Incompatible changes by date

Fuller descriptions of all changes can be found below (follow links).

Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.

# All changes by date

- (Sep 26 '06) Added helpId attribute
- (Jun 7 '06) The Common Palette API has been stabilized.
- (Sep 13 '05) Added support for default drag and drop operations
- (Aug 10 '05) Palette client support released
- (Aug 9 '05) Added a new optional attribute that can specify the width of items in the palette.
- (Aug 8 '05) Removing unnecessary exceptions from PaletteFactory
- (Jul 21 '05) Initial version released

# Changes by version

These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled `1.20`, your manifest should contain in its main attributes the line:

    OpenIDE-Module-Module-Dependencies: org.netbeans.spi.palette > 1.20

- (1.6) Added helpId attribute
- (1.5) The Common Palette API has been stabilized.
- (1.4) Added support for default drag and drop operations
- (1.3) Palette client support released
- (1.2) Added a new optional attribute that can specify the width of items in the palette.
- (1.1) Removing unnecessary exceptions from PaletteFactory
- (1.0) Initial version released

# Changes by affected class

# Details of all changes by API and date

## Palette API

### Added helpId attribute

Sep 26 '06; API spec. version: 1.6; made by: saubrecht; issues: #77387

Now it's possible to add helpId attribute to palette's root, categories and items that will be used to create appropriate HelpCtx. The attribute can be specified in XML layer as a folder (palette's root and categories) or file attribute (palette items) or it can be provided directly by appropriate Nodes.

When F1 key is pressed in palette's window then first the selected item is asked for HelpCtx id. If no item is selected or it does not provide specific help id then selected category is checked for help id. If the category does not provide any help id either then palette's root is asked for help id. If the root does not define any then the default help id CommonPalette will be used.

### The Common Palette API has been stabilized.

Jun 7 '06; API spec. version: 1.5; made by: saubrecht; issues: #77387

To indicate that this is now considered a stable API, the major release version was incremented to 1 from 0.

### Added support for default drag and drop operations

Sep 13 '05; API spec. version: 1.4; made by: saubrecht
The abstract class DragAndDropHandler now provides default implementation for all drag and drop operations. The only method that needs to be overridden is `void customize( ExTransferable t, Lookup item )` to provide custom data flavors for items dragged from the palette to editor.
There are also new methods (and their default implementations) in this class that handle reordering of categories and reordering of items (i.e. drag and drop operations withing the palette window).

### Palette client support released

Aug 10 '05; API spec. version: 1.3; made by: lkotouc
The first release of the Palette client support. It involves namely DTD describing item definition file format and some implementation addons regarding definition file parsing and custom implementation class loading. The palette item implementor can either directly provide the item body or her own item class implementing `org.openide.text.ActiveEditorDrop` interface. Lookup that holds object(s) representing the selected item then associates custom item class instance with the `org.openide.text.ActiveEditorDrop.class` key and the body with `java.lang.String` key.

### Added a new optional attribute that can specify the width of items in the palette.

Aug 9 '05; API spec. version: 1.2; made by: saubrecht
There's a new attribute "itemWidth" that can be set for palette's root node (or for palette's root folder in the layer). This attribute defines the width in pixels for all items in the palette thus forcing the same number of columns for all categories. If the attribute is omitted or its value is "-1" then the item widths will be calculated dynamically. The attribute is read-only.

### Removing unnecessary exceptions from PaletteFactory

Aug 8 '05; API spec. version: 1.1; made by: saubrecht
Removed IOException from the signature of methods in PaletteFactory that accept Node as an argument.

### Initial version released

Jul 21 '05; API spec. version: 1.0; made by: saubrecht
The first initial release of the Palette API.

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.