API Support Module - Bean Browser

## Bean Browser

The Bean Browser facility lets you look at the structure of objects live in the IDE, provided they can be represented as JavaBeans (which many API-related objects can). There are several ways to use the Bean Browser:

- Flip to the Runtime tab in the Explorer and look under the Bean Browser node - you will see some important folders in the system filesystem. You will also see the lookup helper.
- Use the Bean Tester executor on some object with a public default constructor. An instance will be constructed and displayed, permitting you to examine its structure in detail, live inside the IDE.
- Select some node and choose Tools | Bean Browse Node from the context menu. You will see the tree rooted at that node.
- Select some window and choose Tools | Bean Browse Window from the main menu. You will be able to see the tree of JavaBean components present in the selected window.

In the Bean Browser, by default nodes just show up as themselves, but they will show extra children. First of all, their regular children are displayed in a special subnode, to separate them from other things. Other subnodes may be displayed, including:

- A list of all properties of the node, broken up by property set. These display as object nodes, which means they can in turn show hierarchy for e.g. Java collections or arrays, etc. Properties which are themselves beans will show up as bean nodes, i.e. their default representation.
- A list of all computed properties of the node (if it represents a Bean with an instance), under Raw bean properties. Here, `BeanInfo` is simply ignored, and all getter methods are treated as fair game--even if they are not public methods. Useful for classes which have `BeanInfo` which does not include all the information you might to debug with.
- Any node with an `InstanceCookie` will show that instance as a Bean.
- `Node` properties will appear as themselves, after an introduction.
- `Container` properties (i.e. visual beans) will show the AWT component hierarchy.
- `FileSystem` properties additionally display the root folder. This lets you browse to a specific file in the filesystem.
- `FileObject` properties additionally display the data object (from which you can also see the node delegate). And you get a list of file attributes by name. File objects which are part of a `MultiFileSystem` will show the original filesystem which produced them. In the case of file objects in the system filesystem, you can see the provenance of the file, indicating whether it was defined in a module (including the core - generally some XML layer); the user directory (global setting); the installation directory (rarer); or the current project.
- `Clipboard` objects show the objects associated with each currently supported data flavor in their transferables. Go to `java.awt.Clipboard` under Lookup results for example. Also `ExClipboard` objects will update this information when it changes, and `MultiTransferObject` objects are broken apart into constituent flavors.
- Instances of `Lookup.Provider` method (such as nodes, data objects, and so on) will be examined for a list of all standard cookie types, and these cookies will be shown in a separate sublist for examination. (Details...) It is possible to recognize your own cookie types, too; if your module defines a cookie you wish to see listed, simply add an XML file to its layer underneath `Services/Hidden/` matching the DTD at `http://www.netbeans.org/dtds/apisupport-cookie-class-list-1_0.dtd`.
- When browsing objects representing nodes themselves, you can see: the clone of the node (from `Node.cloneNode()`) to test your cloning logic; the visualizer, to see which subnodes have been created already; and the original node, when working with `FilterNode`s.