Protocol

NSOutlineViewDelegate

A set of optional methods implemented by delegates of NSOutlineView objects.

Declaration

@protocol NSOutlineViewDelegate

Topics

Expanding and Collapsing the Outline

- outlineView:shouldExpandItem:

Returns a Boolean value that indicates whether the outline view should expand a given item.

- outlineView:shouldCollapseItem:

Returns a Boolean value that indicates whether the outline view should collapse a given item.

Supporting Type Select

- outlineView:typeSelectStringForTableColumn:item:

Returns the string that is used for type selection for a given column and item.

- outlineView:nextTypeSelectMatchFromItem:toItem:forString:

Returns the first item that matches the searchString from within the range of startItem to endItem

- outlineView:shouldTypeSelectForEvent:withCurrentSearchString:

Returns a Boolean value that indicates whether type select should proceed for a given event and search string.

Working with Tooltips

- outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:

When the cursor pauses over a given cell, the value returned from this method is displayed in a tooltip.

Handling Selection

- outlineView:shouldSelectTableColumn:

Returns a Boolean value that indicates whether the outline view should select a given table column.

- outlineView:shouldSelectItem:

Returns a Boolean value that indicates whether the outline view should select a given item.

- outlineView:selectionIndexesForProposedSelection:

Invoked to allow the delegate to modify the proposed selection.

- selectionShouldChangeInOutlineView:

Returns a Boolean value that indicates whether the outline view should change its selection.

- outlineViewSelectionIsChanging:

Invoked when notification is posted—that is, whenever the outline view’s selection changes.

- outlineViewSelectionDidChange:

Invoked when the selection did change notification is posted—that is, immediately after the outline view’s selection has changed.

Displaying Cells

- outlineView:willDisplayCell:forTableColumn:item:

Informs the delegate that the cell specified by the column and item will be displayed.

- outlineView:willDisplayOutlineCell:forTableColumn:item:

Informs the delegate that an outline view is about to display a cell used to draw the expansion symbol.

- outlineView:dataCellForTableColumn:item:

Returns the cell to use in a given column for a given item.

- outlineView:shouldShowOutlineCellForItem:

Returns whether the specified item should display the outline cell (the disclosure triangle).

- outlineView:shouldShowCellExpansionForTableColumn:item:

Invoked to allow the delegate to control cell expansion for a specific column and item.

Moving and Resizing Columns

- outlineView:shouldReorderColumn:toColumn:

Sent to the delegate to allow or prohibit the specified column to be dragged to a new location.

Working with the Outline Column

- outlineViewColumnDidMove:

Invoked whenever the user moves a column in the outline view.

- outlineViewColumnDidResize:

Invoked whenever the user resizes a column in the outline view.

- outlineViewItemWillExpand:

Invoked when notification is posted—that is, whenever the user is about to expand an item in the outline view.

- outlineViewItemDidExpand:

Invoked when notification is posted—that is, whenever the user expands an item in the outline view.

- outlineViewItemWillCollapse:

Invoked when notification is posted—that is, whenever the user is about to collapse an item in the outline view.

- outlineViewItemDidCollapse:

Invoked when the did collapse notification is posted—that is, whenever the user collapses an item in the outline view.

Editing Items

- outlineView:shouldEditTableColumn:item:

Returns a Boolean value that indicates whether the outline view should allow editing of a given item in a given table column.

Working with Table Columns

- outlineView:mouseDownInHeaderOfTableColumn:

Sent to the delegate whenever the mouse button is clicked in outlineView while the cursor is in a column header tableColumn.

- outlineView:didClickTableColumn:

Sent at the time the mouse button subsequently goes up in outlineView and tableColumn has been “clicked” without having been dragged anywhere.

- outlineView:didDragTableColumn:

Sent at the time the mouse button goes up in outlineView and tableColumn has been dragged during the time the mouse button was down.

Customizing Column and Row Sizes

- outlineView:heightOfRowByItem:

Returns the height in points of the row containing item.

- outlineView:sizeToFitWidthOfColumn:

Invoked to allow the delegate to provide custom sizing behavior when a column’s resize divider is double clicked.

Customizing Tracking Support

- outlineView:shouldTrackCell:forTableColumn:item:

Returns a Boolean value that indicates whether a given cell should be tracked.

Grouping Rows

- outlineView:isGroupItem:

Returns a Boolean that indicates whether a given row should be drawn in the “group row” style.

Working with NSView-Based Outline Views

- outlineView:didAddRowView:forRow:

Implemented to know when a new row view is added to the table.

- outlineView:didRemoveRowView:forRow:

Implemented to know when a row view is removed from the table

- outlineView:rowViewForItem:

implement this method to return a custom NSTableRowView for a particular item.

- outlineView:viewForTableColumn:item:

Implemented to return the view used to display the specified item and column.

Relationships

See Also

Management

NSOutlineViewDataSource

A set of methods that an outline view calls to retrieve data and information about it from the data source delegate, and—optionally—to update data values.