WebObjects 5.2

com.webobjects.eointerface
Class EOTableAssociation

java.lang.Object
  |
  +--com.webobjects.eocontrol.EODelayedObserver
        |
        +--com.webobjects.eointerface.EOAssociation
              |
              +--com.webobjects.eointerface.EOWidgetAssociation
                    |
                    +--com.webobjects.eointerface.EOTableAssociation
All Implemented Interfaces:
EOObserving, NSDisposable

public class EOTableAssociation
extends EOWidgetAssociation

EOTableAssociation associates the contents of its SourceAspect's display group with a NSTableView, JTable or an EOTable (an object that places a javax.swing.JTable in a scroll view), via the repective WidgetPlugin's. Typically, applications won't explicitly instantiate this class, as EOTableColumnAssociation's setTable method assures that an instance exists for its table.

Aspects:

EOAssociation.SourceAspect

EOAssociation.BoldAspect

EOAssociation.ItalicAspect

EOAssociation.TextColorAspect

EOAssociation.EnabledAspect


Inner Class Summary
static class EOTableAssociation.TablePlugin
          TablePlugin communicates with a UI widget (NSTableView, JTable or EOTable, for example) on behalf of an EOTableAssociation.
 
Inner classes inherited from class com.webobjects.eointerface.EOWidgetAssociation
EOWidgetAssociation.WidgetPlugin
 
Fields inherited from class com.webobjects.eointerface.EOAssociation
ActionAspect, ArgumentAspect, AttributeAspectSignature, AttributeToManyAspectSignature, AttributeToOneAspectSignature, AttributeToOneToManyAspectSignature, BackgroundColorAspect, BoldAspect, ChildrenAspect, DestinationAspect, EnabledAspect, ExpandedIconAspect, IconAspect, IgnoreValue, IsLeafAspect, ItalicAspect, MatchKey1Aspect, MatchKey2Aspect, MatchKey3Aspect, NullAspectSignature, ParentAspect, RootAspect, SelectedIndexAspect, SelectedObjectAspect, SelectedTitleAspect, SetValue, SourceAspect, TextColorAspect, TitlesAspect, ToManyAspectSignature, ToOneAspectSignature, ToOneToManyAspectSignature, UnsetValue, URLAspect, ValueAspect
 
Fields inherited from class com.webobjects.eocontrol.EODelayedObserver
ObserverNumberOfPriorities, ObserverPriorityFifth, ObserverPriorityFirst, ObserverPriorityFourth, ObserverPriorityImmediate, ObserverPriorityLater, ObserverPrioritySecond, ObserverPrioritySixth, ObserverPriorityThird
 
Constructor Summary
EOTableAssociation(Object object)
          Creates a new EOTableAssociation to monitor and update the value in aDisplayObject.
 
Method Summary
 int boldStateAtColumnAndRow(int columnIndex, int rowIndex)
          This method returns whether the table cell at the specified row and column is (currently) using a bold font type.
 void dispose()
          Clears all references this association has to other objects especially its display object and EODisplayGroup.
 EOTableColumnAssociation editingTableColumnAssociation()
          If a field in the table is being edited, this method will return the column assocaition for the table column of the edited field.
 boolean isEditableAtColumnAndRow(int columnIndex, int rowIndex)
          This method returns whether the table cell at the specified row and column is editable.
 int italicAtColumnAndRow(int columnIndex, int rowIndex)
          This method returns whether the table cell at the specified row and column is (currently) using a italic font type.
 int numberOfDisplayedObjects()
          Returns the number of diplayed objects (from the source display group).
 String primaryAspect()
          This method returns the primary aspect for this table association.
 void setSortOrderingByTableColumnOrder()
          This method is called internally by several other methods in order to perform sort ordering by column order.
 void setSortsByColumnOrder(boolean flag)
          Enables or disables sorting by column order.
 boolean setValueAtColumnAndRow(Object value, int columnIndex, int rowIndex)
          This method sets value on the table cell at the specified row and column.
 boolean sortsByColumnOrder()
          Retruns whether sorting by column order is enabled.
 void subjectChanged()
          See the subjectChanged method description in the superclass EOAssociation.
 void tableDidChangeColumns()
          This method is called when column ordering is changed by the user, also if they are added or removed, etc.
 void tableDidChangeSelection()
          Called to relay a selection change in the table widget to the display group.
 Object textColorAtColumnAndRow(int columnIndex, int rowIndex)
          This method returns whether the table cell at the specified row and column is (currently) using colored text.
 Object valueAtColumnAndRow(int columnIndex, int rowIndex)
          This method returns the data value for the table cell at the specified row and column.
protected  Class widgetPluginClass()
          Returns the abstract base class for plugin's defined by this association (EOTableAssociation.TablePlugin).
 
Methods inherited from class com.webobjects.eointerface.EOWidgetAssociation
canSupportValueFormatter, defaultPrefersContinuousChangeNotification, isUsableWithObject, objectKeysTaken, prefersContinuousChangeNotification, setDefaultPrefersContinuousChangeNotification, setObject, setPrefersContinuousChangeNotification, setValueFormatter, valueFormatter, widgetPlugin
 
Methods inherited from class com.webobjects.eointerface.EOAssociation
aspects, aspectSignatures, associationClassesForObject, bindAspect, breakConnection, copyMatchingBindingsFromAssociation, displayGroupForAspect, displayGroupKeyForAspect, endEditing, establishConnection, isConnected, isEnabled, isEnabledAtIndex, isExplicitlyDisabled, object, priority, registerAssociationClass, setExplicitlyDisabled, setValueForAspect, setValueForAspectAtIndex, shouldEndEditing, shouldEndEditingAtIndex, valueForAspect, valueForAspectAtIndex
 
Methods inherited from class com.webobjects.eocontrol.EODelayedObserver
discardPendingNotification, objectWillChange, observerQueue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOTableAssociation

public EOTableAssociation(Object object)
Creates a new EOTableAssociation to monitor and update the value in aDisplayObject.
Parameters:
aDisplayObject. -  
Method Detail

boldStateAtColumnAndRow

public int boldStateAtColumnAndRow(int columnIndex,
                                   int rowIndex)
This method returns whether the table cell at the specified row and column is (currently) using a bold font type. If the EOTableColumnAssociation for the specified cell has its bold aspect bound, this method returns the value bound there. If not, this method returns the value bound to the EOTableAssociation's bold aspect. If neither association's aspect is bound, this method returns EOAssociation.IgnoreValue.
Parameters:
columnIndex - the column number of the table cell of interest
rowIndex - the row number of the table cell of interest
Returns:
EOAssociation.IgnoreValue if the bold aspect has not been bound, EOAssociation.SetValue if the cell is bold, EOAssociation.UnsetValue if the bold state is explicitly turned off

dispose

public void dispose()
Clears all references this association has to other objects especially its display object and EODisplayGroup. Call this method before nulling out a reference to this association to ensure it gets garbage collected properly. Subclasses should override this method to do any additional cleanup that may be needed and invoke super's implementation at the end.
Overrides:
dispose in class EOWidgetAssociation
See Also:
NSDisposable

editingTableColumnAssociation

public EOTableColumnAssociation editingTableColumnAssociation()
If a field in the table is being edited, this method will return the column assocaition for the table column of the edited field. If no field is being edited, returns null.
Returns:
EOTableColumnAssociation of the field in edit status, if any; null otherwise

isEditableAtColumnAndRow

public boolean isEditableAtColumnAndRow(int columnIndex,
                                        int rowIndex)
This method returns whether the table cell at the specified row and column is editable.
Parameters:
columnIndex - the column number of the table cell of interest
rowIndex - the row number of the table cell of interest
Returns:
true if this table cell is editable, false otherwise

italicAtColumnAndRow

public int italicAtColumnAndRow(int columnIndex,
                                int rowIndex)
This method returns whether the table cell at the specified row and column is (currently) using a italic font type. If the EOTableColumnAssociation for the specified cell has its italic aspect bound, this method returns the value bound there. If not, this method returns the value bound to the EOTableAssociation's italic aspect. If neither association's aspect is bound, this method returns EOAssociation.IgnoreValue.
Parameters:
columnIndex - the column number of the table cell of interest
rowIndex - the row number of the table cell of interest
Returns:
EOAssociation.IgnoreValue if the italic aspect has not been bound, EOAssociation.SetValue if the cell is italic, EOAssociation.UnsetValue if the italic state is explicitly turned off

numberOfDisplayedObjects

public int numberOfDisplayedObjects()
Returns the number of diplayed objects (from the source display group).
Returns:
the number of displayed objects (zero if there is no display group set)

primaryAspect

public String primaryAspect()
This method returns the primary aspect for this table association.
Overrides:
primaryAspect in class EOAssociation
Returns:
the name of the primary aspect (EOAssociation.SourceAspect)

setSortOrderingByTableColumnOrder

public void setSortOrderingByTableColumnOrder()
This method is called internally by several other methods in order to perform sort ordering by column order. It will then also update the displayed objects for the source display group.

setSortsByColumnOrder

public void setSortsByColumnOrder(boolean flag)
Enables or disables sorting by column order. This means the user can change the sort order by dragging different column headers to the front of the table.
Parameters:
flag - a boolean indicating whether sorting by column order should be enabled

setValueAtColumnAndRow

public boolean setValueAtColumnAndRow(Object value,
                                      int columnIndex,
                                      int rowIndex)
This method sets value on the table cell at the specified row and column.
Parameters:
value - the new object value for the table cell
columnIndex - the column number of the table cell
rowIndex - the row number of the table cell
Returns:
a boolean indicating whether the assignment was successful

sortsByColumnOrder

public boolean sortsByColumnOrder()
Retruns whether sorting by column order is enabled. See the method description for setSortsByColumnOrder.
Returns:
true if sorting by column order is enabled, false otherwise
See Also:
setSortsByColumnOrder(boolean)

subjectChanged

public void subjectChanged()
See the subjectChanged method description in the superclass EOAssociation.
Overrides:
subjectChanged in class EOAssociation
See Also:
EOAssociation.subjectChanged()

tableDidChangeColumns

public void tableDidChangeColumns()
This method is called when column ordering is changed by the user, also if they are added or removed, etc. If sorting by column order is enabled, it will call setSortOrderingByTableColumnOrder.

tableDidChangeSelection

public void tableDidChangeSelection()
Called to relay a selection change in the table widget to the display group. It is usually called by the table plugin.

textColorAtColumnAndRow

public Object textColorAtColumnAndRow(int columnIndex,
                                      int rowIndex)
This method returns whether the table cell at the specified row and column is (currently) using colored text. If the EOTableColumnAssociation for the specified cell has its color aspect bound, this method returns the value bound there. If not, this method returns the value bound to the EOTableAssociation's color aspect. If neither association's aspect is bound, this method returns null.
Parameters:
columnIndex - the column number of the table cell of interest
rowIndex - the row number of the table cell of interest
Returns:
the color object used for text in the table cell, or null if the color aspect has not been bound

valueAtColumnAndRow

public Object valueAtColumnAndRow(int columnIndex,
                                  int rowIndex)
This method returns the data value for the table cell at the specified row and column.
Parameters:
columnIndex - the column number of the table cell of interest
rowIndex - the row number of the table cell of interest
Returns:
an object which is the data value for the specified table cell; the Object type depends on the application (Cocoa or Java Client).

widgetPluginClass

protected Class widgetPluginClass()
Returns the abstract base class for plugin's defined by this association (EOTableAssociation.TablePlugin).
Overrides:
widgetPluginClass in class EOWidgetAssociation
Following copied from class: com.webobjects.eointerface.EOWidgetAssociation
Returns:
EOWidgetAssociation.WidgetPlugin

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.