1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
/*
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.
*
*
*/
|