Release 5.  Copyright ©1994-1998 by TipTop Software, Inc.  All Rights Reserved.






TTOBCellProtocol




Adopted By: TTOBCell
Declared In: <ObjBrowser/TTOBCellProtocol.h>




Protocol Description

This protocol describes the functionality of Objective-Browser cells.  Each OB cell corresponds to an object or some other piece of information (e.g., a method) in a running program.  Each cell has a number of categories.  A category is represented by an object which must respond to -stringValue.  The string value of a category object is used in the category popup button.  For example, a cell which corresponds to an object typically has the "vars" and "methods" categories.  The "vars" category corresponds to instance variables, and the "methods" category which corresponds to methods that the object responds to.  Method -populateArrayWithSubcellCategories: is used to query a cell for a list of category objects which are associated with the cell.

For every category, a cell has a number of subcells.  For example, in the case of a cell which corresponds to an object and the "vars" category, the subcells are cells which correspond to instance variables of the object.  Method -populateArray:withSubcellsForCategory: is used to query a cell for a list of subcells.

A cell can have any number of inspectors associated with it for every category (although, in practice, the inspector list (usually) does not depend on the category selected).  Method -populateArray:withInspectorClassNamesForCategory: is used to query a cell for a list of inspector class names.




Method Types

browser
canBeRootCell
cellDeselected
cellSelected
copyNewRoot
- dragDataForEvent:
getCellImage
getCellName
populateArray:withInspectorClassNamesForCategory:
populateArrayWithSubcellCategories:
populateArray:forCategory:
infoForInspector
isCellValid
loadCellAtRow:inColumn:
object
setBrowser:
setObject:




Instance Methods

browser
  (TTObjBrowser*)browser

Returns the browser object in which the cell is displayed.

See also:  - setBrowser:




canBeRootCell
  (BOOL)canBeRootCell

If the cell can be a root cell for another browser, this method returns YES.  The -copyNewRoot method is used to create a copy of the cell which is then used as a root cell.

See also:  - copyNewRoot




cellDeselected
  (void)cellDeselected

This message is sent to a browser cell object when the cell is deselected.

See also:  - cellSelected




cellSelected
  (void)cellSelected

This message is sent to a browser cell object when the cell is selected in the browser.

See also:  - cellDeselected




copyNewRoot
  (id)copyNewRoot

This method should create an autoreleased copy of the receiver cell which will then be used as a root cell in another browser.

See also:  - canBeRootCell




dragDataForEvent:
  (NSString*)dragDataForEvent:(NSEvent *)ev

This method is supposed to return a string which is to be placed on the pasteboard when the cell's icon is dragged.

See also:  - dragData  (TTOBCell)




getCellImage
  (NSImage*)getCellImage

Returns an image which is used in OB as a graphical representation of the cell.




getCellName
  (NSString*)getCellName

Returns a string which represents the cell.  This name is used for column title.  Note that the string returned by -stringValue is used as the cell name inside a column.

See also:  - stringValue (NSBrowserCell)




populateArray:withInspectorClassNamesForCategory:
  (NSString*)populateArray:(NSMutableArray*)l
withInspectorClassNamesForCategory:(TTOBCCategory*)t

This method fills the list l with string objects corresponding to the inspector class names for the receiving cell, when cell category t is selected.  The value returned is a string object which is the name of the default inspector.  If the cell is a leaf cell, then t is nil.

See also:  - populateArrayWithSubcellCategories:




populateArrayWithSubcellCategories:
  (NSString*)populateArrayWithSubcellCategories:l

This method fills the list l with the cell categories for the receiving cell.  This method is only invoked if the cell is a non-leaf cell.




populateArray:withSubcellsForCategory:
  (void)populateArray:(NSMutableArray*)l
withSubcellsForCategory:(TTOBCCategory*)t

This method fills the list l with the subcells for the receiving cell for category t.  This method is only invoked if the cell is a non-leaf cell.

See also:  - populateArrayWithSubcellCategories:




infoForInspector
  (id)infoForInspector

This method should return an info object which is used by the inspector.  This method typically returns self.




isCellValid
  (BOOL)isCellValid

Returns YES if the cell is valid, NO otherwise.




loadCellAtRow:inColumn:
  (BOOL)loadCellAtRow:(int)r
inColumn:(int)col

This message is sent to a cell (lazily) so that the cell "loads" itself with appropriate information, e.g., -stringValue etc. The cell should set its loaded flag (i.e., use the -setLoaded: method).    If the cell is invalid, this method should return NO, otherwise YES.




object
  (id)object

If a cell corresponds to an object, this method should return the object.

See also:  -setObject:




setBrowser:
  setBrowser:(TTObjBrowser*)b

This method is invoked typically after the init method to notify the cell what its browser is.

See also:  -browser




setObject:
  setObject:(id)o

If the cell corresponds to an object, this method is used to specify which object it is.

See also:  -object




###