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