net.wotonomy.ui
Class EODisplayGroup

java.lang.Object
  extended by java.util.Observable
      extended by net.wotonomy.ui.EODisplayGroup
All Implemented Interfaces:
net.wotonomy.control.EOEditingContext.Editor, net.wotonomy.control.EOObserving
Direct Known Subclasses:
DisplayGroup

public class EODisplayGroup
extends java.util.Observable
implements net.wotonomy.control.EOObserving, net.wotonomy.control.EOEditingContext.Editor

EODisplayGroup provides an abstraction of a user interface, comprising of an ordered collection of data objects, some of which are displayed, and of those some are selected.

Version:
$Revision: 904 $
Author:
michael@mpowers.net, $Author: cgruber $

Nested Class Summary
static interface EODisplayGroup.Delegate
          DisplayGroups can delegate important decisions to a Delegate.
 
Field Summary
protected  net.wotonomy.foundation.NSMutableArray allObjects
           
protected  net.wotonomy.foundation.NSArray allObjectsProxy
           
protected  net.wotonomy.foundation.NSMutableArray displayedObjects
           
protected  net.wotonomy.foundation.NSArray displayedObjectsProxy
           
static java.lang.String DisplayGroupWillFetchNotification
          Notification sent when the display group is about to fetch.
protected  net.wotonomy.foundation.NSMutableArray selectedIndexes
           
protected  net.wotonomy.foundation.NSMutableArray selectedObjects
           
protected  net.wotonomy.foundation.NSArray selectedObjectsProxy
           
 
Constructor Summary
EODisplayGroup()
          Creates a new display group.
 
Method Summary
 net.wotonomy.foundation.NSArray allObjects()
          Returns a read-only List containing all objects managed by the display group.
 void associationDidBeginEditing(EOAssociation anAssociation)
          Called by an association when it begins editing.
 void associationDidEndEditing(EOAssociation anAssociation)
          Called by an association when it is finished editing.
 boolean associationFailedToValidateValue(EOAssociation anAssociation, java.lang.String aValue, java.lang.String aKey, java.lang.Object anObject, java.lang.String anErrorDescription)
          Called by an association when a user-specified value fails the association's validation rules.
 boolean clearSelection()
          Clears the current selection.
 boolean contentsChanged()
          Called by associations to determine whether the contents of any objects have been changed.
 net.wotonomy.control.EODataSource dataSource()
          Returns the current data source backing this display group, or null if no dataSource is currently used.
 java.lang.String defaultStringMatchFormat()
          Returns the current string matching format.
 java.lang.String defaultStringMatchOperator()
          Returns the current string matching operator.
 java.lang.Object delegate()
          Returns the current delegate for this display group, or null if no delegate is currently set.
 boolean deleteObjectAtIndex(int anIndex)
          Deletes the object at the specified index, notifying the delegate before and after the operation, and then updating the selection if needed.
 boolean deleteSelection()
          Deletes the currently selected objects.
 net.wotonomy.foundation.NSArray displayedObjects()
          Returns a read-only List of all objects in the display group that are currently displayed by the associations.
 EOAssociation editingAssociation()
          Returns the association that is currently being edited, or null if no editing is taking place.
 void editingContextPresentErrorMessage(net.wotonomy.control.EOEditingContext anEditingContext, java.lang.String aMessage)
          Called to display a message for an error that occurred in the specified editing context.
 boolean editingContextShouldContinueFetching(net.wotonomy.control.EOEditingContext anEditingContext, int count, int limit, net.wotonomy.control.EOObjectStore anObjectStore)
          Called by the specified object store to determine whether fetching should continue, where count is the current count and limit is the limit as specified by the fetch specification.
 void editingContextWillSaveChanges(net.wotonomy.control.EOEditingContext anEditingContext)
          Called before the editing context begins to save changes.
 boolean editorHasChangesForEditingContext(net.wotonomy.control.EOEditingContext anEditingContext)
          Called to determine whether this editor has changes that have not been committed to the object in the context.
 boolean enabledToSetSelectedObjectValueForKey(java.lang.String aKey)
          Called by an association to determine whether it should enable a component that displayes a value for the specified key.
 boolean endEditing()
          Asks the association currently editing to stop editing.
 void enterQueryMode(java.lang.Object aSender)
          Sets the display group and associations to edit a "query by example" query object.
 net.wotonomy.foundation.NSDictionary equalToQueryValues()
          Returns a Map containing the mappings of keys to query values that will be used to test for equality.
 boolean fetch()
          Requests a list of objects from the DataSource and calls setObjectArray to populate the list.
 boolean fetchesOnLoad()
          Returns whether this display group should immediate fetch when loaded.
static boolean globalDefaultForValidatesChangesImmediately()
          Specifies the default behavior for whether changes should be validated immediately for all display groups.
static java.lang.String globalDefaultStringMatchFormat()
          Specifies the default string matching format for all display groups.
static java.lang.String globalDefaultStringMatchOperator()
          Specifies the default string matching operator for all display groups.
 net.wotonomy.foundation.NSDictionary greaterThanQueryValues()
          Returns a Map containing the mappings of keys to query values that will be used to test for greater value.
 boolean inQueryMode()
          Returns whether this display group is in "query by example" mode.
 net.wotonomy.foundation.NSDictionary insertedObjectDefaultValues()
          Returns a Map of default values that are applied to new objects that are inserted into the list.
 java.lang.Object insertNewObjectAtIndex(int anIndex)
          Creates a new object at the specified index.
 void insertObjectAtIndex(java.lang.Object anObject, int anIndex)
          Inserts the specified object into the list at the specified index.
 net.wotonomy.foundation.NSDictionary lessThanQueryValues()
          Returns a Map containing the mappings of keys to query values that will be used to test for lesser value.
 net.wotonomy.foundation.NSArray localKeys()
          Returns the keys that were declared when read from an external resource file.
 void objectsInvalidatedInEditingContext(net.wotonomy.foundation.NSNotification aNotification)
          Handles notifications from the data source's editing context, looking for InvalidatedAllObjectsInStoreNotification and ObjectsChangedInEditingContextNotification, refetching in the former case and updating displayed objects in the latter.
 void objectWillChange(java.lang.Object anObject)
          Receives notifications of changes from objects that are managed by this display group.
 net.wotonomy.foundation.NSArray observingAssociations()
          Returns a read-only List of associations that are observing this display group.
protected  void processRecentChanges()
          Called by LastGroupObserver to clear flags.
 net.wotonomy.control.EOQualifier qualifier()
          Returns a qualifier that will be applied all the objects in this display group to determine which objects will be displayed.
 net.wotonomy.control.EOQualifier qualifierFromQueryValues()
          Returns a new qualifier built from the three query value maps: greater than, equal to, and less than.
 void qualifyDataSource()
          Calls qualifierFromQueryValues(), applies the result to the data source, and calls fetch().
 void qualifyDisplayGroup()
          Calls qualifierFromQueryValues(), sets the qualifier with setQualifier(), and calls updateDisplayedObjects().
 net.wotonomy.foundation.NSDictionary queryBindingValues()
          Returns a Map containing the mappings of keys to binding query values.
 net.wotonomy.foundation.NSDictionary queryOperatorValues()
          Returns a Map containing the mappings of keys to operator values.
 void redisplay()
          Sets contentsChanged to true and notifies all observers.
 java.lang.Object selectedObject()
          Returns the currently selected object, or null if there is no selection.
 net.wotonomy.foundation.NSArray selectedObjects()
          Returns a read-only List containing all selected objects, if any.
 java.lang.Object selectedObjectValueForKey(java.lang.String aKey)
          Returns a value on the selected object for the specified key.
 boolean selectionChanged()
          Called by associations to determine whether the selection has been changed.
 net.wotonomy.foundation.NSArray selectionIndexes()
          Returns a read-only List containing the indexes of all selected objects, if any.
 boolean selectNext()
          Sets the selection to the next displayed object after the current selection.
 boolean selectObject(java.lang.Object anObject)
          Sets the selection to the specified object.
 boolean selectObjectsIdenticalTo(java.util.List anObjectList)
          Sets the selection to the specified objects.
 boolean selectPrevious()
          Sets the selection to the previous displayed object before the current selection.
 boolean selectsFirstObjectAfterFetch()
          Sets whether this display group will select the first object in the list after a fetch.
 void setDataSource(net.wotonomy.control.EODataSource aDataSource)
          Sets the data source that will be used by this display group.
 void setDefaultStringMatchFormat(java.lang.String aFormat)
          Sets the default string matching format that will be used by this display group.
 void setDefaultStringMatchOperator(java.lang.String anOperator)
          Sets the default string matching operator that will be used by this display group.
 void setDelegate(java.lang.Object aDelegate)
          Sets the display group delegate that will be used by this display group.
 void setEqualToQueryValues(java.util.Map aMap)
          Sets the Map that contains the mappings of keys to query values that will be used to test for equality.
 void setFetchesOnLoad(boolean willFetch)
          Sets whether this display group will fetch objects from its data source on load.
static void setGlobalDefaultForValidatesChangesImmediately(boolean validatesImmediately)
          Sets the default behavior for validating changes for all display groups.
static void setGlobalDefaultStringMatchFormat(java.lang.String aFormat)
          Sets the default string matching format that will be used by all display groups.
static void setGlobalDefaultStringMatchOperator(java.lang.String anOperator)
          Sets the default string matching operator that will be used by all display groups.
 void setGreaterThanQueryValues(java.util.Map aMap)
          Sets the mapping that contains the mappings of keys to query values that will be used to test for greater value.
 void setInQueryMode(boolean isInQueryMode)
          Sets whether this display group is in "query by example" mode.
 void setInsertedObjectDefaultValues(java.util.Map aMap)
          Sets the mapping that contains the values that will be applied to new objects inserted into the display group.
 void setLessThanQueryValues(java.util.Map aMap)
          Sets the mapping that contains the mappings of keys to query values that will be used to test for lesser value.
 void setLocalKeys(java.util.List aKeyList)
          Sets the keys that are declared when instantiated from an external resource file.
 void setObjectArray(java.util.List anObjectList)
          Sets the objects managed by this display group.
 void setQualifier(net.wotonomy.control.EOQualifier aQualifier)
          Sets the qualifier that will be used by updateDisplayedObjects() to filter displayed objects.
 void setQueryBindingValues(java.util.Map aMap)
          Sets the mapping that contains the mappings of keys to binding values.
 void setQueryOperatorValues(java.util.Map aMap)
          Sets the mapping that contains the mappings of keys to operator values.
 void setSelectedObject(java.lang.Object anObject)
          Sets the currently selected object, or clears the selection if the object is not found or is null.
 void setSelectedObjects(java.util.List aList)
          Sets the current selection to the specified objects.
 boolean setSelectedObjectValue(java.lang.Object aValue, java.lang.String aKey)
          Sets the specified value for the specified key on all selected objects.
 boolean setSelectionIndexes(java.util.List aList)
          Sets the current selection to the objects at the specified indexes.
 void setSelectsFirstObjectAfterFetch(boolean selectsFirst)
          Sets whether the first object in the list will be selected after a fetch.
 void setSortOrderings(java.util.List aList)
          Sets the order of the keys by which this display group will be ordered after a fetch or after a call to updateDisplayedObjects().
 void setUsesOptimisticRefresh(boolean isOptimistic)
          Sets whether only changed objects are refreshed (optimistic), or whether all objects are refreshed (pessimistic, default).
 void setValidatesChangesImmediately(boolean validatesImmediately)
          Sets whether changes made by associations are validated immediately, or when changes are saved.
 boolean setValueForObject(java.lang.Object aValue, java.lang.Object anObject, java.lang.String aKey)
          Sets the specified value for the specified key on the specified object.
 boolean setValueForObjectAtIndex(java.lang.Object aValue, int anIndex, java.lang.String aKey)
          Calls setValueForObject() for the object at the specified index.
 net.wotonomy.foundation.NSArray sortOrderings()
          Returns a read-only List of sort orderings for this display group.
 java.lang.String toString()
          Prints out the list of displayed objects.
 void updateDisplayedObjects()
          Applies the qualifier to all objects and sorts the results to update the list of displayed objects.
 int updatedObjectIndex()
          Returns the index of the changed object.
 boolean usesOptimisticRefresh()
          Returns whether this display group refreshes only the changed objects or all objects on refresh.
 boolean validatesChangesImmediately()
          Returns whether this display group validates changes immediately.
 java.lang.Object valueForObject(java.lang.Object anObject, java.lang.String aKey)
          Returns the value for the specified key on the specified object.
 java.lang.Object valueForObjectAtIndex(int anIndex, java.lang.String aKey)
          Calls valueForObject() for the object at the specified index.
protected  void willChange()
          Needed because we don't inherit from NSObject.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DisplayGroupWillFetchNotification

public static final java.lang.String DisplayGroupWillFetchNotification
Notification sent when the display group is about to fetch.

See Also:
Constant Field Values

allObjects

protected net.wotonomy.foundation.NSMutableArray allObjects

allObjectsProxy

protected net.wotonomy.foundation.NSArray allObjectsProxy

displayedObjects

protected net.wotonomy.foundation.NSMutableArray displayedObjects

displayedObjectsProxy

protected net.wotonomy.foundation.NSArray displayedObjectsProxy

selectedObjects

protected net.wotonomy.foundation.NSMutableArray selectedObjects

selectedObjectsProxy

protected net.wotonomy.foundation.NSArray selectedObjectsProxy

selectedIndexes

protected net.wotonomy.foundation.NSMutableArray selectedIndexes
Constructor Detail

EODisplayGroup

public EODisplayGroup()
Creates a new display group.

Method Detail

setDataSource

public void setDataSource(net.wotonomy.control.EODataSource aDataSource)
Sets the data source that will be used by this display group.


dataSource

public net.wotonomy.control.EODataSource dataSource()
Returns the current data source backing this display group, or null if no dataSource is currently used.


setDelegate

public void setDelegate(java.lang.Object aDelegate)
Sets the display group delegate that will be used by this display group.


delegate

public java.lang.Object delegate()
Returns the current delegate for this display group, or null if no delegate is currently set.


defaultStringMatchFormat

public java.lang.String defaultStringMatchFormat()
Returns the current string matching format. If not set, defaults to "%@*".


defaultStringMatchOperator

public java.lang.String defaultStringMatchOperator()
Returns the current string matching operator. If not set, defaults to "caseInsensitiveLike".


enterQueryMode

public void enterQueryMode(java.lang.Object aSender)
Sets the display group and associations to edit a "query by example" query object. This method is used for target/action connections.


fetchesOnLoad

public boolean fetchesOnLoad()
Returns whether this display group should immediate fetch when loaded.


inQueryMode

public boolean inQueryMode()
Returns whether this display group is in "query by example" mode.


insertedObjectDefaultValues

public net.wotonomy.foundation.NSDictionary insertedObjectDefaultValues()
Returns a Map of default values that are applied to new objects that are inserted into the list.


localKeys

public net.wotonomy.foundation.NSArray localKeys()
Returns the keys that were declared when read from an external resource file.


selectsFirstObjectAfterFetch

public boolean selectsFirstObjectAfterFetch()
Sets whether this display group will select the first object in the list after a fetch.


setDefaultStringMatchFormat

public void setDefaultStringMatchFormat(java.lang.String aFormat)
Sets the default string matching format that will be used by this display group.


setDefaultStringMatchOperator

public void setDefaultStringMatchOperator(java.lang.String anOperator)
Sets the default string matching operator that will be used by this display group.


setFetchesOnLoad

public void setFetchesOnLoad(boolean willFetch)
Sets whether this display group will fetch objects from its data source on load.


setInQueryMode

public void setInQueryMode(boolean isInQueryMode)
Sets whether this display group is in "query by example" mode. If true, all associations will bind to a special "example" object.


setInsertedObjectDefaultValues

public void setInsertedObjectDefaultValues(java.util.Map aMap)
Sets the mapping that contains the values that will be applied to new objects inserted into the display group.


setLocalKeys

public void setLocalKeys(java.util.List aKeyList)
Sets the keys that are declared when instantiated from an external resource file.


setSelectsFirstObjectAfterFetch

public void setSelectsFirstObjectAfterFetch(boolean selectsFirst)
Sets whether the first object in the list will be selected after a fetch.


setSortOrderings

public void setSortOrderings(java.util.List aList)
Sets the order of the keys by which this display group will be ordered after a fetch or after a call to updateDisplayedObjects(). The elements in the display group will be sorted first by the first key, within the first key, by the second key, and so on.


setUsesOptimisticRefresh

public void setUsesOptimisticRefresh(boolean isOptimistic)
Sets whether only changed objects are refreshed (optimistic), or whether all objects are refreshed (pessimistic, default). By default, when the display group receives notification that one of its objects has changed, updateDisplayedObjects is called.


setValidatesChangesImmediately

public void setValidatesChangesImmediately(boolean validatesImmediately)
Sets whether changes made by associations are validated immediately, or when changes are saved.


sortOrderings

public net.wotonomy.foundation.NSArray sortOrderings()
Returns a read-only List of sort orderings for this display group.


usesOptimisticRefresh

public boolean usesOptimisticRefresh()
Returns whether this display group refreshes only the changed objects or all objects on refresh.


validatesChangesImmediately

public boolean validatesChangesImmediately()
Returns whether this display group validates changes immediately. Otherwise, validation should occur when changes are saved. Default is the global default, which is initially true.


qualifier

public net.wotonomy.control.EOQualifier qualifier()
Returns a qualifier that will be applied all the objects in this display group to determine which objects will be displayed.


qualifierFromQueryValues

public net.wotonomy.control.EOQualifier qualifierFromQueryValues()
Returns a new qualifier built from the three query value maps: greater than, equal to, and less than.


qualifyDataSource

public void qualifyDataSource()
Calls qualifierFromQueryValues(), applies the result to the data source, and calls fetch().


qualifyDisplayGroup

public void qualifyDisplayGroup()
Calls qualifierFromQueryValues(), sets the qualifier with setQualifier(), and calls updateDisplayedObjects().


queryBindingValues

public net.wotonomy.foundation.NSDictionary queryBindingValues()
Returns a Map containing the mappings of keys to binding query values.


queryOperatorValues

public net.wotonomy.foundation.NSDictionary queryOperatorValues()
Returns a Map containing the mappings of keys to operator values.


setQualifier

public void setQualifier(net.wotonomy.control.EOQualifier aQualifier)
Sets the qualifier that will be used by updateDisplayedObjects() to filter displayed objects.


setQueryBindingValues

public void setQueryBindingValues(java.util.Map aMap)
Sets the mapping that contains the mappings of keys to binding values.


setQueryOperatorValues

public void setQueryOperatorValues(java.util.Map aMap)
Sets the mapping that contains the mappings of keys to operator values.


equalToQueryValues

public net.wotonomy.foundation.NSDictionary equalToQueryValues()
Returns a Map containing the mappings of keys to query values that will be used to test for equality.


greaterThanQueryValues

public net.wotonomy.foundation.NSDictionary greaterThanQueryValues()
Returns a Map containing the mappings of keys to query values that will be used to test for greater value.


lessThanQueryValues

public net.wotonomy.foundation.NSDictionary lessThanQueryValues()
Returns a Map containing the mappings of keys to query values that will be used to test for lesser value.


setEqualToQueryValues

public void setEqualToQueryValues(java.util.Map aMap)
Sets the Map that contains the mappings of keys to query values that will be used to test for equality.


setGreaterThanQueryValues

public void setGreaterThanQueryValues(java.util.Map aMap)
Sets the mapping that contains the mappings of keys to query values that will be used to test for greater value.


setLessThanQueryValues

public void setLessThanQueryValues(java.util.Map aMap)
Sets the mapping that contains the mappings of keys to query values that will be used to test for lesser value.


associationDidBeginEditing

public void associationDidBeginEditing(EOAssociation anAssociation)
Called by an association when it begins editing.


associationDidEndEditing

public void associationDidEndEditing(EOAssociation anAssociation)
Called by an association when it is finished editing.


contentsChanged

public boolean contentsChanged()
Called by associations to determine whether the contents of any objects have been changed. Returns true if the contents have changed and not all observers have been notified.


selectionChanged

public boolean selectionChanged()
Called by associations to determine whether the selection has been changed. Returns true if the selection has changed and not all observers have been notified.


associationFailedToValidateValue

public boolean associationFailedToValidateValue(EOAssociation anAssociation,
                                                java.lang.String aValue,
                                                java.lang.String aKey,
                                                java.lang.Object anObject,
                                                java.lang.String anErrorDescription)
Called by an association when a user-specified value fails the association's validation rules. This implementation returns true, unless the delegate prevents this.

Returns:
True to allow the association to handle user notification, otherwise return false to let the association know that the display group notified the user.

enabledToSetSelectedObjectValueForKey

public boolean enabledToSetSelectedObjectValueForKey(java.lang.String aKey)
Called by an association to determine whether it should enable a component that displayes a value for the specified key.

Returns:
true if an object is selected, or if the specified key is a query key. Otherwise false.

editingAssociation

public EOAssociation editingAssociation()
Returns the association that is currently being edited, or null if no editing is taking place.


endEditing

public boolean endEditing()
Asks the association currently editing to stop editing.


observingAssociations

public net.wotonomy.foundation.NSArray observingAssociations()
Returns a read-only List of associations that are observing this display group.


allObjects

public net.wotonomy.foundation.NSArray allObjects()
Returns a read-only List containing all objects managed by the display group. This includes those objects not visible due to disqualification.


clearSelection

public boolean clearSelection()
Clears the current selection.

Returns:
True is the selection was cleared, False if the selection could not be cleared
See Also:
setSelectionIndexes(java.util.List)

deleteObjectAtIndex

public boolean deleteObjectAtIndex(int anIndex)
Deletes the object at the specified index, notifying the delegate before and after the operation, and then updating the selection if needed.

Returns:
True if delete was successful, false if the object was not deleted.

deleteSelection

public boolean deleteSelection()
Deletes the currently selected objects. This implementation calls deleteObjectAtIndex() for each index in the selection list, immediately returning false if any delete operation fails.

Returns:
True if all selected objects were deleted, false if any deletion failed.

displayedObjects

public net.wotonomy.foundation.NSArray displayedObjects()
Returns a read-only List of all objects in the display group that are currently displayed by the associations.


fetch

public boolean fetch()
Requests a list of objects from the DataSource and calls setObjectArray to populate the list. More specifically, calls endEditing(), asks the delegate, fetches the objects, notifies the delegate, and populates the list.


insertNewObjectAtIndex

public java.lang.Object insertNewObjectAtIndex(int anIndex)
Creates a new object at the specified index. Calls insertObjectAtIndex() with the result from sending createObject() to the data source. Presents a JOptionPane if the create fails, unless the delegate implements displayGroupCreateObjectFailed.

Returns:
the newly created object.

insertObjectAtIndex

public void insertObjectAtIndex(java.lang.Object anObject,
                                int anIndex)
Inserts the specified object into the list at the specified index.


redisplay

public void redisplay()
Sets contentsChanged to true and notifies all observers.


selectNext

public boolean selectNext()
Sets the selection to the next displayed object after the current selection. If the last object is selected, or if no object is selected, then the first object becomes selected. If multiple items are selected, the first selected item is considered the selected item for the purposes of this method. Does not call redisplay().

Returns:
true if an object was selected.

selectObject

public boolean selectObject(java.lang.Object anObject)
Sets the selection to the specified object. If the specified object is null or does not exist in the list of displayed objects, the selection will be cleared.

Returns:
true if the object was selected.

selectObjectsIdenticalTo

public boolean selectObjectsIdenticalTo(java.util.List anObjectList)
Sets the selection to the specified objects. If the specified list is null or if none of the objects in the list exist in the list of displayed objects, the selection will be cleared.

Returns:
true if all specified objects were selected.

selectPrevious

public boolean selectPrevious()
Sets the selection to the previous displayed object before the current selection. If the first object is selected, or if no object is selected, then the last object becomes selected. If multiple items are selected, the first selected item is considered the selected item for the purposes of this method. Does not call redisplay().

Returns:
true if an object was selected.

selectedObject

public java.lang.Object selectedObject()
Returns the currently selected object, or null if there is no selection.


selectedObjects

public net.wotonomy.foundation.NSArray selectedObjects()
Returns a read-only List containing all selected objects, if any. Returns an empty list if no objects are selected.


selectionIndexes

public net.wotonomy.foundation.NSArray selectionIndexes()
Returns a read-only List containing the indexes of all selected objects, if any. The list contains instances of java.lang.Number; call intValue() to retrieve the index.


setObjectArray

public void setObjectArray(java.util.List anObjectList)
Sets the objects managed by this display group. updateDisplayedObjects() is called to filter the display objects. The previous selection will be maintained if possible. The data source is not notified.


setSelectedObject

public void setSelectedObject(java.lang.Object anObject)
Sets the currently selected object, or clears the selection if the object is not found or is null. Note: it's not clear how this differs from selectObject in the spec. It is recommended that you call selectObject for now.


setSelectedObjects

public void setSelectedObjects(java.util.List aList)
Sets the current selection to the specified objects. The previous selection is cleared, and any objects in the display group that are in the specified list are then selected. If no items in the specified list are found in the display group, then the selection is effectively cleared. Note: it's not clear how this differs from selectObjectsIdenticalTo in the spec. It is recommended that you call that method for now.


setSelectionIndexes

public boolean setSelectionIndexes(java.util.List aList)
Sets the current selection to the objects at the specified indexes. Items in the list are assumed to be instances of java.lang.Number. The previous selection is cleared, and any objects in the display group that are in the specified list are then selected. If no items in the specified list are found in the display group, then the selection is effectively cleared.


updateDisplayedObjects

public void updateDisplayedObjects()
Applies the qualifier to all objects and sorts the results to update the list of displayed objects. Observing associations are notified to reflect the changes.


updatedObjectIndex

public int updatedObjectIndex()
Returns the index of the changed object. If more than one object has changed, -1 is returned.


selectedObjectValueForKey

public java.lang.Object selectedObjectValueForKey(java.lang.String aKey)
Returns a value on the selected object for the specified key.


setSelectedObjectValue

public boolean setSelectedObjectValue(java.lang.Object aValue,
                                      java.lang.String aKey)
Sets the specified value for the specified key on all selected objects.


setValueForObject

public boolean setValueForObject(java.lang.Object aValue,
                                 java.lang.Object anObject,
                                 java.lang.String aKey)
Sets the specified value for the specified key on the specified object. Validations may be triggered, and error dialogs may appear to the user.

Returns:
True if the value was set successfully, false if the value could not be set and the update operation should not continue.

setValueForObjectAtIndex

public boolean setValueForObjectAtIndex(java.lang.Object aValue,
                                        int anIndex,
                                        java.lang.String aKey)
Calls setValueForObject() for the object at the specified index.


valueForObject

public java.lang.Object valueForObject(java.lang.Object anObject,
                                       java.lang.String aKey)
Returns the value for the specified key on the specified object.


valueForObjectAtIndex

public java.lang.Object valueForObjectAtIndex(int anIndex,
                                              java.lang.String aKey)
Calls valueForObject() for the object at the specified index.


toString

public java.lang.String toString()
Prints out the list of displayed objects.

Overrides:
toString in class java.lang.Object

objectsInvalidatedInEditingContext

public void objectsInvalidatedInEditingContext(net.wotonomy.foundation.NSNotification aNotification)
Handles notifications from the data source's editing context, looking for InvalidatedAllObjectsInStoreNotification and ObjectsChangedInEditingContextNotification, refetching in the former case and updating displayed objects in the latter. Note: This method is not in the public specification.


globalDefaultForValidatesChangesImmediately

public static boolean globalDefaultForValidatesChangesImmediately()
Specifies the default behavior for whether changes should be validated immediately for all display groups.


globalDefaultStringMatchFormat

public static java.lang.String globalDefaultStringMatchFormat()
Specifies the default string matching format for all display groups.


globalDefaultStringMatchOperator

public static java.lang.String globalDefaultStringMatchOperator()
Specifies the default string matching operator for all display groups.


setGlobalDefaultForValidatesChangesImmediately

public static void setGlobalDefaultForValidatesChangesImmediately(boolean validatesImmediately)
Sets the default behavior for validating changes for all display groups.


setGlobalDefaultStringMatchFormat

public static void setGlobalDefaultStringMatchFormat(java.lang.String aFormat)
Sets the default string matching format that will be used by all display groups.


setGlobalDefaultStringMatchOperator

public static void setGlobalDefaultStringMatchOperator(java.lang.String anOperator)
Sets the default string matching operator that will be used by all display groups.


willChange

protected void willChange()
Needed because we don't inherit from NSObject. Calls EOObserverCenter.notifyObserversObjectWillChange.


processRecentChanges

protected void processRecentChanges()
Called by LastGroupObserver to clear flags.


objectWillChange

public void objectWillChange(java.lang.Object anObject)
Receives notifications of changes from objects that are managed by this display group. This implementation sets updatedObjectIndex and contentsChanged as appropriate.

Specified by:
objectWillChange in interface net.wotonomy.control.EOObserving

editingContextWillSaveChanges

public void editingContextWillSaveChanges(net.wotonomy.control.EOEditingContext anEditingContext)
Called before the editing context begins to save changes. This implementation calls endEditing().

Specified by:
editingContextWillSaveChanges in interface net.wotonomy.control.EOEditingContext.Editor

editorHasChangesForEditingContext

public boolean editorHasChangesForEditingContext(net.wotonomy.control.EOEditingContext anEditingContext)
Called to determine whether this editor has changes that have not been committed to the object in the context.

Specified by:
editorHasChangesForEditingContext in interface net.wotonomy.control.EOEditingContext.Editor

editingContextPresentErrorMessage

public void editingContextPresentErrorMessage(net.wotonomy.control.EOEditingContext anEditingContext,
                                              java.lang.String aMessage)
Called to display a message for an error that occurred in the specified editing context. If the delegate allows, this implementation presents an informational JOptionPane. Override to customize.


editingContextShouldContinueFetching

public boolean editingContextShouldContinueFetching(net.wotonomy.control.EOEditingContext anEditingContext,
                                                    int count,
                                                    int limit,
                                                    net.wotonomy.control.EOObjectStore anObjectStore)
Called by the specified object store to determine whether fetching should continue, where count is the current count and limit is the limit as specified by the fetch specification. This implementation presents an JOptionPane allowing the user to specify whether to continue. Override to customize.



Copyright © 2006 null. All Rights Reserved.