WebObjects 5.2

com.webobjects.eocontrol
Interface EOEditingContext.MessageHandler

Enclosing class:
EOEditingContext

public static interface EOEditingContext.MessageHandler

This interface is used for error reporting and determining fetch limits. See the EOEditingContext, EODatabaseContext (EOAccess), and EODisplayGroup (EOInterface) class specifications for more information.

Message handlers are primarily used to implement exception handling in the interface layer's EODisplayGroup, and would not ordinarily be used in a command line tool or WebObjects application.

Message handlers are not required to provide implementations for all of the methods in the interface. When you write a handler, you don't have to use the implements keyword to specify that the object implements the EOEditingContext.MessageHandler interface. Instead, simply use the EOEditingContext method setMessageHandler method to assign your object as the EOEditingContext's handler and then declare and implement any subset of the methods declared in the EOEditingContext.MessageHandler interface. An EOEditingContext can determine if the handler does not implement a method and only attempts to invoke the methods the handler actually implements.


Method Summary
 void editingContextPresentErrorMessage(EOEditingContext context, String message)
          Invoked by context, this method should present message to the user in whatever way is appropriate (whether by opening an attention panel or printing the message in a terminal window, for example).
 boolean editingContextShouldContinueFetching(EOEditingContext context, int count, int originalLimit, EOObjectStore objectStore)
          Invoked by objectStore (such as an EOAccess layer EODatabaseContext) to allow the message handler for context (often an interface layer EODisplayGroup) to prompt the user about whether or not to continue fetching the current result set.
 

Method Detail

editingContextPresentErrorMessage

public void editingContextPresentErrorMessage(EOEditingContext context,
                                              String message)
Invoked by context, this method should present message to the user in whatever way is appropriate (whether by opening an attention panel or printing the message in a terminal window, for example). This message is sent only if the method is implemented.
Parameters:
context - The target EOEditingContext
message - the text of the error message

editingContextShouldContinueFetching

public boolean editingContextShouldContinueFetching(EOEditingContext context,
                                                    int count,
                                                    int originalLimit,
                                                    EOObjectStore objectStore)
Invoked by objectStore (such as an EOAccess layer EODatabaseContext) to allow the message handler for context (often an interface layer EODisplayGroup) to prompt the user about whether or not to continue fetching the current result set. The count argument is the number of objects fetched so far. limit is the original limit specified an EOFetchSpecification. This message is sent only if the method is implemented.
Parameters:
context - The target EOEditingContext
count - the number of records which have been fetched so far
originalLimit - the limit originally specified by the EOFetchSpecification
objectStore - the provider of the fetched records
Returns:
true if context should continue, false if it should abort the fetch

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

Copyright © 2003 Apple Computer, Inc.