author | Claus Gittinger <cg@exept.de> |
Mon, 03 Mar 2008 10:39:33 +0100 | |
changeset 7996 | 7074ccb92b99 |
parent 7986 | ecee84d41552 |
child 8044 | 1b889062670d |
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 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
375 |
update:something with:aParameter from:changedObject |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
376 |
changedObject == toDoList ifTrue:[ |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
377 |
self updateShownToDoList. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
378 |
^ self |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
379 |
]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
380 |
^ 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
|
381 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
382 |
"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
|
383 |
! |
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 |
updateShownToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
386 |
self shownCopyOfToDoList contents:(self toDoList). |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
387 |
self resort. |
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:58 / 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 |
|
7443 | 392 |
!ToDoListBrowser methodsFor:'initialization & release'! |
393 |
||
394 |
closeDownViews |
|
395 |
"This is a hook method generated by the Browser. |
|
396 |
It will be invoked when your app/dialog-window is really closed. |
|
397 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
398 |
or ask the user for confirmation." |
|
399 |
||
400 |
"/ change the code below as required ... |
|
401 |
"/ This should cleanup any leftover resources |
|
402 |
"/ (for example, temporary files) |
|
403 |
"/ super closeRequest will initiate the closeDown |
|
404 |
||
405 |
"/ add your code here |
|
406 |
||
407 |
"/ do not remove the one below ... |
|
408 |
^ super closeDownViews |
|
409 |
! |
|
410 |
||
411 |
closeRequest |
|
412 |
"This is a hook method generated by the Browser. |
|
413 |
It will be invoked when your app/dialog-window is about to be |
|
414 |
closed (this method has a chance to suppress the close). |
|
415 |
See also #closeDownViews, which is invoked when the close is really done." |
|
416 |
||
417 |
"/ change the code below as required ... |
|
418 |
"/ Closing can be suppressed, by simply returning. |
|
419 |
"/ The 'super closeRequest' at the end will initiate the real closeDown |
|
420 |
||
421 |
("self hasUnsavedChanges" false) ifTrue:[ |
|
422 |
(self confirm:(resources string:'Close without saving ?')) ifFalse:[ |
|
423 |
^ self |
|
424 |
] |
|
425 |
]. |
|
426 |
||
427 |
^ super closeRequest |
|
428 |
||
429 |
"Modified: / 21-10-2006 / 19:21:02 / cg" |
|
430 |
! |
|
431 |
||
432 |
postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
433 |
self toDoList addDependent:self. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
434 |
self updateShownToDoList. |
7443 | 435 |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
436 |
ToDoList autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
437 |
ToDoListEntry autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
438 |
CompilerWarningToDoListEntry autoload. |
7443 | 439 |
|
440 |
^ super postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
441 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
442 |
"Modified: / 18-02-2007 / 12:55:57 / cg" |
7443 | 443 |
! |
444 |
||
445 |
postOpenWith:aBuilder |
|
446 |
"This is a hook method generated by the Browser. |
|
447 |
It will be invoked right after the applications window has been opened. |
|
448 |
Add any app-specific actions here (starting background processes etc.). |
|
449 |
See also #postBuildWith:, which is invoked before opening." |
|
450 |
||
451 |
"/ add any code here ... |
|
452 |
||
453 |
^ super postOpenWith:aBuilder |
|
454 |
! |
|
455 |
||
456 |
release |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
457 |
self toDoList removeDependent:self. |
7443 | 458 |
self == TheOneAndOnlyToDoListBrowser ifTrue:[ |
459 |
TheOneAndOnlyToDoListBrowser := nil |
|
460 |
]. |
|
461 |
super release. |
|
462 |
||
463 |
"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
|
464 |
"Modified: / 18-02-2007 / 12:57:07 / cg" |
7443 | 465 |
! ! |
466 |
||
467 |
!ToDoListBrowser methodsFor:'menu actions'! |
|
468 |
||
469 |
clearList |
|
470 |
toDoList removeAll |
|
471 |
||
472 |
"Created: / 22-10-2006 / 00:02:15 / cg" |
|
473 |
! |
|
474 |
||
475 |
openAboutThisApplication |
|
476 |
super openAboutThisApplication |
|
477 |
! |
|
478 |
||
479 |
openDocumentation |
|
7933 | 480 |
HTMLDocumentView openFullOnDocumentationFile:'tools\misc\TOP.html#TODOLIST'. |
7443 | 481 |
|
482 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName' |
|
483 |
"/ directory, and open a viewer with: |
|
484 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'. |
|
485 |
! ! |
|
486 |
||
487 |
!ToDoListBrowser methodsFor:'menu actions-item'! |
|
488 |
||
489 |
browseItem |
|
7986 | 490 |
(self todoListEntryAtIndex:self selectionIndexHolder value) browse |
7443 | 491 |
|
492 |
"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
|
493 |
"Modified: / 18-02-2007 / 12:56:49 / cg" |
7443 | 494 |
! |
495 |
||
496 |
removeItem |
|
7986 | 497 |
toDoList remove:(self selectedTodoListEntry) |
7443 | 498 |
|
499 |
"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
|
500 |
"Modified: / 18-02-2007 / 12:57:58 / cg" |
7986 | 501 |
! |
502 |
||
503 |
removeItems:entriesToRemove |
|
504 |
entriesToRemove do:[:entryToRemove | |
|
505 |
toDoList remove:entryToRemove |
|
506 |
]. |
|
507 |
! |
|
508 |
||
509 |
removeItemsForClass |
|
510 |
|cls entriesToRemove| |
|
511 |
||
512 |
cls := self selectedTodoListEntry problemClass. |
|
513 |
entriesToRemove := toDoList select:[:entry | entry problemClass == cls]. |
|
514 |
self removeItems:entriesToRemove |
|
515 |
! |
|
516 |
||
517 |
removeItemsForClassOrPrivateClass |
|
518 |
|cls entriesToRemove| |
|
519 |
||
520 |
cls := self selectedTodoListEntry problemClass. |
|
521 |
entriesToRemove := toDoList select:[:entry | entry problemClass == cls |
|
522 |
or:[ entry problemClass topOwningClass == cls]]. |
|
523 |
self removeItems:entriesToRemove |
|
7443 | 524 |
! ! |
525 |
||
526 |
!ToDoListBrowser methodsFor:'user actions'! |
|
527 |
||
528 |
itemDoubleClicked:itemIndex |
|
7986 | 529 |
(self selectedTodoListEntry) browse |
7443 | 530 |
|
531 |
"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
|
532 |
"Modified: / 18-02-2007 / 12:56:30 / cg" |
7469 | 533 |
! |
534 |
||
535 |
resort |
|
536 |
|sortBlock sortBlock1 col| |
|
537 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
538 |
currentSortOrder isNil ifTrue:[^ self ]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
539 |
|
7469 | 540 |
col := currentSortOrder at:#column. |
541 |
||
7996 | 542 |
sortBlock := sortBlock1 := [:a :b | |
543 |
|vA vB| |
|
544 |
||
545 |
vA := (a perform:col). |
|
546 |
vB := (b perform:col). |
|
547 |
vA = vB ifTrue:[ |
|
548 |
col == #severity ifTrue:[ |
|
549 |
vA := a priority. |
|
550 |
vB := b priority. |
|
551 |
] |
|
552 |
]. |
|
553 |
vA < vB |
|
554 |
]. |
|
7469 | 555 |
|
556 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
557 |
sortBlock := [:a :b | (sortBlock1 value:a value:b) not ]. |
|
558 |
]. |
|
559 |
||
560 |
"/ 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
|
561 |
self shownCopyOfToDoList sort:sortBlock |
7469 | 562 |
|
563 |
"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
|
564 |
"Modified: / 18-02-2007 / 13:02:19 / cg" |
7469 | 565 |
! |
566 |
||
567 |
sortBy:instanceName |
|
568 |
self sortBy:instanceName withReverse:true |
|
569 |
||
570 |
"Created: / 25-10-2006 / 00:53:55 / cg" |
|
571 |
! |
|
572 |
||
573 |
sortBy:instanceName withReverse:aBoolean |
|
574 |
|aSymbol| |
|
575 |
||
576 |
aSymbol := instanceName asSymbol. |
|
577 |
||
578 |
currentSortOrder isNil ifTrue:[ |
|
579 |
currentSortOrder := Dictionary new. |
|
580 |
currentSortOrder at:#column put:aSymbol. |
|
581 |
currentSortOrder at:#reverse put:false. |
|
582 |
] ifFalse:[ |
|
583 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
584 |
"/ same column like before - change sort order ifReverse is true |
|
585 |
aBoolean ifTrue:[ |
|
586 |
| isReverse | |
|
587 |
isReverse := currentSortOrder at:#reverse. |
|
588 |
currentSortOrder at:#reverse put:(isReverse not). |
|
589 |
]. |
|
590 |
] ifFalse:[ |
|
591 |
"/ another column - remark column |
|
592 |
currentSortOrder at:#column put:aSymbol. |
|
593 |
] |
|
594 |
]. |
|
595 |
self resort. |
|
596 |
||
597 |
"Created: / 25-10-2006 / 00:54:59 / cg" |
|
7443 | 598 |
! ! |
599 |
||
600 |
!ToDoListBrowser class methodsFor:'documentation'! |
|
601 |
||
602 |
version |
|
7996 | 603 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListBrowser.st,v 1.12 2008-03-03 09:39:33 cg Exp $' |
7443 | 604 |
! ! |