7445
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
List subclass:#ToDoList
|
7458
|
6 |
instanceVariableNames:'validationPending validationProcess validationInvalid'
|
7445
|
7 |
classVariableNames:'TheOneAndOnlyToDoList WarningSeverity ErrorSeverity InfoSeverity'
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Interface-Smalltalk-ToDo'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!ToDoList class methodsFor:'accessing'!
|
|
14 |
|
|
15 |
theOneAndOnlyToDoList
|
|
16 |
TheOneAndOnlyToDoList isNil ifTrue:[
|
|
17 |
TheOneAndOnlyToDoList := self new.
|
|
18 |
].
|
|
19 |
^ TheOneAndOnlyToDoList
|
|
20 |
|
|
21 |
"
|
|
22 |
TheOneAndOnlyToDoList := nil
|
|
23 |
"
|
|
24 |
|
|
25 |
"Created: / 21-10-2006 / 20:57:48 / cg"
|
|
26 |
"Modified: / 21-10-2006 / 23:06:27 / cg"
|
|
27 |
! !
|
|
28 |
|
|
29 |
!ToDoList class methodsFor:'class initialization'!
|
|
30 |
|
|
31 |
initialize
|
|
32 |
WarningSeverity := 1.
|
|
33 |
ErrorSeverity := 2.
|
|
34 |
InfoSeverity := 0.
|
|
35 |
|
|
36 |
"
|
|
37 |
TheOneAndOnlyToDoList := nil.
|
|
38 |
self initialize
|
|
39 |
"
|
|
40 |
|
|
41 |
"Created: / 21-10-2006 / 19:43:37 / cg"
|
|
42 |
"Modified: / 21-10-2006 / 22:11:40 / cg"
|
|
43 |
! !
|
|
44 |
|
|
45 |
!ToDoList class methodsFor:'constants'!
|
|
46 |
|
|
47 |
errorSeverity
|
|
48 |
^ ErrorSeverity
|
|
49 |
!
|
|
50 |
|
|
51 |
highPriority
|
|
52 |
^ 75
|
|
53 |
|
|
54 |
"Created: / 21-10-2006 / 20:43:56 / cg"
|
|
55 |
!
|
|
56 |
|
|
57 |
highestPriority
|
|
58 |
^ 100
|
|
59 |
|
|
60 |
"Created: / 21-10-2006 / 20:43:24 / cg"
|
|
61 |
!
|
|
62 |
|
|
63 |
infoSeverity
|
|
64 |
^ InfoSeverity
|
|
65 |
!
|
|
66 |
|
|
67 |
lowPriority
|
|
68 |
^ 25
|
|
69 |
|
|
70 |
"Created: / 21-10-2006 / 20:43:42 / cg"
|
|
71 |
!
|
|
72 |
|
|
73 |
mediumPriority
|
|
74 |
^ 50
|
|
75 |
|
|
76 |
"Created: / 21-10-2006 / 20:43:37 / cg"
|
|
77 |
!
|
|
78 |
|
|
79 |
warningSeverity
|
|
80 |
^ WarningSeverity
|
|
81 |
! !
|
|
82 |
|
|
83 |
!ToDoList methodsFor:'accessing'!
|
|
84 |
|
|
85 |
add:anEntry
|
|
86 |
(anEntry isAlreadyPresentIn:self) ifFalse:[
|
|
87 |
anEntry list:self.
|
|
88 |
super add:anEntry.
|
|
89 |
Smalltalk addDependent:self.
|
|
90 |
].
|
|
91 |
|
|
92 |
"Created: / 21-10-2006 / 21:14:42 / cg"
|
|
93 |
"Modified: / 21-10-2006 / 23:03:13 / cg"
|
|
94 |
! !
|
|
95 |
|
|
96 |
!ToDoList methodsFor:'change & update'!
|
|
97 |
|
|
98 |
revalidate
|
7458
|
99 |
|wasPending|
|
|
100 |
|
|
101 |
[
|
|
102 |
wasPending := validationPending ? false.
|
|
103 |
validationPending := true.
|
|
104 |
wasPending ifTrue:[
|
|
105 |
validationInvalid := true
|
|
106 |
].
|
|
107 |
] valueUninterruptably.
|
|
108 |
wasPending ifTrue:[^ self].
|
|
109 |
|
|
110 |
validationProcess :=
|
|
111 |
[
|
|
112 |
[
|
|
113 |
|index entry|
|
|
114 |
|
|
115 |
validationInvalid := false.
|
|
116 |
index := 1.
|
|
117 |
[index <= self size] whileTrue:[
|
|
118 |
entry := self at:index.
|
|
119 |
entry revalidate.
|
|
120 |
index <= self size ifTrue:[
|
|
121 |
(self at:index) == entry ifTrue:[
|
|
122 |
"/ it did not remove itself
|
|
123 |
index := index + 1
|
|
124 |
].
|
|
125 |
].
|
|
126 |
validationInvalid ifTrue:[
|
|
127 |
validationInvalid := false.
|
|
128 |
index := 1.
|
|
129 |
].
|
|
130 |
].
|
|
131 |
] ensure:[
|
|
132 |
validationPending := false.
|
|
133 |
validationProcess := nil.
|
|
134 |
validationInvalid := false.
|
|
135 |
].
|
|
136 |
] fork.
|
7445
|
137 |
|
|
138 |
"Created: / 21-10-2006 / 23:02:34 / cg"
|
7458
|
139 |
"Modified: / 23-10-2006 / 22:40:11 / cg"
|
7445
|
140 |
!
|
|
141 |
|
|
142 |
update:something with:aParameter from:changedObject
|
|
143 |
changedObject == Smalltalk ifTrue:[
|
|
144 |
something == #methodTrap ifTrue:[^ self].
|
|
145 |
self revalidate.
|
|
146 |
^ self.
|
|
147 |
].
|
|
148 |
^ super update:something with:aParameter from:changedObject
|
|
149 |
|
|
150 |
"Created: / 21-10-2006 / 23:02:05 / cg"
|
7458
|
151 |
"Modified: / 23-10-2006 / 22:20:52 / cg"
|
7445
|
152 |
! !
|
|
153 |
|
|
154 |
!ToDoList class methodsFor:'documentation'!
|
|
155 |
|
|
156 |
version
|
7458
|
157 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoList.st,v 1.2 2006-10-23 20:40:44 cg Exp $'
|
7445
|
158 |
! !
|
|
159 |
|
|
160 |
ToDoList initialize!
|