Interface next.wo.DisplayGroupDelegate

INTERFACE DESCRIPTION

The next.wo.DisplayGroupDelegate interface defines methods that the DisplayGroup's delegate should implement. To define a delegate for DisplayGroup, have your object conform to this interface and use DisplayGroup's setDelegate method to set the delegate to be your object.

The DisplayGroup invokes delegate methods when performing several of its major functions. For example, DisplayGroup's updateDisplayedObjects filters the objects fetched from the database using a qualifier and sort ordering. However, if the DisplayGroup has a delegate and the delegate implements displayArrayForObjects, it invokes this method instead. The delegate is then responsible for filtering the objects and returning a sorted array.

The DisplayGroup sends the delegate messages when it has fetched, created an object (or failed to create one), inserted or deleted an object, changed the selection, or set a value for a property. It also sends messages that request permission from the delegate to perform most of these same actions. The delegate can return true to permit the action or false to deny it.


METHODS

createObjectFailedForDataSource

public abstract void createObjectFailedForDataSource(next.wo.DisplayGroup aDisplayGroup, java.lang.Object aDataSource)

Invoked from insert to inform the delegate that aDisplayGroup has failed to create a new object for aDataSource. If the delegate doesn't implement this method, the DisplayGroup instead fails silently.


didDeleteObject

public abstract void didDeleteObject(next.wo.DisplayGroup aDisplayGroup, java.lang.Object anObject)

Informs the delegate that aDisplayGroup has deleted anObject.


didFetchObjects

public abstract void didFetchObjects(next.wo.DisplayGroup aDisplayGroup, next.util.ImmutableVector objects)

Informs the delegate that aDisplayGroup has fetched objects.


didInsertObject

public abstract void didInsertObject(next.wo.DisplayGroup aDisplayGroup, java.lang.Object anObject)

Informs the delegate that aDisplayGroup has inserted anObject.


didSetValueForObjectWithKey

public abstract void didSetValueForObjectWithKey(next.wo.DisplayGroup aDisplayGroup, java.lang.Object value, java.lang.Object anObject, java.lang.String key)

Informs the delegate that aDisplayGroup has altered a property value of anObject. key identifies the property, and value is its new value.


displayArrayForObjects

public abstract next.util.ImmutableVector displayArrayForObjects(next.wo.DisplayGroup aDisplayGroup, next.util.ImmutableVector objects)

Invoked from updateDisplayedObjects, this method allows the delegate to filter and sort aDisplayGroup's vector of objects to limit which ones get displayed. objects contains all of aDisplayGroup's objects. The delegate should filter any objects that shouldn't be shown and sort the remainder, returning a new array containing this group of objects. You can use the next.eo.Qualifier method vectorByFilteringWithQualifier and the next.eo.SortOrder method sortedVectorUsingKeyOrders to create the new vector.

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

See Also: displayedObjects, qualifier, sortOrdering (in DisplayGroup)


displayGroupDidChangeDataSource

public abstract void displayGroupDidChangeDataSource(next.wo.DisplayGroup aDisplayGroup)

Informs the delegate that aDisplayGroup's next.eo.DataSource has changed.


displayGroupDidChangeSelectedObjects

public void displayGroupDidChangeSelectedObjects(next.wo.DisplayGroup aDisplayGroup )

Informs the delegate that aDisplayGroup's selected objects have changed, regardless of whether the selection indexes have changed.


displayGroupDidChangeSelection

public abstract void displayGroupDidChangeSelection(next.wo.DisplayGroup aDisplayGroup)

Informs the delegate that aDisplayGroup's selection has changed.


displayGroupShouldFetch

public abstract boolean displayGroupShouldFetch(next.wo.DisplayGroup aDisplayGroup)

Allows the delegate to prevent aDisplayGroup from fetching. If the delegate returns true, aDisplayGroup performs the fetch; if the delegate returns false, aDisplayGroup abandons the fetch.


shouldChangeSelectionToIndexes

public abstract boolean shouldChangeSelectionToIndexes(next.wo.DisplayGroup aDisplayGroup, next.util.ImmutableVector newIndexes)

Allows the delegate to prevent a change in selection by aDisplayGroup. newIndexes is the proposed new selection, a vector of java.lang.Integers. If the delegate returns true, the selection changes; if the delegate returns false, the selection remains as it is.


shouldDeleteObject

public abstract boolean shouldDeleteObject(next.wo.DisplayGroup aDisplayGroup, java.lang.Object anObject)

Allows the delegate to prevent aDisplayGroup from deleting anObject. If the delegate returns true, anObject is deleted; if the delegate returns false, the deletion is abandoned.


shouldInsertObject

public abstract boolean shouldInsertObject(next.wo.DisplayGroup aDisplayGroup, java.lang.Object anObject, int anIndex)

Allows the delegate to prevent aDisplayGroup from inserting anObject at anIndex. If the delegate returns true, anObject is inserted; if the delegate returns false, the insertion is abandoned.


shouldRedisplayForChangesInEditingContext

public abstract boolean shouldRedisplayForChangesInEditingContext(next.wo.DisplayGroup aDisplayGroup, next.util.Notification notification)

Invoked whenever aDisplayGroup receives an ObjectsChangedInEditingContextNotification, this method allows the delegate to suppress redisplay based on the nature of the change that has occurred. If the delegate returns true, aDisplayGroup redisplays; if it returns false, aDisplayGroup doesn't.

See Also: redisplay (in DisplayGroup)


shouldRefetchForInvalidatedAllObjects

public boolean shouldRefetchForInvalidatedAllObjects(next.wo.DisplayGroup aDisplayGroup, next.util.Notification notification)

Invoked whenever aDisplayGroup receives an InvalidatedAllObjectsInStoreNotification, this method allows the delegate to suppress the refetching of the invalidated objects. If the delegate returns true, aDisplayGroup immediately fetches its objects. If the delegate returns false, aDisplayGroup doesn't immediately fetch, instead delaying until absolutely necessary.

See Also: redisplay