API 0.9.5
CPArrayController Class Reference

#import <CPArrayController.h>

Inheritance diagram for CPArrayController:

List of all members.

Instance Methods

(void) - add:
(void) - addObject:
(void) - addObjects:
(BOOL) - alwaysUsesMultipleValuesMarker
(id) - arrangedObjects
(CPArray- arrangeObjects:
(BOOL) - automaticallyRearrangesObjects
(BOOL) - avoidsEmptySelection
(void) - awakeFromCib
(BOOL) - canInsert
(BOOL) - canSelectNext
(BOOL) - canSelectPrevious
(BOOL) - clearsFilterPredicateOnInsertion
(id) - contentArray
(id) - contentSet
(void) - encodeWithCoder:
(CPPredicate- filterPredicate
(id) - init
(id) - initWithCoder:
(void) - insert:
(void) - insertObject:atArrangedObjectIndex:
(void) - prepareContent
(BOOL) - preservesSelection
(void) - rearrangeObjects
(void) - remove:
(void) - removeObject:
(void) - removeObjects:
(void) - removeObjectsAtArrangedObjectIndexes:
(CPArray- selectedObjects
(unsigned) - selectionIndex
(CPIndexSet- selectionIndexes
(void) - selectNext:
(void) - selectPrevious:
(BOOL) - selectsInsertedObjects
(void) - setAlwaysUsesMultipleValuesMarker:
(void) - setAutomaticallyRearrangesObjects:
(void) - setAvoidsEmptySelection:
(void) - setClearsFilterPredicateOnInsertion:
(void) - setContent:
(void) - setFilterPredicate:
(void) - setPreservesSelection:
(BOOL) - setSelectedObjects:
(BOOL) - setSelectionIndex:
(BOOL) - setSelectionIndexes:
(void) - setSelectsInsertedObjects:
(void) - setSortDescriptors:
(CPArray- sortDescriptors

Class Methods

(void) + initialize
(CPSet+ keyPathsForValuesAffectingArrangedObjects
(CPSet+ keyPathsForValuesAffectingCanRemove
(CPSet+ keyPathsForValuesAffectingCanSelectNext
(CPSet+ keyPathsForValuesAffectingCanSelectPrevious
(CPSet+ keyPathsForValuesAffectingContentArray
(CPSet+ keyPathsForValuesAffectingSelectedObjects
(CPSet+ keyPathsForValuesAffectingSelection
(CPSet+ keyPathsForValuesAffectingSelectionIndex
(CPSet+ keyPathsForValuesAffectingSelectionIndexes

Detailed Description

CPArrayController is a bindings compatible class that manages an array. CPArrayController also provides selection management and sorting capabilities.

Definition at line 2 of file CPArrayController.h.


Method Documentation

- (void) add: (id)  sender

Creates and adds a new object to the receiver's content and arranged objects.

Parameters:
idsender - The sender of the message.

Reimplemented from CPObjectController.

Definition at line 879 of file CPArrayController.j.

- (void) addObject: (id)  object

Adds object to the receiver's content collection and the arranged objects array.

Parameters:
idanObject - the object to add the controller.

Reimplemented from CPObjectController.

Definition at line 728 of file CPArrayController.j.

- (void) addObjects: (CPArray objects

Adds an array of objects to the controller's collection.

Parameters:
CPArrayanArray - The array of objects to add to the collection.

Definition at line 969 of file CPArrayController.j.

- (BOOL) alwaysUsesMultipleValuesMarker

Whether the receiver will always return the multiple values marker when multiple items are selected, even if the items have the same value.

Returns:
BOOL YES if the receiver always uses the multiple values marker

Returns a BOOL indicating whether the receiver always returns the multiple values marker when multiple objects are selected.

Returns:
BOOL YES is the controller always uses multiple value markers, otherwise NO.

Definition at line 225 of file CPArrayController.j.

- (id) arrangedObjects

Returns an array of the controller's objects sorted and filtered.

Returns:
- array of objects

Definition at line 442 of file CPArrayController.j.

- (CPArray) arrangeObjects: (CPArray objects

Sorts and filters a given array and returns it.

Parameters:
CPArrayanArray - an array of objects.
Returns:
CPArray - the array of sorted objects.

Definition at line 372 of file CPArrayController.j.

- (BOOL) automaticallyRearrangesObjects

Whether the receiver will rearrange its contents automatically whenever the sort descriptors or filter predicates are changed.

NOTE: not yet implemented. Cappuccino always act as if this value was YES.

Returns:
BOOL YES if the receiver will automatically rearrange its content on new sort descriptors or filter predicates

Definition at line 250 of file CPArrayController.j.

- (BOOL) avoidsEmptySelection
Returns:
BOOL - YES if the controller should try to avoid an empty selection otherwise NO.

Definition at line 185 of file CPArrayController.j.

- (void) awakeFromCib

Reimplemented from CPObjectController.

Definition at line 1164 of file CPArrayController.j.

- (BOOL) canInsert

Returns a BOOL indicating whether an object can be inserted into the controller's collection.

Returns:
BOOL - YES if an object can be inserted, otherwise NO.

Definition at line 1040 of file CPArrayController.j.

- (BOOL) canSelectNext

Returns YES if the next object, relative to the current selection, in the controller's content array can be selected.

Returns:
BOOL - YES if the object can be selected, otherwise NO.

Definition at line 704 of file CPArrayController.j.

- (BOOL) canSelectPrevious

Returns YES if the previous object, relative to the current selection, in the controller's content array can be selected.

Returns:
BOOL - YES if the object can be selected, otherwise NO.

Definition at line 682 of file CPArrayController.j.

- (BOOL) clearsFilterPredicateOnInsertion

Whether the receiver will clear its filter predicate when a new object is inserted.

Returns:
BOOL YES if the receiver clears filter predicates on insert

Definition at line 204 of file CPArrayController.j.

- (id) contentArray

Returns the content array of the controller.

Returns:
id the content array of the receiver

Definition at line 351 of file CPArrayController.j.

- (id) contentSet

Returns the content of the receiver as a CPSet.

Returns:
id - the content of the controller as a set.

Definition at line 361 of file CPArrayController.j.

- (void) encodeWithCoder: (CPCoder aCoder

Reimplemented from CPObjectController.

Definition at line 1151 of file CPArrayController.j.

- (CPPredicate) filterPredicate

Returns the predicate used by the controller to filter the contents of the receiver. If no predicate is set nil is returned.

Returns:
CPPredicate the predicate used by the controller

Definition at line 478 of file CPArrayController.j.

- (id) init

Reimplemented from CPObjectController.

Definition at line 113 of file CPArrayController.j.

+ (void) initialize

Reimplemented from CPObjectController.

Definition at line 54 of file CPArrayController.j.

- (id) initWithCoder: (CPCoder aCoder

Reimplemented from CPObjectController.

Definition at line 1127 of file CPArrayController.j.

- (void) insert: (id)  sender

Creates a new object and inserts it into the receiver's content array.

Parameters:
idsender - The sender of the message.

Definition at line 891 of file CPArrayController.j.

- (void) insertObject: (id)  anObject
atArrangedObjectIndex: (int)  anIndex 

Adds an object at a given index in the receiver's arrangedObjects. Also add the object to the content collection (although at the end rather than the given index).

Parameters:
idanObject - The object to add to the collection.
intanIndex - The index to insert the object at.

Definition at line 795 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingArrangedObjects

Definition at line 68 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingCanRemove

Reimplemented from CPObjectController.

Definition at line 97 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingCanSelectNext

Definition at line 102 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingCanSelectPrevious

Definition at line 107 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingContentArray

Definition at line 63 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelectedObjects

Definition at line 91 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelection

Definition at line 74 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelectionIndex

Definition at line 79 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelectionIndexes

Definition at line 84 of file CPArrayController.j.

- (void) prepareContent

Overridden by a subclass that require control over the creation of new objects.

Reimplemented from CPObjectController.

Definition at line 142 of file CPArrayController.j.

- (BOOL) preservesSelection

Returns YES if the selection should try to be preserved when the content changes, otherwise NO.

Returns:
BOOL YES if the selection is preserved, otherwise NO.

Definition at line 150 of file CPArrayController.j.

- (void) rearrangeObjects

Triggers the filtering of the objects in the controller.

Definition at line 394 of file CPArrayController.j.

- (void) remove: (id)  sender

Removes the controller's selected objects from the controller's collection.

Parameters:
idsender - The sender of the message.

Reimplemented from CPObjectController.

Definition at line 905 of file CPArrayController.j.

- (void) removeObject: (id)  object

Removes a given object from the receiver's collection.

Parameters:
idanObject - The object to remove from the collection.

Reimplemented from CPObjectController.

Definition at line 848 of file CPArrayController.j.

- (void) removeObjects: (CPArray objects

Removes an array of objects from the collection.

Parameters:
CPArrayanArray - The array of objects to remove

Definition at line 989 of file CPArrayController.j.

- (void) removeObjectsAtArrangedObjectIndexes: (CPIndexSet anIndexSet

Removes the objects at the specified indexes in the controller's arranged objects from the content array.

Parameters:
CPIndexSetindexes - indexes of the objects to remove.

Definition at line 914 of file CPArrayController.j.

- (CPArray) selectedObjects

Returns an array of the selected objects.

Returns:
CPArray - the selected objects.

Reimplemented from CPObjectController.

Definition at line 629 of file CPArrayController.j.

- (unsigned) selectionIndex

Returns the index of the first object in the controller's selection.

Returns:
unsigned - Index of the first selected object.

Definition at line 529 of file CPArrayController.j.

- (CPIndexSet) selectionIndexes

Returns an index set of the selected indexes.

Returns:
CPIndexSet - The selected indexes.

Definition at line 550 of file CPArrayController.j.

- (void) selectNext: (id)  sender

Selects the next object, relative to the current selection, in the controllers arranged content.

Parameters:
idsender - the sender of the message.

Definition at line 713 of file CPArrayController.j.

- (void) selectPrevious: (id)  sender

Selects the previous object, relative to the current selection, in the controllers arranged content.

Parameters:
idsender - the sender of the message.

Definition at line 691 of file CPArrayController.j.

- (BOOL) selectsInsertedObjects
Returns:
BOOL - Returns YES if new objects are automatically selected, otherwise NO.

Definition at line 168 of file CPArrayController.j.

- (void) setAlwaysUsesMultipleValuesMarker: (BOOL)  aFlag

Sets whether the receiver should always return the multiple values marker when multiple items are selected, even if the items have the same value.

Parameters:
BOOLaFlag YES if the receiver should always use the multiple values marker

Definition at line 236 of file CPArrayController.j.

- (void) setAutomaticallyRearrangesObjects: (BOOL)  aFlag

Sets whether the receiver should rearrange its contents automatically whenever the sort descriptors or filter predicates are changed.

NOTE: not yet implemented. Cappuccino always act as if this value was YES.

Parameters:
BOOLYES if the receiver should automatically rearrange its content on new sort descriptors or filter predicates

Definition at line 264 of file CPArrayController.j.

- (void) setAvoidsEmptySelection: (BOOL)  value

Sets whether the controller should try to avoid an empty selection.

Parameters:
BOOLaFlag - YES if the receiver should attempt to avoid an empty selection, otherwise NO.

Definition at line 194 of file CPArrayController.j.

- (void) setClearsFilterPredicateOnInsertion: (BOOL)  aFlag

Sets whether the receiver should clear its filter predicate when a new object is inserted.

Parameters:
BOOLYES if the receiver should clear filter predicates on insert

Definition at line 214 of file CPArrayController.j.

- (void) setContent: (id)  value

Sets the controller's content object.

Parameters:
idvalue - the content object of the controller.

Reimplemented from CPObjectController.

Definition at line 274 of file CPArrayController.j.

- (void) setFilterPredicate: (CPPredicate value

Sets the predicate for the controller to filter the content. Passing nil will remove an existing prediate.

Parameters:
CPPrediateaPredicate - the new predicate.

Definition at line 489 of file CPArrayController.j.

- (void) setPreservesSelection: (BOOL)  value

Sets whether the selection is kept when the content changes.

Parameters:
BOOLaFlag - YES if the selection should be kept, otherwise NO.

Definition at line 160 of file CPArrayController.j.

- (BOOL) setSelectedObjects: (CPArray objects

Sets the selected objects of the controller.

Parameters:
CPArrayanArray - the objects to select
Returns:
BOOL - Returns YES if the selection was changed, otherwise NO.

Definition at line 642 of file CPArrayController.j.

- (BOOL) setSelectionIndex: (unsigned)  index

Sets the selected index

Parameters:
unsignedanIndex - the new index to select
Returns:
BOOL - Returns YES if the selection was changed, otherwise NO.

Definition at line 540 of file CPArrayController.j.

- (BOOL) setSelectionIndexes: (CPIndexSet indexes

Sets the selection indexes of the controller.

Parameters:
CPIndexSetindexes - the indexes to select
Returns:
BOOL - Returns YES if the selection changed, otherwise NO.

Definition at line 561 of file CPArrayController.j.

- (void) setSelectsInsertedObjects: (BOOL)  value

Sets whether the controller will automatically select objects as they are inserted.

Returns:
BOOL - YES if new objects are selected, otherwise NO.

Definition at line 177 of file CPArrayController.j.

- (void) setSortDescriptors: (CPArray value

Sets the sort descriptors for the controller.

Parameters:
CPArraydescriptors - the new sort descriptors.

Definition at line 461 of file CPArrayController.j.

- (CPArray) sortDescriptors

Returns the receiver's array of sort descriptors.

Returns:
CPArray an array of sort descriptors

Definition at line 451 of file CPArrayController.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines