Up

NSOutlineView

Authors

Gregory John Casamento (greg_casamento@yahoo.com)
This class is a subclass of NSTableView which provides the user with a way to display tree structured data in an outline format. It is particularly useful for show hierarchical data such as a class inheritance tree or any other set of relationships.

Copyright: (C) 2001 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSOutlineView class
  2. Software documentation for the NSObject(NSOutlineViewDataSource) informal protocol
  3. Software documentation for the NSObject(NSOutlineViewDelegate) informal protocol

Software documentation for the NSOutlineView class

NSOutlineView : NSTableView

Declared in:
AppKit/NSOutlineView.h
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


Instance Variables

Method summary

autoResizesOutlineColumn 

- (BOOL) autoResizesOutlineColumn;
Availability: Not in OpenStep/MacOS-X

Causes the outline column, the column containing the expand/collapse gadget, to resize based on the amount of space needed by widest content.


autosaveExpandedItems 

- (BOOL) autosaveExpandedItems;
Availability: Not in OpenStep/MacOS-X

Causes the outline column, the column containing the expand/collapse gadget, to resize based on the amount of space needed by widest content.


collapseItem: 

- (void) collapseItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Collapses the given item only. This is the equivalent of calling [NSOutlineView -collapseItem:collapseChildren:] with NO.


collapseItem: collapseChildren: 

- (void) collapseItem: (id)item collapseChildren: (BOOL)collapseChildren;
Availability: Not in OpenStep/MacOS-X

Collapses the specified item. If collapseChildren is set to YES, then all of the expandable children of this item all also collapsed in a recursive fashion (i.e. all children, grandchildren and etc).


expandItem: 

- (void) expandItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Expands the given item only. This is the equivalent of calling [NSOutlineView -expandItem:expandChildren:] with NO.


expandItem: expandChildren: 

- (void) expandItem: (id)item expandChildren: (BOOL)expandChildren;
Availability: Not in OpenStep/MacOS-X

Expands the specified item. If expandChildren is set to YES, then all of the expandable children of this item all also expanded in a recursive fashion (i.e. all children, grandchildren and etc).


indentationMarkerFollowsCell 

- (BOOL) indentationMarkerFollowsCell;
Availability: Not in OpenStep/MacOS-X

Returns whether or not the indentation marker or "knob" is indented along with the content inside the cell.


indentationPerLevel 

- (float) indentationPerLevel;
Availability: Not in OpenStep/MacOS-X

Returns the amount of indentation, in points, for each level of the tree represented by the outline view.


isExpandable: 

- (BOOL) isExpandable: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns YES, if the item is able to be expanded, NO otherwise.


isItemExpanded: 

- (BOOL) isItemExpanded: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns YES if the item is expanded or open, NO otherwise.


itemAtRow: 

- (id) itemAtRow: (int)row;
Availability: Not in OpenStep/MacOS-X

Returns the item at a given row.


levelForItem: 

- (int) levelForItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns the level for a given item.


levelForRow: 

- (int) levelForRow: (int)row;
Availability: Not in OpenStep/MacOS-X

Returns the level for the given row.


outlineTableColumn 

- (NSTableColumn*) outlineTableColumn;
Availability: Not in OpenStep/MacOS-X

Returns the outline table column.


reloadItem: 

- (void) reloadItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Causes an item to be reloaded. This is the equivalent of calling [NSOutlineView -reloadItem:reloadChildren:] with reloadChildren set to NO.


reloadItem: reloadChildren: 

- (void) reloadItem: (id)item reloadChildren: (BOOL)reloadChildren;
Availability: Not in OpenStep/MacOS-X

Causes an item and all of it's children to be reloaded if reloadChildren is set to YES, if it's set to NO, then only the item itself is refreshed from the datasource.


rowForItem: 

- (int) rowForItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns the corresponding row in the outline view for the given item.


setAutoresizesOutlineColumn: 

- (void) setAutoresizesOutlineColumn: (BOOL)resize;
Availability: Not in OpenStep/MacOS-X

When set to YES this causes the outline column, the column containing the expand/collapse gadget, to resize based on the amount of space needed by widest content.


setAutosaveExpandedItems: 

- (void) setAutosaveExpandedItems: (BOOL)flag;
Availability: Not in OpenStep/MacOS-X

When set to YES, the outline view will save the state of all expanded or collapsed items in the view to the users defaults for the application the outline view is running in.


setDropItem: dropChildIndex: 

- (void) setDropItem: (id)item dropChildIndex: (int)childIndex;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


setIndentationMarkerFollowsCell: 

- (void) setIndentationMarkerFollowsCell: (BOOL)followsCell;
Availability: Not in OpenStep/MacOS-X

If set to YES, the indentation marker will follow the content at each level. Otherwise, the indentation marker will remain at the left most position of the view regardless of how many levels in the content is indented.


setIndentationPerLevel: 

- (void) setIndentationPerLevel: (float)newIndentLevel;
Availability: Not in OpenStep/MacOS-X

Sets the amount, in points, that each level is to be indented by.


setOutlineTableColumn: 

- (void) setOutlineTableColumn: (NSTableColumn*)outlineTableColumn;
Availability: Not in OpenStep/MacOS-X

Sets the outline table column in which to place the indentation marker.


shouldCollapseAutoExpandedItemsForDeposited: 

- (BOOL) shouldCollapseAutoExpandedItemsForDeposited: (BOOL)deposited;
Availability: Not in OpenStep/MacOS-X

Returns YES, by default. Subclasses should override this method if a different behaviour is required.




Instance Variables for NSOutlineView Class

_autoResizesOutlineColumn

@protected BOOL _autoResizesOutlineColumn;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_autosaveExpandedItems

@protected BOOL _autosaveExpandedItems;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_expandedItems

@protected NSMutableArray* _expandedItems;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_indentationMarkerFollowsCell

@protected BOOL _indentationMarkerFollowsCell;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_indentationPerLevel

@protected float _indentationPerLevel;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_itemDict

@protected NSMapTable* _itemDict;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_items

@protected NSMutableArray* _items;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_levelOfItems

@protected NSMapTable* _levelOfItems;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_outlineTableColumn

@protected NSTableColumn* _outlineTableColumn;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_selectedItems

@protected NSMutableArray* _selectedItems;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.





Software documentation for the NSObject(NSOutlineViewDataSource) informal protocol

NSObject(NSOutlineViewDataSource)

Declared in:
AppKit/NSOutlineView.h
Availability: Not in OpenStep/MacOS-X

Informal protocol NSOutlineViewDataSource

Method summary

outlineView: acceptDrop: item: childIndex: 

- (BOOL) outlineView: (NSOutlineView*)outlineView acceptDrop: (id)info item: (id)item childIndex: (int)index;
Availability: Not in OpenStep/MacOS-X

Returns whether or not the outline view should accept a drop into the indicated item.


outlineView: child: ofItem: 

- (id) outlineView: (NSOutlineView*)outlineView child: (int)index ofItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Implementation of this method is required. Returns the child at the specified index for the given item.


outlineView: isItemExpandable: 

- (BOOL) outlineView: (NSOutlineView*)outlineView isItemExpandable: (id)item;
Availability: Not in OpenStep/MacOS-X

This is a required method. Returns whether or not the outline view item specified is expandable or not.


outlineView: itemForPersistentObject: 

- (id) outlineView: (NSOutlineView*)outlineView itemForPersistentObject: (id)object;
Availability: Not in OpenStep/MacOS-X

Returns the item for the given persistent object.


outlineView: numberOfChildrenOfItem: 

- (int) outlineView: (NSOutlineView*)outlineView numberOfChildrenOfItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


outlineView: objectValueForTableColumn: byItem: 

- (id) outlineView: (NSOutlineView*)outlineView objectValueForTableColumn: (NSTableColumn*)tableColumn byItem: (id)item;
Availability: Not in OpenStep/MacOS-X

This is a required method. Returns the object corresponding to the item representing it in the outline view.


outlineView: persistentObjectForItem: 

- (id) outlineView: (NSOutlineView*)outlineView persistentObjectForItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns the persistent object for the item specified.


outlineView: setObjectValue: forTableColumn: byItem: 

- (void) outlineView: (NSOutlineView*)outlineView setObjectValue: (id)object forTableColumn: (NSTableColumn*)tableColumn byItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Sets the object value of the given item in the given table column to the object provided.


outlineView: validateDrop: proposedItem: proposedChildIndex: 

- (NSDragOperation) outlineView: (NSOutlineView*)outlineView validateDrop: (id)info proposedItem: (id)item proposedChildIndex: (int)index;
Availability: Not in OpenStep/MacOS-X

Used by the Drag and Drop system. Returns the drap operations which was performed on the given outline view.


outlineView: writeItems: toPasteboard: 

- (BOOL) outlineView: (NSOutlineView*)outlineView writeItems: (NSArray*)items toPasteboard: (NSPasteboard*)pboard;
Availability: Not in OpenStep/MacOS-X

Causes the outline view to write the specified items to the pastboard.


Software documentation for the NSObject(NSOutlineViewDelegate) informal protocol

NSObject(NSOutlineViewDelegate)

Declared in:
AppKit/NSOutlineView.h
Availability: Not in OpenStep/MacOS-X

Description forthcoming.

Method summary

outlineView: shouldCollapseItem: 

- (BOOL) outlineView: (NSOutlineView*)outlineView shouldCollapseItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns whether or not the specified item should be allowed to collapse.


outlineView: shouldEditTableColumn: item: 

- (BOOL) outlineView: (NSOutlineView*)outlineView shouldEditTableColumn: (NSTableColumn*)tableColumn item: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns whether or not the given table column should be allowed to be edited.


outlineView: shouldExpandItem: 

- (BOOL) outlineView: (NSOutlineView*)outlineView shouldExpandItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns whether or not the specified item should be expanded.


outlineView: shouldSelectItem: 

- (BOOL) outlineView: (NSOutlineView*)outlineView shouldSelectItem: (id)item;
Availability: Not in OpenStep/MacOS-X

Returns YES or NO depending on if the given item is selectable. If YES, the item is selected, otherwise the outline view will reject the selection.


outlineView: shouldSelectTableColumn: 

- (BOOL) outlineView: (NSOutlineView*)outlineView shouldSelectTableColumn: (NSTableColumn*)tableColumn;
Availability: Not in OpenStep/MacOS-X

Returns YES or NO depending on if the given table column is selectable according to the delegate. If NO is returned the outline view will not allow the selection, if YES it will allow the selection.


outlineView: willDisplayCell: forTableColumn: item: 

- (void) outlineView: (NSOutlineView*)outlineView willDisplayCell: (id)cell forTableColumn: (NSTableColumn*)tableColumn item: (id)item;
Availability: Not in OpenStep/MacOS-X

Called when the given cell is about to be displayed. This method is useful for making last second modifications to what will be shown.


outlineView: willDisplayOutlineCell: forTableColumn: item: 

- (void) outlineView: (NSOutlineView*)outlineView willDisplayOutlineCell: (id)cell forTableColumn: (NSTableColumn*)tableColumn item: (id)item;
Availability: Not in OpenStep/MacOS-X

Called when the given cell in the outline column is about to be displayed. This method is useful for making last second modifications to what will be shown.


outlineViewColumnDidMove: 

- (void) outlineViewColumnDidMove: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called after the column has moved.


outlineViewColumnDidResize: 

- (void) outlineViewColumnDidResize: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called after the view column is resized.


outlineViewItemDidCollapse: 

- (void) outlineViewItemDidCollapse: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called after the item has collapsed.


outlineViewItemDidExpand: 

- (void) outlineViewItemDidExpand: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called after the item has expanded


outlineViewItemWillCollapse: 

- (void) outlineViewItemWillCollapse: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called before the item has collapsed.


outlineViewItemWillExpand: 

- (void) outlineViewItemWillExpand: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called before the item is expanded.


outlineViewSelectionDidChange: 

- (void) outlineViewSelectionDidChange: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called when the selection has changed.


outlineViewSelectionIsChanging: 

- (void) outlineViewSelectionIsChanging: (NSNotification*)aNotification;
Availability: Not in OpenStep/MacOS-X

Called when the selection is about to change.


selectionShouldChangeInOutlineView: 

- (BOOL) selectionShouldChangeInOutlineView: (NSOutlineView*)outlineView;
Availability: Not in OpenStep/MacOS-X

Called before the selection is modified. This method should return YES if the selection is allowed and NO, if not.



Up