- Inherits from:
- EOAssociation : EODelayedObserver (EOControl) : NSObject
- Implements:
- EOObserving (EODelayedObserver)
- Package:
- com.apple.yellow.eointerface
An EOColumnAssociation object cooperates with an EOTableViewAssociation to display values in a column of an NSTableView (Application Kit).
Note: This class doesn't exist in the com.apple.client.eointerface package. |
A column association links an NSTableColumn (Application Kit) to a single attribute of all displayed objects in an EODisplayGroup. The value of each object is displayed in its corresponding row.
Column associations provide values for the cells of each NSTableColumn, and also accept edited values to set in their display groups. The EOTableViewAssociation receives target, delegate, and data source messages from the table view, and forwards them as needed to the appropriate column association.
EOColumnAssociations provide values using NSTableView's
DataSource methods tableViewSetObjectValueForLocation
and tableViewObjectValueForLocation
.
This allows values with non-string representations to be displayed.
For example, if an NSImageCell (Application Kit) is used as an NSTableColumn's
data cell, an EOColumnAssociation can be used to display NSImages (Application
Kit) in the NSTableView.
Usable With |
NSTableColumn (Application Kit) |
Aspects | |
value | An attribute of the objects, displayed in each row of the NSTableColumn. |
enabled | A boolean attribute of the objects, which determines whether each object's value cell is editable. Note that because EOTableViewAssociation also uses this aspect, you can use it with different keys to limit editability to the whole row or to an individual cell (column) in that row. |
Object Keys Taken | |
identifier | An EOColumnAssociations sets itself as the identifier
of its NSTableColumn. (Note: This key isn't formally reserved
by the objectKeysTaken method, as Interface
Builder doesn't treat it as an outlet.) |
To display the last and first names of objects in a Talent
display group, in Interface Builder, Control-drag a connection from
the last name column to the display group. Select EOColumnAssociation
in the Connections inspector, and bind the value
aspect
to the "lastName" key (this automatically creates an EOTableViewAssociation
to manage the individual columns). Repeat to set up a column association
for the first name. Now when you run the application, the last and
first names of each Talent object in the display group's displayedObjects array are put in
the corresponding row.
- Sorting rows
- setSortingSelector
- sortingSelector
- Table view data source methods
- tableViewSetObjectValueForLocation
- tableViewObjectValueForLocation
- Table view delegate methods
- tableViewShouldEditLocation
- tableViewWillDisplayCell
- Control delegate methods
- controlDidFailToFormatStringErrorDescription
- controlIsValidObject
- controlTextShouldBeginEditing
public
EOColumnAssociation
(Object aDisplayObject)
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)
public boolean
controlDidFailToFormatStringErrorDescription
(
com.apple.yellow.application.NSControl aTableView,
String aString,
String errorDescription)
public boolean
controlIsValidObject
(
com.apple.yellow.application.NSControl aControl,
Object anObject)
public boolean
controlTextShouldBeginEditing
(
com.apple.yellow.application.NSControl aControl,
com.apple.yellow.application.NSText text)
public void
establishConnection
()
See Also: breakConnection ( EOAssociation)
public void
setSortingSelector
(NSSelector aSelector)
For more information on these selectors, see the section "Comparison Methods" in the EOSortOrdering class specification (EOControl).
If the EOTableViewAssociation for the receiver's NSTableView (Application Kit) sorts its rows, it applies this method as needed to sort them. The default sorting selector is CompareAscending.
public NSSelector
sortingSelector
()
public Object
tableViewObjectValueForLocation
(
com.apple.yellow.application.NSTableView tableView,
com.apple.yellow.application.NSTableColumn tableColumn,
int rowIndex)
value
aspect.public void
tableViewSetObjectValueForLocation
(
com.apple.yellow.application.NSTableView tableView,
Object value,
com.apple.yellow.application.NSTableColumn tableColumn,
int rowIndex)
value
aspect to value. public boolean
tableViewShouldEditLocation
(
com.apple.yellow.application.NSTableView tableView,
com.apple.yellow.application.NSTableColumn tableColumn,
int rowIndex)
enabled
aspect
is bound and its value for the object at rowIndex is false.
Otherwise returns true. Note that because the enabled
aspects
of EOTableViewAssociation and EOColumnAssociation can be bound to
different keys, you can limit editability to the whole row or to an
individual cell (column) in that row.public void
tableViewWillDisplayCell
(
com.apple.yellow.application.NSTableView tableView,
Object aCell,
com.apple.yellow.application.NSTableColumn tableColumn,
int rowIndex)
enabled
aspect of
the object at rowIndex.