author | Claus Gittinger <cg@exept.de> |
Wed, 20 Aug 2008 21:38:20 +0200 | |
changeset 8232 | f95957b67073 |
parent 8045 | af9f2e2fb059 |
child 8237 | 6213cd99534c |
permissions | -rw-r--r-- |
7443 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
3 |
"{ NameSpace: Tools }" |
|
4 |
||
5 |
ApplicationModel subclass:#ToDoListBrowser |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
6 |
instanceVariableNames:'toDoList shownCopyOfToDoList selectionIndexHolder |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
7 |
currentSortOrder' |
7443 | 8 |
classVariableNames:'TheOneAndOnlyToDoListBrowser' |
9 |
poolDictionaries:'' |
|
10 |
category:'Interface-Smalltalk-ToDo' |
|
11 |
! |
|
12 |
||
13 |
!ToDoListBrowser class methodsFor:'documentation'! |
|
14 |
||
15 |
documentation |
|
16 |
" |
|
17 |
documentation to be added. |
|
18 |
||
19 |
[author:] |
|
20 |
cg (cg@FUSI) |
|
21 |
||
22 |
[instance variables:] |
|
23 |
||
24 |
[class variables:] |
|
25 |
||
26 |
[see also:] |
|
27 |
||
28 |
" |
|
29 |
! |
|
30 |
||
31 |
examples |
|
32 |
" |
|
33 |
Starting the application: |
|
34 |
[exBegin] |
|
35 |
ToDoListBrowser open |
|
36 |
||
37 |
[exEnd] |
|
38 |
||
39 |
more examples to be added: |
|
40 |
[exBegin] |
|
41 |
... add code fragment for |
|
42 |
... executable example here ... |
|
43 |
[exEnd] |
|
44 |
" |
|
45 |
! ! |
|
46 |
||
47 |
!ToDoListBrowser class methodsFor:'class initialization'! |
|
48 |
||
49 |
current |
|
50 |
^ TheOneAndOnlyToDoListBrowser |
|
51 |
||
52 |
"Created: / 21-10-2006 / 20:37:48 / cg" |
|
53 |
! |
|
54 |
||
55 |
current:aBrowser |
|
56 |
TheOneAndOnlyToDoListBrowser := aBrowser. |
|
57 |
||
58 |
"Created: / 21-10-2006 / 20:38:08 / cg" |
|
59 |
! |
|
60 |
||
61 |
new |
|
62 |
|b| |
|
63 |
||
64 |
b := super new. |
|
65 |
TheOneAndOnlyToDoListBrowser isNil ifTrue:[ |
|
66 |
TheOneAndOnlyToDoListBrowser := b. |
|
67 |
]. |
|
68 |
^ b |
|
69 |
||
70 |
"Created: / 21-10-2006 / 20:39:03 / cg" |
|
71 |
! ! |
|
72 |
||
73 |
!ToDoListBrowser class methodsFor:'interface specs'! |
|
74 |
||
75 |
windowSpec |
|
76 |
"This resource specification was automatically generated |
|
77 |
by the UIPainter of ST/X." |
|
78 |
||
79 |
"Do not manually edit this!! If it is corrupted, |
|
80 |
the UIPainter may not be able to read the specification." |
|
81 |
||
82 |
" |
|
83 |
UIPainter new openOnClass:ToDoListBrowser andSelector:#windowSpec |
|
84 |
ToDoListBrowser new openInterface:#windowSpec |
|
85 |
ToDoListBrowser open |
|
86 |
" |
|
87 |
||
88 |
<resource: #canvas> |
|
89 |
||
90 |
^ |
|
91 |
#(FullSpec |
|
92 |
name: windowSpec |
|
93 |
window: |
|
94 |
(WindowSpec |
|
95 |
label: 'ToDoListBrowser' |
|
96 |
name: 'ToDoListBrowser' |
|
97 |
min: (Point 10 10) |
|
98 |
max: (Point 1024 768) |
|
99 |
bounds: (Rectangle 0 0 577 395) |
|
100 |
menu: mainMenu |
|
101 |
) |
|
102 |
component: |
|
103 |
(SpecCollection |
|
104 |
collection: ( |
|
105 |
(DataSetSpec |
|
7736 | 106 |
name: 'Table' |
7443 | 107 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
108 |
model: selectionIndexHolder |
|
109 |
menu: itemMenu |
|
110 |
hasHorizontalScrollBar: true |
|
111 |
hasVerticalScrollBar: true |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
112 |
dataList: shownCopyOfToDoList |
7443 | 113 |
doubleClickSelector: itemDoubleClicked: |
114 |
columnHolder: tableColumns |
|
115 |
) |
|
116 |
) |
|
117 |
||
118 |
) |
|
119 |
) |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
120 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
121 |
"Modified: / 18-02-2007 / 12:55:32 / cg" |
7443 | 122 |
! ! |
123 |
||
124 |
!ToDoListBrowser class methodsFor:'menu specs'! |
|
125 |
||
126 |
itemMenu |
|
127 |
"This resource specification was automatically generated |
|
128 |
by the MenuEditor of ST/X." |
|
129 |
||
130 |
"Do not manually edit this!! If it is corrupted, |
|
131 |
the MenuEditor may not be able to read the specification." |
|
132 |
||
133 |
" |
|
7986 | 134 |
MenuEditor new openOnClass:Tools::ToDoListBrowser andSelector:#itemMenu |
135 |
(Menu new fromLiteralArrayEncoding:(Tools::ToDoListBrowser itemMenu)) startUp |
|
7443 | 136 |
" |
137 |
||
138 |
<resource: #menu> |
|
139 |
||
140 |
^ |
|
141 |
#(Menu |
|
142 |
( |
|
143 |
(MenuItem |
|
144 |
label: 'Browse' |
|
145 |
itemValue: browseItem |
|
146 |
translateLabel: true |
|
147 |
) |
|
148 |
(MenuItem |
|
149 |
label: '-' |
|
150 |
) |
|
151 |
(MenuItem |
|
152 |
label: 'Remove' |
|
153 |
itemValue: removeItem |
|
154 |
translateLabel: true |
|
155 |
) |
|
7986 | 156 |
(MenuItem |
157 |
label: 'Remove all Items for this Class' |
|
158 |
itemValue: removeItemsForClass |
|
159 |
translateLabel: true |
|
160 |
) |
|
161 |
(MenuItem |
|
162 |
label: 'Remove all Items for this Class and its Private Classes' |
|
163 |
itemValue: removeItemsForClassOrPrivateClass |
|
164 |
translateLabel: true |
|
165 |
) |
|
7443 | 166 |
) |
167 |
nil |
|
168 |
nil |
|
169 |
) |
|
170 |
! |
|
171 |
||
172 |
mainMenu |
|
173 |
"This resource specification was automatically generated |
|
174 |
by the MenuEditor of ST/X." |
|
175 |
||
176 |
"Do not manually edit this!! If it is corrupted, |
|
177 |
the MenuEditor may not be able to read the specification." |
|
178 |
||
179 |
" |
|
7457 | 180 |
MenuEditor new openOnClass:Tools::ToDoListBrowser andSelector:#mainMenu |
181 |
(Menu new fromLiteralArrayEncoding:(Tools::ToDoListBrowser mainMenu)) startUp |
|
7443 | 182 |
" |
183 |
||
184 |
<resource: #menu> |
|
185 |
||
186 |
^ |
|
187 |
#(Menu |
|
188 |
( |
|
189 |
(MenuItem |
|
190 |
label: 'File' |
|
191 |
translateLabel: true |
|
192 |
submenu: |
|
193 |
(Menu |
|
194 |
( |
|
195 |
(MenuItem |
|
196 |
label: 'Exit' |
|
197 |
itemValue: closeRequest |
|
198 |
translateLabel: true |
|
199 |
) |
|
200 |
) |
|
201 |
nil |
|
202 |
nil |
|
203 |
) |
|
204 |
) |
|
205 |
(MenuItem |
|
206 |
label: 'List' |
|
207 |
translateLabel: true |
|
208 |
submenu: |
|
209 |
(Menu |
|
210 |
( |
|
211 |
(MenuItem |
|
212 |
label: 'Clear' |
|
213 |
itemValue: clearList |
|
214 |
translateLabel: true |
|
215 |
) |
|
216 |
) |
|
217 |
nil |
|
218 |
nil |
|
219 |
) |
|
220 |
) |
|
221 |
(MenuItem |
|
7464 | 222 |
label: 'MENU_Help' |
7443 | 223 |
translateLabel: true |
7457 | 224 |
startGroup: conditionalRight |
7443 | 225 |
submenu: |
226 |
(Menu |
|
227 |
( |
|
228 |
(MenuItem |
|
229 |
label: 'Documentation' |
|
230 |
itemValue: openDocumentation |
|
231 |
translateLabel: true |
|
232 |
) |
|
233 |
(MenuItem |
|
234 |
label: '-' |
|
235 |
) |
|
236 |
(MenuItem |
|
237 |
label: 'About this Application...' |
|
238 |
itemValue: openAboutThisApplication |
|
239 |
translateLabel: true |
|
240 |
) |
|
241 |
) |
|
242 |
nil |
|
243 |
nil |
|
244 |
) |
|
245 |
) |
|
246 |
) |
|
247 |
nil |
|
248 |
nil |
|
249 |
) |
|
7464 | 250 |
|
251 |
"Modified: / 23-10-2006 / 23:22:45 / cg" |
|
7443 | 252 |
! ! |
253 |
||
254 |
!ToDoListBrowser class methodsFor:'tableColumns specs'! |
|
255 |
||
256 |
tableColumns |
|
257 |
"This resource specification was automatically generated |
|
258 |
by the DataSetBuilder of ST/X." |
|
259 |
||
260 |
"Do not manually edit this!! If it is corrupted, |
|
261 |
the DataSetBuilder may not be able to read the specification." |
|
262 |
||
263 |
" |
|
264 |
DataSetBuilder new openOnClass:ToDoListBrowser andSelector:#tableColumns |
|
265 |
" |
|
266 |
||
267 |
<resource: #tableColumns> |
|
268 |
||
269 |
^#( |
|
270 |
(DataSetColumnSpec |
|
271 |
label: 'Type' |
|
272 |
labelButtonType: Button |
|
273 |
width: 32 |
|
7740 | 274 |
model: severityString |
7443 | 275 |
canSelect: false |
7996 | 276 |
labelActionSelector: sortBy: |
277 |
labelActionArgument: 'severity' |
|
7443 | 278 |
) |
279 |
(DataSetColumnSpec |
|
280 |
label: 'Prio' |
|
281 |
labelButtonType: Button |
|
282 |
width: 30 |
|
7996 | 283 |
model: priorityString |
7443 | 284 |
canSelect: false |
7740 | 285 |
labelActionSelector: sortBy: |
286 |
labelActionArgument: 'priority' |
|
7443 | 287 |
) |
288 |
(DataSetColumnSpec |
|
289 |
label: 'Time' |
|
290 |
labelButtonType: Button |
|
291 |
width: 50 |
|
292 |
model: time |
|
293 |
canSelect: false |
|
7469 | 294 |
labelAlignment: left |
295 |
labelActionSelector: sortBy: |
|
296 |
labelActionArgument: 'timestamp' |
|
7443 | 297 |
) |
298 |
(DataSetColumnSpec |
|
7733 | 299 |
label: 'Message' |
300 |
labelButtonType: Button |
|
301 |
model: message |
|
302 |
canSelect: false |
|
303 |
labelAlignment: left |
|
304 |
labelActionSelector: sortBy: |
|
305 |
labelActionArgument: 'message' |
|
306 |
) |
|
307 |
(DataSetColumnSpec |
|
7443 | 308 |
label: 'Where' |
309 |
labelButtonType: Button |
|
310 |
model: methodOrClassName |
|
311 |
canSelect: false |
|
7469 | 312 |
labelAlignment: left |
313 |
labelActionSelector: sortBy: |
|
314 |
labelActionArgument: 'methodOrClassName' |
|
7443 | 315 |
) |
316 |
) |
|
7469 | 317 |
|
318 |
"Modified: / 25-10-2006 / 01:05:50 / cg" |
|
7443 | 319 |
! ! |
320 |
||
321 |
!ToDoListBrowser methodsFor:'accessing'! |
|
322 |
||
323 |
addEntry:anEntry |
|
324 |
self toDoList add:anEntry |
|
325 |
||
326 |
"Created: / 21-10-2006 / 15:38:08 / cg" |
|
327 |
"Modified: / 21-10-2006 / 21:14:31 / cg" |
|
328 |
! |
|
329 |
||
7986 | 330 |
selectedTodoListEntry |
331 |
^ self todoListEntryAtIndex:(self selectionIndex). |
|
332 |
! |
|
333 |
||
334 |
selectionIndex |
|
335 |
^ self selectionIndexHolder value |
|
336 |
! |
|
337 |
||
7443 | 338 |
selectionIndexHolder |
339 |
selectionIndexHolder isNil ifTrue:[ |
|
340 |
selectionIndexHolder := nil asValue. |
|
341 |
]. |
|
342 |
^ selectionIndexHolder |
|
343 |
||
344 |
"Created: / 22-10-2006 / 02:00:41 / cg" |
|
345 |
! |
|
346 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
347 |
shownCopyOfToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
348 |
shownCopyOfToDoList isNil ifTrue:[ |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
349 |
shownCopyOfToDoList := List new |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
350 |
]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
351 |
^ shownCopyOfToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
352 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
353 |
"Created: / 18-02-2007 / 12:53:01 / cg" |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
354 |
! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
355 |
|
7443 | 356 |
toDoList |
357 |
toDoList isNil ifTrue:[ |
|
358 |
toDoList := ToDoList theOneAndOnlyToDoList. |
|
359 |
]. |
|
360 |
^ toDoList |
|
361 |
||
362 |
"Created: / 21-10-2006 / 20:57:18 / cg" |
|
7986 | 363 |
! |
364 |
||
365 |
todoListEntryAtIndex:idx |
|
366 |
^ shownCopyOfToDoList at:idx |
|
7443 | 367 |
! ! |
368 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
369 |
!ToDoListBrowser methodsFor:'change & update'! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
370 |
|
8044 | 371 |
delayedUpdate:something with:aParameter from:changedObject |
372 |
changedObject == toDoList ifTrue:[ |
|
373 |
self updateShownToDoList. |
|
374 |
^ self |
|
375 |
]. |
|
376 |
! |
|
377 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
378 |
update:something with:aParameter from:changedObject |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
379 |
changedObject == toDoList ifTrue:[ |
8045 | 380 |
self enqueueDelayedUpdate:nil with:nil from:changedObject. |
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
381 |
^ self |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
382 |
]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
383 |
^ super update:something with:aParameter from:changedObject |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
384 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
385 |
"Created: / 18-02-2007 / 12:54:32 / cg" |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
386 |
! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
387 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
388 |
updateShownToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
389 |
self shownCopyOfToDoList contents:(self toDoList). |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
390 |
self resort. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
391 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
392 |
"Created: / 18-02-2007 / 12:54:58 / cg" |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
393 |
! ! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
394 |
|
7443 | 395 |
!ToDoListBrowser methodsFor:'initialization & release'! |
396 |
||
397 |
closeDownViews |
|
398 |
"This is a hook method generated by the Browser. |
|
399 |
It will be invoked when your app/dialog-window is really closed. |
|
400 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
401 |
or ask the user for confirmation." |
|
402 |
||
403 |
"/ change the code below as required ... |
|
404 |
"/ This should cleanup any leftover resources |
|
405 |
"/ (for example, temporary files) |
|
406 |
"/ super closeRequest will initiate the closeDown |
|
407 |
||
408 |
"/ add your code here |
|
409 |
||
410 |
"/ do not remove the one below ... |
|
411 |
^ super closeDownViews |
|
412 |
! |
|
413 |
||
414 |
closeRequest |
|
415 |
"This is a hook method generated by the Browser. |
|
416 |
It will be invoked when your app/dialog-window is about to be |
|
417 |
closed (this method has a chance to suppress the close). |
|
418 |
See also #closeDownViews, which is invoked when the close is really done." |
|
419 |
||
420 |
"/ change the code below as required ... |
|
421 |
"/ Closing can be suppressed, by simply returning. |
|
422 |
"/ The 'super closeRequest' at the end will initiate the real closeDown |
|
423 |
||
424 |
("self hasUnsavedChanges" false) ifTrue:[ |
|
425 |
(self confirm:(resources string:'Close without saving ?')) ifFalse:[ |
|
426 |
^ self |
|
427 |
] |
|
428 |
]. |
|
429 |
||
430 |
^ super closeRequest |
|
431 |
||
432 |
"Modified: / 21-10-2006 / 19:21:02 / cg" |
|
433 |
! |
|
434 |
||
435 |
postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
436 |
self toDoList addDependent:self. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
437 |
self updateShownToDoList. |
7443 | 438 |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
439 |
ToDoList autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
440 |
ToDoListEntry autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
441 |
CompilerWarningToDoListEntry autoload. |
7443 | 442 |
|
443 |
^ super postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
444 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
445 |
"Modified: / 18-02-2007 / 12:55:57 / cg" |
7443 | 446 |
! |
447 |
||
448 |
postOpenWith:aBuilder |
|
449 |
"This is a hook method generated by the Browser. |
|
450 |
It will be invoked right after the applications window has been opened. |
|
451 |
Add any app-specific actions here (starting background processes etc.). |
|
452 |
See also #postBuildWith:, which is invoked before opening." |
|
453 |
||
454 |
"/ add any code here ... |
|
455 |
||
456 |
^ super postOpenWith:aBuilder |
|
457 |
! |
|
458 |
||
459 |
release |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
460 |
self toDoList removeDependent:self. |
7443 | 461 |
self == TheOneAndOnlyToDoListBrowser ifTrue:[ |
462 |
TheOneAndOnlyToDoListBrowser := nil |
|
463 |
]. |
|
464 |
super release. |
|
465 |
||
466 |
"Created: / 21-10-2006 / 20:40:31 / cg" |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
467 |
"Modified: / 18-02-2007 / 12:57:07 / cg" |
7443 | 468 |
! ! |
469 |
||
470 |
!ToDoListBrowser methodsFor:'menu actions'! |
|
471 |
||
472 |
clearList |
|
473 |
toDoList removeAll |
|
474 |
||
475 |
"Created: / 22-10-2006 / 00:02:15 / cg" |
|
476 |
! |
|
477 |
||
478 |
openAboutThisApplication |
|
479 |
super openAboutThisApplication |
|
480 |
! |
|
481 |
||
482 |
openDocumentation |
|
8232 | 483 |
HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#TODOLIST'. |
7443 | 484 |
|
485 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName' |
|
486 |
"/ directory, and open a viewer with: |
|
487 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'. |
|
488 |
! ! |
|
489 |
||
490 |
!ToDoListBrowser methodsFor:'menu actions-item'! |
|
491 |
||
492 |
browseItem |
|
7986 | 493 |
(self todoListEntryAtIndex:self selectionIndexHolder value) browse |
7443 | 494 |
|
495 |
"Created: / 22-10-2006 / 02:00:20 / cg" |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
496 |
"Modified: / 18-02-2007 / 12:56:49 / cg" |
7443 | 497 |
! |
498 |
||
499 |
removeItem |
|
7986 | 500 |
toDoList remove:(self selectedTodoListEntry) |
7443 | 501 |
|
502 |
"Created: / 22-10-2006 / 10:45:52 / cg" |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
503 |
"Modified: / 18-02-2007 / 12:57:58 / cg" |
7986 | 504 |
! |
505 |
||
506 |
removeItems:entriesToRemove |
|
507 |
entriesToRemove do:[:entryToRemove | |
|
508 |
toDoList remove:entryToRemove |
|
509 |
]. |
|
510 |
! |
|
511 |
||
512 |
removeItemsForClass |
|
513 |
|cls entriesToRemove| |
|
514 |
||
515 |
cls := self selectedTodoListEntry problemClass. |
|
516 |
entriesToRemove := toDoList select:[:entry | entry problemClass == cls]. |
|
517 |
self removeItems:entriesToRemove |
|
518 |
! |
|
519 |
||
520 |
removeItemsForClassOrPrivateClass |
|
521 |
|cls entriesToRemove| |
|
522 |
||
523 |
cls := self selectedTodoListEntry problemClass. |
|
524 |
entriesToRemove := toDoList select:[:entry | entry problemClass == cls |
|
525 |
or:[ entry problemClass topOwningClass == cls]]. |
|
526 |
self removeItems:entriesToRemove |
|
7443 | 527 |
! ! |
528 |
||
529 |
!ToDoListBrowser methodsFor:'user actions'! |
|
530 |
||
531 |
itemDoubleClicked:itemIndex |
|
7986 | 532 |
(self selectedTodoListEntry) browse |
7443 | 533 |
|
534 |
"Created: / 22-10-2006 / 01:49:13 / cg" |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
535 |
"Modified: / 18-02-2007 / 12:56:30 / cg" |
7469 | 536 |
! |
537 |
||
538 |
resort |
|
539 |
|sortBlock sortBlock1 col| |
|
540 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
541 |
currentSortOrder isNil ifTrue:[^ self ]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
542 |
|
7469 | 543 |
col := currentSortOrder at:#column. |
544 |
||
7996 | 545 |
sortBlock := sortBlock1 := [:a :b | |
546 |
|vA vB| |
|
547 |
||
548 |
vA := (a perform:col). |
|
549 |
vB := (b perform:col). |
|
550 |
vA = vB ifTrue:[ |
|
551 |
col == #severity ifTrue:[ |
|
552 |
vA := a priority. |
|
553 |
vB := b priority. |
|
554 |
] |
|
555 |
]. |
|
556 |
vA < vB |
|
557 |
]. |
|
7469 | 558 |
|
559 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
560 |
sortBlock := [:a :b | (sortBlock1 value:a value:b) not ]. |
|
561 |
]. |
|
562 |
||
563 |
"/ temporary hack - should make a copy of the real list |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
564 |
self shownCopyOfToDoList sort:sortBlock |
7469 | 565 |
|
566 |
"Created: / 25-10-2006 / 01:01:26 / cg" |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
567 |
"Modified: / 18-02-2007 / 13:02:19 / cg" |
7469 | 568 |
! |
569 |
||
570 |
sortBy:instanceName |
|
571 |
self sortBy:instanceName withReverse:true |
|
572 |
||
573 |
"Created: / 25-10-2006 / 00:53:55 / cg" |
|
574 |
! |
|
575 |
||
576 |
sortBy:instanceName withReverse:aBoolean |
|
577 |
|aSymbol| |
|
578 |
||
579 |
aSymbol := instanceName asSymbol. |
|
580 |
||
581 |
currentSortOrder isNil ifTrue:[ |
|
582 |
currentSortOrder := Dictionary new. |
|
583 |
currentSortOrder at:#column put:aSymbol. |
|
584 |
currentSortOrder at:#reverse put:false. |
|
585 |
] ifFalse:[ |
|
586 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
587 |
"/ same column like before - change sort order ifReverse is true |
|
588 |
aBoolean ifTrue:[ |
|
589 |
| isReverse | |
|
590 |
isReverse := currentSortOrder at:#reverse. |
|
591 |
currentSortOrder at:#reverse put:(isReverse not). |
|
592 |
]. |
|
593 |
] ifFalse:[ |
|
594 |
"/ another column - remark column |
|
595 |
currentSortOrder at:#column put:aSymbol. |
|
596 |
] |
|
597 |
]. |
|
598 |
self resort. |
|
599 |
||
600 |
"Created: / 25-10-2006 / 00:54:59 / cg" |
|
7443 | 601 |
! ! |
602 |
||
603 |
!ToDoListBrowser class methodsFor:'documentation'! |
|
604 |
||
605 |
version |
|
8232 | 606 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListBrowser.st,v 1.15 2008-08-20 19:38:20 cg Exp $' |
7443 | 607 |
! ! |