#import <CPOutlineView.h>
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: |
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.
|
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:.
CPTableColumn | aTableColumn - The table column to add. |
Reimplemented from CPTableView.
Definition at line 1338 of file CPOutlineView.j.
|
implementation |
Collapse a given item.
anItem | - The item you want to collapse. |
Definition at line 600 of file CPOutlineView.j.
|
implementation |
Returns the datasource object.
Reimplemented from CPTableView.
Definition at line 347 of file CPOutlineView.j.
|
implementation |
Returns the delegate object for the outlineview.
Reimplemented from CPTableView.
Definition at line 1298 of file CPOutlineView.j.
|
implementation |
Archives the view to a coder.
aCoder | the 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.
|
implementation |
Expands a given item.
anItem | - the item to expand. |
Definition at line 511 of file CPOutlineView.j.
|
implementation |
Expands a given item, and optionally all the children of that item.
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.
|
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.
|
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.
aRow | - The row of the receiver |
Definition at line 1019 of file CPOutlineView.j.
|
implementation |
Returns the layout behavior of the disclosure buttons.
Definition at line 963 of file CPOutlineView.j.
|
implementation |
Returns the width of an indentation level.
Definition at line 933 of file CPOutlineView.j.
|
implementation |
Initializes the view from an archive.
aCoder | the coder from which to initialize |
Reimplemented from CPTableView.
Provided by category CPOutlineView(CPCoding).
Definition at line 2185 of file CPOutlineView.j.
|
implementation |
Initializes the receiver for usage with the specified bounding rectangle
Reimplemented from CPTableView.
Definition at line 190 of file CPOutlineView.j.
|
implementation |
Used to query whether an item is expandable or not.
anItem | - the item you are interested in. |
Definition at line 359 of file CPOutlineView.j.
|
implementation |
Used to find if an item is already expanded.
anItem | - the item you are interest in. |
Definition at line 392 of file CPOutlineView.j.
|
implementation |
Returns the item at a given row index. If no item exists nil is returned.
aRow | - The row index you want to find the item at. |
Definition at line 411 of file CPOutlineView.j.
|
implementation |
Reimplemented from CPTableView.
Definition at line 1734 of file CPOutlineView.j.
|
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.
anItem | - The item you want the indentation level for. |
Definition at line 443 of file CPOutlineView.j.
|
implementation |
Returns the indentation level for a given row. If the row is invalid CPNotFound is returned. Rows that are not indented return 0.
aRow | - the row of the receiver |
Definition at line 463 of file CPOutlineView.j.
|
implementation |
Returns the table column used to display hierarchical data.
Definition at line 907 of file CPOutlineView.j.
|
implementation |
Returns the parent item for a given item. If the item is a top level root object nil is returned.
anItem | - The item of the receiver. |
Definition at line 975 of file CPOutlineView.j.
|
implementation |
Reloads the data for an item.
anItem | - The item you want to reload. |
Definition at line 671 of file CPOutlineView.j.
|
implementation |
Reloads the data for a given item and optionally the children.
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.
|
implementation |
Reimplemented from CPTableView.
Definition at line 1348 of file CPOutlineView.j.
|
implementation |
Returns the row of a given item
anItem | - The item you want to find the row of. |
Definition at line 422 of file CPOutlineView.j.
|
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.
Returns the child item at an index of a given item. if item is nil you should return the appropriate root item.
Returns YES if the item is expandable, otherwise NO.
Returns the number of child items of a given item. If item is nil you should return the number of top level (root) items.
Returns the object value of the item in a given column.
Sets the data object value for an item in a given column. This needs to be implemented if you want inline editing support.
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
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.
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;
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.
Definition at line 289 of file CPOutlineView.j.
|
implementation |
Sets the delegate for the outlineview.
The following methods can be implemented:
aDelegate | - the delegate object you wish to set for the receiver. |
Called when the user moves a column in the outlineview.
Called when the user resizes a column in the outlineview.
Called when the user collapses an item in the outlineview.
Called when the user expands an item in the outlineview.
Called when the user collapses an item in the outlineview, but before the item is actually collapsed.
Called when the used expands an item, but before the item is actually expanded.
Called when the user changes the selection of the outlineview.
Called when the user changes the selection of the outlineview, but before the change is made.
Return YES if the item should be given permission to expand, otherwise NO.
Return YES if the item should be given permission to collapse, otherwise NO.
Return YES to allow the selection of tableColumn, otherwise NO.
Return YES to allow the selection of an item, otherwise NO.
Return YES to allow the selection of the outlineview to be changed, otherwise NO.
Called when a dataView is about to be displayed. This gives you the ability to alter the dataView if needed.
Return YES to allow for editing of a dataview at given item and tableColumn, otherwise NO to prevent the edit.
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.
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.
Definition at line 1132 of file CPOutlineView.j.
|
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.
aControl | - the control to be used to expand and collapse items. |
Definition at line 1310 of file CPOutlineView.j.
|
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.
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.
|
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.
indentationMarkerShouldFollowDataView | - Pass YES if the disclosure control should be indented along with the dataview, otherwise NO. |
Definition at line 945 of file CPOutlineView.j.
|
implementation |
Sets the number of pixels to indent an item at each indentation level.
anIndentationWidth | - the width of each indentation level. |
Definition at line 917 of file CPOutlineView.j.
|
implementation |
Sets the table column you want to display the disclosure button in. If you do not want an outline column pass nil.
aTableColumn | - The CPTableColumn you want to use for hierarchical data. |
Definition at line 891 of file CPOutlineView.j.