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