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