/* Wotonomy: OpenStep design patterns for pure Java applications. Copyright (C) 2001 Intersect Software Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see http://www.gnu.org */ package net.wotonomy.ui; import java.util.List; import net.wotonomy.control.EODataSource; import net.wotonomy.foundation.NSArray; import net.wotonomy.foundation.NSNotification; /** * A convenience class for creating display group delegates. * All methods of the delegate interface are implemented * to do nothing. * * @author michael@mpowers.net * @author $Author: cgruber $ * @version $Revision: 904 $ */ public class DelegateAdapter implements EODisplayGroup.Delegate { /** * Called when the specified data source fails * to create an object for the specified display group. */ public void displayGroupCreateObjectFailed ( EODisplayGroup aDisplayGroup, EODataSource aDataSource ) { } /** * Called after the specified display group's * data source is changed. */ public void displayGroupDidChangeDataSource ( EODisplayGroup aDisplayGroup ) { } /** * Called after the specified display group's * selection has changed. */ public void displayGroupDidChangeSelectedObjects ( EODisplayGroup aDisplayGroup ) { } /** * Called after the specified display group's * selection has changed. */ public void displayGroupDidChangeSelection ( EODisplayGroup aDisplayGroup ) { } /** * Called after the specified object display group's * selection has changed. */ public void displayGroupDidDeleteObject ( EODisplayGroup aDisplayGroup, Object anObject ) { } /** * Called after the specified display group * has fetched the specified object list. */ public void displayGroupDidFetchObjects ( EODisplayGroup aDisplayGroup, List anObjectList ) { } /** * Called after the specified display group * has inserted the specified object into * its internal object list. */ public void displayGroupDidInsertObject ( EODisplayGroup aDisplayGroup, Object anObject ) { } /** * Called after the specified display group * has set the specified value for the specified * object and key. */ public void displayGroupDidSetValueForObject ( EODisplayGroup aDisplayGroup, Object aValue, Object anObject, String aKey ) { } /** * Called by the specified display group to * determine what objects should be displayed * for the objects in the specified list. * @return An NSArray containing the objects * to be displayed for the objects in the * specified list. */ public NSArray displayGroupDisplayArrayForObjects ( EODisplayGroup aDisplayGroup, List aList ) { return new NSArray( aList ); } /** * Called by the specified display group before * it attempts to change the selection. * This implementation returns true. * @return True to allow the selection to change, * false otherwise. */ public boolean displayGroupShouldChangeSelection ( EODisplayGroup aDisplayGroup, List aSelectionList ) { return true; } /** * Called by the specified display group before * it attempts to delete the specified object. * This implementation returns true. * @return True to allow the object to be deleted * false to prevent the deletion. */ public boolean displayGroupShouldDeleteObject ( EODisplayGroup aDisplayGroup, Object anObject ) { return true; } /** * Called by the specified display group before * it attempts display the specified alert to * the user. * This implementation returns true. * @return True to allow the message to be * displayed, false if you want to handle the * alert yourself and suppress the display group's * notification. */ public boolean displayGroupShouldDisplayAlert ( EODisplayGroup aDisplayGroup, String aTitle, String aMessage ) { return true; } /** * Called by the specified display group before * it attempts fetch objects. * This implementation returns true. * @return True to allow the fetch to take place, * false to prevent the fetch. */ public boolean displayGroupShouldFetch ( EODisplayGroup aDisplayGroup ) { return true; } /** * Called by the specified display group before * it attempts to insert the specified object. * This implementation returns true. * @return True to allow the object to be inserted * false to prevent the insertion. */ public boolean displayGroupShouldInsertObject ( EODisplayGroup aDisplayGroup, Object anObject, int anIndex ) { return true; } /** * No idea what this might indicate, * nor what the notification indicates. * This implementation returns true. */ public boolean displayGroupShouldRedisplay ( EODisplayGroup aDisplayGroup, NSNotification aNotification ) { return true; } /** * No idea what this might indicate, * nor what the notification indicates. */ public boolean displayGroupShouldRefetch ( EODisplayGroup aDisplayGroup, NSNotification aNotification ) { return true; } } /* * $Log$ * Revision 1.2 2006/02/18 23:14:35 cgruber * Update imports and maven dependencies. * * Revision 1.1 2006/02/16 13:22:22 cgruber * Check in all sources in eclipse-friendly maven-enabled packages. * * Revision 1.2 2003/08/06 23:07:52 chochos * general code cleanup (mostly, removing unused imports) * * Revision 1.1 2001/01/24 14:23:17 mpowers * Contributing DelegateAdapter. * * */