8236
|
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 |
"
|
7445
|
12 |
"{ Package: 'stx:libtool' }"
|
|
13 |
|
|
14 |
"{ NameSpace: Tools }"
|
|
15 |
|
|
16 |
List subclass:#ToDoList
|
7458
|
17 |
instanceVariableNames:'validationPending validationProcess validationInvalid'
|
7445
|
18 |
classVariableNames:'TheOneAndOnlyToDoList WarningSeverity ErrorSeverity InfoSeverity'
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Interface-Smalltalk-ToDo'
|
|
21 |
!
|
|
22 |
|
8236
|
23 |
!ToDoList class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
"
|
|
37 |
! !
|
7445
|
38 |
|
|
39 |
!ToDoList class methodsFor:'accessing'!
|
|
40 |
|
|
41 |
theOneAndOnlyToDoList
|
|
42 |
TheOneAndOnlyToDoList isNil ifTrue:[
|
|
43 |
TheOneAndOnlyToDoList := self new.
|
|
44 |
].
|
|
45 |
^ TheOneAndOnlyToDoList
|
|
46 |
|
|
47 |
"
|
|
48 |
TheOneAndOnlyToDoList := nil
|
|
49 |
"
|
|
50 |
|
|
51 |
"Created: / 21-10-2006 / 20:57:48 / cg"
|
|
52 |
"Modified: / 21-10-2006 / 23:06:27 / cg"
|
|
53 |
! !
|
|
54 |
|
|
55 |
!ToDoList class methodsFor:'class initialization'!
|
|
56 |
|
|
57 |
initialize
|
|
58 |
WarningSeverity := 1.
|
|
59 |
ErrorSeverity := 2.
|
|
60 |
InfoSeverity := 0.
|
|
61 |
|
|
62 |
"
|
|
63 |
TheOneAndOnlyToDoList := nil.
|
|
64 |
self initialize
|
|
65 |
"
|
|
66 |
|
|
67 |
"Created: / 21-10-2006 / 19:43:37 / cg"
|
|
68 |
"Modified: / 21-10-2006 / 22:11:40 / cg"
|
|
69 |
! !
|
|
70 |
|
|
71 |
!ToDoList class methodsFor:'constants'!
|
|
72 |
|
|
73 |
errorSeverity
|
|
74 |
^ ErrorSeverity
|
|
75 |
!
|
|
76 |
|
|
77 |
highPriority
|
|
78 |
^ 75
|
|
79 |
|
|
80 |
"Created: / 21-10-2006 / 20:43:56 / cg"
|
|
81 |
!
|
|
82 |
|
|
83 |
highestPriority
|
|
84 |
^ 100
|
|
85 |
|
|
86 |
"Created: / 21-10-2006 / 20:43:24 / cg"
|
|
87 |
!
|
|
88 |
|
|
89 |
infoSeverity
|
|
90 |
^ InfoSeverity
|
|
91 |
!
|
|
92 |
|
|
93 |
lowPriority
|
|
94 |
^ 25
|
|
95 |
|
|
96 |
"Created: / 21-10-2006 / 20:43:42 / cg"
|
|
97 |
!
|
|
98 |
|
|
99 |
mediumPriority
|
|
100 |
^ 50
|
|
101 |
|
|
102 |
"Created: / 21-10-2006 / 20:43:37 / cg"
|
|
103 |
!
|
|
104 |
|
|
105 |
warningSeverity
|
|
106 |
^ WarningSeverity
|
|
107 |
! !
|
|
108 |
|
|
109 |
!ToDoList methodsFor:'accessing'!
|
|
110 |
|
|
111 |
add:anEntry
|
|
112 |
(anEntry isAlreadyPresentIn:self) ifFalse:[
|
|
113 |
anEntry list:self.
|
|
114 |
super add:anEntry.
|
|
115 |
Smalltalk addDependent:self.
|
|
116 |
].
|
|
117 |
|
|
118 |
"Created: / 21-10-2006 / 21:14:42 / cg"
|
|
119 |
"Modified: / 21-10-2006 / 23:03:13 / cg"
|
|
120 |
! !
|
|
121 |
|
|
122 |
!ToDoList methodsFor:'change & update'!
|
|
123 |
|
|
124 |
revalidate
|
7458
|
125 |
|wasPending|
|
|
126 |
|
|
127 |
[
|
|
128 |
wasPending := validationPending ? false.
|
|
129 |
validationPending := true.
|
|
130 |
wasPending ifTrue:[
|
|
131 |
validationInvalid := true
|
|
132 |
].
|
|
133 |
] valueUninterruptably.
|
|
134 |
wasPending ifTrue:[^ self].
|
|
135 |
|
|
136 |
validationProcess :=
|
|
137 |
[
|
|
138 |
[
|
|
139 |
|index entry|
|
|
140 |
|
|
141 |
validationInvalid := false.
|
|
142 |
index := 1.
|
|
143 |
[index <= self size] whileTrue:[
|
|
144 |
entry := self at:index.
|
|
145 |
entry revalidate.
|
|
146 |
index <= self size ifTrue:[
|
7731
|
147 |
((self at:index) sameAs:entry) ifTrue:[
|
7458
|
148 |
"/ it did not remove itself
|
|
149 |
index := index + 1
|
7731
|
150 |
]
|
7458
|
151 |
].
|
|
152 |
validationInvalid ifTrue:[
|
|
153 |
validationInvalid := false.
|
|
154 |
index := 1.
|
|
155 |
].
|
|
156 |
].
|
|
157 |
] ensure:[
|
|
158 |
validationPending := false.
|
|
159 |
validationProcess := nil.
|
|
160 |
validationInvalid := false.
|
|
161 |
].
|
|
162 |
] fork.
|
7445
|
163 |
|
|
164 |
"Created: / 21-10-2006 / 23:02:34 / cg"
|
7458
|
165 |
"Modified: / 23-10-2006 / 22:40:11 / cg"
|
7445
|
166 |
!
|
|
167 |
|
|
168 |
update:something with:aParameter from:changedObject
|
|
169 |
changedObject == Smalltalk ifTrue:[
|
|
170 |
something == #methodTrap ifTrue:[^ self].
|
|
171 |
self revalidate.
|
|
172 |
^ self.
|
|
173 |
].
|
|
174 |
^ super update:something with:aParameter from:changedObject
|
|
175 |
|
|
176 |
"Created: / 21-10-2006 / 23:02:05 / cg"
|
7458
|
177 |
"Modified: / 23-10-2006 / 22:20:52 / cg"
|
7445
|
178 |
! !
|
|
179 |
|
|
180 |
!ToDoList class methodsFor:'documentation'!
|
|
181 |
|
|
182 |
version
|
8236
|
183 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoList.st,v 1.4 2008-08-20 19:41:31 cg Exp $'
|
7445
|
184 |
! !
|
|
185 |
|
|
186 |
ToDoList initialize!
|