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

Table of Contents

NSTextAttachmentCell


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


Class Description


NSTextAttachmentCell implements the functionality of the NSTextAttachmentCell protocol. See the NSCellForTextAttachment interface specification for a general discussion of the interface's methods. This specification describes only those methods whose implementations have features peculiar to this class.

See the NSAttributedString and NSTextView class specifications for general information on text attachments.




Interfaces Implemented


NSCellForTextAttachment
- attachment
- cellBaselineOffset
- cellSize
- drawWithFrame:inView:
- highlight:withFrame:inView:
- trackMouse:inRect:ofView:untilMouseUp:
- setAttachment:
- wantsToTrackMouse


Method Types


Constructors
NSTextAttachmentCell
TBD Header
attachment
cellBaselineOffset
cellFrame
cellSize
drawWithFrameInView
highlightWithFrameInView
setAttachment
trackMouse
wantsToTrackMouse


Constructors



NSTextAttachmentCell

public NSTextAttachmentCell()

Description forthcoming.

public NSTextAttachmentCell(NSImage anImage)

Description forthcoming.

public NSTextAttachmentCell(String aString)

Description forthcoming.


Instance Methods



attachment

public NSTextAttachment attachment()

Description forthcoming.

cellBaselineOffset

public NSPoint cellBaselineOffset()

Description forthcoming.

cellFrame

public NSRect cellFrame( NSTextContainer aTextContainer, NSRect aRect, NSPoint aPoint, int anInt)

Description forthcoming.

cellSize

public NSSize cellSize()

Description forthcoming.

drawWithFrameInView

public void drawWithFrameInView( NSRect aRect, NSView aView)

Description forthcoming.

public void drawWithFrameInView( NSRect aRect, NSView aView, int anInt)

Description forthcoming.

highlightWithFrameInView

public void highlightWithFrameInView( boolean aBoolean, NSRect aRect, NSView aView)

Description forthcoming.

setAttachment

public void setAttachment(NSTextAttachment aTextAttachment)

Description forthcoming.

trackMouse

public boolean trackMouse( NSEvent theEvent, NSRect cellFrame, NSView aTextView, int anInt, boolean flag)

Description forthcoming.

public boolean trackMouse( NSEvent theEvent, NSRect cellFrame, NSView aTextView, boolean flag)

Handles a mouse-down event on the receiver's image. NSTextAttachmentCell's implementation of this method calls upon aTextView's delegate to handle the event. If theEvent concludes as a double click, the text attachment cell sends the delegate a textView:doubleClickedOnCell:inRect: message and returns true. Otherwise, depending on whether the user clicks or drags the cell, it sends the delegate a textView:clickedOnCell:inRect: or a textView:draggingCell:inRect:event: message and returns true. NSTextAttachmentCell's implementation returns false only if flag is false and the mouse is dragged outside of cellFrame. The delegate methods are invoked only if the delegate can respond to them.

See Also: wantsToTrackMouse, trackMouse (NSCell), lockFocus (NSView)



wantsToTrackMouse

public abstract boolean wantsToTrackMouse()

Returns true. NSTextAttachmentCell objects support dragging. An NSTextView invokes this method before sending trackMouse:inRect:ofView:untilMouseUp: to the text attachment cell.

A more static subclass might override this method to return false, which results in the attachment image behaving as any other glyph in the text, and not allowing itself to be dragged or to perform a method on being clicked.




Table of Contents