EOTableViewAssociation
- Inherits from:
- EOAssociation : EODelayedObserver (EOControl) : NSObject
- Conforms to:
- NSCoding
- (EOAssociation)
- EOObserving (EODelayedObserver)
- NSObject (NSObject)
Declared in:
- EOInterface/EOColumnAssociation.h
Class Description
An EOTableViewAssociation object manages the individual EOColumnAssociations between an NSTableView (Application Kit) and an EODisplayGroup.
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. |
Example
For an example of using an EOTableViewAssociation, see the EOColumnAssociation class specification.
Method Types
- Setting up a table view association
- + bindToTableView:displayGroup:
- Sorting
- - setSortsByColumnOrder:
- - sortsByColumnOrder
- Accessing the active EOColumnAssociation
- - editingAssociation
- Table view data source methods
- - numberOfRowsInTableView:
- - tableView:setObjectValue:forTableColumn:row:
- - tableView:objectValueForTableColumn:row:
- Table view delegate methods
- - tableView:shouldEditTableColumn:row:
- - tableView:willDisplayCell:forTableColumn:row:
- Table view notification methods
- - tableViewSelectionDidChange:
- Control delegate methods
- - control:didFailToFormatString:errorDescription:
- - control:isValidObject:
- - control:textShouldBeginEditing:
Class Methods
bindToTableView:displayGroup:
+ (void)bindToTableView:(NSTableView
*)aTableView
displayGroup:(EODisplayGroup *)aDisplayGroup
Instance Methods
control:didFailToFormatString:errorDescription:
- (BOOL)control:(NSControl
*)aTableView
didFailToFormatString:(NSString
*)aString
errorDescription:(NSString *)errorDescription
See Also: - editingAssociation
control:isValidObject:
- (BOOL)control:(NSControl
*)aTableView
isValidObject:(id)anObject
See Also: - editingAssociation
control:textShouldBeginEditing:
- (BOOL)control:(NSControl
*)aTableView
textShouldBeginEditing:(NSText
*)fieldEditor
See Also: - editingAssociation
editingAssociation
- (EOColumnAssociation *)editingAssociation
numberOfRowsInTableView:
- (int)numberOfRowsInTableView:(NSTableView
*)aTableView
See Also: - displayedObjects (EODisplayGroup)
setSortsByColumnOrder:
- (void)setSortsByColumnOrder:(BOOL)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)
sortsByColumnOrder
- (BOOL)sortsByColumnOrder
tableView:objectValueForTableColumn:row:
- (id)tableView:(NSTableView
*)aTableView
objectValueForTableColumn:(NSTableColumn
*)aTableColumn
row:(int)rowIndex
tableViewSelectionDidChange:
- (void)tableViewSelectionDidChange:(NSNotification
*)aNotification
See Also: - setSelectionIndexes: (EODisplayGroup)
tableView:setObjectValue:forTableColumn:row:
- (void)tableView:(NSTableView
*)aTableView
setObjectValue:(id)value
forTableColumn:(NSTableColumn
*)aTableColumn
row:(int)rowIndex
tableView:shouldEditTableColumn:row:
- (BOOL)tableView:(NSTableView
*)aTableView
shouldEditTableColumn:(NSTableColumn
*)aTableColumn
row:(int)rowIndex
enabled
aspect
is bound and its value for the object at rowIndex is NO.
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.tableView:willDisplayCell:forTableColumn:row:
- (void)tableView:(NSTableView
*)aTableView
willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn
*)aTableColumn
row:(int)rowIndex