WebObjects 5.2.3

com.webobjects.eointerface.swing
Class EOSwingTablePlugin

java.lang.Object
  extended bycom.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
      extended bycom.webobjects.eointerface.EOTableAssociation.TablePlugin
          extended bycom.webobjects.eointerface.swing.EOSwingTablePlugin
All Implemented Interfaces:
EventListener, ListSelectionListener, NSDisposable, TableColumnModelListener

public class EOSwingTablePlugin
extends EOTableAssociation.TablePlugin
implements ListSelectionListener, TableColumnModelListener

EOSwingTablePlugin is a concrete subclass of EOTableAssociation.TablePlugin which is used with Swing tables.

associations classes: EOTableAssociation

widgets classes: EOTable, JTable (an EOTable contains a JTable inside)


Nested Class Summary
 
Nested classes inherited from class com.webobjects.eointerface.EOWidgetAssociation.WidgetPlugin
EOWidgetAssociation.WidgetPlugin.Formatting
 
Constructor Summary
EOSwingTablePlugin(EOWidgetAssociation association, Object widget)
          Creates a new EOSwingTablePlugin connected to an association and a UI widget.
 
Method Summary
 void breakConnection()
          Cleans up (ends) the plugin's connection to its TableColumn widget, removing the listeners and resetting the TableModel to an instance of DefaultTableModel.
 void columnAdded(TableColumnModelEvent event)
          Conformance to ColumnModelListener.
 void columnMarginChanged(ChangeEvent event)
          Conformance to ColumnModelListener.
 void columnMoved(TableColumnModelEvent event)
          Conformance to ColumnModelListener.
 void columnRemoved(TableColumnModelEvent event)
          Conformance to ColumnModelListener.
 void columnSelectionChanged(ListSelectionEvent event)
          Conformance to ListSelectionListener.
 int editingColumnIndex()
          Returns the column being edited.
 int editingRowIndex()
          Returns the index of the row being edited
 void establishConnection()
          Establishes a connection between the plugin and its UI widget.
 EOTableAssociation existingTableAssociation()
          Returns the EOTableAssociation for this plugin's table.
 int numberOfColumns()
          Returns the table's number of columns.
 int[] selectionIndexes()
          Returns an array with the indexes of the selected rows.
 EOTableColumnAssociation tableColumnAssociationForColumnAtIndex(int columnIndex)
          Returns the EOTableColumnAssociation for the column at the specified index.
 void updateSelectionIndexes(int[] selectedRowIndexes)
          This method notifies the table plugin that the table's selection has changed It is called internally by the EOTableAssociation.
 void updateTableContents(int numberOfRows)
          This method notifies the table plugin that the table's data has changed.
 void valueChanged(ListSelectionEvent event)
          Conforming to ListSelectionListener API.
 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 plugin's 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

EOSwingTablePlugin

public EOSwingTablePlugin(EOWidgetAssociation association,
                          Object widget)
Creates a new EOSwingTablePlugin 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 EOTable or JTable or subclass that the plugin will manage
Method Detail

breakConnection

public void breakConnection()
Cleans up (ends) the plugin's connection to its TableColumn widget, removing the listeners and resetting the TableModel to an instance of DefaultTableModel.

Overrides:
breakConnection in class EOWidgetAssociation.WidgetPlugin

columnAdded

public void columnAdded(TableColumnModelEvent event)
Conformance to ColumnModelListener. Invokes tableDidChangeColumns on the plugin's EOTableAssociation.

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

columnMarginChanged

public void columnMarginChanged(ChangeEvent event)
Conformance to ColumnModelListener.

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

columnMoved

public void columnMoved(TableColumnModelEvent event)
Conformance to ColumnModelListener. Invokes tableDidChangeColumns on the plugin's EOTableAssociation.

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

columnRemoved

public void columnRemoved(TableColumnModelEvent event)
Conformance to ColumnModelListener. Invokes tableDidChangeColumns on the plugin's EOTableAssociation.

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.

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

editingColumnIndex

public int editingColumnIndex()
Returns the column being edited.

Specified by:
editingColumnIndex in class EOTableAssociation.TablePlugin
Returns:
the index of the column being edited

editingRowIndex

public int editingRowIndex()
Returns the index of the row being edited

Specified by:
editingRowIndex in class EOTableAssociation.TablePlugin
Returns:
the index of the row being edited

establishConnection

public void establishConnection()
Establishes a connection between the plugin and its UI widget.

Overrides:
establishConnection in class EOWidgetAssociation.WidgetPlugin

existingTableAssociation

public EOTableAssociation existingTableAssociation()
Returns the EOTableAssociation for this plugin's table.

Specified by:
existingTableAssociation in class EOTableAssociation.TablePlugin
Returns:
the EOTableAssociation for table

numberOfColumns

public int numberOfColumns()
Returns the table's number of columns.

Specified by:
numberOfColumns in class EOTableAssociation.TablePlugin
Returns:
the number of columns

selectionIndexes

public int[] selectionIndexes()
Returns an array with the indexes of the selected rows.

Specified by:
selectionIndexes in class EOTableAssociation.TablePlugin
Returns:
an array (of type int[]) with as many elements as there are rows selected (for multiple row selections); if no row is selected, will return an arrray of length 0

tableColumnAssociationForColumnAtIndex

public EOTableColumnAssociation tableColumnAssociationForColumnAtIndex(int columnIndex)
Returns the EOTableColumnAssociation for the column at the specified index.

Specified by:
tableColumnAssociationForColumnAtIndex in class EOTableAssociation.TablePlugin
Parameters:
columnIndex - the index of the column of interest
Returns:
the index of the column

updateSelectionIndexes

public void updateSelectionIndexes(int[] selectedRowIndexes)
This method notifies the table plugin that the table's selection has changed It is called internally by the EOTableAssociation.

Specified by:
updateSelectionIndexes in class EOTableAssociation.TablePlugin
Parameters:
selectedRowIndexes - an array (of type int[]) with as many elements as there are rows selected (allowing multiple rows selected); each element is an index of one of the selected rows; to de-select all rows, use an array of length 0

updateTableContents

public void updateTableContents(int numberOfRows)
This method notifies the table plugin that the table's data has changed. It is called internally by the EOTableAssociation.

Specified by:
updateTableContents in class EOTableAssociation.TablePlugin
Parameters:
numberOfRows - this parameter is currently ignored

valueChanged

public void valueChanged(ListSelectionEvent event)
Conforming to ListSelectionListener API. Invokes EOTableAssociation's tableDidChangeSelection method.

Specified by:
valueChanged in interface ListSelectionListener
Parameters:
event - the Event sent by the SelectionModel

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 plugin's 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.