- Inherits from:
- EOAssociation : EODelayedObserver (EOControl) : NSObject
- EOObserving (EODelayedObserver)
An EORecursiveBrowserAssociation is the default association for use with a multi-column NSBrowser (Application Kit).
|Note: This class doesn't exist in the com.apple.client.eointerface package.|
EORecursiveBrowserAssociation manages hierarchical structures, such as a company's management chain-the first column is filled with top-level managers, the second column is filled with the employees who report directly to the selected top-level manager, and so on.
|NSBrowser (Application Kit)|
|rootChildren||An array of objects with which to fill the browser's first column.|
|title||An attribute of objects to display in the browser's cells.|
|isLeaf||A boolean attribute of objects that determines whether
the corresponding browser cell is a leaf (
|children||An NSArray attribute of the selected object, with which
to fill the next column. This aspect is only used when the selected
object is a branch (responds
|Object Keys Taken|
|target||used to handle user click actions within the browser. The association sends the proper synchronization msg to the DG.|
|delegate||used to fill in the values of the browser|
Suppose you want to display a company's management structure in a browser. Start with a display group for Employee objects. Programmatically qualify this display group to fetch only the top-level management (the Employees with which to fill the browser's first column).
Drag a browser into a window. Be sure to set it to "Allow
branch selection." Control-drag from the browser to your Employee
display group. In the Interface Builder's Connections Inspector (EORecursiveBrowserAssociation-labeled
EORecBrowser-is chosen by default), bind the
(a recursive, to-many relationship). Making this binding has the
- Creating a new display group named "LastEmployeeColumn." More generally, the new display group has a name of the form, "Last NameOfFirstDisplayGroup Column."
- Preconnecting the new display group to a data source.
- Binding the EORecursiveBrowserAssociation's
childrenaspect to the
directReportsrelationship-the same relationship used for the
Now bind the
(Note that if you try to bind these aspects before you bind the
you'll bypass work that the association can do for you automatically.) Control-drag
from the browser to either of the display groups, and bind the association's
title aspect to
fullName key and the
isIndividualContributor key (a method
the Employee is a manager with direct reports). It doesn't matter
what display group you make these bindings to, because the association
reference the same kind of objects (have the same keys).
Now the association populates the browser's columns based on the selection in the previous column. You might want to create a master-detail association between the LastColumn display group and another display group. For example, the Employees application might display information about the employee selected in the browser's right-most column.
The rootChildren Aspect
When you bind an EORecursiveBrowserAssociation's
the association assumes that
be bound to the same key. However, it's possible for you to bind
these aspects to different keys. If you want to do this, you'll
have to disconnect the
that the association creates automatically, and then rebind it to
the key you want to use. Note that you only have this freedom with
the first column. Subsequent columns must all use the same key to
Creates a new EORecursiveBrowserAssociation
to monitor and update the values in aDisplayObject, an
NSBrowser (Application Kit).
You normally set up associations with the Interface Builder application, in which case you don't need to create them programmatically. However, if you do create them up programmatically, setting them up is a multi-step process. After creating an association, you must bind its aspects and establish its connections.
See Also: bindAspect (EOAssociation), establishConnection (EOAssociation)