|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
net.wotonomy.web.WODisplayGroup
public class WODisplayGroup
WODisplayGroup manages a set of objects, allowing them to be sorted, batched, and filtered. WODisplay also acts as a bridge to the wotonomy's control package, including WODisplayGroup and EOEditingContext.
| Nested Class Summary | |
|---|---|
static interface |
WODisplayGroup.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 | |
|---|---|
WODisplayGroup()
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. |
net.wotonomy.foundation.NSArray |
allQualifierOperators()
Returns a list containing all supported qualifier operators. |
int |
batchCount()
Returns the total number of batches held by this display group. |
boolean |
clearSelection()
Clears the current selection. |
int |
currentBatchIndex()
Returns the index of the currently displayed batch. |
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. |
java.lang.Object |
delete()
Convenience for binding to a component action: calls deleteSelection() and then displayBatchContainingSelectedObject() and returns null, which is a suitable result from a component action. |
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. |
java.lang.String |
detailKey()
Returns the key by which this display group is bound a master display group, or null if this is not a detail display group. |
java.lang.Object |
displayBatchContainingSelectedObject()
Sets the displayed objects to the batch containing the first selected object, and updates the current batch index, and returns null to force a page reload. |
net.wotonomy.foundation.NSArray |
displayedObjects()
Returns a read-only List of all objects in the display group that are currently displayed by the associations. |
java.lang.Object |
displayNextBatch()
Sets the displayed objects to the next batch and updates the current batch index, and returns null to force a page reload. |
java.lang.Object |
displayPreviousBatch()
Sets the displayed objects to the next batch and updates the current batch index, and returns null to force a page reload. |
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 |
endEditing()
Deprecated: returns true. |
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. |
java.lang.Object |
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 |
hasDetailDataSource()
Returns whether the data source is a detail data source, suggesting that this is a detail display group. |
boolean |
hasMultipleBatches()
Returns whether the displayed objects have been batched. |
int |
indexOfFirstDisplayedObject()
Returns the one-based index within the displayed objects list of the first displayed object in the current batch. |
int |
indexOfLastDisplayedObject()
Returns the one-based index within the displayed objects list of the first last object in the current batch. |
boolean |
inQueryMode()
Returns whether this display group is in "query by example" mode. |
java.lang.Object |
insert()
Convenience to call insertNewObjectAtIndex with the current selection plus one, or at the end of the list if there is no selection. |
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. |
java.lang.Object |
masterObject()
Returns the selected object in the master display group, or null if this is not a detail display group. |
int |
numberOfObjectsPerBatch()
Returns the number of objects per batch. |
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.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.NSMutableDictionary |
queryBindings()
Returns a Map containing the mappings of keys to binding query values. |
net.wotonomy.foundation.NSDictionary |
queryBindingValues()
Returns a Map containing the mappings of keys to binding query values. |
net.wotonomy.foundation.NSMutableDictionary |
queryMatch()
Returns a Map containing the mappings of keys to binding query values for a matching query. |
net.wotonomy.foundation.NSMutableDictionary |
queryMax()
Returns a Map containing the mappings of keys to binding query values for a maximum value query. |
net.wotonomy.foundation.NSMutableDictionary |
queryMin()
Returns a Map containing the mappings of keys to binding query values for a minimum value query. |
net.wotonomy.foundation.NSMutableDictionary |
queryOperator()
Returns a Map containing the mappings of keys to operator 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. |
net.wotonomy.foundation.NSArray |
selectionIndexes()
Returns a read-only List containing the indexes of all selected objects, if any. |
java.lang.Object |
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 |
selectObjectsIdenticalToSelectFirstOnNoMatch(java.util.List anObjectList,
boolean selectFirstIfNoMatch)
Calls selectObjectsIdenticalTo and if false is returned and selectFirstIfNoMatch is true, selects the first object. |
java.lang.Object |
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 |
setCurrentBatchIndex(int aBatchIndex)
Sets the index of the currently displayed batch. |
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 |
setDetailKey(java.lang.String aKey)
Sets the key by which this display group is bound a master 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 |
setMasterObject(java.lang.Object anObject)
Sets the master object in the detail data source. |
void |
setNumberOfObjectsPerBatch(int aSize)
Returns the number of objects per batch. |
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 |
|---|
public static final java.lang.String DisplayGroupWillFetchNotification
protected net.wotonomy.foundation.NSMutableArray allObjects
protected net.wotonomy.foundation.NSArray allObjectsProxy
protected net.wotonomy.foundation.NSMutableArray displayedObjects
protected net.wotonomy.foundation.NSArray displayedObjectsProxy
protected net.wotonomy.foundation.NSMutableArray selectedObjects
protected net.wotonomy.foundation.NSArray selectedObjectsProxy
protected net.wotonomy.foundation.NSMutableArray selectedIndexes
| Constructor Detail |
|---|
public WODisplayGroup()
| Method Detail |
|---|
public void setDataSource(net.wotonomy.control.EODataSource aDataSource)
public net.wotonomy.control.EODataSource dataSource()
public java.lang.String detailKey()
public void setDetailKey(java.lang.String aKey)
public boolean hasDetailDataSource()
public java.lang.Object masterObject()
public void setMasterObject(java.lang.Object anObject)
public void setDelegate(java.lang.Object aDelegate)
public java.lang.Object delegate()
public java.lang.String defaultStringMatchFormat()
public java.lang.String defaultStringMatchOperator()
public void enterQueryMode(java.lang.Object aSender)
public boolean fetchesOnLoad()
public boolean inQueryMode()
public net.wotonomy.foundation.NSDictionary insertedObjectDefaultValues()
public net.wotonomy.foundation.NSArray localKeys()
public boolean selectsFirstObjectAfterFetch()
public void setDefaultStringMatchFormat(java.lang.String aFormat)
public void setDefaultStringMatchOperator(java.lang.String anOperator)
public void setFetchesOnLoad(boolean willFetch)
public void setInQueryMode(boolean isInQueryMode)
public void setInsertedObjectDefaultValues(java.util.Map aMap)
public void setLocalKeys(java.util.List aKeyList)
public void setSelectsFirstObjectAfterFetch(boolean selectsFirst)
public void setSortOrderings(java.util.List aList)
public void setUsesOptimisticRefresh(boolean isOptimistic)
public void setValidatesChangesImmediately(boolean validatesImmediately)
public net.wotonomy.foundation.NSArray sortOrderings()
public boolean usesOptimisticRefresh()
public boolean validatesChangesImmediately()
public net.wotonomy.control.EOQualifier qualifier()
public net.wotonomy.control.EOQualifier qualifierFromQueryValues()
public void qualifyDataSource()
public void qualifyDisplayGroup()
public net.wotonomy.foundation.NSDictionary queryBindingValues()
public net.wotonomy.foundation.NSMutableDictionary queryBindings()
public net.wotonomy.foundation.NSMutableDictionary queryMatch()
public net.wotonomy.foundation.NSMutableDictionary queryMin()
public net.wotonomy.foundation.NSMutableDictionary queryMax()
public net.wotonomy.foundation.NSMutableDictionary queryOperator()
public net.wotonomy.foundation.NSArray allQualifierOperators()
public net.wotonomy.foundation.NSDictionary queryOperatorValues()
public void setQualifier(net.wotonomy.control.EOQualifier aQualifier)
public void setQueryBindingValues(java.util.Map aMap)
public void setQueryOperatorValues(java.util.Map aMap)
public net.wotonomy.foundation.NSDictionary equalToQueryValues()
public net.wotonomy.foundation.NSDictionary greaterThanQueryValues()
public net.wotonomy.foundation.NSDictionary lessThanQueryValues()
public void setEqualToQueryValues(java.util.Map aMap)
public void setGreaterThanQueryValues(java.util.Map aMap)
public void setLessThanQueryValues(java.util.Map aMap)
public boolean endEditing()
public net.wotonomy.foundation.NSArray allObjects()
public int batchCount()
public int currentBatchIndex()
public void setCurrentBatchIndex(int aBatchIndex)
public java.lang.Object displayBatchContainingSelectedObject()
public java.lang.Object displayNextBatch()
public java.lang.Object displayPreviousBatch()
public boolean hasMultipleBatches()
public int indexOfFirstDisplayedObject()
public int indexOfLastDisplayedObject()
public int numberOfObjectsPerBatch()
public void setNumberOfObjectsPerBatch(int aSize)
public boolean clearSelection()
setSelectionIndexes(java.util.List)public java.lang.Object delete()
public boolean deleteObjectAtIndex(int anIndex)
public boolean deleteSelection()
public net.wotonomy.foundation.NSArray displayedObjects()
public java.lang.Object fetch()
public java.lang.Object insert()
public java.lang.Object insertNewObjectAtIndex(int anIndex)
public void insertObjectAtIndex(java.lang.Object anObject,
int anIndex)
public void redisplay()
public java.lang.Object selectNext()
public boolean selectObject(java.lang.Object anObject)
public boolean selectObjectsIdenticalTo(java.util.List anObjectList)
public boolean selectObjectsIdenticalToSelectFirstOnNoMatch(java.util.List anObjectList,
boolean selectFirstIfNoMatch)
public java.lang.Object selectPrevious()
public java.lang.Object selectedObject()
public net.wotonomy.foundation.NSArray selectedObjects()
public net.wotonomy.foundation.NSArray selectionIndexes()
public void setObjectArray(java.util.List anObjectList)
public void setSelectedObject(java.lang.Object anObject)
public void setSelectedObjects(java.util.List aList)
public boolean setSelectionIndexes(java.util.List aList)
public void updateDisplayedObjects()
public int updatedObjectIndex()
public java.lang.Object selectedObjectValueForKey(java.lang.String aKey)
public boolean setSelectedObjectValue(java.lang.Object aValue,
java.lang.String aKey)
public boolean setValueForObject(java.lang.Object aValue,
java.lang.Object anObject,
java.lang.String aKey)
public boolean setValueForObjectAtIndex(java.lang.Object aValue,
int anIndex,
java.lang.String aKey)
public java.lang.Object valueForObject(java.lang.Object anObject,
java.lang.String aKey)
public java.lang.Object valueForObjectAtIndex(int anIndex,
java.lang.String aKey)
public java.lang.String toString()
toString in class java.lang.Objectpublic void objectsInvalidatedInEditingContext(net.wotonomy.foundation.NSNotification aNotification)
public static boolean globalDefaultForValidatesChangesImmediately()
public static java.lang.String globalDefaultStringMatchFormat()
public static java.lang.String globalDefaultStringMatchOperator()
public static void setGlobalDefaultForValidatesChangesImmediately(boolean validatesImmediately)
public static void setGlobalDefaultStringMatchFormat(java.lang.String aFormat)
public static void setGlobalDefaultStringMatchOperator(java.lang.String anOperator)
protected void willChange()
public void objectWillChange(java.lang.Object anObject)
objectWillChange in interface net.wotonomy.control.EOObservingpublic void editingContextWillSaveChanges(net.wotonomy.control.EOEditingContext anEditingContext)
editingContextWillSaveChanges in interface net.wotonomy.control.EOEditingContext.Editorpublic boolean editorHasChangesForEditingContext(net.wotonomy.control.EOEditingContext anEditingContext)
editorHasChangesForEditingContext in interface net.wotonomy.control.EOEditingContext.Editor
public void editingContextPresentErrorMessage(net.wotonomy.control.EOEditingContext anEditingContext,
java.lang.String aMessage)
public boolean editingContextShouldContinueFetching(net.wotonomy.control.EOEditingContext anEditingContext,
int count,
int limit,
net.wotonomy.control.EOObjectStore anObjectStore)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||