WebObjects 5.2.3

com.webobjects.eointerface.cocoa
Class EOCocoaRadioMatrixPlugin

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
      extended bycom.webobjects.eointerface.EOValueSelectionAssociation.ValueSelectionPlugin
          extended bycom.webobjects.eointerface.cocoa.EOCocoaRadioMatrixPlugin
All Implemented Interfaces:
EOWidgetAssociation.WidgetPlugin.Formatting, NSDisposable

public class EOCocoaRadioMatrixPlugin
extends EOValueSelectionAssociation.ValueSelectionPlugin
implements EOWidgetAssociation.WidgetPlugin.Formatting

EOCocoaRadioMatrixPlugin is used in Cocoa applications to connect matrices of radio buttons to value selection associations. This plugin handles setting the list of titles of the radio butons on behalf of its association and handles reporting the selection index to its association. You can populate the radio button list by hand in Interface Builder. In that case, do not bind the titles aspect of this plugin's association. When the user changes the selection of the radio button in the interface, this plugin invokes its association's widgetSelectionDidChange method.

Object Keys Taken: target, action When the user chooses an item in the display object, the EOValueSelectionAssociation updates the selected object's property with the item's title, tag, or object.

Usage:
Association classes: EOValueSelectionAssociation
Widget classes: NSMatrix


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Field Summary
 
Fields inherited from class com.webobjects.eointerface.EOValueSelectionAssociation.ValueSelectionPlugin
NoSelection
 
Constructor Summary
EOCocoaRadioMatrixPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOCocoaRadioMatrixPlugin for use with association and widget.
 
Method Summary
 void breakConnection()
          Tells the plugin to halt communication with its NSMatrix object.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 int selectionIndex()
          Returns the index of the item selected in this plugin's radio matrix.
 void setSelectionIndex(int selectionIndex, boolean enabled)
          Selects the item at index selectionIndex in this plugin's radio matrix.
 void setTitlesFromObjects(Object[] titles)
          Sets the radio matrix's list of items to the items of objectArray.
 void setValueFormatter(Object formatter)
          Sets the formatter used to format values in the interface.
 String[] titles()
          Returns the array of Strings used in the radio matrix.
 Object valueFormatter()
          Gets the formatter used to format values in the interface.
 String[] widgetKeysTaken()
          Returns an array of Strings which represent outlet names in Interface Builder.
 
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

EOCocoaRadioMatrixPlugin

public EOCocoaRadioMatrixPlugin(EOWidgetAssociation association,
                                Object widget)
Creates a new EOCocoaRadioMatrixPlugin for use with association and widget.

Parameters:
association - EOValueSelectionAssociation for this plugin to communicate with.
widget - The NSMatrix object for this plugin to manage.
Method Detail

breakConnection

public void breakConnection()
Tells the plugin to halt communication with its NSMatrix object. This makes sure that actions from the NSMatrix don't get 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 actions from the NSMatrix are sent to this plugin.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

selectionIndex

public int selectionIndex()
Returns the index of the item selected in this plugin's radio matrix.

Specified by:
selectionIndex in class EOValueSelectionAssociation.ValueSelectionPlugin
Returns:
index of the item selected in this plugin's radio matrix

setSelectionIndex

public void setSelectionIndex(int selectionIndex,
                              boolean enabled)
Selects the item at index selectionIndex in this plugin's radio matrix.

Specified by:
setSelectionIndex in class EOValueSelectionAssociation.ValueSelectionPlugin
Parameters:
selectionIndex - index of the item to select in this plugin's radio matrix
enabled - if true, the radio matrix is enabled in the interface; if false, the combo box is disabled and the user cannot change the radio matrix's selected item

setTitlesFromObjects

public void setTitlesFromObjects(Object[] titles)
Sets the radio matrix's list of items to the items of objectArray. This method is only invoked if EOAssociation.TitlesAspect is bound in the plugin's association.

Specified by:
setTitlesFromObjects in class EOValueSelectionAssociation.ValueSelectionPlugin
Parameters:
titles - array of objects to use to populate the list of items in the plugin's radio matrix

setValueFormatter

public void setValueFormatter(Object formatter)
Sets the formatter used to format values in the interface. In Cocoa, formatters should be set on the radio 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

titles

public String[] titles()
Returns the array of Strings used in the radio matrix.

Specified by:
titles in class EOValueSelectionAssociation.ValueSelectionPlugin
Returns:
array of String objects displayed to the user in the radio matrix

valueFormatter

public Object valueFormatter()
Gets the formatter used to format values in the interface.

Specified by:
valueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Returns:
NSFormatter used to format values in the interface

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 radio matrix is connected to this plugins association.

EOCocoaRadioMatrixPlugin takes over outlets with keys "action" and "target".

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.