API  1.0.0
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:
 
(CPString- description
 
(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
 
(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:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(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:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

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

◆ bind:toObject:withKeyPath:options:()

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

Binds the receiver to an object. Note that unlike Cocoa, this works only after the receiver has been added to a CPTableView.

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 610 of file CPTableColumn.j.

◆ dataCell()

- (CPView) dataCell
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 818 of file CPTableColumn.j.

◆ dataCellForRow:()

- (id) dataCellForRow: (CPInteger)  row
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 827 of file CPTableColumn.j.

◆ dataView()

- (CPView) dataView
implementation

Definition at line 396 of file CPTableColumn.j.

◆ dataViewForRow:()

- (id) dataViewForRow: (CPInteger)  aRowIndex
implementation

Definition at line 409 of file CPTableColumn.j.

◆ description()

- (CPString) description
implementation

Reimplemented from CPObject.

Definition at line 534 of file CPTableColumn.j.

◆ disableResizingPosting()

- (BOOL) disableResizingPosting
implementation

Synthesized accessor method.

Provided by category CPTableColumn(CPSynthesizedAccessors).

Definition at line 840 of file CPTableColumn.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Provided by category CPTableColumn(CPCoding).

Definition at line 767 of file CPTableColumn.j.

◆ headerCell()

- (CPView) headerCell
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 800 of file CPTableColumn.j.

◆ headerToolTip()

- (CPString) headerToolTip
implementation

Returns the tooltip for the column header

Definition at line 526 of file CPTableColumn.j.

◆ headerView()

- (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 316 of file CPTableColumn.j.

◆ identifier()

- (id) identifier
implementation

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

Definition at line 441 of file CPTableColumn.j.

◆ init()

- (id) init
implementation

Reimplemented from CPObject.

Definition at line 64 of file CPTableColumn.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Provided by category CPTableColumn(CPCoding).

Definition at line 738 of file CPTableColumn.j.

◆ initWithIdentifier:()

- (id) initWithIdentifier: (id)  anIdentifier
implementation

Initializes a newly created CPTableColumn with a given identifier.

Definition at line 73 of file CPTableColumn.j.

◆ isEditable()

- (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 460 of file CPTableColumn.j.

◆ isHidden()

- (BOOL) isHidden
implementation

Returns the visibility status of the column.

Definition at line 507 of file CPTableColumn.j.

◆ maxWidth()

- (float) maxWidth
implementation

Returns the maximum width of the column

Definition at line 241 of file CPTableColumn.j.

◆ minWidth()

- (float) minWidth
implementation

Returns the minimum width of the column.

Definition at line 213 of file CPTableColumn.j.

◆ resizingMask()

- (unsigned) resizingMask
implementation

Returns the resizing mask of the column

Definition at line 266 of file CPTableColumn.j.

◆ setDataCell:()

- (void) setDataCell: (CPView aView
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 809 of file CPTableColumn.j.

◆ setDataView:()

- (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 385 of file CPTableColumn.j.

◆ setDisableResizingPosting:()

- (void) setDisableResizingPosting: (BOOL)  aValue
implementation

Synthesized accessor method.

Provided by category CPTableColumn(CPSynthesizedAccessors).

Definition at line 848 of file CPTableColumn.j.

◆ setEditable:()

- (void) setEditable: (BOOL)  shouldBeEditable
implementation

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

Definition at line 451 of file CPTableColumn.j.

◆ setHeaderCell:()

- (void) setHeaderCell: (CPView aView
implementation

Provided by category CPTableColumn(NSInCompatibility).

Definition at line 791 of file CPTableColumn.j.

◆ setHeaderToolTip:()

- (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 518 of file CPTableColumn.j.

◆ setHeaderView:()

- (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 297 of file CPTableColumn.j.

◆ setHidden:()

- (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 491 of file CPTableColumn.j.

◆ setIdentifier:()

- (void) setIdentifier: (id)  anIdentifier
implementation

Sets the receiver identifier to anIdentifier.

Definition at line 433 of file CPTableColumn.j.

◆ setMaxWidth:()

- (void) setMaxWidth: (float)  aMaxWidth
implementation

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

Definition at line 222 of file CPTableColumn.j.

◆ setMinWidth:()

- (void) setMinWidth: (float)  aMinWidth
implementation

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

Definition at line 194 of file CPTableColumn.j.

◆ setResizingMask:()

- (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 257 of file CPTableColumn.j.

◆ setSortDescriptorPrototype:()

- (void) setSortDescriptorPrototype: (CPSortDescriptor aSortDescriptor
implementation

Sets the sort descriptor prototype for the column.

Definition at line 468 of file CPTableColumn.j.

◆ setTableView:()

- (void) setTableView: (CPTableView aTableView
implementation

Set the columns's parent tableview

Definition at line 101 of file CPTableColumn.j.

◆ setWidth:()

- (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 142 of file CPTableColumn.j.

◆ sizeToFit()

- (void) sizeToFit
implementation

Sizes the column to fix the column header text.

Definition at line 274 of file CPTableColumn.j.

◆ sortDescriptorPrototype()

- (CPSortDescriptor) sortDescriptorPrototype
implementation

Returns the sort descriptor prototype for the column.

Definition at line 476 of file CPTableColumn.j.

◆ tableView()

- (CPTableView) tableView
implementation

Return the column's parent tableview

Definition at line 109 of file CPTableColumn.j.

◆ width()

- (float) width
implementation

Returns the column's width

Definition at line 185 of file CPTableColumn.j.


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