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

#import <CPArrayController.h>

+ Inheritance diagram for CPArrayController:

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) - removeObjectAtArrangedObjectIndex:
 
(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
 
- Instance Methods inherited from CPObjectController
(void) - addObserver:forKeyPath:options:context:
 
(BOOL) - automaticallyPreparesContent
 
(BOOL) - canAdd
 
(BOOL) - canRemove
 
(id) - content
 
(id) - initWithContent:
 
(BOOL) - isEditable
 
(id) - newObject
 
(Class) - objectClass
 
(id) - observedKeys
 
(void) - removeObserver:forKeyPath:
 
(id) - selection
 
(void) - setAutomaticallyPreparesContent:
 
(void) - setEditable:
 
(void) - setObjectClass:
 
- Instance Methods inherited from CPController
(BOOL) - commitEditing
 
(void) - discardEditing
 
(BOOL) - isEditing
 
(void) - objectDidBeginEditing:
 
(void) - objectDidEndEditing:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - bind:toObject:withKeyPath:options:
 
(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
 
(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:
 

Class Methods

(void) + initialize
 
(CPSet+ keyPathsForValuesAffectingArrangedObjects
 
(CPSet+ keyPathsForValuesAffectingCanRemove
 
(CPSet+ keyPathsForValuesAffectingCanSelectNext
 
(CPSet+ keyPathsForValuesAffectingCanSelectPrevious
 
(CPSet+ keyPathsForValuesAffectingContentArray
 
(CPSet+ keyPathsForValuesAffectingSelectedObjects
 
(CPSet+ keyPathsForValuesAffectingSelection
 
(CPSet+ keyPathsForValuesAffectingSelectionIndex
 
(CPSet+ keyPathsForValuesAffectingSelectionIndexes
 
- Class Methods inherited from CPObjectController
(BOOL) + automaticallyNotifiesObserversForKey:
 
(CPSet+ keyPathsForValuesAffectingCanAdd
 
(CPSet+ keyPathsForValuesAffectingCanInsert
 
(CPSet+ keyPathsForValuesAffectingContentObject
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(Class) + class
 
(void) + exposeBinding:
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

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
implementation

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 892 of file CPArrayController.j.

- (void) addObject: (id)  object
implementation

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 738 of file CPArrayController.j.

- (void) addObjects: (CPArray objects
implementation

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

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

Definition at line 993 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 225 of file CPArrayController.j.

- (id) arrangedObjects
implementation

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
implementation

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
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 250 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 185 of file CPArrayController.j.

- (void) awakeFromCib
implementation

Reimplemented from CPObjectController.

Provided by category CPArrayController(CPCoding).

Definition at line 1211 of file CPArrayController.j.

- (BOOL) canInsert
implementation

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 1064 of file CPArrayController.j.

- (BOOL) canSelectNext
implementation

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 714 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 692 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 204 of file CPArrayController.j.

- (id) contentArray
implementation

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
implementation

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
implementation

Reimplemented from CPObjectController.

Provided by category CPArrayController(CPCoding).

Definition at line 1198 of file CPArrayController.j.

- (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 478 of file CPArrayController.j.

- (id) init
implementation

Reimplemented from CPObjectController.

Definition at line 113 of file CPArrayController.j.

+ (void) initialize
implementation

Reimplemented from CPObjectController.

Definition at line 54 of file CPArrayController.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPObjectController.

Provided by category CPArrayController(CPCoding).

Definition at line 1174 of file CPArrayController.j.

- (void) insert: (id)  sender
implementation

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

Parameters
idsender - The sender of the message.

Definition at line 904 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
idanObject - The object to add to the collection.
intanIndex - The index to insert the object at.

Definition at line 805 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingArrangedObjects
implementation

Definition at line 68 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingCanRemove
implementation

Reimplemented from CPObjectController.

Definition at line 97 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingCanSelectNext
implementation

Definition at line 102 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingCanSelectPrevious
implementation

Definition at line 107 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingContentArray
implementation

Definition at line 63 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelectedObjects
implementation

Definition at line 91 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelection
implementation

Definition at line 74 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelectionIndex
implementation

Definition at line 79 of file CPArrayController.j.

+ (CPSet) keyPathsForValuesAffectingSelectionIndexes
implementation

Definition at line 84 of file CPArrayController.j.

- (void) prepareContent
implementation

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
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 150 of file CPArrayController.j.

- (void) rearrangeObjects
implementation

Triggers the filtering of the objects in the controller.

Definition at line 394 of file CPArrayController.j.

- (void) remove: (id)  sender
implementation

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

Parameters
idsender - The sender of the message.

Reimplemented from CPObjectController.

Definition at line 918 of file CPArrayController.j.

- (void) removeObject: (id)  object
implementation

Removes a given object from the receiver's collection.

Parameters
idanObject - The object to remove from the collection.

Reimplemented from CPObjectController.

Definition at line 858 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
intindex - index of the object to remove.

Definition at line 927 of file CPArrayController.j.

- (void) removeObjects: (CPArray objects
implementation

Removes an array of objects from the collection.

Parameters
CPArrayanArray - The array of objects to remove

Definition at line 1013 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
CPIndexSetindexes - indexes of the objects to remove.

Definition at line 936 of file CPArrayController.j.

- (CPArray) selectedObjects
implementation

Returns an array of the selected objects.

Returns
CPArray - the selected objects.

Reimplemented from CPObjectController.

Definition at line 634 of file CPArrayController.j.

- (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 529 of file CPArrayController.j.

- (CPIndexSet) selectionIndexes
implementation

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
implementation

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

Parameters
idsender - the sender of the message.

Definition at line 723 of file CPArrayController.j.

- (void) selectPrevious: (id)  sender
implementation

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

Parameters
idsender - the sender of the message.

Definition at line 701 of file CPArrayController.j.

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

Definition at line 168 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
BOOLaFlag YES if the receiver should always use the multiple values marker

Definition at line 236 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
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
implementation

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
implementation

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
implementation

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
implementation

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
implementation

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
implementation

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 647 of file CPArrayController.j.

- (BOOL) setSelectionIndex: (unsigned)  index
implementation

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
implementation

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
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 177 of file CPArrayController.j.

- (void) setSortDescriptors: (CPArray value
implementation

Sets the sort descriptors for the controller.

Parameters
CPArraydescriptors - the new sort descriptors.

Definition at line 461 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 451 of file CPArrayController.j.


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