WebObjects 5.2

com.webobjects.eointerface.cocoa
Class EOCocoaTextPlugin

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.EOCocoaTextPlugin
All Implemented Interfaces:
NSDisposable

public class EOCocoaTextPlugin
extends EOCocoaSimpleTextPlugin

EOCocoaTextPlugin is used in Cocoa applications to connect text view widgets to EOTextAssociations.

Usage:
Association classes: EOTextAssociation
Widget classes: NSText
Value classes: String, RTF data, or RTFD data


Inner classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOCocoaTextPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOCocoaTextPlugin for use with association and widget.
 
Method Summary
 void breakConnection()
          Tells the plugin to halt communication with its NSText 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 NSText this plugin manages.
 void setFontProperties(int boldState, int italicState)
          Sets the bold and italic properties for this plugin's NSText object.
 void setValue(Object value, boolean editable)
          Sets the attributes of this plugin's NSText object based on value and isEnabled.
 Object value()
          Returns the text held by this plugin's NSText object.
 
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

EOCocoaTextPlugin

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

breakConnection

public void breakConnection()
Tells the plugin to halt communication with its NSText object. This makes sure that actions from the NSText object 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 NSText object 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 NSText this plugin manages.
Overrides:
setColors in class EOTextAssociation.TextPlugin
Parameters:
textColor - NSColor object to use to set the NSText's text color
bgColor - NSColor object to use to set teh NSText's background color

setFontProperties

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

setValue

public void setValue(Object value,
                     boolean editable)
Sets the attributes of this plugin's NSText object based on value and isEnabled.

value may be a com.webobjects.foundation.NSData object containing RTF or RTFD data. Otherwise, value's toString value is used as the text area's contents. If value is null or if value is NSData but not RTF or RTFD data, the text area's content is empty.

Overrides:
setValue in class EOValueAssociation.ValuePlugin
Parameters:
value - Object to use as display text in this plugin's text area
editable - if true, the text area will be editable; if false, editing the contents of the NSText will be disabled, but the text will always be selectable

value

public Object value()
Returns the text held by this plugin's NSText object. If the NSText object accepts rich text and/or graphics, this method returns a com.webobjects.foundation.NSData object conatining the bytes of the RTF or RTFD representation of the NSText contents.
Overrides:
value in class EOValueAssociation.ValuePlugin
Returns:
the contents of this plugin's NSText object

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

Copyright © 2003 Apple Computer, Inc.