#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 |
|
|
implementation |
Creates and adds a new object to the receiver's content and arranged objects.
- Parameters
-
id | sender - The sender of the message. |
Reimplemented from CPObjectController.
Definition at line 906 of file CPArrayController.j.
- (void) addObject: |
|
(id) |
object |
|
|
implementation |
Adds object to the receiver's content collection and the arranged objects array.
- Parameters
-
id | anObject - the object to add the controller. |
Reimplemented from CPObjectController.
Definition at line 736 of file CPArrayController.j.
- (void) addObjects: |
|
(CPArray) |
objects |
|
|
implementation |
Adds an array of objects to the controller's collection.
- Parameters
-
CPArray | anArray - The array of objects to add to the collection. |
Definition at line 1013 of file CPArrayController.j.
- (BOOL) alwaysUsesMultipleValuesMarker |
|
|
|
|
implementation |
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 223 of file CPArrayController.j.
Returns an array of the controller's objects sorted and filtered.
- Returns
- - array of objects
Definition at line 440 of file CPArrayController.j.
- (CPArray) arrangeObjects: |
|
(CPArray) |
objects |
|
|
implementation |
Sorts and filters a given array and returns it.
- Parameters
-
CPArray | anArray - an array of objects. |
- Returns
- CPArray - the array of sorted objects.
Definition at line 370 of file CPArrayController.j.
- (BOOL) automaticallyRearrangesObjects |
|
|
|
|
implementation |
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 248 of file CPArrayController.j.
- (BOOL) avoidsEmptySelection |
|
|
|
|
implementation |
- Returns
- BOOL - YES if the controller should try to avoid an empty selection otherwise NO.
Definition at line 183 of file CPArrayController.j.
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 1084 of file CPArrayController.j.
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 712 of file CPArrayController.j.
- (BOOL) canSelectPrevious |
|
|
|
|
implementation |
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 690 of file CPArrayController.j.
- (BOOL) clearsFilterPredicateOnInsertion |
|
|
|
|
implementation |
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 202 of file CPArrayController.j.
Returns the content array of the controller.
- Returns
- id the content array of the receiver
Definition at line 349 of file CPArrayController.j.
Returns the content of the receiver as a CPSet.
- Returns
- id - the content of the controller as a set.
Definition at line 359 of file CPArrayController.j.
- (void) encodeWithCoder: |
|
(CPCoder) |
aCoder |
|
|
implementation |
- (CPPredicate) filterPredicate |
|
|
|
|
implementation |
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 476 of file CPArrayController.j.
- (id) initWithCoder: |
|
(CPCoder) |
aCoder |
|
|
implementation |
- (void) insert: |
|
(id) |
sender |
|
|
implementation |
Creates a new object and inserts it into the receiver's content array.
- Parameters
-
id | sender - The sender of the message. |
Definition at line 920 of file CPArrayController.j.
- (void) insertObject: |
|
(id) |
anObject |
atArrangedObjectIndex: |
|
(int) |
anIndex |
|
|
| |
|
implementation |
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
-
id | anObject - The object to add to the collection. |
int | anIndex - The index to insert the object at. |
Definition at line 812 of file CPArrayController.j.
+ (CPSet) keyPathsForValuesAffectingArrangedObjects |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingCanRemove |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingCanSelectNext |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingCanSelectPrevious |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingContentArray |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingSelectedObjects |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingSelection |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingSelectionIndex |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingSelectionIndexes |
|
|
|
|
implementation |
- (BOOL) preservesSelection |
|
|
|
|
implementation |
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 148 of file CPArrayController.j.
- (void) rearrangeObjects |
|
|
|
|
implementation |
- (void) remove: |
|
(id) |
sender |
|
|
implementation |
Removes the controller's selected objects from the controller's collection.
- Parameters
-
id | sender - The sender of the message. |
Reimplemented from CPObjectController.
Definition at line 938 of file CPArrayController.j.
- (void) removeObject: |
|
(id) |
object |
|
|
implementation |
Removes a given object from the receiver's collection.
- Parameters
-
id | anObject - The object to remove from the collection. |
Reimplemented from CPObjectController.
Definition at line 872 of file CPArrayController.j.
- (void) removeObjectAtArrangedObjectIndex: |
|
(int) |
index |
|
|
implementation |
Removes the object at the specified index in the controller's arranged objects from the content array.
- Parameters
-
int | index - index of the object to remove. |
Definition at line 947 of file CPArrayController.j.
- (void) removeObjects: |
|
(CPArray) |
objects |
|
|
implementation |
Removes an array of objects from the collection.
- Parameters
-
CPArray | anArray - The array of objects to remove |
Definition at line 1033 of file CPArrayController.j.
- (void) removeObjectsAtArrangedObjectIndexes: |
|
(CPIndexSet) |
anIndexSet |
|
|
implementation |
Removes the objects at the specified indexes in the controller's arranged objects from the content array.
- Parameters
-
CPIndexSet | indexes - indexes of the objects to remove. |
Definition at line 956 of file CPArrayController.j.
- (CPArray) selectedObjects |
|
|
|
|
implementation |
- (unsigned) selectionIndex |
|
|
|
|
implementation |
Returns the index of the first object in the controller's selection.
- Returns
- unsigned - Index of the first selected object.
Definition at line 527 of file CPArrayController.j.
- (void) selectNext: |
|
(id) |
sender |
|
|
implementation |
Selects the next object, relative to the current selection, in the controllers arranged content.
- Parameters
-
id | sender - the sender of the message. |
Definition at line 721 of file CPArrayController.j.
- (void) selectPrevious: |
|
(id) |
sender |
|
|
implementation |
Selects the previous object, relative to the current selection, in the controllers arranged content.
- Parameters
-
id | sender - the sender of the message. |
Definition at line 699 of file CPArrayController.j.
- (BOOL) selectsInsertedObjects |
|
|
|
|
implementation |
- Returns
- BOOL - Returns YES if new objects are automatically selected, otherwise NO.
Definition at line 166 of file CPArrayController.j.
- (void) setAlwaysUsesMultipleValuesMarker: |
|
(BOOL) |
aFlag |
|
|
implementation |
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
-
BOOL | aFlag YES if the receiver should always use the multiple values marker |
Definition at line 234 of file CPArrayController.j.
- (void) setAutomaticallyRearrangesObjects: |
|
(BOOL) |
aFlag |
|
|
implementation |
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
-
BOOL | YES if the receiver should automatically rearrange its content on new sort descriptors or filter predicates |
Definition at line 262 of file CPArrayController.j.
- (void) setAvoidsEmptySelection: |
|
(BOOL) |
value |
|
|
implementation |
Sets whether the controller should try to avoid an empty selection.
- Parameters
-
BOOL | aFlag - YES if the receiver should attempt to avoid an empty selection, otherwise NO. |
Definition at line 192 of file CPArrayController.j.
- (void) setClearsFilterPredicateOnInsertion: |
|
(BOOL) |
aFlag |
|
|
implementation |
Sets whether the receiver should clear its filter predicate when a new object is inserted.
- Parameters
-
BOOL | YES if the receiver should clear filter predicates on insert |
Definition at line 212 of file CPArrayController.j.
- (void) setContent: |
|
(id) |
value |
|
|
implementation |
- (void) setFilterPredicate: |
|
(CPPredicate) |
value |
|
|
implementation |
Sets the predicate for the controller to filter the content. Passing nil will remove an existing prediate.
- Parameters
-
CPPrediate | aPredicate - the new predicate. |
Definition at line 487 of file CPArrayController.j.
- (void) setPreservesSelection: |
|
(BOOL) |
value |
|
|
implementation |
Sets whether the selection is kept when the content changes.
- Parameters
-
BOOL | aFlag - YES if the selection should be kept, otherwise NO. |
Definition at line 158 of file CPArrayController.j.
- (BOOL) setSelectedObjects: |
|
(CPArray) |
objects |
|
|
implementation |
Sets the selected objects of the controller.
- Parameters
-
CPArray | anArray - the objects to select |
- Returns
- BOOL - Returns YES if the selection was changed, otherwise NO.
Definition at line 645 of file CPArrayController.j.
- (BOOL) setSelectionIndex: |
|
(unsigned) |
index |
|
|
implementation |
Sets the selected index
- Parameters
-
unsigned | anIndex - the new index to select |
- Returns
- BOOL - Returns YES if the selection was changed, otherwise NO.
Definition at line 538 of file CPArrayController.j.
- (BOOL) setSelectionIndexes: |
|
(CPIndexSet) |
indexes |
|
|
implementation |
Sets the selection indexes of the controller.
- Parameters
-
- Returns
- BOOL - Returns YES if the selection changed, otherwise NO.
Definition at line 559 of file CPArrayController.j.
- (void) setSelectsInsertedObjects: |
|
(BOOL) |
value |
|
|
implementation |
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 175 of file CPArrayController.j.
- (void) setSortDescriptors: |
|
(CPArray) |
value |
|
|
implementation |
Sets the sort descriptors for the controller.
- Parameters
-
CPArray | descriptors - the new sort descriptors. |
Definition at line 459 of file CPArrayController.j.
- (CPArray) sortDescriptors |
|
|
|
|
implementation |
Returns the receiver's array of sort descriptors.
- Returns
- CPArray an array of sort descriptors
Definition at line 449 of file CPArrayController.j.
The documentation for this class was generated from the following files: