WebObjects 5.2

com.webobjects.eointerface.cocoa
Class EOCocoaTextFieldPlugin

java.lang.Object
  |
  +--com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
        |
        +--com.webobjects.eointerface.EOValueAssociation.ValuePlugin
              |
              +--com.webobjects.eointerface.EOTextAssociation.TextPlugin
                    |
                    +--com.webobjects.eointerface.cocoa.EOCocoaSimpleTextPlugin
                          |
                          +--com.webobjects.eointerface.cocoa.EOCocoaTextFieldPlugin
All Implemented Interfaces:
EOWidgetAssociation.WidgetPlugin.Formatting, NSDisposable

public class EOCocoaTextFieldPlugin
extends EOCocoaSimpleTextPlugin
implements EOWidgetAssociation.WidgetPlugin.Formatting

EOCocoaTextFieldPlugin is used in Cocoa applications to connect text field widgets to EOTextAssociations and EOPickTextAssociations.

Usage:
Association classes: EOTextAssociation, EOPickTextAssociation
Widget classes: NSTextField, NSTextFieldCell, NSFormCell
Value classes: String or other formattable classes


Inner classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOCocoaTextFieldPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOCocoaTextFieldPlugin for use with association and widget.
 
Method Summary
 void breakConnection()
          Tells the plugin to halt communication with its NSTextField object.
 boolean endEditing()
          Asks the plugin to halt editing of its widget in the UI.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 void setColors(Object textColor, Object bgColor)
          Sets the text and background colors for the text field this plugin manages.
 void setFontProperties(int boldState, int italicState)
          Sets the bold and italic properties for this plugin's text fields.
 void setValue(Object value, boolean enabled)
          Sets the attributes of this plugin's text field based on value and isEnabled.
 void setValueFormatter(Object formatter)
          Sets the formatter used to format values in the interface.
 Object value()
           
 Object valueFormatter()
          Returns the formatter object of the receiver.
 
Methods inherited from class com.webobjects.eointerface.cocoa.EOCocoaSimpleTextPlugin
hasChanges, saveEdits, setHasChanges, widgetKeysTaken
 
Methods inherited from class com.webobjects.eointerface.EOValueAssociation.ValuePlugin
useURLAsValue
 
Methods inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
association, dispose, unacceptableAspects, widget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOCocoaTextFieldPlugin

public EOCocoaTextFieldPlugin(EOWidgetAssociation association,
                              Object widget)
Creates a new EOCocoaTextFieldPlugin for use with association and widget.
Parameters:
association - EOValueAssociation for this plugin to communicate with
widget - the NSTextField or NSMatrix object for this plugin to manage
Method Detail

breakConnection

public void breakConnection()
Tells the plugin to halt communication with its NSTextField object. This makes sure that actions from the text field widget don't get to this plugin.
Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

endEditing

public boolean endEditing()
Asks the plugin to halt editing of its widget in the UI.
Overrides:
endEditing in class EOValueAssociation.ValuePlugin
Returns:
true if editing ended successfully, false if the widget would not allow editing to end, typically because of a formatting error

establishConnection

public void establishConnection()
Establishes a connection between the plugin and its UI widget. This makes sure that actions from the text field widget are sent to this plugin.
Overrides:
establishConnection in class EOCocoaSimpleTextPlugin

setColors

public void setColors(Object textColor,
                      Object bgColor)
Sets the text and background colors for the text field this plugin manages.
Overrides:
setColors in class EOTextAssociation.TextPlugin
Parameters:
textColor - NSColor object to use to set the text field's text color
bgColor - NSColor object to use to set teh text field's background color

setFontProperties

public void setFontProperties(int boldState,
                              int italicState)
Sets the bold and italic properties for this plugin's text fields.
Overrides:
setFontProperties in class EOTextAssociation.TextPlugin
Parameters:
boldState - If EOAssociation.IgnoreValue, the bold state of the text field's text is not changed. If EOAssociation.SetValue, the text of the text field will be bold. If EOAssociation.UnsetValue, the text of the text field will not be bold.
italicState - If EOAssociation.IgnoreValue, the italic state of the text field's text is not changed. If EOAssociation.SetValue, the text of the text field will be italic. If EOAssociation.UnsetValue, the text of the text field will not be italic.

setValue

public void setValue(Object value,
                     boolean enabled)
Sets the attributes of this plugin's text field based on value and isEnabled.
Overrides:
setValue in class EOValueAssociation.ValuePlugin
Parameters:
value - Object to use as display text in this plugin's text field
editable - if true, the text field will be editable; if false, editing the contents of the text field will be disabled, but the text will always be selectable

setValueFormatter

public void setValueFormatter(Object formatter)
Sets the formatter used to format values in the interface. In Cocoa, formatters should be set on the text field or matrix in your nib file using Interface Builder.
Specified by:
setValueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Parameters:
formatter - NSFormatter used to format values in the interface

value

public Object value()
Overrides:
value in class EOValueAssociation.ValuePlugin
Returns:
String contents of this plugin's text field widget

valueFormatter

public Object valueFormatter()
Description copied from interface: EOWidgetAssociation.WidgetPlugin.Formatting
Returns the formatter object of the receiver.
Specified by:
valueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Returns:
NSFormatter used to format values in the interface

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.