View Javadoc

1   /*
2   Wotonomy: OpenStep design patterns for pure Java applications.
3   Copyright (C) 2001 Intersect Software Corporation
4   
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9   
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  Lesser General Public License for more details.
14  
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, see http://www.gnu.org
17  */
18  
19  package net.wotonomy.ui;
20  
21  import java.util.List;
22  
23  import net.wotonomy.control.EODataSource;
24  import net.wotonomy.foundation.NSArray;
25  import net.wotonomy.foundation.NSNotification;
26  
27      /***
28      * A convenience class for creating display group delegates.
29      * All methods of the delegate interface are implemented
30      * to do nothing.
31      *
32      * @author michael@mpowers.net
33      * @author $Author: cgruber $
34      * @version $Revision: 904 $
35      */
36      public class DelegateAdapter implements EODisplayGroup.Delegate
37      {
38          /***
39          * Called when the specified data source fails
40          * to create an object for the specified display group.
41          */
42  		public void displayGroupCreateObjectFailed ( 
43  			EODisplayGroup aDisplayGroup,
44  			EODataSource aDataSource )
45          {
46                          
47          }
48  
49          /***
50  		* Called after the specified display group's
51  		* data source is changed.
52  		*/
53  		public void displayGroupDidChangeDataSource ( 
54  			EODisplayGroup aDisplayGroup )
55          {
56                          
57          }
58  
59  		/***
60  		* Called after the specified display group's
61  		* selection has changed.
62  		*/
63  		public void displayGroupDidChangeSelectedObjects ( 
64  			EODisplayGroup aDisplayGroup )
65          {
66                          
67          }
68  
69  		/***
70  		* Called after the specified display group's
71  		* selection has changed.
72  		*/
73  		public void displayGroupDidChangeSelection ( 
74  			EODisplayGroup aDisplayGroup )
75          {
76                          
77          }
78  
79  		/***
80  		* Called after the specified object display group's
81  		* selection has changed.
82  		*/
83  		public void displayGroupDidDeleteObject ( 
84  			EODisplayGroup aDisplayGroup,
85  			Object anObject )
86          {
87                          
88          }
89  
90  		/***
91  		* Called after the specified display group
92  		* has fetched the specified object list.
93  		*/
94  		public void displayGroupDidFetchObjects ( 
95  			EODisplayGroup aDisplayGroup,
96  			List anObjectList )
97          {
98                          
99          }
100 
101 		/***
102 		* Called after the specified display group
103 		* has inserted the specified object into
104 		* its internal object list.
105 		*/
106 		public void displayGroupDidInsertObject ( 
107 			EODisplayGroup aDisplayGroup,
108 			Object anObject )
109         {
110                         
111         }
112 
113 		/***
114 		* Called after the specified display group
115 		* has set the specified value for the specified
116 		* object and key.
117 		*/
118 		public void displayGroupDidSetValueForObject ( 
119 			EODisplayGroup aDisplayGroup,
120 			Object aValue,
121 			Object anObject,
122 			String aKey )
123         {
124                         
125         }
126 
127 		/***
128 		* Called by the specified display group to
129 		* determine what objects should be displayed
130 		* for the objects in the specified list.
131 		* @return An NSArray containing the objects
132 		* to be displayed for the objects in the 
133 		* specified list.
134 		*/
135 		public NSArray displayGroupDisplayArrayForObjects ( 
136 			EODisplayGroup aDisplayGroup,
137 			List aList )
138         {
139             return new NSArray( aList );                
140         }
141 
142 		/***
143 		* Called by the specified display group before
144 		* it attempts to change the selection.
145         * This implementation returns true.
146 		* @return True to allow the selection to change,
147 		* false otherwise.
148 		*/
149 		public boolean displayGroupShouldChangeSelection ( 
150 			EODisplayGroup aDisplayGroup,
151 			List aSelectionList )
152         {
153             return true;
154         }
155 
156 		/***
157 		* Called by the specified display group before
158 		* it attempts to delete the specified object.
159         * This implementation returns true.
160 		* @return True to allow the object to be deleted
161 		* false to prevent the deletion.
162 		*/
163 		public boolean displayGroupShouldDeleteObject ( 
164 			EODisplayGroup aDisplayGroup,
165 			Object anObject )
166         {
167             return true;
168         }
169 
170 		/***
171 		* Called by the specified display group before
172 		* it attempts display the specified alert to
173 		* the user.
174         * This implementation returns true.
175 		* @return True to allow the message to be 
176 		* displayed, false if you want to handle the
177 		* alert yourself and suppress the display group's
178 		* notification.
179 		*/
180 		public boolean displayGroupShouldDisplayAlert ( 
181 			EODisplayGroup aDisplayGroup,
182 			String aTitle,
183 			String aMessage )
184         {
185             return true;
186         }
187 
188 		/***
189 		* Called by the specified display group before
190 		* it attempts fetch objects.
191         * This implementation returns true.
192 		* @return True to allow the fetch to take place,
193 		* false to prevent the fetch.
194 		*/
195 		public boolean displayGroupShouldFetch ( 
196 			EODisplayGroup aDisplayGroup )
197         {
198             return true;
199         }
200 
201 		/***
202 		* Called by the specified display group before
203 		* it attempts to insert the specified object.
204         * This implementation returns true.
205 		* @return True to allow the object to be inserted
206 		* false to prevent the insertion.
207 		*/
208 		public boolean displayGroupShouldInsertObject ( 
209 			EODisplayGroup aDisplayGroup,
210 			Object anObject,
211 			int anIndex )
212         {
213             return true;
214         }
215 
216 		/***
217 		* No idea what this might indicate,
218 		* nor what the notification indicates.
219         * This implementation returns true.
220 		*/
221 		public boolean displayGroupShouldRedisplay ( 
222 			EODisplayGroup aDisplayGroup,
223 			NSNotification aNotification )
224         {
225             return true;
226         }
227 
228 		/***
229 		* No idea what this might indicate,
230 		* nor what the notification indicates.
231 		*/
232 		public boolean displayGroupShouldRefetch ( 
233 			EODisplayGroup aDisplayGroup,
234 			NSNotification aNotification )
235         {
236             return true;
237         }
238         
239     }
240 
241 /*
242  * $Log$
243  * Revision 1.2  2006/02/18 23:14:35  cgruber
244  * Update imports and maven dependencies.
245  *
246  * Revision 1.1  2006/02/16 13:22:22  cgruber
247  * Check in all sources in eclipse-friendly maven-enabled packages.
248  *
249  * Revision 1.2  2003/08/06 23:07:52  chochos
250  * general code cleanup (mostly, removing unused imports)
251  *
252  * Revision 1.1  2001/01/24 14:23:17  mpowers
253  * Contributing DelegateAdapter.
254  *
255  *
256  */
257