![]() |
API 0.9.5
|
#import <CPArrayController.h>
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.
- (void) add: | (id) | sender |
Creates and adds a new object to the receiver's content and arranged objects.
id | sender - 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.
id | anObject - 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.
CPArray | anArray - 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 a BOOL indicating whether the receiver always returns the multiple values marker when multiple objects are selected.
Definition at line 225 of file CPArrayController.j.
- (id) arrangedObjects |
Returns an array of the controller's objects sorted and filtered.
Definition at line 442 of file CPArrayController.j.
Sorts and filters a given array and returns it.
CPArray | anArray - an array of 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.
Definition at line 250 of file CPArrayController.j.
- (BOOL) avoidsEmptySelection |
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.
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.
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.
Definition at line 682 of file CPArrayController.j.
- (BOOL) clearsFilterPredicateOnInsertion |
Whether the receiver will clear its filter predicate when a new object is inserted.
Definition at line 204 of file CPArrayController.j.
- (id) contentArray |
Returns the content array of the controller.
Definition at line 351 of file CPArrayController.j.
- (id) contentSet |
Returns the content of the receiver as a CPSet.
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.
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.
id | sender - 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).
id | anObject - The object to add to the collection. |
int | anIndex - 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.
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.
id | sender - 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.
id | anObject - 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.
CPArray | anArray - 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.
CPIndexSet | indexes - indexes of the objects to remove. |
Definition at line 914 of file CPArrayController.j.
- (CPArray) selectedObjects |
Returns an array of 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.
Definition at line 529 of file CPArrayController.j.
- (CPIndexSet) selectionIndexes |
Returns an index set of 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.
id | sender - 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.
id | sender - the sender of the message. |
Definition at line 691 of file CPArrayController.j.
- (BOOL) selectsInsertedObjects |
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.
BOOL | aFlag 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.
BOOL | YES 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.
BOOL | aFlag - 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.
BOOL | YES 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.
id | value - 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.
CPPrediate | aPredicate - 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.
BOOL | aFlag - 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.
CPArray | anArray - the objects to select |
Definition at line 642 of file CPArrayController.j.
- (BOOL) setSelectionIndex: | (unsigned) | index |
Sets the selected index
unsigned | anIndex - the new index to select |
Definition at line 540 of file CPArrayController.j.
- (BOOL) setSelectionIndexes: | (CPIndexSet) | indexes |
Sets the selection indexes of the controller.
CPIndexSet | indexes - the indexes to select |
Definition at line 561 of file CPArrayController.j.
- (void) setSelectsInsertedObjects: | (BOOL) | value |
Sets whether the controller will automatically select objects as they are inserted.
Definition at line 177 of file CPArrayController.j.
- (void) setSortDescriptors: | (CPArray) | value |
Sets the sort descriptors for the controller.
CPArray | descriptors - the new sort descriptors. |
Definition at line 461 of file CPArrayController.j.
- (CPArray) sortDescriptors |
Returns the receiver's array of sort descriptors.
Definition at line 451 of file CPArrayController.j.