Developer Documentation
PATH  Mac OS X Documentation > Application Kit Reference: Java

Table of Contents

NSBrowserCell


Inherits from:
NSCell : NSObject
Package:
com.apple.yellow.application


Class Description


NSBrowserCell is the subclass of NSCell used by default to display data in the columns of an NSBrowser. (Each column contains an NSMatrix filled with NSBrowserCells.) An NSBrowserCell can be a leaf or branch cell. A branch cell displays an image indicating that, when the cell is clicked, the NSBrowser will display a new column of NSBrowserCells; branch cells are thus important to the display of hierarchical information typical of NSBrowsers. An NSBrowserCell can also be loaded or unloaded; loaded NSBrowserCells have their state set and are ready for display.

Many of NSBrowserCell's methods are designed to interact with NSBrowser and NSBrowser's delegate. The delegate implements methods for loading the NSCells in NSBrowser by setting their values and status. If your code needs access to a specific NSBrowserCell, you can use the NSBrowser method loadedCellAtLocation.

Because NSBrowserCells do not inherit from NSActionCell, they don't hold target and action values and thus don't participate in the target/action paradigm of the Application Kit. However, NSBrowser does allow you to specify a target and an action, and you can obtain the last selected NSBrowserCell by sending selectedCell to an NSBrowser.

You may find it useful to create a subclass of NSBrowserCell to alter its behavior and to enable it to work with and display the type of data you wish to represent. Use NSBrowser's setCellClass: or setCellPrototype methods to have it use your subclass.

See the NSBrowser class specification for more details. In particular, the class description and the "Methods Implemented By the Delegate" describe how the NSBrowser's delegate interacts with both NSBrowser and NSBrowserCells.




Method Types


Constructors
NSBrowserCell
Accessing graphic images
branchImage
highlightedBranchImage
alternateImage
setAlternateImage
Setting state
reset
set
Determining cell attributes
isLeaf
setLeaf
isLoaded
setLoaded


Constructors



NSBrowserCell

public NSBrowserCell()

Description forthcoming.

public NSBrowserCell(String aString)

Description forthcoming.

public NSBrowserCell(NSImage anImage)

Description forthcoming.


Static Methods



branchImage

public static NSImage branchImage()

Returns the default image for branch NSBrowserCells (a right-pointing triangle). Override this method if you want a different image. To have a branch NSBrowserCell with no image (and no space reserved for an image), override this method to return null.

See Also: highlightedBranchImage, alternateImage, setAlternateImage



highlightedBranchImage

public static NSImage highlightedBranchImage()

Returns the default NSImage for branch NSBrowserCells that are highlighted (a lighter version of the image returned by branchImage). Override this method if you want a different image.

See Also: branchImage, alternateImage, setAlternateImage




Instance Methods



alternateImage

public NSImage alternateImage()

Returns this NSBrowserCell's image for the highlighted state or null if no image is set.

See Also: setAlternateImage



isLeaf

public boolean isLeaf()

Returns whether the NSBrowserCell is a leaf or a branch cell. A branch NSBrowserCell has an image near its right edge indicating that more, hierarchically related information is available; when the user selects the cell, the NSBrowser displays a new column of NSBrowserCells. A leaf NSBrowserCell has no image, indicating that the user has reached a terminal piece of information; it doesn't point to additional information.

See Also: setLeaf



isLoaded

public boolean isLoaded()

Returns true if all the NSBrowserCell's state has been set and the cell is ready to display.

See Also: setLoaded



reset

public void reset()

Unhighlights the NSBrowserCell and sets its state to 0 (false).

See Also: set



set

public void set()

Highlights the NSBrowserCell and sets its state to 1 (true).

See Also: reset



setAlternateImage

public void setAlternateImage(NSImage newAltImage)

Sets this NSBrowserCell's image for the highlighted state. If newAltImage is null, it removes the alternate image for the NSBrowserCell.

See Also: alternateImage



setLeaf

public void setLeaf(boolean flag)

Sets whether the NSBrowserCell is a leaf or a branch cell. A branch NSBrowserCell has an image near its right edge indicating that more, hierarchically related information is available; when the user selects the cell, the NSBrowser displays a new column of NSBrowserCells. A leaf NSBrowserCell has no image, indicating that the user has reached a terminal piece of information; it doesn't point to additional information.

See Also: isLeaf



setLoaded

public void setLoaded(boolean flag)

Sets whether the NSBrowserCell's state has been set to 1 (true) and the cell is ready to display.

See Also: isLoaded




Table of Contents