Class

NSBrowser

An interface that displays a hierarchically organized list of data items that can be navigated and selected.

Declaration

@interface NSBrowser : NSControl

Overview

A browser displays information using a set of columns, which are indexed from left to right. Each successive column displays the next level down in the data hierarchy. This class uses the NSBrowserCell class to implement its user interface.

Browsers have the following components:

  • Columns

  • Scroll views

  • Matrices

  • Browser cells

To the user, browsers display data in columns and rows within each column. These components are arranged in the following component hierarchy:

Browser
|---Columns [1..*]
    |---Scroll view
       |---Matrix
           |---Rows [0..*]

Topics

Configuring Browsers

reusesColumns

A Boolean that indicates whether the browser reuses matrix objects after their columns are unloaded.

maxVisibleColumns

The maximum number of visible columns.

autohidesScroller

A Boolean that indicates whether the browser automatically hides its scroller.

backgroundColor

The browser’s background color.

minColumnWidth

The minimum column width, in pixels.

separatesColumns

A Boolean that indicates whether columns are separated by bezeled borders.

takesTitleFromPreviousColumn

A Boolean that indicates whether a column takes its title from the selected cell in the previous column.

- tile

Adjusts the various subviews of the browser—scrollers, columns, titles, and so on—without redrawing.

delegate

The browser’s delegate.

Getting Browser Information

- isOpaque

Indicates whether the browser is opaque.

Managing Component Types

cellClass

Returns the NSBrowserCell class.

- setCellClass:

Sets the class of the cell to be used by the matrices in the columns of the browser.

cellPrototype

The prototype NSCell for displaying items in the matrices in the columns of the browser.

Managing Selection Behavior

allowsBranchSelection

A Boolean that indicates whether the user can select branch items.

allowsEmptySelection

A Boolean that indicates whether there can be nothing selected.

allowsMultipleSelection

A Boolean that indicates whether the user can select multiple items.

- selectedRowIndexesInColumn:

Provides the indexes of the selected rows in a given column of the browser.

- selectRowIndexes:inColumn:

Specifies the selected rows in a given column of the browser.

allowsTypeSelect

A Boolean that indicates whether the browser allows keystroke-based selection (type select).

Managing Selection

selectedCell

The last (rightmost and lowest) selected cell.

- selectedCellInColumn:

Returns the last (lowest) cell selected in the given column.

selectedCells

All cells selected in the rightmost column.

- selectAll:

Selects all cells in the last column of the browser.

- selectedRowInColumn:

Returns the row index of the selected cell in the specified column.

- selectRow:inColumn:

Selects the cell at the specified row and column index.

selectionIndexPath

The index path of the item selected in the browser.

selectionIndexPaths

An array containing the index paths of all items selected in the browser.

Accessing Components

- loadedCellAtRow:column:

Loads, if necessary, and returns the cell at the specified row and column location.

- editItemAtIndexPath:withEvent:select:

Begins editing the item at the specified path.

- itemAtIndexPath:

Returns the item at the specified index path.

- itemAtRow:inColumn:

Returns the item located at the specified row and column.

- indexPathForColumn:

Returns the index path of the item whose children are displayed in the given column.

- isLeafItem:

Returns whether the specified item is a leaf item.

- parentForItemsInColumn:

Returns the item that contains the children located in the specified column.

Managing the Path

- path

Returns a string representing the browser’s current path.

- setPath:

Sets the path to be displayed by the browser.

- pathToColumn:

Returns a string representing the path from the first column up to, but not including, the column at the given index.

pathSeparator

The path separator.

Managing Columns

- addColumn

Adds a column to the right of the last column.

selectedColumn

The index of the last column with a selected item.

lastColumn

The index of the last column loaded.

firstVisibleColumn

The index of the first visible column.

numberOfVisibleColumns

The number of visible columns.

lastVisibleColumn

The index of the last visible column.

- validateVisibleColumns

Validates the browser’s visible columns.

loaded

A Boolean that indicates whether column 0 is loaded.

- loadColumnZero

Loads column 0; unloads previously loaded columns.

- reloadColumn:

Reloads the given column.

Accessing Column Titles

- titleOfColumn:

Returns the title displayed for the given column.

- setTitle:ofColumn:

Sets the title of the given column.

titled

A Boolean that indicates whether columns display titles.

- drawTitleOfColumn:inRect:

Draws the title for the specified column within the given rectangle.

titleHeight

The height of the column titles for the browser.

- titleFrameOfColumn:

Returns the bounds of the title frame for the specified column.

Updating Browsers

- noteHeightOfRowsWithIndexesChanged:inColumn:

Immediately retiles the browser’s columns using row heights specified by the browser’s delegate.

- reloadDataForRowIndexes:inColumn:

Updates the rows in the column with the specified column index with indexes in the specified set.

Scrolling

hasHorizontalScroller

A Boolean that indicates whether the browser has a horizontal scroller.

- scrollColumnToVisible:

Scrolls to make the specified column visible.

- scrollColumnsLeftBy:

Scrolls columns left by the specified number of columns.

- scrollColumnsRightBy:

Scrolls columns right by the specified number of columns.

- scrollRowToVisible:inColumn:

Scrolls the specified row to be visible within the specified column.

Dragging

- draggingSourceOperationMaskForLocal:

Indicates the types of dragging operations the source object allows on the dragged image’s data.

- setDraggingSourceOperationMask:forLocal:

Specifies the drag-operation mask for dragging operations with local or external destinations.

- canDragRowsWithIndexes:inColumn:withEvent:

Indicates whether the browser can attempt to initiate a drag of the given rows for the given event.

- draggingImageForRowsWithIndexes:inColumn:withEvent:offset:

Provides an image to represent dragged rows during a drag operation on the browser.

- namesOfPromisedFilesDroppedAtDestination:

Provides the names of the files that the browser promises to create at a specified location.

Getting Column Frames

- frameOfColumn:

Returns the rectangle containing the given column.

- frameOfInsideOfColumn:

Returns the rectangle containing the specified column, not including borders.

Getting Row Frames

- frameOfRow:inColumn:

Returns the frame of the cell at the specified location, including the expandable arrow.

- getRow:column:forPoint:

Gets the row and column coordinates for the specified point, if a cell exists at that point.

Managing Actions

doubleAction

The browser’s double-click action method.

sendsActionOnArrowKeys

A Boolean that indicates whether pressing an arrow key causes an action message to be sent.

- sendAction

Sends the action message to the target.

Handling Mouse-Click Events

- doClick:

Responds to (single) mouse clicks in a column of the browser.

- doDoubleClick:

Responds to double clicks in a column of the browser.

clickedColumn

The column number of the cell that the user clicked to display a context menu.

clickedRow

The row number of the cell that the user clicked to display a context menu.

Sizing

+ removeSavedColumnsWithAutosaveName:

Removes the column configuration data stored under the given name from the application’s user defaults.

columnsAutosaveName

The name used to automatically save the browser’s column configuration.

- columnContentWidthForColumnWidth:

Returns the content width for a given column width.

- columnWidthForColumnContentWidth:

Returns the column width for the width of the given column’s content.

columnResizingType

A constant indicating the browser’s column resizing type.

prefersAllColumnUserResizing

A Boolean that indicates whether the browser is set to resize all columns simultaneously rather than resizing a single column at a time.

- widthOfColumn:

Returns the width of the specified column.

- setWidth:ofColumn:

Sets the width of the specified column.

- defaultColumnWidth

Returns the default column width of the browser’s columns.

- setDefaultColumnWidth:

Sets the default column width for new browser columns that do not otherwise have an initial width from defaults or the browser’s delegate.

rowHeight

The height of the browser’s rows.

Constants

NSBrowserColumnResizingType

Types of browser column resizing.

NSBrowserDropOperation

The type used to specify the drop type of a drag-and-drop operation. See browser:validateDrop:proposedRow:column:dropOperation: for more information.

NSBrowserAuxiliaryOpaque

A private data structure used internally by NSBrowser.

Application Kit Versions for NSBrowser Functionality

The version of the AppKit.framework containing a specific bug fix or capability.

Notifications

NSBrowserColumnConfigurationDidChangeNotification

Notifies the delegate when the width of a browser column has changed.

Deprecated

- updateScroller

Updates the horizontal scroller to reflect column positions.

Deprecated
- scrollViaScroller:

Scrolls columns left or right based on an NSScroller.

Deprecated
- displayAllColumns

Updates the browser to display all loaded columns.

Deprecated
- displayColumn:

Updates the browser to display the given column.

Deprecated
- columnOfMatrix:

Returns the column number in which the given matrix is located.

Deprecated
- matrixInColumn:

Returns the matrix located in the specified column.

Deprecated
- matrixClass

Returns the matrix class used in the browser’s columns.

Deprecated
- setMatrixClass:

Sets the matrix class to be used in the browser’s columns.

Deprecated
- acceptsArrowKeys

Indicates whether the browser allows navigation using the arrow keys.

Deprecated
- setAcceptsArrowKeys:

Specifies whether the browser allows navigation using the arrow keys.

Deprecated

Relationships

Inherits From