API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPTableColumn Class Reference

#import <CPTableColumn.h>

+ Inheritance diagram for CPTableColumn:

Instance Methods

(void) - bind:toObject:withKeyPath:options:
 
(CPView- dataCell
 
(id) - dataCellForRow:
 
(CPView- dataView
 
(id) - dataViewForRow:
 
(BOOL) - disableResizingPosting
 
(void) - encodeWithCoder:
 
(CPView- headerCell
 
(CPString- headerToolTip
 
(CPView- headerView
 
(id) - identifier
 
(id) - init
 
(id) - initWithCoder:
 
(id) - initWithIdentifier:
 
(BOOL) - isEditable
 
(BOOL) - isHidden
 
(float) - maxWidth
 
(float) - minWidth
 
(unsigned) - resizingMask
 
(void) - setDataCell:
 
(void) - setDataView:
 
(void) - setDisableResizingPosting:
 
(void) - setEditable:
 
(void) - setHeaderCell:
 
(void) - setHeaderToolTip:
 
(void) - setHeaderView:
 
(void) - setHidden:
 
(void) - setIdentifier:
 
(void) - setMaxWidth:
 
(void) - setMinWidth:
 
(void) - setResizingMask:
 
(void) - setSortDescriptorPrototype:
 
(void) - setTableView:
 
(void) - setWidth:
 
(void) - sizeToFit
 
(CPSortDescriptor- sortDescriptorPrototype
 
(CPTableView- tableView
 
(float) - width
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray- exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Additional Inherited Members

- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 
- Instance Variables inherited from CPObject
Class isa
 

Detailed Description

A CPTableColumn contains a dataview to display for its column of the CPTableView. A CPTableColumn determines its own size constrains and resizing behavior.

The default dataview is a CPTextField but you can set it to any view you'd like. See -setDataView: for documentation including theme states.

To customize the text of the column header you can simply call setStringValue: on the headerview of a table column. For example: [[myTableColumn headerView] setStringValue:"My Title"];

Definition at line 2 of file CPTableColumn.h.

Method Documentation

- (void) bind: (CPString aBinding
toObject: (id)  anObject
withKeyPath: (CPString aKeyPath
options: (CPDictionary options 
implementation

Binds the receiver to an object.

Parameters
CPStringaBinding - The binding you wish to make. Typically CPValueBinding.
idanObject - The object to bind the receiver to.
CPStringaKeyPath - The key path you wish to bind the receiver to.
CPDictionaryoptions - A dictionary of options for the binding. This parameter is optional, pass nil if you do not wish to use it.

Reimplemented from CPObject.

Provided by category CPTableColumn(Bindings).

Definition at line 617 of file CPTableColumn.j.

- (CPView) dataCell
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 825 of file CPTableColumn.j.

- (id) dataCellForRow: (int)  row
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 834 of file CPTableColumn.j.

- (CPView) dataView
implementation

Definition at line 397 of file CPTableColumn.j.

- (id) dataViewForRow: (int)  aRowIndex
implementation

Definition at line 410 of file CPTableColumn.j.

- (BOOL) disableResizingPosting
implementation

Synthesized accessor method.

Provided by category CPTableColumn(CPSynthesizedAccessors).

Definition at line 847 of file CPTableColumn.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Provided by category CPTableColumn(CPCoding).

Definition at line 774 of file CPTableColumn.j.

- (CPView) headerCell
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 807 of file CPTableColumn.j.

- (CPString) headerToolTip
implementation

Returns the tooltip for the column header

Definition at line 539 of file CPTableColumn.j.

- (CPView) headerView
implementation

Returns the headerview for the column.

In order to change the text of the headerview for a column you should call setStringValue: on the headerview. For example: [[myTableColumn headerView] setStringValue:"My Column"];

Definition at line 317 of file CPTableColumn.j.

- (id) identifier
implementation

Returns the object used by the data source to identify the attribute corresponding to the receiver.

Definition at line 454 of file CPTableColumn.j.

- (id) init
implementation

Reimplemented from CPObject.

Definition at line 65 of file CPTableColumn.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Provided by category CPTableColumn(CPCoding).

Definition at line 745 of file CPTableColumn.j.

- (id) initWithIdentifier: (id)  anIdentifier
implementation

Initializes a newly created CPTableColumn with a given identifier.

Definition at line 74 of file CPTableColumn.j.

- (BOOL) isEditable
implementation

Returns YES if the user can edit cells associated with the receiver by double-clicking the column in the CPTableView, NO otherwise.

Definition at line 473 of file CPTableColumn.j.

- (BOOL) isHidden
implementation

Returns the visibility status of the column.

Definition at line 520 of file CPTableColumn.j.

- (float) maxWidth
implementation

Returns the maximum width of the column

Definition at line 242 of file CPTableColumn.j.

- (float) minWidth
implementation

Returns the minimum width of the column.

Definition at line 214 of file CPTableColumn.j.

- (unsigned) resizingMask
implementation

Returns the resizing mask of the column

Definition at line 267 of file CPTableColumn.j.

- (void) setDataCell: (CPView aView
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 816 of file CPTableColumn.j.

- (void) setDataView: (CPView aView
implementation

This method sets the "prototype" view which will be used to create all table cells in this column.

It creates a snapshot of aView, using keyed archiving, which is then copied over and over for each individual cell that is shown. As a result, changes made after calling this method won't be reflected.

Example:

[tableColumn setDataView:someView]; // snapshot taken
[[tableColumn dataView] setSomething:x]; //won't work

This doesn't work because the snapshot is taken before the new property is applied. Instead, do:

[someView setSomething:x];
[tableColumn setDataView:someView];
Note
you should implement CPKeyedArchiving otherwise you might see unexpected results. This is done by adding the following methods to your class:
- (id)initWithCoder(CPCoder)aCoder;
- (void)encodeWithCoder:(CPCoder)aCoder;

Example: Say you have two instance variables in your object that need to be set up each time an object is create. We will call these instance variables "image" and "text". Your CPCoding methods will look like the following:

- (id)initWithCoder:(CPCoder)aCoder
{
self = [super initWithCoder:aCoder];
if (self)
{
image = [aCoder decodeObjectForKey:"MyDataViewImage"];
text = [aCoder decodeObjectForKey:"MyDataViewText"];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:image forKey:"MyDataViewImage"];
[aCoder encodeObject:text forKey:"MyDataViewText"];
}

Themeing

When you set a dataview and it is added to the tableview the theme state will be set to CPThemeStateTableDataView When the dataview becomes selected the theme state will be set to CPThemeStateSelectedDataView.

If the dataview shows up in a group row of the tableview the theme state will be set to CPThemeStateGroupRow.

You should overide setThemeState: and unsetThemeState: to handle these theme state changes in your dataview.

Definition at line 386 of file CPTableColumn.j.

- (void) setDisableResizingPosting: (BOOL)  aValue
implementation

Synthesized accessor method.

Provided by category CPTableColumn(CPSynthesizedAccessors).

Definition at line 855 of file CPTableColumn.j.

- (void) setEditable: (BOOL)  shouldBeEditable
implementation

Controls whether the user can edit cells in the receiver by double-clicking them.

Definition at line 464 of file CPTableColumn.j.

- (void) setHeaderCell: (CPView aView
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 798 of file CPTableColumn.j.

- (void) setHeaderToolTip: (CPString aToolTip
implementation

Sets the tooltip string that is displayed when the cursor pauses over the header cell of the receiver.

Definition at line 531 of file CPTableColumn.j.

- (void) setHeaderView: (CPView aView
implementation

Sets the header view for the column. The headerview handles the display of sort indicators, text, etc.

If you do not want a headerview for you table you should call setHeaderView: on your CPTableView instance. Passing nil here will throw an exception.

In order to customize the text of the column header see - (CPView)headerView;

Definition at line 298 of file CPTableColumn.j.

- (void) setHidden: (BOOL)  shouldBeHidden
implementation

If YES the tablecolumn will no longer be visible in the tableview. If NO the tablecolumn will be visible in the tableview.

Definition at line 504 of file CPTableColumn.j.

- (void) setIdentifier: (id)  anIdentifier
implementation

Sets the receiver identifier to anIdentifier.

Definition at line 446 of file CPTableColumn.j.

- (void) setMaxWidth: (float)  aMaxWidth
implementation

Sets the maximum width of the table column. Default value is: 1000000

Definition at line 223 of file CPTableColumn.j.

- (void) setMinWidth: (float)  aMinWidth
implementation

Sets the minimum width of the column. Default value is 10.

Definition at line 195 of file CPTableColumn.j.

- (void) setResizingMask: (unsigned)  aResizingMask
implementation
    Set the resizing mask of the column.
    By default the column can be resized automatically with the tableview and manually by the user
    Possible masking values are:
    CPTableColumnNoResizing
    CPTableColumnAutoresizingMask
    CPTableColumnUserResizingMask

Definition at line 258 of file CPTableColumn.j.

- (void) setSortDescriptorPrototype: (CPSortDescriptor aSortDescriptor
implementation

Sets the sort descriptor prototype for the column.

Definition at line 481 of file CPTableColumn.j.

- (void) setTableView: (CPTableView aTableView
implementation

Set the columns's parent tableview

Definition at line 102 of file CPTableColumn.j.

- (void) setWidth: (float)  aWidth
implementation

Set the width of the column Default value is: 100

If the value is greater than the maxWidth the maxWidth will be reset with the supplied width here If the value is less than the minWidth the minWidth will be reset with the supplied width.

Definition at line 143 of file CPTableColumn.j.

- (void) sizeToFit
implementation

Sizes the column to fix the column header text.

Definition at line 275 of file CPTableColumn.j.

- (CPSortDescriptor) sortDescriptorPrototype
implementation

Returns the sort descriptor prototype for the column.

Definition at line 489 of file CPTableColumn.j.

- (CPTableView) tableView
implementation

Return the column's parent tableview

Definition at line 110 of file CPTableColumn.j.

- (float) width
implementation

Returns the column's width

Definition at line 186 of file CPTableColumn.j.


The documentation for this class was generated from the following files: