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