WebObjects 5.2

com.webobjects.appserver
Interface WODisplayGroup.Delegate

Enclosing class:
WODisplayGroup

public static interface WODisplayGroup.Delegate

The WODisplayGroup delegate offers a number of methods, and WODisplayGroup invokes them as appropriate.

Besides displayGroupDisplayArrayForObjects, there are methods that inform the delegate that the WODisplayGroup has fetched objects from its dataSource, created an object (or failed to create one), inserted or deleted an object within its EOEditingContext, changed the selection, or set a value for a property of one of its objects.

There are also methods that request permission from the delegate to perform most of these same actions. Such methods can return true to permit the action or false to deny it.

If the WODisplayGroup has a delegate object, the delegate object may not implement this interface (in order to avoid the need to implement all of the delegate methods). The WODisplayGroup will only invoke delegate methods if it has a delegate and the methods in question are implemented by the delegate.

See Also:
EODataSource, EOEditingContext, WODisplayGroup.delegate(), WODisplayGroup.setDelegate(java.lang.Object), displayGroupDisplayArrayForObjects(com.webobjects.appserver.WODisplayGroup, com.webobjects.foundation.NSArray)

Method Summary
 void displayGroupCreateObjectFailedForDataSource(WODisplayGroup group, EODataSource dataSource)
          Informs the delegate that group has failed to create a new object for dataSource.
 void displayGroupDidChangeDataSource(WODisplayGroup group)
          Informs the delegate that group's dataSource has changed.
 void displayGroupDidChangeSelectedObjects(WODisplayGroup group)
          Informs the delegate that group's selected objects have changed, regardless of whether the selection indexes have changed.
 void displayGroupDidChangeSelection(WODisplayGroup group)
          Informs the delegate that group's selection has changed.
 void displayGroupDidDeleteObject(WODisplayGroup group, Object eo)
          Informs the delegate that group has deleted eo.
 void displayGroupDidFetchObjects(WODisplayGroup group, NSArray objects)
          Informs the delegate that group has fetched objects from its dataSource.
 void displayGroupDidInsertObject(WODisplayGroup group, Object eo)
          Informs the delegate that group has inserted eo.
 NSArray displayGroupDisplayArrayForObjects(WODisplayGroup group, NSArray objects)
          Allows the delegate to filter and sort group's array of objects to limit which ones get displayed.
 boolean displayGroupShouldChangeSelectionToIndexes(WODisplayGroup group, NSArray newIndexes)
          Allows the delegate to prevent a change in selection by group.
 boolean displayGroupShouldDeleteObject(WODisplayGroup group, Object eo)
          Allows the delegate to prevent group from deleting eo.
 boolean displayGroupShouldDisplayAlert(WODisplayGroup group, String title, String message)
          Deprecated. No longer important for WebObjects applications. No user code should depend upon this, and any references to this method may be eliminated freely.
 boolean displayGroupShouldFetch(WODisplayGroup group)
          Allows the delegate to prevent group from fetching.
 boolean displayGroupShouldInsertObject(WODisplayGroup group, Object eo, int index)
          Allows the delegate to prevent group from inserting eo at index.
 boolean displayGroupShouldRefetchForInvalidatedAllObjects(WODisplayGroup group, NSNotification notification)
          Allows the delegate to suppress immediate refetching when the WODisplayGroup's objects have been invalidated.
 

Method Detail

displayGroupCreateObjectFailedForDataSource

public void displayGroupCreateObjectFailedForDataSource(WODisplayGroup group,
                                                        EODataSource dataSource)
Informs the delegate that group has failed to create a new object for dataSource. Invoked from insertNewObjectAtIndex.

If the delegate doesn't implement this method, WODisplayGroup fails silently.

Parameters:
group - display group for which this delegate will act. Should never be null.
dataSource - data source for which the failure occurred. Should never be null.
See Also:
WODisplayGroup.insertNewObjectAtIndex(int)

displayGroupDidChangeDataSource

public void displayGroupDidChangeDataSource(WODisplayGroup group)
Informs the delegate that group's dataSource has changed.
Parameters:
group - display group for which this delegate will act. Should never be null.
See Also:
WODisplayGroup.dataSource()

displayGroupDidChangeSelectedObjects

public void displayGroupDidChangeSelectedObjects(WODisplayGroup group)
Informs the delegate that group's selected objects have changed, regardless of whether the selection indexes have changed.
Parameters:
group - display group for which this delegate will act. Should never be null.

displayGroupDidChangeSelection

public void displayGroupDidChangeSelection(WODisplayGroup group)
Informs the delegate that group's selection has changed.
Parameters:
group - display group for which this delegate will act. Should never be null.

displayGroupDidDeleteObject

public void displayGroupDidDeleteObject(WODisplayGroup group,
                                        Object eo)
Informs the delegate that group has deleted eo.
Parameters:
group - display group for which this delegate will act. Should never be null.
eo - object deleted by group. Should never be null.

displayGroupDidFetchObjects

public void displayGroupDidFetchObjects(WODisplayGroup group,
                                        NSArray objects)
Informs the delegate that group has fetched objects from its dataSource.
Parameters:
group - display group for which this delegate will act. Should never be null.
objects - objects fetched by group. Should never be null.
See Also:
WODisplayGroup.dataSource()

displayGroupDidInsertObject

public void displayGroupDidInsertObject(WODisplayGroup group,
                                        Object eo)
Informs the delegate that group has inserted eo.
Parameters:
group - display group for which this delegate will act. Should never be null.
eo - object inserted by group. Should never be null.

displayGroupDisplayArrayForObjects

public NSArray displayGroupDisplayArrayForObjects(WODisplayGroup group,
                                                  NSArray objects)
Allows the delegate to filter and sort group's array of objects to limit which ones get displayed. Invoked from updateDisplayedObjects. The delegate should filter any objects that shouldn't be shown and sort the remainder, returning a new array containing this grouping of objects.

You can use EOQualifier's filteredArrayWithQualifier and EOSortOrdering's sortedArrayUsingKeyOrderArray methods to create the new array.

If the delegate doesn't implement this method, WODisplayGroup uses its own qualifier and sort ordering to update the displayedObjects array.

Parameters:
group - display group for which this delegate will act. Should never be null.
objects - all of group's objects. Should never be null.
Returns:
array of filtered and sorted objects. If no objects pass the filter, returns NSArray.EmptyArray.
See Also:
EOQualifier.filteredArrayWithQualifier(com.webobjects.foundation.NSArray, com.webobjects.eocontrol.EOQualifier), EOSortOrdering.sortedArrayUsingKeyOrderArray(com.webobjects.foundation.NSArray, com.webobjects.foundation.NSArray), NSArray.EmptyArray, WODisplayGroup.displayedObjects(), WODisplayGroup.qualifier(), WODisplayGroup.sortOrderings(), WODisplayGroup.updateDisplayedObjects()

displayGroupShouldChangeSelectionToIndexes

public boolean displayGroupShouldChangeSelectionToIndexes(WODisplayGroup group,
                                                          NSArray newIndexes)
Allows the delegate to prevent a change in selection by group.
Parameters:
group - display group for which this delegate will act. Should never be null.
newIndexes - proposed new selection
Returns:
true when group should change its selection to newIndexes, false otherwise

displayGroupShouldDeleteObject

public boolean displayGroupShouldDeleteObject(WODisplayGroup group,
                                              Object eo)
Allows the delegate to prevent group from deleting eo.
Parameters:
group - display group for which this delegate will act. Should never be null.
eo - object that will be deleted by group. Should never be null.
Returns:
true when group should delete eo, false otherwise

displayGroupShouldDisplayAlert

public boolean displayGroupShouldDisplayAlert(WODisplayGroup group,
                                              String title,
                                              String message)
Deprecated. No longer important for WebObjects applications. No user code should depend upon this, and any references to this method may be eliminated freely.

Allows the delegate to control the display of alert messages when an error is encountered in group or its EOEditingContext.

If this delegate method returns true, an alert is displayed; if the delegate returns false, no alert is displayed. The two String parameters specify the alert title and alert description, respectively.

Such alerts are displayed using Foundation's NSLog class.

Parameters:
group - display group for which this delegate will act. Should never be null.
title - alert title that might be displayed
message - alert description that might be displayed
Returns:
true when group should display an alert, false otherwise
See Also:
EOEditingContext, NSLog

displayGroupShouldFetch

public boolean displayGroupShouldFetch(WODisplayGroup group)
Allows the delegate to prevent group from fetching.
Parameters:
group - display group for which this delegate will act. Should never be null.
Returns:
true when group should perform the fetch from its dataSource, false otherwise
See Also:
WODisplayGroup.dataSource()

displayGroupShouldInsertObject

public boolean displayGroupShouldInsertObject(WODisplayGroup group,
                                              Object eo,
                                              int index)
Allows the delegate to prevent group from inserting eo at index.
Parameters:
group - display group for which this delegate will act. Should never be null.
eo - object to be inserted at index. Should never be null.
index - index at which to insert object.
Returns:
true when group should insert eo, false otherwise
See Also:
WODisplayGroup.insertObjectAtIndex(java.lang.Object, int)

displayGroupShouldRefetchForInvalidatedAllObjects

public boolean displayGroupShouldRefetchForInvalidatedAllObjects(WODisplayGroup group,
                                                                 NSNotification notification)
Allows the delegate to suppress immediate refetching when the WODisplayGroup's objects have been invalidated. Invoked whenever group receives an EOObjectStore.InvalidatedAllObjectsInStoreNotification.
Parameters:
group - display group for which this delegate will act. Should never be null.
notification - notification provided for the associated object's userInfo. Should never be null.
Returns:
true when group should immediately refetch from its dataSource, false otherwise
See Also:
EOObjectStore.InvalidatedAllObjectsInStoreNotification, NSNotification, WODisplayGroup.dataSource(), WODisplayGroup.redisplay()

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

Copyright © 2003 Apple Computer, Inc.