8238
|
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 |
"
|
7444
|
12 |
"{ Package: 'stx:libtool' }"
|
|
13 |
|
|
14 |
"{ NameSpace: Tools }"
|
|
15 |
|
|
16 |
Object subclass:#ToDoListEntry
|
|
17 |
instanceVariableNames:'list stillValid severity priority timestamp message'
|
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Interface-Smalltalk-ToDo'
|
|
21 |
!
|
|
22 |
|
8238
|
23 |
!ToDoListEntry 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 |
! !
|
7444
|
38 |
|
|
39 |
!ToDoListEntry methodsFor:'accessing'!
|
|
40 |
|
7997
|
41 |
errorColor
|
|
42 |
^ Color rgbValue:16rCF0000
|
|
43 |
!
|
|
44 |
|
|
45 |
hasHighSeverity
|
|
46 |
^ (severity ? 0) >= (Tools::ToDoList errorSeverity)
|
|
47 |
!
|
|
48 |
|
7444
|
49 |
list:something
|
|
50 |
list := something.
|
|
51 |
!
|
|
52 |
|
|
53 |
message
|
7997
|
54 |
self hasHighSeverity ifTrue:[
|
|
55 |
^ message colorizeAllWith:self errorColor
|
|
56 |
].
|
|
57 |
|
7444
|
58 |
^ message
|
|
59 |
!
|
|
60 |
|
7530
|
61 |
message:something
|
|
62 |
message := something.
|
|
63 |
!
|
|
64 |
|
7444
|
65 |
priority
|
|
66 |
^ priority ? 0
|
|
67 |
|
|
68 |
"Modified: / 22-10-2006 / 11:09:36 / cg"
|
|
69 |
!
|
|
70 |
|
7644
|
71 |
priority:priorityOrPrioritySymbol
|
|
72 |
priorityOrPrioritySymbol isSymbol ifTrue:[
|
|
73 |
priorityOrPrioritySymbol == #low ifTrue:[
|
|
74 |
priority := ToDoList lowPriority.
|
|
75 |
^ self.
|
|
76 |
].
|
|
77 |
priorityOrPrioritySymbol == #medium ifTrue:[
|
|
78 |
priority := ToDoList mediumPriority.
|
|
79 |
^ self.
|
|
80 |
].
|
|
81 |
priorityOrPrioritySymbol == #high ifTrue:[
|
|
82 |
priority := ToDoList highPriority.
|
|
83 |
^ self.
|
|
84 |
].
|
|
85 |
self error:'bad argument'
|
|
86 |
].
|
|
87 |
priority := priorityOrPrioritySymbol.
|
|
88 |
!
|
|
89 |
|
7997
|
90 |
priorityString
|
|
91 |
|s|
|
|
92 |
|
|
93 |
s := (priority ? 0) printString.
|
|
94 |
self hasHighSeverity ifTrue:[
|
|
95 |
^ s colorizeAllWith:self errorColor
|
|
96 |
].
|
|
97 |
^ s
|
|
98 |
|
|
99 |
"Modified: / 22-10-2006 / 11:09:36 / cg"
|
|
100 |
!
|
|
101 |
|
7444
|
102 |
severity
|
|
103 |
^ severity ? 0
|
|
104 |
|
|
105 |
"Modified: / 22-10-2006 / 11:09:42 / cg"
|
|
106 |
!
|
|
107 |
|
7644
|
108 |
severity:severityOrSeveritySymbol
|
|
109 |
severityOrSeveritySymbol isSymbol ifTrue:[
|
|
110 |
severityOrSeveritySymbol == #info ifTrue:[
|
|
111 |
severity := ToDoList infoSeverity.
|
|
112 |
^ self.
|
|
113 |
].
|
|
114 |
severityOrSeveritySymbol == #warning ifTrue:[
|
|
115 |
severity := ToDoList warningSeverity.
|
|
116 |
^ self.
|
|
117 |
].
|
|
118 |
severityOrSeveritySymbol == #error ifTrue:[
|
|
119 |
severity := ToDoList errorSeverity.
|
|
120 |
^ self.
|
|
121 |
].
|
|
122 |
self error:'bad argument'
|
|
123 |
].
|
|
124 |
severity := severityOrSeveritySymbol.
|
|
125 |
!
|
|
126 |
|
7444
|
127 |
severity:severityArg priority:priorityArg timestamp:timestampArg message:messageArg
|
7644
|
128 |
self severity:severityArg.
|
|
129 |
self priority:priorityArg.
|
7444
|
130 |
timestamp := timestampArg.
|
|
131 |
message := messageArg.
|
|
132 |
!
|
|
133 |
|
7741
|
134 |
severityString
|
|
135 |
|sev|
|
|
136 |
|
|
137 |
sev := self severity.
|
7997
|
138 |
sev >= (Tools::ToDoList errorSeverity) ifTrue:[ ^ 'E' allBold colorizeAllWith:self errorColor].
|
|
139 |
sev >= (Tools::ToDoList warningSeverity) ifTrue:[ ^ 'W' ].
|
|
140 |
sev >= (Tools::ToDoList infoSeverity) ifTrue:[ ^ 'i' ].
|
|
141 |
^ ' '
|
7741
|
142 |
|
|
143 |
"Modified: / 22-10-2006 / 11:09:42 / cg"
|
|
144 |
!
|
|
145 |
|
7444
|
146 |
stillValid
|
|
147 |
^ stillValid ? true
|
|
148 |
|
|
149 |
"Created: / 21-10-2006 / 20:45:33 / cg"
|
|
150 |
!
|
|
151 |
|
|
152 |
time
|
|
153 |
^ timestamp asTime
|
|
154 |
|
|
155 |
"Created: / 21-10-2006 / 20:58:14 / cg"
|
|
156 |
!
|
|
157 |
|
|
158 |
timestamp
|
|
159 |
^ timestamp
|
|
160 |
! !
|
|
161 |
|
|
162 |
!ToDoListEntry methodsFor:'duplicate detection'!
|
|
163 |
|
|
164 |
isAlreadyPresentIn:aList
|
|
165 |
^ aList contains:[:anEntry | anEntry sameAs:self ].
|
|
166 |
|
|
167 |
"Created: / 21-10-2006 / 21:36:57 / cg"
|
|
168 |
!
|
|
169 |
|
|
170 |
sameAs:anotherEntry
|
|
171 |
self subclassResponsibility
|
|
172 |
|
|
173 |
"Created: / 21-10-2006 / 21:37:42 / cg"
|
|
174 |
!
|
|
175 |
|
|
176 |
sameAsCompilerWarningToDoListEntry:anotherEntry
|
|
177 |
^ false
|
|
178 |
|
|
179 |
"Created: / 21-10-2006 / 21:40:47 / cg"
|
|
180 |
! !
|
|
181 |
|
7530
|
182 |
!ToDoListEntry methodsFor:'initialization'!
|
|
183 |
|
|
184 |
initialize
|
|
185 |
severity := Tools::ToDoList warningSeverity.
|
|
186 |
priority := Tools::ToDoList highPriority.
|
|
187 |
timestamp := Timestamp now.
|
|
188 |
message := 'Check this'
|
|
189 |
|
|
190 |
"Created: / 20-11-2006 / 15:00:39 / cg"
|
|
191 |
! !
|
|
192 |
|
7444
|
193 |
!ToDoListEntry methodsFor:'misc'!
|
|
194 |
|
|
195 |
browse
|
|
196 |
self subclassResponsibility
|
|
197 |
|
|
198 |
"Created: / 22-10-2006 / 01:37:42 / cg"
|
|
199 |
! !
|
|
200 |
|
|
201 |
!ToDoListEntry methodsFor:'printing & storing'!
|
|
202 |
|
|
203 |
printOn:aStream
|
|
204 |
aStream nextPutAll:message
|
|
205 |
|
|
206 |
"Created: / 21-10-2006 / 23:13:39 / cg"
|
|
207 |
! !
|
|
208 |
|
|
209 |
!ToDoListEntry methodsFor:'validation'!
|
|
210 |
|
|
211 |
checkIfStillValid
|
|
212 |
self subclassResponsibility
|
|
213 |
|
|
214 |
"Created: / 21-10-2006 / 21:30:29 / cg"
|
|
215 |
!
|
|
216 |
|
|
217 |
revalidate
|
|
218 |
self checkIfStillValid ifFalse:[
|
|
219 |
stillValid := false.
|
|
220 |
list removeIdentical:self ifAbsent:[].
|
|
221 |
Smalltalk removeDependent:self.
|
|
222 |
].
|
|
223 |
|
|
224 |
"Created: / 21-10-2006 / 20:46:03 / cg"
|
|
225 |
"Modified: / 21-10-2006 / 22:00:52 / cg"
|
|
226 |
! !
|
|
227 |
|
|
228 |
!ToDoListEntry class methodsFor:'documentation'!
|
|
229 |
|
|
230 |
version
|
8238
|
231 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ToDoListEntry.st,v 1.8 2008-08-20 19:41:35 cg Exp $'
|
7444
|
232 |
! !
|