WebObjects 5.2.3

com.webobjects.eointerface.swing
Class EOSwingTextPlugin

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
      extended bycom.webobjects.eointerface.EOValueAssociation.ValuePlugin
          extended bycom.webobjects.eointerface.EOTextAssociation.TextPlugin
              extended bycom.webobjects.eointerface.swing.EOSwingTextPlugin
All Implemented Interfaces:
DocumentListener, EOWidgetAssociation.WidgetPlugin.Formatting, EventListener, FocusListener, NSDisposable

public class EOSwingTextPlugin
extends EOTextAssociation.TextPlugin
implements FocusListener, DocumentListener, EOWidgetAssociation.WidgetPlugin.Formatting

EOSwingTextPlugin is a concrete subclass of EOTextAssociation.TextPlugin which is used a Swing JTextComponent (or a EOTextComponentAccess, which includes a JTextComponent).

Associations classes: EOTextAssociation

Widgets classes: JTextComponent (EOTextField) or EOTextComponentAccess (EOTextField, EOTextArea, EOFormCell)

value classes: String or other classes with formatters (Numbers with NSNumberFormatter, NSTimestamp with NSTimestampFormatter)


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOSwingTextPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOSwingTextPlugin connected to an association and a UI widget.
 
Method Summary
 void breakConnection()
          Cleans up (ends) the plugin's connection to its JTextComponent widget.
 void changedUpdate(DocumentEvent event)
          Conforming to DocumentListener.
 boolean endEditing()
          Called to halt editing of this plugin's widget.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 void focusGained(FocusEvent event)
          Conforming to FocusListener.
 void focusLost(FocusEvent event)
          Conforming to FocusListener.
 void insertUpdate(DocumentEvent event)
          Conforming to DocumentListener.
 void removeUpdate(DocumentEvent event)
          Conforming to DocumentListener.
 void setColors(Object textColor, Object bgColor)
          Sets the colors of the text widget.
 void setFontProperties(int boldState, int italicState)
          Sets the font properties of the text widget.
 void setValue(Object value, boolean isEnabled)
          Sets value as the object to display in the plugin's widget .
 void setValueFormatter(Object formatter)
          Set the formatter for this plugin's text component.
 Object value()
          Returns the value of the text widget.
 Object valueFormatter()
          Returns the Format for this plugin's text component.
 String[] widgetKeysTaken()
          Returns an array of Strings which represent outlet names in Interface Builder These outlets are disabled by Interface Builder once the button is connected to this plugins association.
 
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

EOSwingTextPlugin

public EOSwingTextPlugin(EOWidgetAssociation association,
                         Object widget)
Creates a new EOSwingTextPlugin connected to an association and a UI widget.

Parameters:
association - association of class EOTextAssociation or subclass for the plugin to use
widget - widget of class JTextComponent or subclass, or a subclass of EOTextComponentAccess (which includes a JTextComponent), that the plugin will manage.
Method Detail

breakConnection

public void breakConnection()
Cleans up (ends) the plugin's connection to its JTextComponent widget. This also makes sure that FocusEvent's from the JTextComponent are not sent anymore to this plugin.

Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

changedUpdate

public void changedUpdate(DocumentEvent event)
Conforming to DocumentListener. Invokes EOValueAssociation.widgetDidBeginEditing.

Specified by:
changedUpdate in interface DocumentListener
Parameters:
event - the DocumentEvent received from the AWT event dispatcher

endEditing

public boolean endEditing()
Called to halt editing of this plugin's widget.

Overrides:
endEditing in class EOValueAssociation.ValuePlugin
Returns:
true if editing ended successfully, false if this 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 also makes sure that FocusEvent's from the JTextComponent are sent to this plugin.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

focusGained

public void focusGained(FocusEvent event)
Conforming to FocusListener.

Specified by:
focusGained in interface FocusListener
Parameters:
event - the FocusEvent received from the AWT event dispatcher

focusLost

public void focusLost(FocusEvent event)
Conforming to FocusListener. Invokes EOValueAssociation.widgetDidEndEditing.

Specified by:
focusLost in interface FocusListener
Parameters:
event - the FocusEvent received from the AWT event dispatcher

insertUpdate

public void insertUpdate(DocumentEvent event)
Conforming to DocumentListener. Invokes EOValueAssociation.widgetDidBeginEditing.

Specified by:
insertUpdate in interface DocumentListener
Parameters:
event - the DocumentEvent received from the AWT event dispatcher

removeUpdate

public void removeUpdate(DocumentEvent event)
Conforming to DocumentListener. Invokes EOValueAssociation.widgetDidBeginEditing.

Specified by:
removeUpdate in interface DocumentListener
Parameters:
event - the DocumentEvent received from the AWT event dispatcher

setColors

public void setColors(Object textColor,
                      Object bgColor)
Sets the colors of the text widget.

Specified by:
setColors in class EOTextAssociation.TextPlugin
Parameters:
textColor - not currently implemented
bgColor - the background color, an object of the Swing class Color

setFontProperties

public void setFontProperties(int boldState,
                              int italicState)
Sets the font properties of the text widget.

Specified by:
setFontProperties in class EOTextAssociation.TextPlugin
Parameters:
boldState - not currently implemented
italicState - not currently implemented

setValue

public void setValue(Object value,
                     boolean isEnabled)
Sets value as the object to display in the plugin's widget .

Specified by:
setValue in class EOValueAssociation.ValuePlugin
Parameters:
value - the new value for the text widget, a String or other classes with formatters (Numbers with NSNumberFormatter, NSTimestamp with NSTimestampFormatter)
isEnabled - enables or disables editability of the text widget

setValueFormatter

public void setValueFormatter(Object formatter)
Set the formatter for this plugin's text component.

Specified by:
setValueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Parameters:
formatter - of type Format

value

public Object value()
Returns the value of the text widget.

Specified by:
value in class EOValueAssociation.ValuePlugin
Returns:
value a String or other classes as returned by the formatter's parseObject method

valueFormatter

public Object valueFormatter()
Returns the Format for this plugin's text component.

Specified by:
valueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Returns:
the formatter for this plugin's widget, if one exists

widgetKeysTaken

public String[] widgetKeysTaken()
Returns an array of Strings which represent outlet names in Interface Builder These outlets are disabled by Interface Builder once the button is connected to this plugins association.

Overrides:
widgetKeysTaken in class EOWidgetAssociation.WidgetPlugin
Returns:
String array of outlet names

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.