API  0.9.10
CPOutlineView Class Reference

#import <CPOutlineView.h>

+ Inheritance diagram for CPOutlineView:

Instance Methods

(void) - addTableColumn:
 
(void) - collapseItem:
 
(id) - dataSource
 
(id) - delegate
 
(void) - encodeWithCoder:
 
(void) - expandItem:
 
(void) - expandItem:expandChildren:
 
(CGRect) - frameOfDataViewAtColumn:row:
 
(CGRect) - frameOfOutlineDisclosureControlAtRow:
 
(BOOL) - indentationMarkerFollowsDataView
 
(float) - indentationPerLevel
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(BOOL) - isExpandable:
 
(BOOL) - isItemExpanded:
 
(id) - itemAtRow:
 
(void) - keyDown:
 
(CPInteger) - levelForItem:
 
(CPInteger) - levelForRow:
 
(CPTableColumn- outlineTableColumn
 
(id) - parentForItem:
 
(void) - reloadItem:
 
(void) - reloadItem:reloadChildren:
 
(void) - removeTableColumn:
 
(CPInteger) - rowForItem:
 
(void) - setDataSource:
 
(void) - setDelegate:
 
(void) - setDisclosureControlPrototype:
 
(void) - setDropItem:dropChildIndex:
 
(void) - setIndentationMarkerFollowsDataView:
 
(void) - setIndentationPerLevel:
 
(void) - setOutlineTableColumn:
 
- Instance Methods inherited from CPTableView
(BOOL) - acceptsFirstResponder
 
(BOOL) - allowsColumnReordering
 
(BOOL) - allowsColumnResizing
 
(BOOL) - allowsColumnSelection
 
(BOOL) - allowsEmptySelection
 
(BOOL) - allowsMultipleSelection
 
(CPArray) - alternatingRowBackgroundColors
 
(CPString- autosaveName
 
(BOOL) - autosaveTableColumns
 
(void) - becomeKeyWindow
 
(void) - bind:toObject:withKeyPath:options:
 
(BOOL) - canDragRowsWithIndexes:atPoint:
 
(CPInteger) - clickedColumn
 
(CPInteger) - clickedRow
 
(CPInteger) - columnAtPoint:
 
(unsigned) - columnAutoresizingStyle
 
(CPInteger) - columnForView:
 
(CPIndexSet- columnIndexesInRect:
 
(CPInteger) - columnWithIdentifier:
 
(void) - concludeDragOperation:
 
(BOOL) - continueTracking:at:
 
(CPView- cornerView
 
(void) - deselectAll
 
(void) - deselectAll:
 
(void) - deselectColumn:
 
(void) - deselectRow:
 
(BOOL) - disableAutomaticResizing
 
(SEL) - doubleAction
 
(void) - draggedImage:endedAt:operation:
 
(void) - draggedView:endedAt:operation:
 
(CPTableViewDraggingDestinationFeedbackStyle) - draggingDestinationFeedbackStyle
 
(void) - draggingEnded:
 
(CPDragOperation) - draggingEntered:
 
(void) - draggingExited:
 
(CPDragOperation) - draggingUpdated:
 
(CPImage- dragImageForRowsWithIndexes:tableColumns:event:offset:
 
(CPView- dragViewForRowsWithIndexes:tableColumns:event:offset:
 
(void) - drawBackgroundInClipRect:
 
(void) - drawGridInClipRect:
 
(void) - drawRow:clipRect:
 
(void) - editColumn:row:withEvent:select:
 
(CPInteger) - editedColumn
 
(CPInteger) - editedRow
 
(void) - enumerateAvailableViewsUsingBlock:
 
(CGRect) - exposedRect
 
(void) - getColumn:row:forView:
 
(CPColor- gridColor
 
(unsigned) - gridStyleMask
 
(CPView- headerView
 
(CPTableColumn- highlightedTableColumn
 
(void) - highlightSelectionInClipRect:
 
(CPView- hitTest:
 
(CGSize) - intercellSpacing
 
(BOOL) - isColumnSelected:
 
(BOOL) - isRowSelected:
 
(void) - layoutSubviews
 
(void) - load
 
(id) - makeViewWithIdentifier:owner:
 
(CPMenu- menuForEvent:
 
(void) - moveColumn:toColumn:
 
(BOOL) - needsPanelToBecomeKey
 
(void) - noteHeightOfRowsWithIndexesChanged:
 
(void) - noteNumberOfRowsChanged
 
(int) - numberOfColumns
 
(int) - numberOfRows
 
(CPInteger) - numberOfSelectedColumns
 
(CPInteger) - numberOfSelectedRows
 
(void) - observeValueForKeyPath:ofObject:change:context:
 
(BOOL) - performDragOperation:
 
(CPView- preparedViewAtColumn:row:
 
(BOOL) - prepareForDragOperation:
 
(CGRect) - rectOfColumn:
 
(CGRect) - rectOfRow:
 
(void) - reloadData
 
(void) - reloadDataForRowIndexes:columnIndexes:
 
(void) - resignKeyWindow
 
(void) - resizeWithOldSuperviewSize:
 
(CPInteger) - rowAtPoint:
 
(CPInteger) - rowForView:
 
(unsigned) - rowHeight
 
(CPRange) - rowsInRect:
 
(void) - scrollColumnToVisible:
 
(void) - scrollRowToVisible:
 
(void) - selectAll:
 
(void) - selectColumnIndexes:byExtendingSelection:
 
(int) - selectedColumn
 
(CPIndexSet- selectedColumnIndexes
 
(int) - selectedRow
 
(CPIndexSet- selectedRowIndexes
 
(CPDictionary- selectionGradientColors
 
(CPColor- selectionHighlightColor
 
(unsigned) - selectionHighlightStyle
 
(void) - selectRowIndexes:byExtendingSelection:
 
(void) - setAllowsColumnReordering:
 
(void) - setAllowsColumnResizing:
 
(void) - setAllowsColumnSelection:
 
(void) - setAllowsEmptySelection:
 
(void) - setAllowsMultipleSelection:
 
(void) - setAlternatingRowBackgroundColors:
 
(void) - setAutosaveName:
 
(void) - setAutosaveTableColumns:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setColumnAutoresizingStyle:
 
(void) - setCornerView:
 
(void) - setDataSource:
 
(void) - setDelegate:
 
(void) - setDisableAutomaticResizing:
 
(void) - setDoubleAction:
 
(void) - setDraggingDestinationFeedbackStyle:
 
(void) - setDraggingSourceOperationMask:forLocal:
 
(void) - setDropRow:dropOperation:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setGridColor:
 
(void) - setGridStyleMask:
 
(void) - setHeaderView:
 
(void) - setHighlightedTableColumn:
 
(void) - setIndicatorImage:inTableColumn:
 
(void) - setIntercellSpacing:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsLayout
 
(void) - setRowHeight:
 
(void) - setSelectionGradientColors:
 
(void) - setSelectionHighlightColor:
 
(void) - setSelectionHighlightStyle:
 
(void) - setSortDescriptors:
 
(void) - setUsesAlternatingRowBackgroundColors:
 
(void) - setVerticalMotionCanBeginDrag:
 
(void) - sizeLastColumnToFit
 
(CPArray) - sortDescriptors
 
(BOOL) - startTrackingAt:
 
(void) - stopTracking:at:mouseIsUp:
 
(void) - superviewBoundsChanged:
 
(void) - superviewFrameChanged:
 
(CPArray) - tableColumns
 
(CPTableColumn- tableColumnWithIdentifier:
 
(void) - tile
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(CPColor- unfocusedSelectionGradientColors
 
(CPColor- unfocusedSelectionHighlightColor
 
(BOOL) - usesAlternatingRowBackgroundColors
 
(BOOL) - verticalMotionCanBeginDrag
 
(id) - viewAtColumn:row:makeIfNecessary:
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(BOOL) - wantsPeriodicDraggingUpdates
 
- Instance Methods inherited from CPControl
(BOOL) - acceptsFirstMouse:
 
(SEL) - action
 
(CPTextAlignment) - alignment
 
(CPWritingDirection) - baseWritingDirection
 
(CPControlSize) - controlSize
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPUInteger) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(void) - mouseDown:
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(CPInteger) - nextState
 
(id) - objectValue
 
(void) - performClick:
 
(BOOL) - sendAction:to:
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(void) - setBaseWritingDirection:
 
(void) - setContinuous:
 
(void) - setControlSize:
 
(void) - setDoubleValue:
 
(void) - setEnabled:
 
(void) - setFloatValue:
 
(void) - setFont:
 
(void) - setFormatter:
 
(void) - setHighlighted:
 
(void) - setImagePosition:
 
(void) - setImageScaling:
 
(void) - setIntegerValue:
 
(void) - setIntValue:
 
(void) - setLineBreakMode:
 
(void) - setObjectValue:
 
(void) - setSendsActionOnEndEditing:
 
(void) - setState:
 
(void) - setStringValue:
 
(void) - setTarget:
 
(void) - setTextColor:
 
(void) - setTextShadowColor:
 
(void) - setTextShadowOffset:
 
(void) - setVerticalAlignment:
 
(CPString- stringValue
 
(void) - takeDoubleValueFrom:
 
(void) - takeFloatValueFrom:
 
(void) - takeIntegerValueFrom:
 
(void) - takeIntValueFrom:
 
(void) - takeObjectValueFrom:
 
(void) - takeStringValueFrom:
 
(id) - target
 
(CPColor- textColor
 
(void) - textDidBeginEditing:
 
(void) - textDidChange:
 
(void) - textDidEndEditing:
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - unhighlightButtonTimerDidFinish:
 
(void) - updateTrackingAreas
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(void) - addTrackingArea:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(CAAnimation- animationForKey:
 
(CPDictionary- animations
 
(id) - animator
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(CPView- createEphemeralSubviewNamed:
 
(CPString- debug_description
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPAppearance- effectiveAppearance
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGRect) - frameRectOfView:inSuperviewSize:
 
(CGSize) - frameSize
 
(CGRect) - frameWithNewSuperviewSize:
 
(BOOL) - hasCustomDrawRect
 
(BOOL) - hasCustomLayoutSubviews
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(void) - layout
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(void) - objectDidChangeTheme
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeAllTrackingAreas
 
(void) - removeFromSuperview
 
(void) - removeTrackingArea:
 
(void) - replaceSubview:with:
 
(BOOL) - resignFirstResponder
 
(void) - resizeSubviewsWithOldSize:
 
(void) - rightMouseDown:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAnimations:
 
(void) - setAppearance:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setFrame:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidLayout
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(void) - viewWillLayout
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 

Additional Inherited Members

- Class Methods inherited from CPTableView
(CPString+ defaultThemeClass
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(Class) + animatorClass
 
(CAAnimation+ defaultAnimationForKey:
 
(CPMenu+ defaultMenu
 
(BOOL) + isHighDPIDrawingEnabled
 
(CPSet) + keyPathsForValuesAffectingBounds
 
(CPSet) + keyPathsForValuesAffectingFrame
 
(void) + setHighDPIDrawingEnabled:
 

Detailed Description

CPOutlineView is a subclass of CPTableView that inherits the row and column format to display hierarchical data. The outlineview adds the ability to expand and collapse items. This is useful for browsing a tree like structure such as directories or a filesystem.

Like the tableview, an outlineview uses a data source to supply its data. For this reason you must implement a couple data source methods (documented in setDataSource:).

Theme states for custom data views are documented in CPTableView.

Definition at line 2 of file CPOutlineView.h.

Method Documentation

◆ addTableColumn:()

- (void) addTableColumn: (CPTableColumn aTableColumn
implementation

Adds a new table column to the receiver. If this is the first column added it will automatically be set to the outline column.

Also see -setOutlineTableColumn:.

Note
This behavior deviates from cocoa slightly.
Parameters
CPTableColumnaTableColumn - The table column to add.

Reimplemented from CPTableView.

Definition at line 1338 of file CPOutlineView.j.

◆ collapseItem:()

- (void) collapseItem: (id)  anItem
implementation

Collapse a given item.

Parameters
anItem- The item you want to collapse.

Definition at line 600 of file CPOutlineView.j.

◆ dataSource()

- (id) dataSource
implementation

Returns the datasource object.

Returns
id - The data source object

Reimplemented from CPTableView.

Definition at line 347 of file CPOutlineView.j.

◆ delegate()

- (id) delegate
implementation

Returns the delegate object for the outlineview.

Reimplemented from CPTableView.

Definition at line 1298 of file CPOutlineView.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Archives the view to a coder.

Parameters
aCoderthe object into which the view's data will be archived.

Reimplemented from CPTableView.

Provided by category CPOutlineView(CPCoding).

Definition at line 2216 of file CPOutlineView.j.

◆ expandItem:()

- (void) expandItem: (id)  anItem
implementation

Expands a given item.

Parameters
anItem- the item to expand.

Definition at line 511 of file CPOutlineView.j.

◆ expandItem:expandChildren:()

- (void) expandItem: (id)  anItem
expandChildren: (BOOL)  shouldExpandChildren 
implementation

Expands a given item, and optionally all the children of that item.

Parameters
anItem- the item you want to expand.
shouldExpandChildren- Pass YES if you want to expand all the children of anItem, otherwise NO.

Definition at line 522 of file CPOutlineView.j.

◆ frameOfDataViewAtColumn:row:()

- (CGRect) frameOfDataViewAtColumn: (CPInteger)  aColumn
row: (CPInteger)  aRow 
implementation

We override this because we need a special behavior for the outline column.

Reimplemented from CPTableView.

Definition at line 1379 of file CPOutlineView.j.

◆ frameOfOutlineDisclosureControlAtRow:()

- (CGRect) frameOfOutlineDisclosureControlAtRow: (CPInteger)  aRow
implementation

Returns the frame of the disclosure button for the outline column. If the item is not expandable a CGZeroRect is returned. Subclasses can return a CGZeroRect to prevent the disclosure control from being displayed.

Parameters
aRow- The row of the receiver
Returns
CGRect - The rect of the disclosure button at aRow.

Definition at line 1019 of file CPOutlineView.j.

◆ indentationMarkerFollowsDataView()

- (BOOL) indentationMarkerFollowsDataView
implementation

Returns the layout behavior of the disclosure buttons.

Returns
BOOL - YES if the disclosure control indents itself with the dataview, otherwise NO if the control is always aligned to the left of the outline column

Definition at line 963 of file CPOutlineView.j.

◆ indentationPerLevel()

- (float) indentationPerLevel
implementation

Returns the width of an indentation level.

Returns
float - the width of the indentation per level.

Definition at line 933 of file CPOutlineView.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the view from an archive.

Parameters
aCoderthe coder from which to initialize
Returns
the initialized view

Reimplemented from CPTableView.

Provided by category CPOutlineView(CPCoding).

Definition at line 2185 of file CPOutlineView.j.

◆ initWithFrame:()

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPTableView.

Definition at line 190 of file CPOutlineView.j.

◆ isExpandable:()

- (BOOL) isExpandable: (id)  anItem
implementation

Used to query whether an item is expandable or not.

Parameters
anItem- the item you are interested in.
Returns
BOOL - YES if the item is expandable, otherwise NO.

Definition at line 359 of file CPOutlineView.j.

◆ isItemExpanded:()

- (BOOL) isItemExpanded: (id)  anItem
implementation

Used to find if an item is already expanded.

Parameters
anItem- the item you are interest in.
Returns
BOOL - Yes if the item is already expanded, otherwise NO.

Definition at line 392 of file CPOutlineView.j.

◆ itemAtRow:()

- (id) itemAtRow: (CPInteger)  aRow
implementation

Returns the item at a given row index. If no item exists nil is returned.

Parameters
aRow- The row index you want to find the item at.
Returns
id - The item at a given index.

Definition at line 411 of file CPOutlineView.j.

◆ keyDown:()

- (void) keyDown: (CPEvent anEvent
implementation

Reimplemented from CPTableView.

Definition at line 1734 of file CPOutlineView.j.

◆ levelForItem:()

- (CPInteger) levelForItem: (id)  anItem
implementation

Returns the indentation level of a given item. If the item is nil (the top level root item) CPNotFound is returned. Indentation levels are zero based, thus items that are not indented return 0.

Parameters
anItem- The item you want the indentation level for.
Returns
int - the indentation level of anItem.

Definition at line 443 of file CPOutlineView.j.

◆ levelForRow:()

- (CPInteger) levelForRow: (CPInteger)  aRow
implementation

Returns the indentation level for a given row. If the row is invalid CPNotFound is returned. Rows that are not indented return 0.

Parameters
aRow- the row of the receiver
Returns
int - the indentation level of aRow.

Definition at line 463 of file CPOutlineView.j.

◆ outlineTableColumn()

- (CPTableColumn) outlineTableColumn
implementation

Returns the table column used to display hierarchical data.

Returns
CPTableColumn - The table column that displays the disclosure button.

Definition at line 907 of file CPOutlineView.j.

◆ parentForItem:()

- (id) parentForItem: (id)  anItem
implementation

Returns the parent item for a given item. If the item is a top level root object nil is returned.

Parameters
anItem- The item of the receiver.
Returns
id - The parent item of anItem. If no parent exists (the item is a root item) nil is returned.

Definition at line 975 of file CPOutlineView.j.

◆ reloadItem:()

- (void) reloadItem: (id)  anItem
implementation

Reloads the data for an item.

Parameters
anItem- The item you want to reload.

Definition at line 671 of file CPOutlineView.j.

◆ reloadItem:reloadChildren:()

- (void) reloadItem: (id)  anItem
reloadChildren: (BOOL)  shouldReloadChildren 
implementation

Reloads the data for a given item and optionally the children.

Parameters
anItem- The item you want to reload.
shouldReloadChildren- Pass YES if you want to reload all the children, otherwise NO.

Definition at line 682 of file CPOutlineView.j.

◆ removeTableColumn:()

- (void) removeTableColumn: (CPTableColumn aTableColumn
implementation

Reimplemented from CPTableView.

Definition at line 1348 of file CPOutlineView.j.

◆ rowForItem:()

- (CPInteger) rowForItem: (id)  anItem
implementation

Returns the row of a given item

Parameters
anItem- The item you want to find the row of.
Returns
int - The row index of a given item.

Definition at line 422 of file CPOutlineView.j.

◆ setDataSource:()

- (void) setDataSource: (id <CPOutlineViewDataSource>)  aDataSource
implementation

In addition to standard delegation, the outline view also supports data source delegation. This method sets the data source object. Just like the TableView you have CPTableColumns but instead of rows you deal with items.

You must implement these data source methods:

Returns the child item at an index of a given item. if item is nil you should return the appropriate root item.

- (id)outlineView:(CPOutlineView)outlineView child:(CPInteger)index ofItem:(id)item;

Returns YES if the item is expandable, otherwise NO.

- (BOOL)outlineView:(CPOutlineView)outlineView isItemExpandable:(id)item;

Returns the number of child items of a given item. If item is nil you should return the number of top level (root) items.

- (int)outlineView:(CPOutlineView)outlineView numberOfChildrenOfItem:(id)item;

Returns the object value of the item in a given column.

- (id)outlineView:(CPOutlineView)outlineView objectValueForTableColumn:(CPTableColumn)tableColumn byItem:(id)item;

The following methods are optional:

Editing:

Sets the data object value for an item in a given column. This needs to be implemented if you want inline editing support.

- (void)outlineView:(CPOutlineView)outlineView setObjectValue:(id)object forTableColumn:(CPTableColumn)tableColumn byItem:(id)item;

Sorting:

The outlineview will call this method if you click the table header. You should sort the datasource based off of the new sort descriptors and reload the data

- (void)outlineView:(CPOutlineView)outlineView sortDescriptorsDidChange:(CPArray)oldDescriptors;

Drag and Drop:

Note
In order for the outlineview to receive drops don't forget to first register the tableview for drag types like you do with every other view

Return YES if the operation was successful otherwise return NO. The data source should incorporate the data from the dragging pasteboard in this method implementation. To get this data use the draggingPasteboard method on the CPDraggingInfo object.

- (BOOL)outlineView:(CPOutlineView)outlineView acceptDrop:(id < CPDraggingInfo >)info item:(id)item childIndex:(CPInteger)index;

Return the drag operation (move, copy, etc) that should be performed if a registered drag type is over the tableview The data source can retarget a drop if you want by calling

-(void)setDropItem:(id)anItem dropChildIndex:(int)anIndex;
- (CPDragOperation)outlineView:(CPOutlineView)outlineView validateDrop:(id < CPDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(CPInteger)index;

Returns YES if the drop operation is allowed otherwise NO. This method is invoked by the outlineview after a drag should begin, but before it is started. If you don't want the drag to being return NO. If you want the drag to begin you should return YES and place the drag data on the pboard.

- (BOOL)outlineView:(CPOutlineView)outlineView writeItems:(CPArray)items toPasteboard:(CPPasteboard)pboard;

Definition at line 289 of file CPOutlineView.j.

◆ setDelegate:()

- (void) setDelegate: (id <CPOutlineViewDelegate>)  aDelegate
implementation

Sets the delegate for the outlineview.

The following methods can be implemented:

Parameters
aDelegate- the delegate object you wish to set for the receiver.

User Interaction Notifications:

Called when the user moves a column in the outlineview.

- (void)outlineViewColumnDidMove:(CPNotification)notification;

Called when the user resizes a column in the outlineview.

- (void)outlineViewColumnDidResize:(CPNotification)notification;

Called when the user collapses an item in the outlineview.

- (void)outlineViewItemDidCollapse:(CPNotification)notification;

Called when the user expands an item in the outlineview.

- (void)outlineViewItemDidExpand:(CPNotification)notification;

Called when the user collapses an item in the outlineview, but before the item is actually collapsed.

- (void)outlineViewItemWillCollapse:(CPNotification)notification;

Called when the used expands an item, but before the item is actually expanded.

- (void)outlineViewItemWillExpand:(CPNotification)notification;

Called when the user changes the selection of the outlineview.

- (void)outlineViewSelectionDidChange:(CPNotification)notification;

Called when the user changes the selection of the outlineview, but before the change is made.

- (void)outlineViewSelectionIsChanging:(CPNotification)notification;

Expanding and collapsing items:

Return YES if the item should be given permission to expand, otherwise NO.

- (BOOL)outlineView:(CPOutlineView)outlineView shouldExpandItem:(id)item;

Return YES if the item should be given permission to collapse, otherwise NO.

- (BOOL)outlineView:(CPOutlineView)outlineView shouldCollapseItem:(id)item;

Selection:

Return YES to allow the selection of tableColumn, otherwise NO.

- (BOOL)outlineView:(CPOutlineView)outlineView shouldSelectTableColumn:(CPTableColumn)tableColumn;

Return YES to allow the selection of an item, otherwise NO.

- (BOOL)outlineView:(CPOutlineView)outlineView shouldSelectItem:(id)item;

Return YES to allow the selection of the outlineview to be changed, otherwise NO.

- (BOOL)selectionShouldChangeInOutlineView:(CPOutlineView)outlineView;

Displaying DataViews:

Called when a dataView is about to be displayed. This gives you the ability to alter the dataView if needed.

- (void)outlineView:(CPOutlineView)outlineView willDisplayView:(id)dataView forTableColumn:(CPTableColumn)tableColumn item:(id)item;

Editing:

Return YES to allow for editing of a dataview at given item and tableColumn, otherwise NO to prevent the edit.

- (BOOL)outlineView:(CPOutlineView)outlineView shouldEditTableColumn:(CPTableColumn)tableColumn item:(id)item;

Group Items:

Implement this to indicate whether a given item should be rendered using the group item style. Return YES if the item is a group item, otherwise NO.

- (BOOL)outlineView:(CPOutlineView)outlineView isGroupItem:(id)item;

Variable Item Heights

Implement this method to get custom heights of rows based on the item. This delegate method will be passed your 'item' object and expects you to return an integer height.

Note
This should only be implemented if rows will be different heights, if you want to set a height for ALL of your rows see -setRowHeight:
- (int)outlineView:(CPOutlineView)outlineView heightOfRowByItem:(id)anItem;

Definition at line 1132 of file CPOutlineView.j.

◆ setDisclosureControlPrototype:()

- (void) setDisclosureControlPrototype: (CPControl aControl
implementation

Sets the prototype of the disclosure control. This is used if you want to set a special type of button, instead of the default triangle. The control must implement CPCoding.

Parameters
aControl- the control to be used to expand and collapse items.

Definition at line 1310 of file CPOutlineView.j.

◆ setDropItem:dropChildIndex:()

- (void) setDropItem: (id)  theItem
dropChildIndex: (int)  theIndex 
implementation

Retargets the drop item for the outlineview.

To specify a drop on theItem, you specify item as theItem and index as CPOutlineViewDropOnItemIndex.

To specify a drop between child 1 and 2 of theItem, you specify item as theItem and index as 2.

To specify a drop on an item that can't be expanded theItem, you specify item as someOutlineItem and index as CPOutlineViewDropOnItemIndex.

Parameters
theItem- The item you want to retarget the drop on.
theIndex- The index of the child item you want to retarget the drop between. Pass CPOutlineViewDropOnItemIndex if you want to drop on theItem.

Definition at line 1404 of file CPOutlineView.j.

◆ setIndentationMarkerFollowsDataView:()

- (void) setIndentationMarkerFollowsDataView: (BOOL)  indentationMarkerShouldFollowDataView
implementation

Sets the layout behavior of disclosure button. If you pass NO the disclosure button will always align itself to the left of the outline column.

Parameters
indentationMarkerShouldFollowDataView- Pass YES if the disclosure control should be indented along with the dataview, otherwise NO.

Definition at line 945 of file CPOutlineView.j.

◆ setIndentationPerLevel:()

- (void) setIndentationPerLevel: (float)  anIndentationWidth
implementation

Sets the number of pixels to indent an item at each indentation level.

Parameters
anIndentationWidth- the width of each indentation level.

Definition at line 917 of file CPOutlineView.j.

◆ setOutlineTableColumn:()

- (void) setOutlineTableColumn: (CPTableColumn aTableColumn
implementation

Sets the table column you want to display the disclosure button in. If you do not want an outline column pass nil.

Parameters
aTableColumn- The CPTableColumn you want to use for hierarchical data.

Definition at line 891 of file CPOutlineView.j.


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