- Inherits from:
 - EOAssociation : EODelayedObserver (EOControl) : NSObject
 
- Implements:
 - EOObserving (EODelayedObserver)
 
- Package:
 - com.apple.yellow.eointerface
 
An EOTableViewAssociation object manages the individual EOColumnAssociations between an NSTableView (Application Kit) and an EODisplayGroup.
| Note: This class doesn't exist in the com.apple.client.eointerface package. | 
An EOTableViewAssociation can sort the objects in the display group by the left-to-right order of the table columns. The first EOColumnAssociation to be bound to a table view automatically creates the EOTableViewAssociation; you should rarely need to do so yourself.
An EOTableViewAssociation receives data source and delegate messages from the table view, some of which it handles itself, and some of which it forwards to the appropriate EOColumnAssociations. For more information, see the EOColumnAssociation class specification.
| Usable With | 
| NSTableView | 
| Aspects | |
| source | Bound to the EODisplayGroup providing objects. This aspect doesn't use a key. | 
| enabled | A boolean attribute of the objects, which determines whether each object's row is editable. Note that because EOColumnAssociation 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. | 
| textColor | An NSColor attribute of the objects, which determines the color of text for each object's row in the NSTableView. | 
| bold | A boolean attribute of the objects, which determines whether each objects row is displayed in bold or regular weight text. | 
| italic | A boolean attribute of the objects, which determines whether each objects row is displayed in italic or normal angle text. | 
| Object Keys Taken | |
| dataSource | An EOTableViewAssociation responds to some data source messages and forwards others to the appropriate EOColumnAssociation. | 
| delegate | An EOTableViewAssociation forwards delegate messages to the appropriate EOColumnAssociations. | 
| target | Reserved, but not used. | 
For an example of using an EOTableViewAssociation, see the EOColumnAssociation class specification.
- Setting up a table view association
 - bindToTableView
 
- Sorting
 - setSortsByColumnOrder
 - sortsByColumnOrder
 
- Accessing the active EOColumnAssociation
 - editingAssociation
 
- Table view data source methods
 - numberOfRowsInTableView
 - tableViewSetObjectValueForLocation
 - tableViewObjectValueForLocation
 
- Table view delegate methods
 - tableViewShouldEditLocation
 - tableViewWillDisplayCell
 
- Table view notification methods
 - tableViewSelectionDidChange
 
- Control delegate methods
 - controlDidFailToFormatStringErrorDescription
 - controlIsValidObject
 - controlTextShouldBeginEditing
 
public EOTableViewAssociation(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 static void bindToTableView(
com.apple.yellow.application.NSTableView  aTableView, 
EODisplayGroup  aDisplayGroup)
establishConnection invokes
this method to guarantee the presence of a coordinating EOTableViewAssociation.public boolean controlDidFailToFormatStringErrorDescription(
com.apple.yellow.application.NSControl  aTableView, 
String  aString, 
String  errorDescription)
See Also: editingAssociation
public boolean controlIsValidObject(
com.apple.yellow.application.NSControl  aTableView, 
Object  anObject)
See Also: editingAssociation
public boolean controlTextShouldBeginEditing(
com.apple.yellow.application.NSControl  aTableView, 
com.apple.yellow.application.NSText  fieldEditor)
See Also: editingAssociation
public EOColumnAssociation editingAssociation()
public int numberOfRowsInTableView(com.apple.yellow.application.NSTableView  aTableView)
See Also: displayedObjects (EODisplayGroup)
public void setSortsByColumnOrder(boolean  flag)
An EOTableViewAssociation assigns sort orderings based on the left to right order of the table columns, and reassigns them whenever the user moves a column.
See Also: sortingSelector (EOColumnAssociation)
public boolean sortsByColumnOrder()
public Object tableViewObjectValueForLocation(
com.apple.yellow.application.NSTableView  aTableView, 
com.apple.yellow.application.NSTableColumn  aTableColumn, 
int  rowIndex)
public void tableViewSelectionDidChange(NSNotification  aNotification)
See Also: setSelectionIndexes (EODisplayGroup)
public void tableViewSetObjectValueForLocation(
com.apple.yellow.application.NSTableView  aTableView, 
Object  value, 
com.apple.yellow.application.NSTableColumn  aTableColumn, 
int  rowIndex)
public boolean tableViewShouldEditLocation(
com.apple.yellow.application.NSTableView  aTableView, 
com.apple.yellow.application.NSTableColumn  aTableColumn, 
int  rowIndex)
enabled aspect
is bound and its value for the object at  rowIndex  is 0.
Otherwise forwards the message to  aTableColumn 's
identifier-assumed to be the EOColumnAssociation bound to that
column-and returns its response. Note that because the two associations' enabled aspects
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  aTableView, 
Object  aCell, 
com.apple.yellow.application.NSTableColumn  aTableColumn, 
int  rowIndex)
enabled, textColor, bold,
and italic aspects of the object at  rowIndex. 
Then forwards the message to  aTableColumn 's
identifier-assumed to be the EOColumnAssociation bound to that
column-allowing it to adjust  aCell  based
on its own enabled aspect.