# Property Sheet Reference

This document details a few ways in which the Property Sheet can be customized or affected by system properties, UI manager keys, non-normative hints from Nodes and such.

## System properties that affect the behavior of the Property Sheet

Note that generally these flags may or may not be supported in future versions. The following flags may be passed to the JVM in the form `runide -J-Dsome.property=true` which affect the user interface of the Property Sheet. Generally they represent either cases where different applications have different requirements, or where there is some contention about which style is the most effective.

- netbeans.ps.noCustomButtons - Do not display custom editor buttons for properties unless the user has clicked the property to put it into edit mode. This mimics the behavior of the original Property Sheet, and looks somewhat cleaner, but has the side effect that properties are not automatically updated by clicking on a checkbox, and combo box editors do not automatically open on the first click.
- netbeans.ps.forceRadioBoolean - always use a radio button editor for boolean/Boolean properties, instead of a checkbox
- netbeans.ps.noCheckboxCaption - do not display a caption on checkbox boolean editors displayed in the Property Sheet
- netbeans.ps.hideSingleExpansion - In sort-by-category mode, hide the category expander for nodes that posess only one set of properties
- netbeans.ps.neverMargin - Suppress the left margin of the property sheet - less aesthetically pleasing, but useful on small displays
- netbeans.reusable.strictthreads - diagnostic flag to force an exception to be thrown if code attempts to force the Property Sheet to paint from some thread other than the AWT event thread
- netbeans.ps.forcetabs - debugging flag which forces the property sheet to use tabs instead of expandable sets for all property sets

## UIManager settings that affect Property Sheet display characteristics

The Property Sheet will look for a number of custom values in UIManager, which may be supplied to affect its appearance, either by a themes.xml file in the user directory, or by a custom look and feel. It is not required that UIManager return non-null for any of these values - they are optional for enhancing the presentation of the Property Sheet:

- Tree.altbackground - an alternate Color to use for every other line in the Property Sheet
- PropSheet.setBackground - Background color for expandable sets. If not set, a color is derived from the default table background color.
- PropSheet.setBackground - Background color for expandable sets when selected. If not set, a color is derived from the default table selection background color.
- netbeans.ps.rowheight - An Integer specifying a fixed height for rows in the Property Sheet, regardless of font size. If not set, the height is derived from the font size.
- netbeans.ps.iconmargin - Integer pixel count to add to the left column margin in the Property Sheet
- `netbeans.ps.combohack`-Forces the combo box editor to use a heavyweight popup window, used to solve a problem with some window managers.
- `netbeans.ps.forcetabs`-Force each property set to be displayed in a separate tab (normally this is done only by providing a hint from a PropertySet via getValue("tabName").
- `netbeans.ps.nevertabs`-Disable use of tabs in the Property Sheet even if the property set provides a tab name via the above mentioned hint

## Customization of PropertyPanel

The PropertyPanel component is a generic component which will display a property editor for a single property - rather like a single cell of the Property Sheet. There are a few non-normative client properties which may be set on it to change its behavior, via `putClientProperty()`.

- `radioButtonThreshold`-Integer - display a set of labelled radio buttons instead of a combo box if the property editor returns less than the specified number of tags from `PropertyEditor.getTags()`
- `suppressCustomEditor`-Do not display a custom editor button even if the property's associated property editor supports one
- `useLabels`-Use the property's display name as the label portion of a checkbox boolean editor, if the property is boolean, so that there is some indication of keyboard focus. If radioButtonThreshold is in use and a property panel will display radio buttons, this will also affect whether a TitledBorder is used for the group of radio buttons.

## Using Tabs in a Property Sheet in a stand-alone application

The Property Sheet can display different property sets in different tabs - all sets that return the same value from `PropertySet.getValue("tabName")` will be aggregated together on the same tab.

To use this functionality in a standalone application, an implementation of `org.netbeans.modules.openide.explorer.TabbedContainerBridge` must be available via `Lookup.getDefault()`. For an example, see `org.netbeans.core.windows.view.ui.tabcontrol.TabbedContainerBridgeImpl`. A non-functional implementation is provided if none is present via lookup, to enable unit testing.