PATH  Documentation > WebObjects 4.5 > EOInterface Reference

Table of Contents

EOTextAssociation


Inherits from:
(com.apple.client.eointerface) EOAssociation : EODelayedObserver (EOControl) : Object
(com.apple.yellow.eointerface) EOAssociation : EODelayedObserver (EOControl) : NSObject
Implements:
EOObserving (EODelayedObserver)
(com.apple.client.eointerface only) java.awt.event.FocusListener
(com.apple.client.eointerface only) NSDisposable (EOAssociation)
Package:
com.apple.client.eointerface
com.apple.yellow.eointerface


Class Description


In a Java Client application (using com.apple.client.eointerface), an EOTextAssociation object displays a plain text attribute in an EOTextField, EOTextArea, or EOFormCell by binding the text object to a string. Text is written back to the object as a String.

In a com.apple.yellow.eointerface application, an EOTextAssociation object displays a plain or rich text attribute in an NSText object (Application Kit) by binding the text object to a string or NSData attribute. It determines the kind of text received from an object by examining the beginning for signature codes specific to RTF and RTFD. When writing text back to the object, the association examines the configuration of the NSText object to determine the type to use according to the following table:


Multiple Fonts Allows Graphics Type Written to Object
NO NO NSString text
YES NO NSData containing RTF
YES YES NSData containing RTFD

The following tables describe the display objects an EOTextAssociation can be used with, the aspects of an EOTextAssociation, and the object keys it takes.


Usable With
(com.apple.client.eointerface) EOTextField, EOTextArea, EOFormCell
(com.apple.yellow.eointerface) NSText, NSTextView


Aspects
value A text attribute of the selected object.
(com.apple.yellow.eointerface only) editable A boolean attribute of the selected object, which determines whether the text object is editable.
(com.apple.client.eointerface only) enabled A boolean attribute of the selected object, which determines whether the text object is enabled.


Object Keys Taken
(com.apple.yellow.eointerface only) delegate An EOTextAssociation accepts delegate messages related to the editing and validation of text; see the NSText and NSTextView class specifications for more information.




Constructors



EOTextAssociation

public EOTextAssociation(Object aDisplayObject)

Creates a new EOTextAssociation to monitor and update the value in aDisplayObject, which is typically an Application Kit NSActionCell or, in com.apple.client.eointerface applications, an EOFormCell.

You normally set up associations with the Interface Builder application, in which case you don't need to create them programmatically. However, if you do create them up programmatically, setting them up is a multi-step process. After creating an association, you must bind its aspects and establish its connections.

See Also: bindAspect (EOAssociation), establishConnection (EOAssociation)




Instance Methods



breakConnection

public void breakConnection()

See the breakConnection method description in the superclass EOAssociation.

endEditing

public void endEditing()

See the endEditing method description in the superclass EOAssociation.

establishConnection

public void establishConnection()

See the establishConnection method description in the superclass EOAssociation.

focusGained

public void focusGained(java.awt.event.FocusEvent aFocusEvent)

(com.apple.client.eointerface only) EOTextAssociation listens to its display object's focus state changes in order to notify the display group when the user starts editing in the display object. focusGained is invoked when the user selected the display object in order to edit its value.

focusLost

public void focusLost(java.awt.event.FocusEvent aFocusEvent)

(com.apple.client.eointerface only) Invoked when a user leaves the display object, having finished editing its value.

format

public java.text.Format format()

(com.apple.client.eointerface only) Returns the java.lang.text.Format used to format values bound to the receiver's ValueAspect for display and editing.

isUsableWithObject

public boolean isUsableWithObject(Object aDisplayObject)

(com.apple.client.eointerface only) Returns true if aDisplayObject implements the EOTextAssociation.JTextComponentAccess interface and if its jTextComponent is non null, false otherwise.

See Also: isUsableWithObject ( EOAssociation)



primaryAspect

public String primaryAspect()

(com.apple.client.eointerface only) Returns ValueAspect.

setFormat

public void setFormat(java.text.Format aFormat)

(com.apple.client.eointerface only) Sets the java.lang.text.Format object to use in formatting values bound to the receiver's ValueAspect for display and editing.

subjectChanged

public void subjectChanged()

See the subjectChanged method description in the superclass EOAssociation.


Table of Contents