WebObjects 5.2

com.webobjects.eointerface.swing
Class EOSwingComboBoxPlugin

java.lang.Object
  |
  +--com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
        |
        +--com.webobjects.eointerface.EOValueSelectionAssociation.ValueSelectionPlugin
              |
              +--com.webobjects.eointerface.swing.EOSwingComboBoxPlugin
All Implemented Interfaces:
ActionListener, EOWidgetAssociation.WidgetPlugin.Formatting, EventListener, NSDisposable

public class EOSwingComboBoxPlugin
extends EOValueSelectionAssociation.ValueSelectionPlugin
implements ActionListener, EOWidgetAssociation.WidgetPlugin.Formatting

EOSwingComboBoxPlugin is a concrete subclass of EOValueSelectionAssociation.ValueSelectionPlugin which is used with Swing's JComboBox.

Associations classes: EOValueSelectionAssociation

Widgets classes: JComboBox


Inner classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Fields inherited from class com.webobjects.eointerface.EOValueSelectionAssociation.ValueSelectionPlugin
NoSelection
 
Constructor Summary
EOSwingComboBoxPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOSwingComboBoxPlugin connected to an association and a UI widget.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Invokes widgetSelectionDidChange on this plugin's EOValueSelectionAssociation.
 void breakConnection()
          Clean up (end) the plugin's connection to its JComboBox widget.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 int selectionIndex()
          Returns the selected choice in the JComboBox.
 void setSelectionIndex(int selectionIndex, boolean isEnabled)
          Sets the selected choice and whether the JCombobox is enabled
 void setTitlesFromObjects(Object[] objects)
          Sets the titles in the plugin's JComboBox.
 void setValueFormatter(Object formatter)
          Sets a formatter for the available choices (titles) in the JComboBox, which will format an array of objects coming from the EOValueSelectionAssociation into displayed strings.
 String[] titles()
          Returns an array of available titles in the plugin's combo box
 Object valueFormatter()
          Returns the format set with setValueFormatter.
 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.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

EOSwingComboBoxPlugin

public EOSwingComboBoxPlugin(EOWidgetAssociation association,
                             Object widget)
Creates a new EOSwingComboBoxPlugin connected to an association and a UI widget.
Parameters:
association - Association of class EOValueSelectionAssociation or subclass for the plugin to use
widget - Widget of class JComboBox or subclass that the plugin will manage
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Invokes widgetSelectionDidChange on this plugin's EOValueSelectionAssociation.
Specified by:
actionPerformed in interface ActionListener
Parameters:
event - the ActionEvent received from the AWT event dispatcher

breakConnection

public void breakConnection()
Clean up (end) the plugin's connection to its JComboBox widget. This makes sure that action events from the JComboBox are not sent anymore to this plugin.
Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

establishConnection

public void establishConnection()
Establishes a connection between the plugin and its UI widget. This makes sure that action events from the JComboBox are sent to this plugin.
Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

selectionIndex

public int selectionIndex()
Returns the selected choice in the JComboBox.
Overrides:
selectionIndex in class EOValueSelectionAssociation.ValueSelectionPlugin
Returns:
the selected choice as an index into the array of titles.

setSelectionIndex

public void setSelectionIndex(int selectionIndex,
                              boolean isEnabled)
Sets the selected choice and whether the JCombobox is enabled
Overrides:
setSelectionIndex in class EOValueSelectionAssociation.ValueSelectionPlugin
Parameters:
selectionIndex - the selected choice, as an index into the array of titles
isEnabled - whether or not the JComboBox will be enabled

setTitlesFromObjects

public void setTitlesFromObjects(Object[] objects)
Sets the titles in the plugin's JComboBox.

If objects is null, clear out titles -- (only invoked if EOAssociation.TitlesAspect is bound).

Overrides:
setTitlesFromObjects in class EOValueSelectionAssociation.ValueSelectionPlugin
Parameters:
objects - an object array of the choices to display in the combo box

setValueFormatter

public void setValueFormatter(Object formatter)
Sets a formatter for the available choices (titles) in the JComboBox, which will format an array of objects coming from the EOValueSelectionAssociation into displayed strings.
Specified by:
setValueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Parameters:
formatter - an object of class Format or subclass whose format(Object) method will be called for each title displayed

titles

public String[] titles()
Returns an array of available titles in the plugin's combo box
Overrides:
titles in class EOValueSelectionAssociation.ValueSelectionPlugin
Returns:
String array of available titles in the plugin's combo box

valueFormatter

public Object valueFormatter()
Returns the format set with setValueFormatter.
Specified by:
valueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Returns:
the format, which is an instance of Format or a subclass

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 Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.