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 the browser's annotations of the
entire project desktop (i.e. Explorer), including all installed root
nodes, as well as a representation of the
TopManager
, giving
you access to many parts of the IDE.
- 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 Browser.
You will see the tree rooted at that node.
- From anywhere, select Tools | Bean Browse Master.
You will get a fresh copy (in its own Explorer) of the node normally displayed
on the Runtime tab.
- From anywhere, select Tools | Bean Browse Window.
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 file system.
-
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.
-
Clipboard
objects show the objects associated
with each currently supported data flavor in their
transferables. Go to TopManager.clipboard
for
example. Also ExClipboard
objects will update this
information when it changes, and MultiTransferObject
objects are broken apart into constituent flavors.
-
Places
(from the TopManager and Places APIs)
will show the corresponding places, both folders and nodes.
- Objects with a
getCookie
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.
Here is an example of what you can do with the Browser:
- Open Bean Browse Master (or go to Runtime | Bean Browser). Click on the Property Sheet. Make the
window a little bigger.
- TopManager -> Properties.
- windowManager -> Properties.
- mainWindow -> Components.
- (only child) -> Components.
- null.layeredPane -> Components.
- (MenuBar) -> Components.
- First child: property text in Property Sheet should read
File
.
- Change property to
Phile
. IDE menu bar should change.
Remember to look at tool tips on the nodes, and have fun browsing the IDE!
Node Information
Associated with the Bean Browser is a special utility action to help you see information
about nodes and understand cloning, the node hierarchy, and visualizers. If you select
any node, the tools action Explore node... will be enabled, and will have
several subitems you can choose; each will open a new Explorer window:
- Itself just shows the actual node.
- Its clone clones it using
Node.cloneNode
and
displays the result. So you can see if your cloning technique works correctly.
- Its parent shows its parent node, if any.
- Its parent's clone clones and displays its parent node, if any.
- Its visualizer shows its visualizer, i.e. the way the node
is presented visually in the Explorer and possibly elsewhere. Note that the visualizer
structure represents a "snapshot" of the node, so you can see how many of its subnodes
are actually being stored in the system, and possibly diagnose related problems.
- Itself as a bean shows the actual node object using
the Bean Browser. This is handy for finding out its actual class, looking for cookies,
and lots of other things.
Additionally, this action is presented in the context menu of every Bean Browser node
which represents a real node (i.e. every "wrapper"). If you select it on a Bean Browser
wrapper node, the real underlying node is used instead, which is occasionally useful.
Back to Contents