author | Claus Gittinger <cg@exept.de> |
Wed, 27 Feb 2008 17:13:10 +0100 | |
changeset 7986 | ecee84d41552 |
parent 7933 | cc2c54e4043b |
child 7996 | 7074ccb92b99 |
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 |
280 |
) |
|
281 |
(DataSetColumnSpec |
|
282 |
label: 'Prio' |
|
283 |
labelButtonType: Button |
|
284 |
width: 30 |
|
285 |
model: priority |
|
286 |
canSelect: false |
|
7740 | 287 |
labelActionSelector: sortBy: |
288 |
labelActionArgument: 'priority' |
|
7443 | 289 |
) |
290 |
(DataSetColumnSpec |
|
291 |
label: 'Time' |
|
292 |
labelButtonType: Button |
|
293 |
width: 50 |
|
294 |
model: time |
|
295 |
canSelect: false |
|
7469 | 296 |
labelAlignment: left |
297 |
labelActionSelector: sortBy: |
|
298 |
labelActionArgument: 'timestamp' |
|
7443 | 299 |
) |
300 |
(DataSetColumnSpec |
|
7733 | 301 |
label: 'Message' |
302 |
labelButtonType: Button |
|
303 |
model: message |
|
304 |
canSelect: false |
|
305 |
labelAlignment: left |
|
306 |
labelActionSelector: sortBy: |
|
307 |
labelActionArgument: 'message' |
|
308 |
) |
|
309 |
(DataSetColumnSpec |
|
7443 | 310 |
label: 'Where' |
311 |
labelButtonType: Button |
|
312 |
model: methodOrClassName |
|
313 |
canSelect: false |
|
7469 | 314 |
labelAlignment: left |
315 |
labelActionSelector: sortBy: |
|
316 |
labelActionArgument: 'methodOrClassName' |
|
7443 | 317 |
) |
318 |
) |
|
7469 | 319 |
|
320 |
"Modified: / 25-10-2006 / 01:05:50 / cg" |
|
7443 | 321 |
! ! |
322 |
||
323 |
!ToDoListBrowser methodsFor:'accessing'! |
|
324 |
||
325 |
addEntry:anEntry |
|
326 |
self toDoList add:anEntry |
|
327 |
||
328 |
"Created: / 21-10-2006 / 15:38:08 / cg" |
|
329 |
"Modified: / 21-10-2006 / 21:14:31 / cg" |
|
330 |
! |
|
331 |
||
7986 | 332 |
selectedTodoListEntry |
333 |
^ self todoListEntryAtIndex:(self selectionIndex). |
|
334 |
! |
|
335 |
||
336 |
selectionIndex |
|
337 |
^ self selectionIndexHolder value |
|
338 |
! |
|
339 |
||
7443 | 340 |
selectionIndexHolder |
341 |
selectionIndexHolder isNil ifTrue:[ |
|
342 |
selectionIndexHolder := nil asValue. |
|
343 |
]. |
|
344 |
^ selectionIndexHolder |
|
345 |
||
346 |
"Created: / 22-10-2006 / 02:00:41 / cg" |
|
347 |
! |
|
348 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
349 |
shownCopyOfToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
350 |
shownCopyOfToDoList isNil ifTrue:[ |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
351 |
shownCopyOfToDoList := List new |
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 |
^ shownCopyOfToDoList |
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 |
"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
|
356 |
! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
357 |
|
7443 | 358 |
toDoList |
359 |
toDoList isNil ifTrue:[ |
|
360 |
toDoList := ToDoList theOneAndOnlyToDoList. |
|
361 |
]. |
|
362 |
^ toDoList |
|
363 |
||
364 |
"Created: / 21-10-2006 / 20:57:18 / cg" |
|
7986 | 365 |
! |
366 |
||
367 |
todoListEntryAtIndex:idx |
|
368 |
^ shownCopyOfToDoList at:idx |
|
7443 | 369 |
! ! |
370 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
371 |
!ToDoListBrowser methodsFor:'change & update'! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
372 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
373 |
update:something with:aParameter from:changedObject |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
374 |
changedObject == toDoList ifTrue:[ |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
375 |
self updateShownToDoList. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
376 |
^ self |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
377 |
]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
378 |
^ 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
|
379 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
380 |
"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
|
381 |
! |
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 |
updateShownToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
384 |
self shownCopyOfToDoList contents:(self toDoList). |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
385 |
self resort. |
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 |
"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
|
388 |
! ! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
389 |
|
7443 | 390 |
!ToDoListBrowser methodsFor:'initialization & release'! |
391 |
||
392 |
closeDownViews |
|
393 |
"This is a hook method generated by the Browser. |
|
394 |
It will be invoked when your app/dialog-window is really closed. |
|
395 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
396 |
or ask the user for confirmation." |
|
397 |
||
398 |
"/ change the code below as required ... |
|
399 |
"/ This should cleanup any leftover resources |
|
400 |
"/ (for example, temporary files) |
|
401 |
"/ super closeRequest will initiate the closeDown |
|
402 |
||
403 |
"/ add your code here |
|
404 |
||
405 |
"/ do not remove the one below ... |
|
406 |
^ super closeDownViews |
|
407 |
! |
|
408 |
||
409 |
closeRequest |
|
410 |
"This is a hook method generated by the Browser. |
|
411 |
It will be invoked when your app/dialog-window is about to be |
|
412 |
closed (this method has a chance to suppress the close). |
|
413 |
See also #closeDownViews, which is invoked when the close is really done." |
|
414 |
||
415 |
"/ change the code below as required ... |
|
416 |
"/ Closing can be suppressed, by simply returning. |
|
417 |
"/ The 'super closeRequest' at the end will initiate the real closeDown |
|
418 |
||
419 |
("self hasUnsavedChanges" false) ifTrue:[ |
|
420 |
(self confirm:(resources string:'Close without saving ?')) ifFalse:[ |
|
421 |
^ self |
|
422 |
] |
|
423 |
]. |
|
424 |
||
425 |
^ super closeRequest |
|
426 |
||
427 |
"Modified: / 21-10-2006 / 19:21:02 / cg" |
|
428 |
! |
|
429 |
||
430 |
postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
431 |
self toDoList addDependent:self. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
432 |
self updateShownToDoList. |
7443 | 433 |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
434 |
ToDoList autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
435 |
ToDoListEntry autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
436 |
CompilerWarningToDoListEntry autoload. |
7443 | 437 |
|
438 |
^ super postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
439 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
440 |
"Modified: / 18-02-2007 / 12:55:57 / cg" |
7443 | 441 |
! |
442 |
||
443 |
postOpenWith:aBuilder |
|
444 |
"This is a hook method generated by the Browser. |
|
445 |
It will be invoked right after the applications window has been opened. |
|
446 |
Add any app-specific actions here (starting background processes etc.). |
|
447 |
See also #postBuildWith:, which is invoked before opening." |
|
448 |
||
449 |
"/ add any code here ... |
|
450 |
||
451 |
^ super postOpenWith:aBuilder |
|
452 |
! |
|
453 |
||
454 |
release |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
455 |
self toDoList removeDependent:self. |
7443 | 456 |
self == TheOneAndOnlyToDoListBrowser ifTrue:[ |
457 |
TheOneAndOnlyToDoListBrowser := nil |
|
458 |
]. |
|
459 |
super release. |
|
460 |
||
461 |
"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
|
462 |
"Modified: / 18-02-2007 / 12:57:07 / cg" |
7443 | 463 |
! ! |
464 |
||
465 |
!ToDoListBrowser methodsFor:'menu actions'! |
|
466 |
||
467 |
clearList |
|
468 |
toDoList removeAll |
|
469 |
||
470 |
"Created: / 22-10-2006 / 00:02:15 / cg" |
|
471 |
! |
|
472 |
||
473 |
openAboutThisApplication |
|
474 |
super openAboutThisApplication |
|
475 |
! |
|
476 |
||
477 |
openDocumentation |
|
7933 | 478 |
HTMLDocumentView openFullOnDocumentationFile:'tools\misc\TOP.html#TODOLIST'. |
7443 | 479 |
|
480 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName' |
|
481 |
"/ directory, and open a viewer with: |
|
482 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'. |
|
483 |
! ! |
|
484 |
||
485 |
!ToDoListBrowser methodsFor:'menu actions-item'! |
|
486 |
||
487 |
browseItem |
|
7986 | 488 |
(self todoListEntryAtIndex:self selectionIndexHolder value) browse |
7443 | 489 |
|
490 |
"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
|
491 |
"Modified: / 18-02-2007 / 12:56:49 / cg" |
7443 | 492 |
! |
493 |
||
494 |
removeItem |
|
7986 | 495 |
toDoList remove:(self selectedTodoListEntry) |
7443 | 496 |
|
497 |
"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
|
498 |
"Modified: / 18-02-2007 / 12:57:58 / cg" |
7986 | 499 |
! |
500 |
||
501 |
removeItems:entriesToRemove |
|
502 |
entriesToRemove do:[:entryToRemove | |
|
503 |
toDoList remove:entryToRemove |
|
504 |
]. |
|
505 |
! |
|
506 |
||
507 |
removeItemsForClass |
|
508 |
|cls entriesToRemove| |
|
509 |
||
510 |
cls := self selectedTodoListEntry problemClass. |
|
511 |
entriesToRemove := toDoList select:[:entry | entry problemClass == cls]. |
|
512 |
self removeItems:entriesToRemove |
|
513 |
! |
|
514 |
||
515 |
removeItemsForClassOrPrivateClass |
|
516 |
|cls entriesToRemove| |
|
517 |
||
518 |
cls := self selectedTodoListEntry problemClass. |
|
519 |
entriesToRemove := toDoList select:[:entry | entry problemClass == cls |
|
520 |
or:[ entry problemClass topOwningClass == cls]]. |
|
521 |
self removeItems:entriesToRemove |
|
7443 | 522 |
! ! |
523 |
||
524 |
!ToDoListBrowser methodsFor:'user actions'! |
|
525 |
||
526 |
itemDoubleClicked:itemIndex |
|
7986 | 527 |
(self selectedTodoListEntry) browse |
7443 | 528 |
|
529 |
"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
|
530 |
"Modified: / 18-02-2007 / 12:56:30 / cg" |
7469 | 531 |
! |
532 |
||
533 |
resort |
|
534 |
|sortBlock sortBlock1 col| |
|
535 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
536 |
currentSortOrder isNil ifTrue:[^ self ]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
537 |
|
7469 | 538 |
col := currentSortOrder at:#column. |
539 |
||
540 |
sortBlock := sortBlock1 := [:a :b | (a perform:col) < (b perform:col)]. |
|
541 |
||
542 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
543 |
sortBlock := [:a :b | (sortBlock1 value:a value:b) not ]. |
|
544 |
]. |
|
545 |
||
546 |
"/ 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
|
547 |
self shownCopyOfToDoList sort:sortBlock |
7469 | 548 |
|
549 |
"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
|
550 |
"Modified: / 18-02-2007 / 13:02:19 / cg" |
7469 | 551 |
! |
552 |
||
553 |
sortBy:instanceName |
|
554 |
self sortBy:instanceName withReverse:true |
|
555 |
||
556 |
"Created: / 25-10-2006 / 00:53:55 / cg" |
|
557 |
! |
|
558 |
||
559 |
sortBy:instanceName withReverse:aBoolean |
|
560 |
|aSymbol| |
|
561 |
||
562 |
aSymbol := instanceName asSymbol. |
|
563 |
||
564 |
currentSortOrder isNil ifTrue:[ |
|
565 |
currentSortOrder := Dictionary new. |
|
566 |
currentSortOrder at:#column put:aSymbol. |
|
567 |
currentSortOrder at:#reverse put:false. |
|
568 |
] ifFalse:[ |
|
569 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
570 |
"/ same column like before - change sort order ifReverse is true |
|
571 |
aBoolean ifTrue:[ |
|
572 |
| isReverse | |
|
573 |
isReverse := currentSortOrder at:#reverse. |
|
574 |
currentSortOrder at:#reverse put:(isReverse not). |
|
575 |
]. |
|
576 |
] ifFalse:[ |
|
577 |
"/ another column - remark column |
|
578 |
currentSortOrder at:#column put:aSymbol. |
|
579 |
] |
|
580 |
]. |
|
581 |
self resort. |
|
582 |
||
583 |
"Created: / 25-10-2006 / 00:54:59 / cg" |
|
7443 | 584 |
! ! |
585 |
||
586 |
!ToDoListBrowser class methodsFor:'documentation'! |
|
587 |
||
588 |
version |
|
7986 | 589 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListBrowser.st,v 1.11 2008-02-27 16:13:10 cg Exp $' |
7443 | 590 |
! ! |