tableView:createNewRowAtIndex: |
- ( BOOL ) tableView: (id ) sender createNewRowAtIndex: (int ) rowIndex;
This method is sent by the -createNewRow: action method to ask the dataSource to create a new row at a given index in the table. If the dataSource is able to successfully create the row it should return YES, if it cannot create the row for any reason it should return NO.
- sender
- The sending MOExtendedTableView.
- rowIndex
- The index of the row where the new item should be inserted.
tableView:deleteRows: |
- ( BOOL ) tableView: (id ) sender deleteRows: (NSArray *) rows;
This method is sent by the -delete: and -cut: action methods to ask the dataSource to delete one or more rows. The rows array contains NSNumbers whose -intValues are the indices of the rows to be deleted. The array is guaranteed to be sorted in ascending row index order. If the dataSource is able to successfully delete the rows it should return YES, if it cannot delete the rows for any reason it should return NO. If this method does not alter the selection, then the table will deselect all rows after a successful deletion.
- sender
- The sending MOExtendedTableView.
- rows
- The array of row indices (an array of ascending order NSNumbers).
tableView:draggedImage:beganAt: |
- ( void ) tableView: (id ) sender draggedImage: (NSImage *) image beganAt: (NSPoint ) screenPoint;
Data source method for notification of drag source activity. This method is invoked from MOExtendedTableView's -draggedImage:beganAt: implementation if the dataSource responds.
- sender
- The sending MOExtendedTableView.
- image
- The drag image.
- screenPoint
- The screen point where the drag began.
tableView:draggedImage:endedAt:operation: |
- ( void ) tableView: (id ) sender draggedImage: (NSImage *) image endedAt: (NSPoint ) screenPoint operation: (NSDragOperation ) operation;
Data source method for notification of drag source activity. This method is invoked from MOExtendedTableView's -draggedImage:endedAt:operation: implementation if the dataSource responds.
- sender
- The sending MOExtendedTableView.
- image
- The drag image.
- screenPoint
- The screen point where the drag ended.
- operation
- The operation that was performed (or NSDragOperationNone if the drag was not successful).
tableView:draggedImage:movedTo: |
- ( void ) tableView: (id ) sender draggedImage: (NSImage *) image movedTo: (NSPoint ) screenPoint;
Data source method for notification of drag source activity. This method is invoked from MOExtendedTableView's -draggedImage:movedTo: implementation if the dataSource responds.
- sender
- The sending MOExtendedTableView.
- image
- The drag image.
- screenPoint
- The screen point where the drag is currently.
tableView:draggingSourceOperationMaskForLocal: |
- ( NSDragOperation ) tableView: (id ) sender draggingSourceOperationMaskForLocal: (BOOL ) localFlag;
Data source method for altering the drag source operation mask. This method is invoked from MOExtendedTableView's draggingSourceOperationMaskForLocal: implementation if the dataSource responds.
- sender
- The sending MOExtendedTableView.
- localFlag
- Whether the drag destination is in the current application or a different one.
tableView:readRowsFromPasteboard:row:dropOperation:pasteboardSourceType: |
- ( BOOL ) tableView: (id ) sender readRowsFromPasteboard: (NSPasteboard *) pboard row: (int ) row dropOperation: (NSTableViewDropOperation ) op pasteboardSourceType: (MOPasteboardSourceType ) sourceType;
This method provides a single funnel point for reading rows from the pasteboard for drag&frop, copy/paste, and Services. It is sent by the tables' -paste: and -readSelectionFromPasteboard: methods. It is also sent from MOKit's delfault NSObject implementation of the standard NSTableView drag&drop dataSource method -tableView:acceptDrop:row:dropOperation:. An implementation should read the data from the pasteboard and insert new rows (usually).
In case the exact semantics for handling the different kinds of operations is required, an enumeration constant is passed in that identifies why the method is being called (ie whether it is for copy/paste or drag&drop or Services.) For drag&drop the constant also tells you whether the source of the new rows is the same table that is receiving them or some other source.
For copy/paste and Services, the row index will be after the last selected row and the drop operation will be NSTableViewDropAbove. In some circumstances for copy/paste or for Services, especially, you may want to ignore the row and op parameters and work directly from the selection. For instance, if a Service took row data as input from the selected rows, you may want to replace the selected rows with the output data. Note that for Services to be enabled, someone must call NSApplication's -registerServicesMenuSendTypes:returnTypes: with arrays of the supported send and return types to make the application globally aware that these types are supported.
For drag&drop, you can use the information about whether the source was the same table to decide whether to move or copy the rows by default. Note also that to accept drops, someone must register the table for the drop types it supports by sending the table a -registerForDraggedTypes: message.
- sender
- The sending MOExtendedTableView.
- pboard
- The pasteboard to read the data from.
- row
- The row index of where to insert the new rows.
- op
- The drop operation. For copy/paste and Services, this is always NSTableViewDropAbove. For drag&drop it may also be NSTableViewDropOn.
- sourceType
- Where the pasteboard came from (ie what sort of operation is happening).
tableView:validRequestorForSendType:returnType: |
- ( id ) tableView: (id ) sender validRequestorForSendType: (NSString *) sendType returnType: (NSString *) returnType;
This method is sent by -validRequestorForSendType:returnType: to validate Service menu items, and it is also sent by -validateUserInterfaceItem: to validate the Paste command. Implementors should return sender if the send and return types are able to be handled and nil otherwise. When this is sent to validate the Paste command, the sendType is nil and the returnType is one of the types currently on the pasteboard. Note that for Services to be enabled, someone must call NSApplication's -registerServicesMenuSendTypes:returnTypes: with arrays of the supported send and return types to make the application globally aware that these types are supported.
- sender
- The sending MOExtendedTableView.
- sendType
- The type of data that will be requested as input for a Service.
- returnType
- The type of data that will be provided as output for a Service or that is on the pasteboard for Paste.
tableViewDraggingExited: |
- ( void ) tableViewDraggingExited: (id ) sender;
This method is invoked from MOExtendedTableView's draggingExited: implementation if the dataSource responds.
- sender
- The sending MOExtendedTableView.
tableViewIgnoreModifierKeysWhileDragging: |
- ( BOOL ) tableViewIgnoreModifierKeysWhileDragging: (id ) sender;
Data source method for controlling whether modifiers are ignored. This method is invoked from MOExtendedTableView's -ignoreModifierKeysWhileDragging implementation if the dataSource responds.
- sender
- The sending MOExtendedTableView.
(Last Updated 3/20/2005)