author | Claus Gittinger <cg@exept.de> |
Wed, 14 Mar 2007 13:13:51 +0100 | |
changeset 7740 | 1be4f085540e |
parent 7736 | 0ae76a027e90 |
child 7933 | cc2c54e4043b |
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 |
" |
|
138 |
MenuEditor new openOnClass:ToDoListBrowser andSelector:#itemMenu |
|
139 |
(Menu new fromLiteralArrayEncoding:(ToDoListBrowser itemMenu)) startUp |
|
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 |
) |
|
160 |
) |
|
161 |
nil |
|
162 |
nil |
|
163 |
) |
|
164 |
! |
|
165 |
||
166 |
mainMenu |
|
167 |
"This resource specification was automatically generated |
|
168 |
by the MenuEditor of ST/X." |
|
169 |
||
170 |
"Do not manually edit this!! If it is corrupted, |
|
171 |
the MenuEditor may not be able to read the specification." |
|
172 |
||
173 |
" |
|
7457 | 174 |
MenuEditor new openOnClass:Tools::ToDoListBrowser andSelector:#mainMenu |
175 |
(Menu new fromLiteralArrayEncoding:(Tools::ToDoListBrowser mainMenu)) startUp |
|
7443 | 176 |
" |
177 |
||
178 |
<resource: #menu> |
|
179 |
||
180 |
^ |
|
181 |
#(Menu |
|
182 |
( |
|
183 |
(MenuItem |
|
184 |
label: 'File' |
|
185 |
translateLabel: true |
|
186 |
submenu: |
|
187 |
(Menu |
|
188 |
( |
|
189 |
(MenuItem |
|
190 |
label: 'Exit' |
|
191 |
itemValue: closeRequest |
|
192 |
translateLabel: true |
|
193 |
) |
|
194 |
) |
|
195 |
nil |
|
196 |
nil |
|
197 |
) |
|
198 |
) |
|
199 |
(MenuItem |
|
200 |
label: 'List' |
|
201 |
translateLabel: true |
|
202 |
submenu: |
|
203 |
(Menu |
|
204 |
( |
|
205 |
(MenuItem |
|
206 |
label: 'Clear' |
|
207 |
itemValue: clearList |
|
208 |
translateLabel: true |
|
209 |
) |
|
210 |
) |
|
211 |
nil |
|
212 |
nil |
|
213 |
) |
|
214 |
) |
|
215 |
(MenuItem |
|
7464 | 216 |
label: 'MENU_Help' |
7443 | 217 |
translateLabel: true |
7457 | 218 |
startGroup: conditionalRight |
7443 | 219 |
submenu: |
220 |
(Menu |
|
221 |
( |
|
222 |
(MenuItem |
|
223 |
label: 'Documentation' |
|
224 |
itemValue: openDocumentation |
|
225 |
translateLabel: true |
|
226 |
) |
|
227 |
(MenuItem |
|
228 |
label: '-' |
|
229 |
) |
|
230 |
(MenuItem |
|
231 |
label: 'About this Application...' |
|
232 |
itemValue: openAboutThisApplication |
|
233 |
translateLabel: true |
|
234 |
) |
|
235 |
) |
|
236 |
nil |
|
237 |
nil |
|
238 |
) |
|
239 |
) |
|
240 |
) |
|
241 |
nil |
|
242 |
nil |
|
243 |
) |
|
7464 | 244 |
|
245 |
"Modified: / 23-10-2006 / 23:22:45 / cg" |
|
7443 | 246 |
! ! |
247 |
||
248 |
!ToDoListBrowser class methodsFor:'tableColumns specs'! |
|
249 |
||
250 |
tableColumns |
|
251 |
"This resource specification was automatically generated |
|
252 |
by the DataSetBuilder of ST/X." |
|
253 |
||
254 |
"Do not manually edit this!! If it is corrupted, |
|
255 |
the DataSetBuilder may not be able to read the specification." |
|
256 |
||
257 |
" |
|
258 |
DataSetBuilder new openOnClass:ToDoListBrowser andSelector:#tableColumns |
|
259 |
" |
|
260 |
||
261 |
<resource: #tableColumns> |
|
262 |
||
263 |
^#( |
|
264 |
(DataSetColumnSpec |
|
265 |
label: 'Type' |
|
266 |
labelButtonType: Button |
|
267 |
width: 32 |
|
7740 | 268 |
model: severityString |
7443 | 269 |
canSelect: false |
270 |
) |
|
271 |
(DataSetColumnSpec |
|
272 |
label: 'Prio' |
|
273 |
labelButtonType: Button |
|
274 |
width: 30 |
|
275 |
model: priority |
|
276 |
canSelect: false |
|
7740 | 277 |
labelActionSelector: sortBy: |
278 |
labelActionArgument: 'priority' |
|
7443 | 279 |
) |
280 |
(DataSetColumnSpec |
|
281 |
label: 'Time' |
|
282 |
labelButtonType: Button |
|
283 |
width: 50 |
|
284 |
model: time |
|
285 |
canSelect: false |
|
7469 | 286 |
labelAlignment: left |
287 |
labelActionSelector: sortBy: |
|
288 |
labelActionArgument: 'timestamp' |
|
7443 | 289 |
) |
290 |
(DataSetColumnSpec |
|
7733 | 291 |
label: 'Message' |
292 |
labelButtonType: Button |
|
293 |
model: message |
|
294 |
canSelect: false |
|
295 |
labelAlignment: left |
|
296 |
labelActionSelector: sortBy: |
|
297 |
labelActionArgument: 'message' |
|
298 |
) |
|
299 |
(DataSetColumnSpec |
|
7443 | 300 |
label: 'Where' |
301 |
labelButtonType: Button |
|
302 |
model: methodOrClassName |
|
303 |
canSelect: false |
|
7469 | 304 |
labelAlignment: left |
305 |
labelActionSelector: sortBy: |
|
306 |
labelActionArgument: 'methodOrClassName' |
|
7443 | 307 |
) |
308 |
) |
|
7469 | 309 |
|
310 |
"Modified: / 25-10-2006 / 01:05:50 / cg" |
|
7443 | 311 |
! ! |
312 |
||
313 |
!ToDoListBrowser methodsFor:'accessing'! |
|
314 |
||
315 |
addEntry:anEntry |
|
316 |
self toDoList add:anEntry |
|
317 |
||
318 |
"Created: / 21-10-2006 / 15:38:08 / cg" |
|
319 |
"Modified: / 21-10-2006 / 21:14:31 / cg" |
|
320 |
! |
|
321 |
||
322 |
selectionIndexHolder |
|
323 |
selectionIndexHolder isNil ifTrue:[ |
|
324 |
selectionIndexHolder := nil asValue. |
|
325 |
]. |
|
326 |
^ selectionIndexHolder |
|
327 |
||
328 |
"Created: / 22-10-2006 / 02:00:41 / cg" |
|
329 |
! |
|
330 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
331 |
shownCopyOfToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
332 |
shownCopyOfToDoList isNil ifTrue:[ |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
333 |
shownCopyOfToDoList := List new |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
334 |
]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
335 |
^ shownCopyOfToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
336 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
337 |
"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
|
338 |
! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
339 |
|
7443 | 340 |
toDoList |
341 |
toDoList isNil ifTrue:[ |
|
342 |
toDoList := ToDoList theOneAndOnlyToDoList. |
|
343 |
]. |
|
344 |
^ toDoList |
|
345 |
||
346 |
"Created: / 21-10-2006 / 20:57:18 / cg" |
|
347 |
! ! |
|
348 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
349 |
!ToDoListBrowser methodsFor:'change & update'! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
350 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
351 |
update:something with:aParameter from:changedObject |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
352 |
changedObject == toDoList ifTrue:[ |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
353 |
self updateShownToDoList. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
354 |
^ self |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
355 |
]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
356 |
^ 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
|
357 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
358 |
"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
|
359 |
! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
360 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
361 |
updateShownToDoList |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
362 |
self shownCopyOfToDoList contents:(self toDoList). |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
363 |
self resort. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
364 |
|
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
365 |
"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
|
366 |
! ! |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
367 |
|
7443 | 368 |
!ToDoListBrowser methodsFor:'initialization & release'! |
369 |
||
370 |
closeDownViews |
|
371 |
"This is a hook method generated by the Browser. |
|
372 |
It will be invoked when your app/dialog-window is really closed. |
|
373 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
374 |
or ask the user for confirmation." |
|
375 |
||
376 |
"/ change the code below as required ... |
|
377 |
"/ This should cleanup any leftover resources |
|
378 |
"/ (for example, temporary files) |
|
379 |
"/ super closeRequest will initiate the closeDown |
|
380 |
||
381 |
"/ add your code here |
|
382 |
||
383 |
"/ do not remove the one below ... |
|
384 |
^ super closeDownViews |
|
385 |
! |
|
386 |
||
387 |
closeRequest |
|
388 |
"This is a hook method generated by the Browser. |
|
389 |
It will be invoked when your app/dialog-window is about to be |
|
390 |
closed (this method has a chance to suppress the close). |
|
391 |
See also #closeDownViews, which is invoked when the close is really done." |
|
392 |
||
393 |
"/ change the code below as required ... |
|
394 |
"/ Closing can be suppressed, by simply returning. |
|
395 |
"/ The 'super closeRequest' at the end will initiate the real closeDown |
|
396 |
||
397 |
("self hasUnsavedChanges" false) ifTrue:[ |
|
398 |
(self confirm:(resources string:'Close without saving ?')) ifFalse:[ |
|
399 |
^ self |
|
400 |
] |
|
401 |
]. |
|
402 |
||
403 |
^ super closeRequest |
|
404 |
||
405 |
"Modified: / 21-10-2006 / 19:21:02 / cg" |
|
406 |
! |
|
407 |
||
408 |
postBuildWith:aBuilder |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
409 |
self toDoList addDependent:self. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
410 |
self updateShownToDoList. |
7443 | 411 |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
412 |
ToDoList autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
413 |
ToDoListEntry autoload. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
414 |
CompilerWarningToDoListEntry autoload. |
7443 | 415 |
|
416 |
^ super postBuildWith:aBuilder |
|
7649
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 |
"Modified: / 18-02-2007 / 12:55:57 / cg" |
7443 | 419 |
! |
420 |
||
421 |
postOpenWith:aBuilder |
|
422 |
"This is a hook method generated by the Browser. |
|
423 |
It will be invoked right after the applications window has been opened. |
|
424 |
Add any app-specific actions here (starting background processes etc.). |
|
425 |
See also #postBuildWith:, which is invoked before opening." |
|
426 |
||
427 |
"/ add any code here ... |
|
428 |
||
429 |
^ super postOpenWith:aBuilder |
|
430 |
! |
|
431 |
||
432 |
release |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
433 |
self toDoList removeDependent:self. |
7443 | 434 |
self == TheOneAndOnlyToDoListBrowser ifTrue:[ |
435 |
TheOneAndOnlyToDoListBrowser := nil |
|
436 |
]. |
|
437 |
super release. |
|
438 |
||
439 |
"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
|
440 |
"Modified: / 18-02-2007 / 12:57:07 / cg" |
7443 | 441 |
! ! |
442 |
||
443 |
!ToDoListBrowser methodsFor:'menu actions'! |
|
444 |
||
445 |
clearList |
|
446 |
toDoList removeAll |
|
447 |
||
448 |
"Created: / 22-10-2006 / 00:02:15 / cg" |
|
449 |
! |
|
450 |
||
451 |
menuSave |
|
452 |
"This method was generated by the Browser. |
|
453 |
It will be invoked when the menu-item 'save' is selected." |
|
454 |
||
455 |
"/ change below and add any actions as required here ... |
|
456 |
self warn:'no action for ''save'' defined.'. |
|
457 |
! |
|
458 |
||
459 |
menuSaveAs |
|
460 |
"This method was generated by the Browser. |
|
461 |
It will be invoked when the menu-item 'saveAs' is selected." |
|
462 |
||
463 |
"/ change below and add any actions as required here ... |
|
464 |
self warn:'no action for ''saveAs'' defined.'. |
|
465 |
! |
|
466 |
||
467 |
openAboutThisApplication |
|
468 |
"This method was generated by the Browser. |
|
469 |
It will be invoked when the menu-item 'help-about' is selected." |
|
470 |
||
471 |
"/ could open a customized aboutBox here ... |
|
472 |
super openAboutThisApplication |
|
473 |
! |
|
474 |
||
475 |
openDocumentation |
|
476 |
"This method was generated by the Browser. |
|
477 |
It will be invoked when the menu-item 'help-documentation' is selected." |
|
478 |
||
479 |
"/ change below as required ... |
|
480 |
||
481 |
"/ to open an HTML viewer on some document (under 'doc/online/<language>/' ): |
|
482 |
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'. |
|
483 |
||
484 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName' |
|
485 |
"/ directory, and open a viewer with: |
|
486 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'. |
|
487 |
! ! |
|
488 |
||
489 |
!ToDoListBrowser methodsFor:'menu actions-item'! |
|
490 |
||
491 |
browseItem |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
492 |
(shownCopyOfToDoList at:self selectionIndexHolder value) browse |
7443 | 493 |
|
494 |
"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
|
495 |
"Modified: / 18-02-2007 / 12:56:49 / cg" |
7443 | 496 |
! |
497 |
||
498 |
removeItem |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
499 |
toDoList remove:(shownCopyOfToDoList at:self selectionIndexHolder value) |
7443 | 500 |
|
501 |
"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
|
502 |
"Modified: / 18-02-2007 / 12:57:58 / cg" |
7443 | 503 |
! ! |
504 |
||
505 |
!ToDoListBrowser methodsFor:'user actions'! |
|
506 |
||
507 |
itemDoubleClicked:itemIndex |
|
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
508 |
(shownCopyOfToDoList at:itemIndex) browse |
7443 | 509 |
|
510 |
"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
|
511 |
"Modified: / 18-02-2007 / 12:56:30 / cg" |
7469 | 512 |
! |
513 |
||
514 |
resort |
|
515 |
|sortBlock sortBlock1 col| |
|
516 |
||
7649
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
517 |
currentSortOrder isNil ifTrue:[^ self ]. |
b7d62f6f5485
two separate lists: todo and shown (sorted) todo
Claus Gittinger <cg@exept.de>
parents:
7469
diff
changeset
|
518 |
|
7469 | 519 |
col := currentSortOrder at:#column. |
520 |
||
521 |
sortBlock := sortBlock1 := [:a :b | (a perform:col) < (b perform:col)]. |
|
522 |
||
523 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
524 |
sortBlock := [:a :b | (sortBlock1 value:a value:b) not ]. |
|
525 |
]. |
|
526 |
||
527 |
"/ 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
|
528 |
self shownCopyOfToDoList sort:sortBlock |
7469 | 529 |
|
530 |
"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
|
531 |
"Modified: / 18-02-2007 / 13:02:19 / cg" |
7469 | 532 |
! |
533 |
||
534 |
sortBy:instanceName |
|
535 |
self sortBy:instanceName withReverse:true |
|
536 |
||
537 |
"Created: / 25-10-2006 / 00:53:55 / cg" |
|
538 |
! |
|
539 |
||
540 |
sortBy:instanceName withReverse:aBoolean |
|
541 |
|aSymbol| |
|
542 |
||
543 |
aSymbol := instanceName asSymbol. |
|
544 |
||
545 |
currentSortOrder isNil ifTrue:[ |
|
546 |
currentSortOrder := Dictionary new. |
|
547 |
currentSortOrder at:#column put:aSymbol. |
|
548 |
currentSortOrder at:#reverse put:false. |
|
549 |
] ifFalse:[ |
|
550 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
551 |
"/ same column like before - change sort order ifReverse is true |
|
552 |
aBoolean ifTrue:[ |
|
553 |
| isReverse | |
|
554 |
isReverse := currentSortOrder at:#reverse. |
|
555 |
currentSortOrder at:#reverse put:(isReverse not). |
|
556 |
]. |
|
557 |
] ifFalse:[ |
|
558 |
"/ another column - remark column |
|
559 |
currentSortOrder at:#column put:aSymbol. |
|
560 |
] |
|
561 |
]. |
|
562 |
self resort. |
|
563 |
||
564 |
"Created: / 25-10-2006 / 00:54:59 / cg" |
|
7443 | 565 |
! ! |
566 |
||
567 |
!ToDoListBrowser class methodsFor:'documentation'! |
|
568 |
||
569 |
version |
|
7740 | 570 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListBrowser.st,v 1.9 2007-03-14 12:13:51 cg Exp $' |
7443 | 571 |
! ! |