85 #define SELECTION_SHOULD_CHANGE(anOutlineView) (!((anOutlineView)._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_selectionShouldChangeInOutlineView_) || [(anOutlineView)._outlineViewDelegate selectionShouldChangeInOutlineView:(anOutlineView)]) 87 #define SHOULD_SELECT_ITEM(anOutlineView, anItem) (!((anOutlineView)._implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldSelectItem_) || [(anOutlineView)._outlineViewDelegate outlineView:(anOutlineView) shouldSelectItem:(anItem)]) 93 - (BOOL)outlineView:(
CPOutlineView)anOutlineView isGroupItem:(
id)anItem;
94 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldCollapseItem:(
id)anItem;
96 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldExpandItem:(
id)anItem;
97 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldReorderColumn:(CPInteger)columnIndex toColumn:(CPInteger)newColumnIndex;
98 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldSelectItem:(
id)anItem;
100 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldShowOutlineDisclosureControlForItem:(
id)anItem;
101 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldShowViewExpansionForTableColumn:(
CPTableColumn)aTableColumn item:(
id)anItem;
103 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldTypeSelectForEvent:(
CPEvent)anEvent withCurrentSearchString:(
CPString)searchString;
104 - (BOOL)selectionShouldChangeInOutlineView:(
CPOutlineView)anOutlineView;
111 - (float)outlineView:(
CPOutlineView)anOutlineView heightOfRowByItem:(
id)anItem;
113 - (id)outlineView:(
CPOutlineView)anOutlineView nextTypeSelectMatchFromItem:(
id)startItem toItem:(
id)endItem forString:(
CPString)searchString;
127 - (BOOL)outlineView:(
CPOutlineView)anOutlineView acceptDrop:(
id )info item:(
id)anItem childIndex:(CPInteger)anIndex;
128 - (BOOL)outlineView:(
CPOutlineView)anOutlineView shouldDeferDisplayingChildrenOfItem:(
id)anItem;
130 - (CPArray)outlineView:(
CPOutlineView)anOutlineView namesOfPromisedFilesDroppedAtDestination:(
CPURL)dropDestination forDraggedItems:(CPArray)items;
131 - (CPDragOperation)outlineView:(
CPOutlineView)anOutlineView validateDrop:(
id )info proposedItem:(
id)anItem proposedChildIndex:(CPInteger)anIndex;
132 - (CPDragOperation)outlineView:(
CPOutlineView)anOutlineView validateDrop:(
id )info proposedRow:(
int)theRow proposedDropOperation:(CPTableViewDropOperation)theOperation;
133 - (id)outlineView:(
CPOutlineView)anOutlineView itemForPersistentObject:(
id)anObject;
135 - (id)outlineView:(
CPOutlineView)anOutlineView persistentObjectForItem:(
id)anItem;
136 - (void)outlineView:(
CPOutlineView)anOutlineView setObjectValue:(
id)anObject forTableColumn:(
CPTableColumn)aTableColumn byItem:(
id)anItem;
137 - (void)outlineView:(
CPOutlineView)anOutlineView sortDescriptorsDidChange:(CPArray)oldDescriptors;
157 id <CPOutlineViewDataSource> _outlineViewDataSource;
158 id <CPOutlineViewDelegate> _outlineViewDelegate;
161 float _indentationPerLevel;
162 BOOL _indentationMarkerFollowsDataView;
164 CPInteger _implementedOutlineViewDataSourceMethods;
165 CPInteger _implementedOutlineViewDelegateMethods;
167 Object _rootItemInfo;
169 Object _itemInfosForItems;
172 CPArray _disclosureControlsForRows;
173 CPData _disclosureControlData;
174 CPArray _disclosureControlQueue;
176 BOOL _shouldRetargetItem;
179 BOOL _shouldRetargetChildIndex;
180 CPInteger _retargedChildIndex;
184 BOOL _coalesceSelectionNotificationState;
186 CPArray _pendingItemToClean;
187 CPArray _itemAddedDuringLastLoading;
190 - (id)initWithFrame:(CGRect)aFrame
199 _rootItemInfo = { isExpanded:YES, isExpandable:NO, shouldShowOutlineDisclosureControl:NO, level:-1, row:-1, children:[], weight:0 };
202 _itemInfosForItems = { };
203 _disclosureControlsForRows = [];
205 _retargetedItem = nil;
206 _shouldRetargetItem = NO;
208 _retargedChildIndex = nil;
209 _shouldRetargetChildIndex = NO;
214 [
super setDataSource:[[_CPOutlineViewTableViewDataSource alloc] initWithOutlineView:self]];
215 [
super setDelegate:[[_CPOutlineViewTableViewDelegate alloc] initWithOutlineView:self]];
223 - (void)_initSubclass
225 _BlockDeselectView =
function(view, row, column)
227 [view unsetThemeState:CPThemeStateSelectedDataView];
228 [_disclosureControlsForRows[row] unsetThemeState:CPThemeStateSelected];
231 _BlockSelectView =
function(view, row, column)
233 [view setThemeState:CPThemeStateSelectedDataView];
234 [_disclosureControlsForRows[row] setThemeState:CPThemeStateSelected];
289 - (void)setDataSource:(
id <CPOutlineViewDataSource>)aDataSource
291 if (_outlineViewDataSource === aDataSource)
294 if (![aDataSource respondsToSelector:
@selector(outlineView:child:ofItem:)])
297 if (![aDataSource respondsToSelector:
@selector(outlineView:isItemExpandable:)])
300 if (![aDataSource respondsToSelector:
@selector(outlineView:numberOfChildrenOfItem:)])
303 _outlineViewDataSource = aDataSource;
304 _implementedOutlineViewDataSourceMethods = 0;
306 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:objectValueForTableColumn:byItem:)])
309 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
312 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:shouldDeferDisplayingChildrenOfItem:)])
315 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:acceptDrop:item:childIndex:)])
318 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:validateDrop:proposedItem:proposedChildIndex:)])
321 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:validateDrop:proposedRow:proposedDropOperation:)])
324 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)])
327 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:itemForPersistentObject:)])
330 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:persistentObjectForItem:)])
333 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:writeItems:toPasteboard:)])
336 if ([_outlineViewDataSource respondsToSelector:
@selector(outlineView:sortDescriptorsDidChange:)])
349 return _outlineViewDataSource;
359 - (BOOL)isExpandable:(
id)anItem
364 var itemInfo = [
self _itemInfosForItem:anItem];
369 return itemInfo.isExpandable;
372 - (BOOL)_shouldShowOutlineDisclosureControlForItem:(
id)anItem
377 var itemInfo = _itemInfosForItems[[anItem UID]];
382 return itemInfo.shouldShowOutlineDisclosureControl;
392 - (BOOL)isItemExpanded:(
id)anItem
397 var itemInfo = [
self _itemInfosForItem:anItem];
402 return itemInfo.isExpanded;
411 - (id)itemAtRow:(CPInteger)aRow
413 return _itemsForRows[aRow] || nil;
422 - (CPInteger)rowForItem:(
id)anItem
425 return _rootItemInfo.row;
427 var itemInfo = [
self _itemInfosForItem:anItem];
443 - (CPInteger)levelForItem:(
id)anItem
446 return _rootItemInfo.level;
448 var itemInfo = [
self _itemInfosForItem:anItem];
453 return itemInfo.level;
463 - (CPInteger)levelForRow:(CPInteger)aRow
467 if (!item && aRow >= 0)
478 - (Object)_itemInfosForItem:(
id)anItem
480 var itemInfo = _itemInfosForItems[[anItem UID]];
482 if (!itemInfo || [
self _parentIsCollapsed:[
self parentForItem:anItem]])
492 - (BOOL)_parentIsCollapsed:(
id)anItem
494 var parentItem = [
self parentForItem:anItem],
495 itemInfo = _itemInfosForItems[[anItem UID]];
500 if (!itemInfo.isExpanded)
503 return [
self _parentIsCollapsed:parentItem];
511 - (void)expandItem:(
id)anItem
522 - (void)expandItem:(
id)anItem expandChildren:(BOOL)shouldExpandChildren
524 if ([
self _delegateRespondsToShouldExpandItem])
525 if ([_outlineViewDelegate outlineView:
self shouldExpandItem:anItem] == NO)
531 itemInfo = _rootItemInfo;
533 itemInfo = _itemInfosForItems[[anItem UID]];
543 if (!_coalesceSelectionNotificationState)
550 if (!itemInfo.isExpanded)
552 [
self _noteItemWillExpand:anItem];
556 itemInfo.isExpanded = YES;
558 [
self _noteItemDidExpand:anItem];
561 var rowCountDelta = [
self numberOfRows] - previousRowCount;
568 if ([selection intersectsIndexesInRange:
CPMakeRange(expandIndex, _itemsForRows.length)])
570 [
self _noteSelectionIsChanging];
571 [selection shiftIndexesStartingAtIndex:expandIndex by:rowCountDelta];
572 [
self _setSelectedRowIndexes:selection];
577 if (shouldExpandChildren)
579 var children = itemInfo.children,
580 childIndex = children.length;
588 var r = _coalesceSelectionNotificationState;
591 [
self _noteSelectionDidChange];
600 - (void)collapseItem:(
id)anItem
605 if ([
self _delegateRespondsToShouldCollapseItem])
606 if ([_outlineViewDelegate outlineView:
self shouldCollapseItem:anItem] == NO)
609 var itemInfo = _itemInfosForItems[[anItem UID]];
614 if (!itemInfo.isExpanded)
620 [
self _noteItemWillCollapse:anItem];
624 var collapseTopIndex = [
self rowForItem:anItem],
626 collapseEndIndex = collapseTopIndex;
628 while (collapseEndIndex + 1 < _itemsForRows.length && [
self levelForRow:collapseEndIndex + 1] > topLevel)
631 var collapseRange =
CPMakeRange(collapseTopIndex + 1, collapseEndIndex - collapseTopIndex);
633 if (collapseRange.length)
637 if ([selection intersectsIndexesInRange:collapseRange])
639 [
self _noteSelectionIsChanging];
640 [selection removeIndexesInRange:collapseRange];
641 [
self _setSelectedRowIndexes:selection];
645 if ([selection intersectsIndexesInRange:
CPMakeRange(collapseEndIndex + 1, _itemsForRows.length)])
647 [
self _noteSelectionIsChanging];
648 [selection shiftIndexesStartingAtIndex:collapseEndIndex + 1 by:-collapseRange.length];
649 [
self _setSelectedRowIndexes:selection];
653 itemInfo.isExpanded = NO;
656 [
self _noteItemDidCollapse:anItem];
660 var r = _coalesceSelectionNotificationState;
663 [
self _noteSelectionDidChange];
671 - (void)reloadItem:(
id)anItem
682 - (void)reloadItem:(
id)anItem reloadChildren:(BOOL)shouldReloadChildren
684 _pendingItemToClean = [];
685 _itemAddedDuringLastLoading = [];
687 if (!!shouldReloadChildren || !anItem)
688 [
self _loadItemInfoForItem:anItem intermediate:NO];
690 [
self _reloadItem:anItem];
692 [
self _cleanPendingItem];
694 [
super _reloadDataViews];
697 - (void)_reloadItem:(
id)anItem
703 var itemUID = [anItem UID],
704 itemInfo = _itemInfosForItems[itemUID];
711 var parent = itemInfo.parent,
712 parentItemInfo = parent ? _itemInfosForItems[[parent UID]] : _rootItemInfo,
713 parentChildren = parentItemInfo.children,
714 index = [parentChildren indexOfObjectIdenticalTo:anItem],
715 newItem = [_outlineViewDataSource outlineView:self child:index ofItem:parent];
717 if (anItem !== newItem)
719 _itemInfosForItems[[anItem UID]] = nil;
720 _itemInfosForItems[[newItem UID]] = itemInfo;
722 parentChildren[index] = newItem;
723 _itemsForRows[itemInfo.row] = newItem;
726 itemInfo.isExpandable = [_outlineViewDataSource outlineView:self isItemExpandable:newItem];
727 itemInfo.isExpanded = itemInfo.isExpandable && itemInfo.isExpanded;
728 itemInfo.shouldShowOutlineDisclosureControl = [
self _sendDelegateShouldShowOutlineDisclosureControlForItem:newItem];
731 - (void)_addPendingItemsFromPreviousItems:(CPArray)previousItems forItemInfo:(Object)itemInfo
736 var children = itemInfo.children;
738 for (var i = [previousItems count] - 1; i >= 0; i--)
740 var item = previousItems[i];
742 if (![children containsObject:item])
743 [
self _addPendingItem:item];
747 - (void)_addPendingItem:(
id)anItem
749 var itemInfo = _itemInfosForItems[[anItem UID]];
754 var children = itemInfo.children;
756 for (var i = [children count]; i >= 0; i--)
758 var child = children[i];
759 [
self _addPendingItem:child];
762 [_pendingItemToClean addObject:anItem];
765 - (void)_cleanPendingItem
767 for (var i = [_pendingItemToClean count]; i >= 0; i--)
769 var item = _pendingItemToClean[i];
771 if (![_itemAddedDuringLastLoading containsObject:item])
772 delete _itemInfosForItems[[item UID]];
775 _pendingItemToClean = [];
776 _itemAddedDuringLastLoading = [];
779 - (CPArray)_loadItemInfoForItem:(
id)anItem intermediate:(BOOL)isIntermediate
783 var itemInfo = _rootItemInfo;
788 var itemUID = [anItem UID],
789 itemInfo = _itemInfosForItems[itemUID];
795 itemInfo.isExpandable = [_outlineViewDataSource outlineView:self isItemExpandable:anItem];
796 itemInfo.shouldShowOutlineDisclosureControl = [
self _sendDelegateShouldShowOutlineDisclosureControlForItem:anItem];
800 if (!itemInfo.isExpandable && itemInfo.isExpanded)
802 itemInfo.isExpanded = NO;
803 itemInfo.children = [];
808 var weight = itemInfo.weight,
809 descendants = anItem ? [anItem] : [];
811 [_itemAddedDuringLastLoading addObject:anItem];
813 if (itemInfo.isExpanded && [
self _sendDataSourceShouldDeferDisplayingChildrenOfItem:anItem])
816 count = [_outlineViewDataSource outlineView:self numberOfChildrenOfItem:anItem],
817 level = itemInfo.level + 1,
818 previousChildren = itemInfo.children;
820 itemInfo.children = [];
822 for (; index < count; ++index)
824 var childItem = [_outlineViewDataSource outlineView:self child:index ofItem:anItem],
825 childItemInfo = _itemInfosForItems[[childItem UID]];
829 childItemInfo = { isExpanded:NO, isExpandable:NO, shouldShowOutlineDisclosureControl:YES, children:[], weight:1 };
830 _itemInfosForItems[[childItem UID]] = childItemInfo;
833 itemInfo.children[index] = childItem;
835 var childDescendants = [self _loadItemInfoForItem:childItem intermediate:YES];
837 childItemInfo.parent = anItem;
838 childItemInfo.level = level;
839 descendants = descendants.concat(childDescendants);
844 [
self _addPendingItemsFromPreviousItems:previousChildren forItemInfo:itemInfo];
847 itemInfo.weight = descendants.length;
852 var index = MAX(itemInfo.row, 0);
854 descendants.unshift(index, weight);
856 _itemsForRows.splice.apply(_itemsForRows, descendants);
858 var count = _itemsForRows.length;
860 for (; index < count; ++index)
861 _itemInfosForItems[[_itemsForRows[index] UID]].row = index;
863 var deltaWeight = itemInfo.weight - weight;
865 if (deltaWeight !== 0)
867 var parent = itemInfo.parent;
871 var parentItemInfo = _itemInfosForItems[[parent UID]];
873 parentItemInfo.weight += deltaWeight;
874 parent = parentItemInfo.parent;
878 _rootItemInfo.weight += deltaWeight;
893 if (_outlineTableColumn === aTableColumn)
896 _outlineTableColumn = aTableColumn;
909 return _outlineTableColumn;
917 - (void)setIndentationPerLevel:(
float)anIndentationWidth
919 if (_indentationPerLevel === anIndentationWidth)
922 _indentationPerLevel = anIndentationWidth;
933 - (float)indentationPerLevel
935 return _indentationPerLevel;
945 - (void)setIndentationMarkerFollowsDataView:(BOOL)indentationMarkerShouldFollowDataView
947 if (_indentationMarkerFollowsDataView === indentationMarkerShouldFollowDataView)
950 _indentationMarkerFollowsDataView = indentationMarkerShouldFollowDataView;
963 - (BOOL)indentationMarkerFollowsDataView
965 return _indentationMarkerFollowsDataView;
975 - (id)parentForItem:(
id)anItem
980 var itemInfo = _itemInfosForItems[[anItem UID]];
985 var parent = itemInfo.parent;
988 if (itemInfo[[parent UID]] === _rootItemInfo)
999 - (CGRect)_frameOfOutlineDataViewAtRow:(CPInteger)aRow
1001 var
columnIndex = [[
self tableColumns] indexOfObject:_outlineTableColumn],
1002 frame = [
super frameOfDataViewAtColumn:columnIndex row:aRow],
1003 indentationWidth = ([
self levelForRow:aRow] + 1) * [self indentationPerLevel];
1005 frame.origin.x += indentationWidth;
1006 frame.size.width -= indentationWidth;
1019 - (CGRect)frameOfOutlineDisclosureControlAtRow:(CPInteger)aRow
1023 if (![
self isExpandable:theItem] || ![
self _shouldShowOutlineDisclosureControlForItem:theItem])
1024 return CGRectMakeZero();
1026 var dataViewFrame = [
self _frameOfOutlineDataViewAtRow:aRow],
1027 disclosureWidth = CGRectGetWidth([_disclosureControlPrototype
frame]),
1028 frame = CGRectMake(CGRectGetMinX(dataViewFrame) - disclosureWidth, CGRectGetMinY(dataViewFrame), disclosureWidth, CGRectGetHeight(dataViewFrame));
1037 - (void)_setSelectedRowIndexes:(
CPIndexSet)rows
1039 if (_disclosureControlsForRows.length)
1041 var indexes = [_selectedRowIndexes copy];
1042 [indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, _itemsForRows.length - _disclosureControlsForRows.length)];
1043 [[_disclosureControlsForRows objectsAtIndexes:indexes] makeObjectsPerformSelector:@selector(unsetThemeState:) withObject:CPThemeStateSelected];
1046 [
super _setSelectedRowIndexes:rows];
1048 if (_disclosureControlsForRows.length)
1050 var indexes = [_selectedRowIndexes copy];
1051 [indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, _itemsForRows.length - _disclosureControlsForRows.length)];
1052 [[_disclosureControlsForRows objectsAtIndexes:indexes] makeObjectsPerformSelector:@selector(setThemeState:) withObject:CPThemeStateSelected];
1132 - (void)setDelegate:(
id <CPOutlineViewDelegate>)aDelegate
1134 if (_outlineViewDelegate === aDelegate)
1139 if (_outlineViewDelegate)
1141 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewColumnDidMove:)])
1143 removeObserver:_outlineViewDelegate
1144 name:CPOutlineViewColumnDidMoveNotification
1147 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewColumnDidResize:)])
1149 removeObserver:_outlineViewDelegate
1150 name:CPOutlineViewColumnDidResizeNotification
1153 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewSelectionDidChange:)])
1155 removeObserver:_outlineViewDelegate
1156 name:CPOutlineViewSelectionDidChangeNotification
1159 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewSelectionIsChanging:)])
1161 removeObserver:_outlineViewDelegate
1162 name:CPOutlineViewSelectionIsChangingNotification
1165 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemWillExpand:)])
1167 removeObserver:_outlineViewDelegate
1168 name:CPOutlineViewItemWillExpandNotification
1171 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemDidExpand:)])
1173 removeObserver:_outlineViewDelegate
1174 name:CPOutlineViewItemDidExpandNotification
1177 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemWillCollapse:)])
1179 removeObserver:_outlineViewDelegate
1180 name:CPOutlineViewItemWillCollapseNotification
1183 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemDidCollapse:)])
1185 removeObserver:_outlineViewDelegate
1186 name:CPOutlineViewItemDidCollapseNotification
1190 _outlineViewDelegate = aDelegate;
1191 _implementedOutlineViewDelegateMethods = 0;
1193 var delegateMethods = [
1194 CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_ , @selector(outlineView:dataViewForTableColumn:item:),
1195 CPOutlineViewDelegate_outlineView_viewForTableColumn_item_ , @selector(outlineView:viewForTableColumn:item:),
1196 CPOutlineViewDelegate_outlineView_didClickTableColumn_ , @selector(outlineView:didClickTableColumn:),
1197 CPOutlineViewDelegate_outlineView_didDragTableColumn_ , @selector(outlineView:didDragTableColumn:),
1198 CPOutlineViewDelegate_outlineView_heightOfRowByItem_ , @selector(outlineView:heightOfRowByItem:),
1199 CPOutlineViewDelegate_outlineView_isGroupItem_ , @selector(outlineView:isGroupItem:),
1200 CPOutlineViewDelegate_outlineView_mouseDownInHeaderOfTableColumn_ , @selector(outlineView:mouseDownInHeaderOfTableColumn:),
1201 CPOutlineViewDelegate_outlineView_nextTypeSelectMatchFromItem_toItem_forString_ , @selector(outlineView:nextTypeSelectMatchFromItem:toItem:forString:),
1202 CPOutlineViewDelegate_outlineView_selectionIndexesForProposedSelection_ , @selector(outlineView:selectionIndexesForProposedSelection:),
1203 CPOutlineViewDelegate_outlineView_shouldCollapseItem_ , @selector(outlineView:shouldCollapseItem:),
1204 CPOutlineViewDelegate_outlineView_shouldEditTableColumn_item_ , @selector(outlineView:shouldEditTableColumn:item:),
1205 CPOutlineViewDelegate_outlineView_shouldExpandItem_ , @selector(outlineView:shouldExpandItem:),
1206 CPOutlineViewDelegate_outlineView_shouldReorderColumn_toColumn_ , @selector(outlineView:shouldReorderColumn:toColumn:),
1207 CPOutlineViewDelegate_outlineView_shouldSelectItem_ , @selector(outlineView:shouldSelectItem:),
1208 CPOutlineViewDelegate_outlineView_shouldSelectTableColumn_ , @selector(outlineView:shouldSelectTableColumn:),
1209 CPOutlineViewDelegate_outlineView_shouldShowOutlineDisclosureControlForItem_ , @selector(outlineView:shouldShowOutlineDisclosureControlForItem:),
1210 CPOutlineViewDelegate_outlineView_shouldShowViewExpansionForTableColumn_item_ , @selector(outlineView:shouldShowViewExpansionForTableColumn:item:),
1211 CPOutlineViewDelegate_outlineView_shouldTrackView_forTableColumn_item_ , @selector(outlineView:shouldTrackView:forTableColumn:item:),
1212 CPOutlineViewDelegate_outlineView_shouldTypeSelectForEvent_withCurrentSearchString_ , @selector(outlineView:shouldTypeSelectForEvent:withCurrentSearchString:),
1213 CPOutlineViewDelegate_outlineView_sizeToFitWidthOfColumn_ , @selector(outlineView:sizeToFitWidthOfColumn:),
1214 CPOutlineViewDelegate_outlineView_toolTipForView_rect_tableColumn_item_mouseLocation_, @selector(outlineView:toolTipForView:rect:tableColumn:item:mouseLocation:),
1215 CPOutlineViewDelegate_outlineView_typeSelectStringForTableColumn_item_ , @selector(outlineView:typeSelectStringForTableColumn:item:),
1216 CPOutlineViewDelegate_outlineView_willDisplayOutlineView_forTableColumn_item_ , @selector(outlineView:willDisplayOutlineView:forTableColumn:item:),
1217 CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_ , @selector(outlineView:willDisplayView:forTableColumn:item:),
1218 CPOutlineViewDelegate_outlineView_willRemoveView_forTableColumn_item_ , @selector(outlineView:willRemoveView:forTableColumn:item:),
1219 CPOutlineViewDelegate_selectionShouldChangeInOutlineView_ , @selector(selectionShouldChangeInOutlineView:),
1220 CPOutlineViewDelegate_outlineView_menuForTableColumn_item_ , @selector(outlineView:menuForTableColumn:item:)
1222 delegateCount = [delegateMethods count];
1224 for (var i = 0; i < delegateCount; i += 2)
1226 var bitMask = delegateMethods[i],
1227 selector = delegateMethods[i + 1];
1229 if ([_outlineViewDelegate respondsToSelector:selector])
1230 _implementedOutlineViewDelegateMethods |= bitMask;
1233 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewColumnDidMove:)])
1235 addObserver:_outlineViewDelegate
1236 selector:@selector(outlineViewColumnDidMove:)
1237 name:CPOutlineViewColumnDidMoveNotification
1240 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewColumnDidResize:)])
1242 addObserver:_outlineViewDelegate
1243 selector:@selector(outlineViewColumnDidMove:)
1244 name:CPOutlineViewColumnDidResizeNotification
1247 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewSelectionDidChange:)])
1249 addObserver:_outlineViewDelegate
1250 selector:@selector(outlineViewSelectionDidChange:)
1251 name:CPOutlineViewSelectionDidChangeNotification
1254 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewSelectionIsChanging:)])
1256 addObserver:_outlineViewDelegate
1257 selector:@selector(outlineViewSelectionIsChanging:)
1258 name:CPOutlineViewSelectionIsChangingNotification
1261 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemWillExpand:)])
1263 addObserver:_outlineViewDelegate
1264 selector:@selector(outlineViewItemWillExpand:)
1265 name:CPOutlineViewItemWillExpandNotification
1268 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemDidExpand:)])
1270 addObserver:_outlineViewDelegate
1271 selector:@selector(outlineViewItemDidExpand:)
1272 name:CPOutlineViewItemDidExpandNotification
1275 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemWillCollapse:)])
1277 addObserver:_outlineViewDelegate
1278 selector:@selector(outlineViewItemWillCollapse:)
1279 name:CPOutlineViewItemWillCollapseNotification
1282 if ([_outlineViewDelegate respondsToSelector:
@selector(outlineViewItemDidCollapse:)])
1284 addObserver:_outlineViewDelegate
1285 selector:@selector(outlineViewItemDidCollapse:)
1286 name:CPOutlineViewItemDidCollapseNotification
1289 [
self _updateIsViewBased];
1291 if ([
self _delegateRespondsToDataViewForTableColumn])
1292 CPLog.warn(
"outlineView:dataViewForTableColumn:item: is deprecated. You should use -outlineView:viewForTableColumn:item: where you can request the view with -makeViewWithIdentifier:owner:");
1300 return _outlineViewDelegate;
1312 _disclosureControlPrototype = aControl;
1313 _disclosureControlData = nil;
1314 _disclosureControlQueue = [];
1323 - (void)_reloadDataViews
1325 [
self reloadItem:nil reloadChildren:YES];
1342 if ([
self numberOfColumns] === 1)
1343 _outlineTableColumn = aTableColumn;
1350 if (aTableColumn === [
self outlineTableColumn])
1351 CPLog(
"CPOutlineView cannot remove outlineTableColumn with removeTableColumn:. User setOutlineTableColumn: instead.");
1356 - (void)_addDraggedDataView:(
CPView)aDataView toView:(
CPView)aSuperview forColumn:(CPInteger)column row:(CPInteger)row offset:(CGPoint)offset
1360 [
super _addDraggedDataView:aDataView toView:aSuperview forColumn:column row:row offset:offset];
1362 if (_tableColumns[column] === _outlineTableColumn && (control = _disclosureControlsForRows[row]))
1364 var controlFrame = [
self frameOfOutlineDisclosureControlAtRow:row];
1366 controlFrame.origin.x -= offset.x;
1367 controlFrame.origin.y -= offset.y;
1369 [control setFrame:controlFrame];
1379 - (CGRect)frameOfDataViewAtColumn:(CPInteger)aColumn row:(CPInteger)aRow
1383 if (tableColumn === _outlineTableColumn)
1384 return [
self _frameOfOutlineDataViewAtRow:aRow];
1404 - (void)setDropItem:(
id)theItem dropChildIndex:(
int)theIndex
1406 if (_dropItem !== theItem && theIndex < 0 && [
self isExpandable:theItem] && ![
self isItemExpanded:theItem])
1408 if (_dragHoverTimer)
1409 [_dragHoverTimer invalidate];
1411 var autoExpandCallBack =
function()
1415 [_dropOperationFeedbackView blink];
1425 [_dragHoverTimer invalidate];
1426 _dragHoverTimer = nil;
1429 _dropItem = theItem;
1430 _retargetedItem = theItem;
1431 _shouldRetargetItem = YES;
1433 _retargedChildIndex = theIndex;
1434 _shouldRetargetChildIndex = YES;
1437 var retargetedItemInfo = (_retargetedItem !== nil) ? _itemInfosForItems[[_retargetedItem UID]] : _rootItemInfo;
1439 if (_retargedChildIndex === [retargetedItemInfo.children count])
1441 var retargetedChildItem = [retargetedItemInfo.children lastObject];
1442 _retargetedDropRow = [
self rowForItem:retargetedChildItem] + 1;
1446 var retargetedChildItem = (_retargedChildIndex !==
CPOutlineViewDropOnItemIndex) ? retargetedItemInfo.children[_retargedChildIndex] : _retargetedItem;
1447 _retargetedDropRow = [
self rowForItem:retargetedChildItem];
1454 - (void)_draggingEnded
1456 [
super _draggingEnded];
1458 [_dragHoverTimer invalidate];
1459 _dragHoverTimer = nil;
1465 - (id)_parentItemForUpperRow:(CPInteger)theUpperRowIndex andLowerRow:(CPInteger)theLowerRowIndex atMouseOffset:(CGPoint)theOffset
1467 if (_shouldRetargetItem)
1468 return _retargetedItem;
1470 var lowerLevel = [
self levelForRow:theLowerRowIndex],
1471 upperItem = [
self itemAtRow:theUpperRowIndex],
1472 upperLevel = [
self levelForItem:upperItem];
1477 while (upperLevel > lowerLevel)
1479 upperLevel = [
self levelForItem:upperItem];
1482 if (theOffset.x > (upperLevel + 1) * [
self indentationPerLevel])
1483 return [
self parentForItem:upperItem];
1486 upperItem = [
self parentForItem:upperItem];
1489 return [
self parentForItem:[
self itemAtRow:theLowerRowIndex]];
1495 - (CGRect)_rectForDropHighlightViewBetweenUpperRow:(CPInteger)theUpperRowIndex andLowerRow:(CPInteger)theLowerRowIndex offset:(CGPoint)theOffset
1498 var rect = [
super _rectForDropHighlightViewBetweenUpperRow:theUpperRowIndex andLowerRow:theLowerRowIndex offset:theOffset],
1499 parentItem = [
self _parentItemForUpperRow:theUpperRowIndex andLowerRow:theLowerRowIndex atMouseOffset:theOffset],
1500 level = [
self levelForItem:parentItem];
1502 rect.origin.x = (level + 1) * [self indentationPerLevel];
1503 rect.size.width -= rect.origin.x;
1512 - (void)_layoutViewsForRowIndexes:(
CPIndexSet)rowIndexes columnIndexes:(
CPIndexSet)columnIndexes
1514 [
self _enumerateViewsInRows:rowIndexes columns:columnIndexes usingBlock:function(view, row, column, stop)
1518 [view setFrame:[
self frameOfDataViewAtColumn:column row:row]];
1520 if (_tableColumns[column] === _outlineTableColumn && (control = _disclosureControlsForRows[row]))
1522 var frame = [
self frameOfOutlineDisclosureControlAtRow:row];
1523 [control setFrame:frame];
1527 [
self setNeedsDisplay:YES];
1535 [
super _loadDataViewsInRows:rows columns:columns];
1537 var outlineColumn = [[
self tableColumns] indexOfObjectIdenticalTo:[
self outlineTableColumn]];
1539 if (![columns containsIndex:outlineColumn] || outlineColumn === _draggedColumnIndex)
1547 rowsCount = rowArray.length;
1549 for (; rowIndex < rowsCount; ++rowIndex)
1551 var row = rowArray[rowIndex],
1552 item = _itemsForRows[row],
1553 isExpandable = [
self isExpandable:item];
1558 var disclosureControlFrame = [
self frameOfOutlineDisclosureControlAtRow:row];
1560 if (CGRectIsEmpty(disclosureControlFrame))
1563 var control = [
self _dequeueDisclosureControl];
1565 _disclosureControlsForRows[row] = control;
1567 [control setState:[
self isItemExpanded:item] ? CPOnState : CPOffState];
1568 var selector = [
self isRowSelected:row] ?
@"setThemeState:" :
@"unsetThemeState:";
1569 [control performSelector:CPSelectorFromString(selector) withObject:CPThemeStateSelected];
1570 [control setFrame:disclosureControlFrame];
1572 [
self addSubview:control];
1581 [
super _unloadDataViewsInRows:rows columns:columns];
1583 var outlineColumn = [[
self tableColumns] indexOfObjectIdenticalTo:[
self outlineTableColumn]];
1585 if (![columns containsIndex:outlineColumn])
1593 rowsCount = rowArray.length;
1595 for (; rowIndex < rowsCount; ++rowIndex)
1597 var row = rowArray[rowIndex],
1598 control = _disclosureControlsForRows[row];
1603 [control removeFromSuperview];
1605 [
self _enqueueDisclosureControl:control];
1607 _disclosureControlsForRows[row] = nil;
1614 - (void)_toggleFromDisclosureControl:(
CPControl)aControl
1616 var controlFrame = [aControl
frame],
1617 item = [
self itemAtRow:[
self rowAtPoint:CGPointMake(CGRectGetMinX(controlFrame), CGRectGetMidY(controlFrame))]];
1619 if ([
self isItemExpanded:item])
1620 [
self collapseItem:item];
1623 [
self expandItem:item expandChildren:([[CPApp currentEvent] modifierFlags] & CPAlternateKeyMask)];
1629 - (void)_enqueueDisclosureControl:(
CPControl)aControl
1631 _disclosureControlQueue.push(aControl);
1639 if (_disclosureControlQueue.length)
1640 return _disclosureControlQueue.pop();
1642 if (!_disclosureControlData)
1643 if (!_disclosureControlPrototype)
1650 [disclosureControl setTarget:self];
1651 [disclosureControl setAction:@selector(_toggleFromDisclosureControl:)];
1653 return disclosureControl;
1659 - (void)_noteSelectionIsChanging
1676 - (void)_noteSelectionDidChange
1678 if (!_coalesceSelectionNotificationState)
1693 - (void)_noteItemWillExpand:(
id)item
1704 - (void)_noteItemDidExpand:(
id)item
1715 - (void)_noteItemWillCollapse:(
id)item
1726 - (void)_noteItemDidCollapse:(
id)item
1743 return [
super keyDown:anEvent];
1749 [rows getIndexes:indexes maxCount:-1 inIndexRange:nil];
1752 c = [indexes count];
1755 items.push([
self itemAtRow:indexes[i]]);
1759 for (var i = 0; i < c; i++)
1760 [
self expandItem:items[i]];
1768 var theItem = items[0];
1769 if (![
self isItemExpanded:theItem])
1783 for (var i = 0; i < c; i++)
1784 [
self collapseItem:items[i]];
1790 - (BOOL)_sendDelegateDeleteKeyPressed
1792 if ([[
self delegate] respondsToSelector:
@selector(outlineViewDeleteKeyPressed:)])
1794 [[
self delegate] outlineViewDeleteKeyPressed:self];
1801 - (BOOL)_sendDelegateShouldShowOutlineDisclosureControlForItem:(
id)anItem
1806 return [_outlineViewDelegate outlineView:self shouldShowOutlineDisclosureControlForItem:anItem];
1809 - (BOOL)_sendDataSourceShouldDeferDisplayingChildrenOfItem:(
id)anItem
1814 return [_outlineViewDataSource outlineView:self shouldDeferDisplayingChildrenOfItem:anItem];
1819 return [_outlineViewDelegate outlineView:self viewForTableColumn:aTableColumn item:[
self itemAtRow:aRow]];
1822 - (
CPView)_sendDelegateDataViewForTableColumn:(
CPTableColumn)aTableColumn row:(CPInteger)aRow
1824 return [_outlineViewDelegate outlineView:self dataViewForTableColumn:aTableColumn item:[
self itemAtRow:aRow]];
1827 - (BOOL)_dataSourceRespondsToObjectValueForTableColumn
1832 - (BOOL)_delegateRespondsToViewForTableColumn
1837 - (BOOL)_delegateRespondsToDataViewForTableColumn
1842 - (id)_hitTest:(
CPView)aView
1847 return [
super _hitTest:aView];
1850 - (BOOL)_delegateRespondsToShouldExpandItem
1855 - (BOOL)_delegateRespondsToShouldCollapseItem
1864 - (BOOL)_delegateRespondsToSelectionIndexesForProposedSelection
1873 - (BOOL)_delegateRespondsToShouldSelectRow
1880 @implementation _CPOutlineViewTableViewDataSource :
CPObject 1887 self = [
super init];
1890 _outlineView = anOutlineView;
1895 - (CPInteger)numberOfRowsInTableView:(
CPTableView)anOutlineView
1897 return _outlineView._itemsForRows.length;
1902 return [_outlineView._outlineViewDataSource outlineView:_outlineView objectValueForTableColumn:aTableColumn byItem:_outlineView._itemsForRows[aRow]];
1909 [_outlineView._outlineViewDataSource outlineView:_outlineView setObjectValue:aValue forTableColumn:aColumn byItem:_outlineView._itemsForRows[aRow]];
1922 [items addObject:[_outlineView itemAtRow:index]];
1926 return [_outlineView._outlineViewDataSource outlineView:_outlineView writeItems:items toPasteboard:thePasteboard];
1929 - (int)_childIndexForDropOperation:(CPTableViewDropOperation)theDropOperation row:(CPInteger)theRow offset:(CGPoint)theOffset
1931 if (_outlineView._shouldRetargetChildIndex)
1932 return _outlineView._retargedChildIndex;
1938 var parentItem = [_outlineView _parentItemForUpperRow:theRow - 1 andLowerRow:theRow atMouseOffset:theOffset],
1939 itemInfo = (parentItem !== nil) ? _outlineView._itemInfosForItems[[parentItem UID]] : _outlineView._rootItemInfo,
1940 children = itemInfo.children;
1942 childIndex = [children indexOfObject:[_outlineView itemAtRow:theRow]];
1945 childIndex = children.length;
1953 - (void)_parentItemForDropOperation:(CPTableViewDropOperation)theDropOperation row:(CPInteger)theRow offset:(CGPoint)theOffset
1956 return [_outlineView _parentItemForUpperRow:theRow - 1 andLowerRow:theRow atMouseOffset:theOffset];
1958 return [_outlineView itemAtRow:theRow];
1962 proposedRow:(CPInteger)theRow proposedDropOperation:(CPTableViewDropOperation)theOperation
1968 _outlineView._retargetedItem = nil;
1969 _outlineView._shouldRetargetItem = NO;
1971 _outlineView._retargedChildIndex = nil;
1972 _outlineView._shouldRetargetChildIndex = NO;
1974 var location = [_outlineView convertPoint:[theInfo draggingLocation] fromView:nil],
1975 parentItem = [
self _parentItemForDropOperation:theOperation row:theRow offset:location],
1976 childIndex = [
self _childIndexForDropOperation:theOperation row:theRow offset:location];
1978 return [_outlineView._outlineViewDataSource outlineView:_outlineView validateDrop:theInfo proposedItem:parentItem proposedChildIndex:childIndex];
1981 - (BOOL)
tableView:(
CPTableView)aTableView acceptDrop:(
id )theInfo row:(CPInteger)theRow dropOperation:(CPTableViewDropOperation)theOperation
1986 var location = [_outlineView convertPoint:[theInfo draggingLocation] fromView:nil],
1987 parentItem = [
self _parentItemForDropOperation:theOperation row:theRow offset:location],
1988 childIndex = [
self _childIndexForDropOperation:theOperation row:theRow offset:location];
1990 _outlineView._retargetedItem = nil;
1991 _outlineView._shouldRetargetItem = NO;
1993 _outlineView._retargedChildIndex = nil;
1994 _outlineView._shouldRetargetChildIndex = NO;
1996 return [_outlineView._outlineViewDataSource outlineView:_outlineView acceptDrop:theInfo item:parentItem childIndex:childIndex];
2001 if ((_outlineView._implementedOutlineViewDataSourceMethods &
2004 [[_outlineView dataSource] outlineView:_outlineView sortDescriptorsDidChange:oldSortDescriptors];
2010 @implementation _CPOutlineViewTableViewDelegate :
CPObject 2017 self = [
super init];
2020 _outlineView = anOutlineView;
2030 - (BOOL)selectionShouldChangeInTableView:(
CPTableView)theTableView
2038 return [_outlineView._outlineViewDelegate outlineView:_outlineView shouldEditTableColumn:aColumn item:[_outlineView itemAtRow:aRow]];
2046 return [_outlineView._outlineViewDelegate outlineView:_outlineView heightOfRowByItem:[_outlineView itemAtRow:theRow]];
2055 var item = [_outlineView itemAtRow:aRowIndex];
2056 [_outlineView._outlineViewDelegate outlineView:_outlineView willDisplayView:aView forTableColumn:aTableColumn item:item];
2064 var item = [_outlineView itemAtRow:aRowIndex];
2065 [_outlineView._outlineViewDelegate outlineView:_outlineView willRemoveView:aView forTableColumn:aTableColumn item:item];
2072 return [_outlineView._outlineViewDelegate outlineView:_outlineView isGroupItem:[_outlineView itemAtRow:aRow]];
2081 var item = [_outlineView itemAtRow:aRow];
2082 return [_outlineView._outlineViewDelegate outlineView:_outlineView menuForTableColumn:aTableColumn item:item]
2087 return [_outlineView menu] || [[_outlineView class] defaultMenu];
2093 return [_outlineView._outlineViewDelegate outlineView:_outlineView selectionIndexesForProposedSelection:anIndexSet];
2101 return [_outlineView._outlineViewDelegate outlineView:_outlineView shouldSelectTableColumn:aTableColumn];
2113 - (id)initWithFrame:(CGRect)aFrame
2123 - (void)setState:(CPInteger)aState
2134 - (void)drawRect:(CGRect)aRect
2139 height = CGRectGetHeight(
bounds);
2145 var centre = CGPointMake(FLOOR(
width / 2.0), FLOOR(height / 2.0));
2192 _rootItemInfo = { isExpanded:YES, isExpandable:NO, level:-1, row:-1, children:[], weight:0 };
2195 _itemInfosForItems = { };
2196 _disclosureControlsForRows = [];
2201 _outlineTableColumn = [aCoder decodeObjectForKey:CPOutlineViewOutlineTableColumnKey];
2202 _indentationPerLevel = [aCoder decodeFloatForKey:CPOutlineViewIndentationPerLevelKey];
2204 _outlineViewDataSource = [aCoder decodeObjectForKey:CPOutlineViewDataSourceKey];
2205 _outlineViewDelegate = [aCoder decodeObjectForKey:CPOutlineViewDelegateKey];
2207 [
super setDataSource:[[_CPOutlineViewTableViewDataSource alloc] initWithOutlineView:self]];
2208 [
super setDelegate:[[_CPOutlineViewTableViewDelegate alloc] initWithOutlineView:self]];
2210 [
self _updateIsViewBased];
2219 var internalDelegate = _delegate,
2220 internalDataSource = _dataSource;
2224 _delegate = internalDelegate;
2225 _dataSource = internalDataSource;
2227 [aCoder encodeObject:_outlineTableColumn forKey:CPOutlineViewOutlineTableColumnKey];
2228 [aCoder encodeFloat:_indentationPerLevel forKey:CPOutlineViewIndentationPerLevelKey];
2230 [aCoder encodeObject:_outlineViewDataSource forKey:CPOutlineViewDataSourceKey];
2231 [aCoder encodeObject:_outlineViewDelegate forKey:CPOutlineViewDelegateKey];
2244 ? [
CPColor colorWithCalibratedWhite:0.4 alpha: 1.0]
2245 : [
CPColor colorWithCalibratedWhite:0.5 alpha: 1.0]);
CPInteger levelForItem:(id anItem)
var CPOutlineViewDataSource_outlineView_validateDrop_proposedRow_proposedDropOperation_
CPInteger rowForItem:(id anItem)
Used to implement exception handling (creating & raising).
var CPOutlineViewDelegate_outlineView_willRemoveView_forTableColumn_item_
function CGContextTranslateCTM(aContext, tx, ty)
CPIndexSet selectedRowIndexes()
void addSubview:(CPView aSubview)
var CPOutlineViewDelegate_outlineView_shouldTrackView_forTableColumn_item_
var CPOutlineViewDelegateKey
var CPOutlineViewDelegate_outlineView_isGroupItem_
CGRect frameOfDataViewAtColumn:row:(CPInteger aColumn, [row] CPInteger aRow)
CPOutlineViewDropOnItemIndex
CPGraphicsContext currentContext()
void postNotificationName:object:userInfo:(CPString aNotificationName, [object] id anObject, [userInfo] CPDictionary aUserInfo)
id initWithCoder:(CPCoder aCoder)
CPDragOperation CPDragOperationNone
var CPOutlineViewDelegate_outlineView_typeSelectStringForTableColumn_item_
var CPOutlineViewDelegate_outlineView_nextTypeSelectMatchFromItem_toItem_forString_
CPOutlineViewColumnDidResizeNotification
var CPOutlineViewDataSource_outlineView_validateDrop_proposedItem_proposedChildIndex_
var CPOutlineViewDataSource_outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems_
CPOutlineViewItemDidExpandNotification
function CGContextSetStrokeColor(aContext, aColor)
CPInteger levelForRow:(CPInteger aRow)
CPOutlineViewSelectionIsChangingNotification
var CPOutlineViewDelegate_outlineView_shouldTypeSelectForEvent_withCurrentSearchString_
CPInteger getIndexes:maxCount:inIndexRange:(CPArray anArray, [maxCount] CPInteger aMaxCount, [inIndexRange] CPRange aRange)
A Cappuccino wrapper for any data type.
var CPOutlineViewDataSource_outlineView_sortDescriptorsDidChange_
A collection of unique integers.
CPString charactersIgnoringModifiers()
var CPOutlineViewDelegate_outlineView_shouldCollapseItem_
var CPOutlineViewDelegate_outlineView_shouldSelectItem_
CPTimer scheduledTimerWithTimeInterval:callback:repeats:(CPTimeInterval seconds, [callback] Function aFunction, [repeats] BOOL shouldRepeat)
Unarchives objects created using CPKeyedArchiver.
function CGContextAddLineToPoint(aContext, x, y)
function CGContextStrokePath(aContext)
void reloadItem:reloadChildren:(id anItem, [reloadChildren] BOOL shouldReloadChildren)
CPNotificationCenter defaultCenter()
void removeTableColumn:(CPTableColumn aTableColumn)
var CPOutlineViewDataSource_outlineView_persistentObjectForItem_
function CGContextClosePath(aContext)
var CPOutlineViewDelegate_outlineView_shouldShowOutlineDisclosureControlForItem_
void selectRowIndexes:byExtendingSelection:(CPIndexSet rows, [byExtendingSelection] BOOL shouldExtendSelection)
var CPOutlineViewCoalesceSelectionNotificationStateOff
var CPOutlineViewDataSource_outlineView_itemForPersistentObject_
void addTableColumn:(CPTableColumn aTableColumn)
var CPOutlineViewOutlineTableColumnKey
var CPOutlineViewDelegate_outlineView_toolTipForView_rect_tableColumn_item_mouseLocation_
var CPOutlineViewDelegate_outlineView_didDragTableColumn_
var CPOutlineViewIndentationPerLevelKey
Implements keyed archiving of object graphs (e.g. for storing data).
var CPOutlineViewDelegate_outlineView_shouldExpandItem_
var CPOutlineViewDelegate_selectionShouldChangeInOutlineView_
An immutable string (collection of characters).
var CPOutlineViewDataSource_outlineView_writeItems_toPasteboard_
if(CPFeatureIsCompatible(CPHTMLCanvasFeature))
CPInteger indexGreaterThanIndex:(CPInteger anIndex)
var CPOutlineViewDelegate_outlineView_heightOfRowByItem_
CPColor colorWithCalibratedWhite:alpha:(float white, [alpha] float alpha)
function CGContextSetFillColor(aContext, aColor)
function CGContextRotateCTM(aContext, anAngle)
var CPOutlineViewDelegate_outlineView_mouseDownInHeaderOfTableColumn_
var CPOutlineViewDelegate_outlineView_shouldReorderColumn_toColumn_
function CGContextBeginPath(aContext)
void setDelegate:(id< CPTableViewDelegate > aDelegate)
var CPOutlineViewDelegate_outlineView_menuForTableColumn_item_
id initWithFrame:(CGRect aFrame)
id parentForItem:(id anItem)
CPOutlineViewItemWillCollapseNotification
var CPOutlineViewDataSource_outlineView_objectValue_forTableColumn_byItem_
CPInternalInconsistencyException
var CPOutlineViewDataSourceKey
var CPOutlineViewDelegate_outlineView_sizeToFitWidthOfColumn_
var CPOutlineViewDelegate_outlineView_shouldShowViewExpansionForTableColumn_item_
void setIndentationPerLevel:(float anIndentationWidth)
var CPOutlineViewDelegate_outlineView_shouldEditTableColumn_item_
A timer object that can send a message after the given time interval.
var CPOutlineViewCoalesceSelectionNotificationStateDid
Defines methods for use when archiving & restoring (enc/decoding).
var CPOutlineViewDelegate_outlineView_viewForTableColumn_item_
void expandItem:expandChildren:(id anItem, [expandChildren] BOOL shouldExpandChildren)
var CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_
id unarchiveObjectWithData:(CPData aData)
CPOutlineViewSelectionDidChangeNotification
global CPApp CPOutlineViewColumnDidMoveNotification
Sends messages (CPNotification) between objects.
void keyDown:(CPEvent anEvent)
var CPOutlineViewCoalesceSelectionNotificationStateOn
var CPOutlineViewDelegate_outlineView_shouldSelectTableColumn_
var CPOutlineViewDelegate_outlineView_willDisplayOutlineView_forTableColumn_item_
var CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_
var CPOutlineViewDelegate_outlineView_willDisplayView_forTableColumn_item_
#define SELECTION_SHOULD_CHANGE(anOutlineView)
CPOutlineViewItemWillExpandNotification
var CPOutlineViewDataSource_outlineView_acceptDrop_item_childIndex_
CPTableViewSelectionHighlightStyleSourceList
void encodeWithCoder:(CPCoder aCoder)
#define SHOULD_SELECT_ITEM(anOutlineView, anItem)
CPOutlineViewItemDidCollapseNotification
var CPOutlineViewDelegate_outlineView_didClickTableColumn_
void scrollRowToVisible:(int rowIndex)
void setIndentationMarkerFollowsDataView:(BOOL indentationMarkerShouldFollowDataView)
var colorForDisclosureTriangle
void setDisclosureControlPrototype:(CPControl aControl)
function CGContextFillPath(aContext)
void setDataSource:(id< CPTableViewDataSource > aDataSource)
id indexSetWithIndex:(int anIndex)
var CPOutlineViewDataSource_outlineView_shouldDeferDisplayingChildrenOfItem_
function CGContextMoveToPoint(aContext, x, y)
void expandItem:(id anItem)
CPRange function CPMakeRange(location, length)
var CPOutlineViewDelegate_outlineView_selectionIndexesForProposedSelection_
id itemAtRow:(CPInteger aRow)
CPData archivedDataWithRootObject:(id anObject)