Documentation Archive Developer
Search
[an error occurred while processing this directive] PATH  Documentation > WebObjects 4.5 > EOInterface Reference

Table of Contents

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

Creates an EOTableViewAssociation, binding aTableView to aDisplayGroup, if there isn't already a table view association for aTableView. EOColumnAssociation's establishConnection invokes this method to guarantee the presence of a coordinating EOTableViewAssociation.


Instance Methods



control:didFailToFormatString:errorDescription:

- (BOOL)control:(NSControl *)aTableView didFailToFormatString:(NSString *)aString errorDescription:(NSString *)errorDescription

Forwards the message to the receiver's editing association.

See Also: - editingAssociation



control:isValidObject:

- (BOOL)control:(NSControl *)aTableView isValidObject:(id)anObject

Forwards the message to the receiver's editing association.

See Also: - editingAssociation



control:textShouldBeginEditing:

- (BOOL)control:(NSControl *)aTableView textShouldBeginEditing:(NSText *)fieldEditor

Forwards the message to the receiver's editing association.

See Also: - editingAssociation



editingAssociation

- (EOColumnAssociation *)editingAssociation

Returns the EOColumnAssociation for the NSTableView cell being edited, or nil if no cell is being edited.

numberOfRowsInTableView:

- (int)numberOfRowsInTableView:(NSTableView *)aTableView

Returns the number of displayed objects in the receiver's EODisplayGroup.

See Also: - displayedObjects (EODisplayGroup)



setSortsByColumnOrder:

- (void)setSortsByColumnOrder:(BOOL)flag

Controls whether the receiver applies a sort ordering to its EODisplayGroup. If flag is YES, it builds EOSortOrderings (EOControl) for each of the EOColumnAssociations, collects them into an NSArray based on the left-to-right order of the columns, and assigns them to the display group with setSortOrderings:. If flag is NO, it doesn't alter the sort ordering of the display group.

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

Returns YES if the receiver assigns EOSortOrderings (EOControl) to its EODisplayGroup based on the sorting selectors of its EOColumnAssociations, NO if it doesn't alter the display group's sort ordering.

tableView:objectValueForTableColumn:row:

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

Forwards the message to aTableColumn's identifier-assumed to be the EOColumnAssociation bound to that column-so that it can provide the value.

tableViewSelectionDidChange:

- (void)tableViewSelectionDidChange:(NSNotification *)aNotification

Updates the receiver's EODisplayGroup based on the new selection in the table view.

See Also: - setSelectionIndexes: (EODisplayGroup)



tableView:setObjectValue:forTableColumn:row:

- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)value forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

Forwards the message to aTableColumn's identifier-assumed to be the EOColumnAssociation bound to that column-so that it can set the value.

tableView:shouldEditTableColumn:row:

- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

Returns NO if the 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

Alters the display characteristics for aCell according to the values for the 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.


Table of Contents