WebObjects 5.2.3

com.webobjects.eointerface.swing
Class EOSwingTableColumnPlugin

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
      extended bycom.webobjects.eointerface.EOTableColumnAssociation.TableColumnPlugin
          extended bycom.webobjects.eointerface.swing.EOSwingTableColumnPlugin
All Implemented Interfaces:
EOWidgetAssociation.WidgetPlugin.Formatting, EventListener, NSDisposable, TableColumnModelListener

public class EOSwingTableColumnPlugin
extends EOTableColumnAssociation.TableColumnPlugin
implements TableColumnModelListener, EOWidgetAssociation.WidgetPlugin.Formatting

EOSwingTableColumnPlugin is a concrete subclass of EOTableColumnAssociation.TableColumnPlugin which is used with Swing table columns.

associations classes: EOTableColumnAssociation

widgets classes: TableColumn


Nested Class Summary
static interface EOSwingTableColumnPlugin.TableColumnCustomizer
          Use this interface to implement your custom TableColumnCustomizer which will be used to obtain the CellRenderer and CellEditor for this plugin's column.
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOSwingTableColumnPlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOSwingTableColumnPlugin connected to an association and a UI widget.
 
Method Summary
 void breakConnection()
          Clean up (end) the plugin's connection to its TableColumn widget.
 void columnAdded(TableColumnModelEvent event)
          Conformance to TableColumnListener API.
 int columnIndexInTable()
          Returns the index of this plugin's column in its table.
 void columnMarginChanged(ChangeEvent event)
          Conformance to ChangeListener API.
 void columnMoved(TableColumnModelEvent event)
          Conformance to TableColumnListener API.
 void columnRemoved(TableColumnModelEvent event)
          Conformance to TableColumnListener API.
 void columnSelectionChanged(ListSelectionEvent event)
          Conformance to ListSelectionListener API.
 Object displayValueForValue(Object value)
          Formats a data value for display (using a Format object, if available).
 boolean endEditing()
          Called to halt editing of this widget.
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 boolean isEditable()
          Whether the TableColumn is editable
static void setTableColumnCustomizer(EOSwingTableColumnPlugin.TableColumnCustomizer tableColumnCustomizer)
          This method sets the TableColumnCustomizer which will be used to obtain the CellRenderer and CellEditor for this plugin's column.
 void setValueFormatter(Object formatter)
          Set formatter as the Format for this plugin column's values
 Object table()
          Returns the table containing the plugin's table column.
 EOTableAssociation tableAssociation()
          Returns the table association of the table containing this plugin's column.
static EOSwingTableColumnPlugin.TableColumnCustomizer tableColumnCustomizer()
          Returns the TableColumnCustomizer which is used to obtain the CellRenderer and CellEditor for this plugin's column.
 Object valueForDisplayValue(Object displayValue)
          This method performs the reverse operation of formatting, that is, it returns the data value for a displayed value by using the Format's parseObject method.
 Object valueFormatter()
          Returns the formatter for this plugin's column
 String[] widgetKeysTaken()
          Returns an array of Strings which represent outlet names in Interface Builder These outlets are disabled by Interface Builder once the TableColumn 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

EOSwingTableColumnPlugin

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

Parameters:
association - association of class EOTableColumnAssociation or subclass for the plugin to use
widget - widget of class TableColumn or subclass that the plugin will manage
Method Detail

breakConnection

public void breakConnection()
Clean up (end) the plugin's connection to its TableColumn widget. This also removes the specific CellEditor and CellRenderer being used.

Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

columnAdded

public void columnAdded(TableColumnModelEvent event)
Conformance to TableColumnListener API.

Specified by:
columnAdded in interface TableColumnModelListener
Parameters:
event - the TableColumnModelEvent received from the AWT event dispatcher

columnIndexInTable

public int columnIndexInTable()
Returns the index of this plugin's column in its table.

Specified by:
columnIndexInTable in class EOTableColumnAssociation.TableColumnPlugin
Returns:
int the index of the column

columnMarginChanged

public void columnMarginChanged(ChangeEvent event)
Conformance to ChangeListener API.

Specified by:
columnMarginChanged in interface TableColumnModelListener
Parameters:
event - the ChangeEvent received from the AWT event dispatcher

columnMoved

public void columnMoved(TableColumnModelEvent event)
Conformance to TableColumnListener API.

Specified by:
columnMoved in interface TableColumnModelListener
Parameters:
event - the TableColumnModelEvent received from the AWT event dispatcher

columnRemoved

public void columnRemoved(TableColumnModelEvent event)
Conformance to TableColumnListener API.

Specified by:
columnRemoved in interface TableColumnModelListener
Parameters:
event - the TableColumnModelEvent received from the AWT event dispatcher

columnSelectionChanged

public void columnSelectionChanged(ListSelectionEvent event)
Conformance to ListSelectionListener API.

Specified by:
columnSelectionChanged in interface TableColumnModelListener
Parameters:
event - the ListSelectionEvent received from the AWT event dispatcher

displayValueForValue

public Object displayValueForValue(Object value)
Formats a data value for display (using a Format object, if available).

Specified by:
displayValueForValue in class EOTableColumnAssociation.TableColumnPlugin
Parameters:
value - the data value to be displayed
Returns:
the value formatted for display

endEditing

public boolean endEditing()
Called to halt editing of this widget. (The call is forwarded to the cellEditor, if it exists.)

Overrides:
endEditing in class EOTableColumnAssociation.TableColumnPlugin
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. Sets up the CellRenderer and CellEditor. See the documentation for setTableColumnCustomizer, since it should be called before establishConnection in order to be effective.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin
See Also:
setTableColumnCustomizer(com.webobjects.eointerface.swing.EOSwingTableColumnPlugin.TableColumnCustomizer)

isEditable

public boolean isEditable()
Whether the TableColumn is editable

Specified by:
isEditable in class EOTableColumnAssociation.TableColumnPlugin
Returns:
a flag indicating whether this column is editable (whether a cellEditor is assigned)

setTableColumnCustomizer

public static void setTableColumnCustomizer(EOSwingTableColumnPlugin.TableColumnCustomizer tableColumnCustomizer)
This method sets the TableColumnCustomizer which will be used to obtain the CellRenderer and CellEditor for this plugin's column. The TableColumnCustomizer should be set before establishConnection is called, otherwise the internal defaultTableColumnCustomizer is used which returns a EOTextColumnEditor and a DefaultTableCellRenderer. See also the documentation for the interface TableColumnCustomizer.

Parameters:
tableColumnCustomizer - the TableColumnCustomizer to be used for this plugin's column

setValueFormatter

public void setValueFormatter(Object formatter)
Set formatter as the Format for this plugin column's values

Specified by:
setValueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Parameters:
formatter - of type Object (it is cast to type Format)

table

public Object table()
Returns the table containing the plugin's table column. This method always returns null. You have to explicitly set table on the column association.

Specified by:
table in class EOTableColumnAssociation.TableColumnPlugin
Returns:
Object always returns null

tableAssociation

public EOTableAssociation tableAssociation()
Returns the table association of the table containing this plugin's column.

Specified by:
tableAssociation in class EOTableColumnAssociation.TableColumnPlugin
Returns:
EOTableAssociation an association for the table, if available, otherwise null

tableColumnCustomizer

public static EOSwingTableColumnPlugin.TableColumnCustomizer tableColumnCustomizer()
Returns the TableColumnCustomizer which is used to obtain the CellRenderer and CellEditor for this plugin's column.

Returns:
TableColumnCustomizer the TableColumnCustomizer for this plugin's column

valueForDisplayValue

public Object valueForDisplayValue(Object displayValue)
This method performs the reverse operation of formatting, that is, it returns the data value for a displayed value by using the Format's parseObject method. Note that there maybe a loss of precision or detail depending on the display value.

Specified by:
valueForDisplayValue in class EOTableColumnAssociation.TableColumnPlugin
Parameters:
displayValue - the (String) value as it was displayed and/or entered by the user
Returns:
the data value parsed from the display value.

valueFormatter

public Object valueFormatter()
Returns the formatter for this plugin's column

Specified by:
valueFormatter in interface EOWidgetAssociation.WidgetPlugin.Formatting
Returns:
the formatter for this plugin's column

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 TableColumn 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.