WebObjects 5.2.3

com.webobjects.eointerface.cocoa
Class EOCocoaTableColumnPlugin

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
      extended bycom.webobjects.eointerface.EOTableColumnAssociation.TableColumnPlugin
          extended bycom.webobjects.eointerface.cocoa.EOCocoaTableColumnPlugin
All Implemented Interfaces:
EOWidgetAssociation.WidgetPlugin.Formatting, NSDisposable

public class EOCocoaTableColumnPlugin
extends EOTableColumnAssociation.TableColumnPlugin
implements EOWidgetAssociation.WidgetPlugin.Formatting

EOCocoaTableColumnPlugin is used in Cocoa applications to connect NSTableColumns to table column associations. This plugin coordinates updating and getting values from the NSCells of its table column, as well as reporting which cells are selected.

Usage:
Association classes: EOTableColumnAssociation
Widget classes: NSTableColumn


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOCocoaTableColumnPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOCocoaTableColumnPlugin for use with association and widget.
 
Method Summary
 void breakConnection()
          Tells the plugin to halt communication with its NSTableColumn object.
 int columnIndexInTable()
          Gets the positional index of the plugin's column.
 boolean controlDidFailToFormatStringErrorDescription(com.apple.cocoa.application.NSControl control, String string, String error)
          See the description of this method in com.apple.cocoa.NSControl.Delegate.
 boolean controlIsValidObject(com.apple.cocoa.application.NSControl control, Object object)
          See the description of this method in com.apple.cocoa.NSControl.Delegate.
 void controlTextDidChange(com.apple.cocoa.foundation.NSNotification notification)
          See the description of this method in com.apple.cocoa.NSControl.Notifications.
 boolean controlTextShouldBeginEditing(com.apple.cocoa.application.NSControl control, com.apple.cocoa.application.NSText fieldEditor)
          See the description of this method in com.apple.cocoa.NSControl.Delegate.
 boolean controlTextShouldEndEditing(com.apple.cocoa.application.NSControl control, com.apple.cocoa.application.NSText fieldEditor)
          See the description of this method in com.apple.cocoa.NSControl.Delegate.
 Object displayValueForValue(Object dataValue)
          Returns the display value to set in the interface, given a data value from a data source.
 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.
 boolean isEditable()
          Asks the plugin if the widget it manages supports the concept of editing.
 boolean saveEdits(Object value)
          Saves value to this plugin's association for the object displayed in the edited row.
 void setValueFormatter(Object formatter)
          Sets the formatter used to format values in the interface.
 Object table()
          Gets the NSTableView object that contains this plugin's NSTableColumn object.
 EOTableAssociation tableAssociation()
          Gets the EOTableAssociation object that manages the table that contains this plugin's NSTableColumn.
 Object tableViewObjectValueForLocation(com.apple.cocoa.application.NSTableView view, com.apple.cocoa.application.NSTableColumn column, int index)
          See the description of this method in com.apple.cocoa.application.NSTableView.DataSource.
 void tableViewSetObjectValueForLocation(com.apple.cocoa.application.NSTableView view, Object object, com.apple.cocoa.application.NSTableColumn column, int rowIndex)
          See the description of this method in com.apple.cocoa.application.NSTableView.DataSource.
 void tableViewWillDisplayCell(com.apple.cocoa.application.NSTableView view, Object cell, com.apple.cocoa.application.NSTableColumn column, int rowIndex)
          See the description of this method in com.apple.cocoa.application.NSTableView.Delegate.
 Object valueForDisplayValue(Object displayValue)
          Returns the data value to set in the association, given a display value from the interface.
 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

EOCocoaTableColumnPlugin

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

Parameters:
association - EOTableColumnAssociation for this plugin to communicate with
widget - the NSTableColumn object for this plugin to manage
Method Detail

breakConnection

public void breakConnection()
Tells the plugin to halt communication with its NSTableColumn object. This makes sure that actions from the NSTableColumn don't get to this plugin.

Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

columnIndexInTable

public int columnIndexInTable()
Gets the positional index of the plugin's column.

Specified by:
columnIndexInTable in class EOTableColumnAssociation.TableColumnPlugin
Returns:
positional index of the plugin's table column in its table view; 0 is the first column on the left, -1 if this column isn't in a table view

controlDidFailToFormatStringErrorDescription

public boolean controlDidFailToFormatStringErrorDescription(com.apple.cocoa.application.NSControl control,
                                                            String string,
                                                            String error)
See the description of this method in com.apple.cocoa.NSControl.Delegate.


controlIsValidObject

public boolean controlIsValidObject(com.apple.cocoa.application.NSControl control,
                                    Object object)
See the description of this method in com.apple.cocoa.NSControl.Delegate.


controlTextDidChange

public void controlTextDidChange(com.apple.cocoa.foundation.NSNotification notification)
See the description of this method in com.apple.cocoa.NSControl.Notifications.


controlTextShouldBeginEditing

public boolean controlTextShouldBeginEditing(com.apple.cocoa.application.NSControl control,
                                             com.apple.cocoa.application.NSText fieldEditor)
See the description of this method in com.apple.cocoa.NSControl.Delegate.


controlTextShouldEndEditing

public boolean controlTextShouldEndEditing(com.apple.cocoa.application.NSControl control,
                                           com.apple.cocoa.application.NSText fieldEditor)
See the description of this method in com.apple.cocoa.NSControl.Delegate.


displayValueForValue

public Object displayValueForValue(Object dataValue)
Returns the display value to set in the interface, given a data value from a data source. Subclasses can override this method to alter what value is pushed to the user interface. For instance, string values can be beautified or have explicit language filtered. By default, this method returns a com.apple.cocoa.foundation.NSGregorianDate for any instance of value that is a com.webobjects.foundation.NSTimestamp. You should call the super implementation of this method in your subclass's implementation.

Specified by:
displayValueForValue in class EOTableColumnAssociation.TableColumnPlugin
Parameters:
dataValue - value to use in generating a value suitable for use in the display
Returns:
an object suitable for use in the display

endEditing

public boolean endEditing()
Asks the plugin to halt editing of its widget in the UI.

Overrides:
endEditing in class EOTableColumnAssociation.TableColumnPlugin
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 NSImageView are sent to this plugin.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

isEditable

public boolean isEditable()
Asks the plugin if the widget it manages supports the concept of editing.

Specified by:
isEditable in class EOTableColumnAssociation.TableColumnPlugin
Returns:
default implementation returns true

saveEdits

public boolean saveEdits(Object value)
Saves value to this plugin's association for the object displayed in the edited row. Returns a boolean value indicating whether or not the new value was successfully set in the plugin's association.

Parameters:
value - an object to set on the table column's selected enterprise object
Returns:
false if setting the value in the association failed; true if the operation succeeded, or if there were no edits to save

setValueFormatter

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

table

public Object table()
Gets the NSTableView object that contains this plugin's NSTableColumn object.

Specified by:
table in class EOTableColumnAssociation.TableColumnPlugin
Returns:
the table view object that contains this plugin's table column

tableAssociation

public EOTableAssociation tableAssociation()
Gets the EOTableAssociation object that manages the table that contains this plugin's NSTableColumn.

Specified by:
tableAssociation in class EOTableColumnAssociation.TableColumnPlugin
Returns:
the table view object that contains this plugin's table column

tableViewObjectValueForLocation

public Object tableViewObjectValueForLocation(com.apple.cocoa.application.NSTableView view,
                                              com.apple.cocoa.application.NSTableColumn column,
                                              int index)
See the description of this method in com.apple.cocoa.application.NSTableView.DataSource.


tableViewSetObjectValueForLocation

public void tableViewSetObjectValueForLocation(com.apple.cocoa.application.NSTableView view,
                                               Object object,
                                               com.apple.cocoa.application.NSTableColumn column,
                                               int rowIndex)
See the description of this method in com.apple.cocoa.application.NSTableView.DataSource.


tableViewWillDisplayCell

public void tableViewWillDisplayCell(com.apple.cocoa.application.NSTableView view,
                                     Object cell,
                                     com.apple.cocoa.application.NSTableColumn column,
                                     int rowIndex)
See the description of this method in com.apple.cocoa.application.NSTableView.Delegate.


valueForDisplayValue

public Object valueForDisplayValue(Object displayValue)
Returns the data value to set in the association, given a display value from the interface. Subclasses can override this method to alter the value that is pushed to the association. For instance, string values can be beautified or have explicit language filtered.

By default, this method returns a com.webobjects.foundation.NSTimestamp for any instance of displayValue that is a com.apple.cocoa.foundation.NSGregorianDate You should call the super implementation of this method in your subclass's implementation.

Specified by:
valueForDisplayValue in class EOTableColumnAssociation.TableColumnPlugin
Parameters:
displayValue - value to use in generating a value suitable for setting in the association
Returns:
an object suitable for pushing to the association

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

EOCocoaImageViewPlugin takes over the outlet with key "identifier".

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.