author | Claus Gittinger <cg@exept.de> |
Fri, 08 Jul 2011 08:50:25 +0200 | |
changeset 10274 | baa3a285f686 |
parent 10257 | bdc20c20c46c |
child 10298 | cc70ede4c310 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 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 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#MethodList |
|
17 |
instanceVariableNames:'classes selectedMethodNameIndices methodList lastSelectedMethods |
|
18 |
browserNameList variableFilter filterClassVars updateProcess |
|
19 |
lastShowClass lastShowCategory lastShowClassFirst |
|
20 |
showMethodInheritance lastMethodClass lastMethodClassesSubclasses |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
21 |
classAndSelectorsRedefinedBySubclassesOfClass showClass |
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
22 |
showMethodComplexity showMethodTypeIcon |
10228 | 23 |
showImageResourceMethodsImages' |
6271 | 24 |
classVariableNames:'ShowComplexityValue' |
5591 | 25 |
poolDictionaries:'' |
26 |
category:'Interface-Browsers-New' |
|
27 |
! |
|
28 |
||
29 |
!MethodList class methodsFor:'documentation'! |
|
30 |
||
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
34 |
All Rights Reserved |
|
35 |
||
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! ! |
|
44 |
||
45 |
!MethodList class methodsFor:'interface specs'! |
|
46 |
||
47 |
singleMethodWindowSpec |
|
48 |
"This resource specification was automatically generated |
|
49 |
by the UIPainter of ST/X." |
|
50 |
||
51 |
"Do not manually edit this!! If it is corrupted, |
|
52 |
the UIPainter may not be able to read the specification." |
|
53 |
||
54 |
" |
|
55 |
UIPainter new openOnClass:MethodList andSelector:#singleMethodWindowSpec |
|
56 |
MethodList new openInterface:#singleMethodWindowSpec |
|
57 |
" |
|
58 |
||
59 |
<resource: #canvas> |
|
60 |
||
61 |
^ |
|
62 |
#(#FullSpec |
|
63 |
#name: #singleMethodWindowSpec |
|
64 |
#window: |
|
65 |
#(#WindowSpec |
|
66 |
#label: 'SingleSelectorList' |
|
67 |
#name: 'SingleSelectorList' |
|
68 |
#min: #(#Point 0 0) |
|
69 |
#max: #(#Point 1024 721) |
|
70 |
#bounds: #(#Rectangle 12 22 312 322) |
|
71 |
) |
|
72 |
#component: |
|
73 |
#(#SpecCollection |
|
74 |
#collection: #( |
|
75 |
#(#LabelSpec |
|
76 |
#label: 'MethodName' |
|
77 |
#name: 'MethodLabel' |
|
78 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
79 |
#translateLabel: true |
|
80 |
#labelChannel: #methodLabelHolder |
|
81 |
#menu: #menuHolder |
|
82 |
) |
|
83 |
) |
|
84 |
||
85 |
) |
|
86 |
) |
|
87 |
||
88 |
"Modified: / 1.3.2000 / 20:50:15 / cg" |
|
89 |
! |
|
90 |
||
91 |
windowSpec |
|
92 |
"This resource specification was automatically generated |
|
93 |
by the UIPainter of ST/X." |
|
94 |
||
95 |
"Do not manually edit this!! If it is corrupted, |
|
96 |
the UIPainter may not be able to read the specification." |
|
97 |
||
98 |
" |
|
99 |
UIPainter new openOnClass:MethodList andSelector:#windowSpec |
|
100 |
MethodList new openInterface:#windowSpec |
|
101 |
MethodList open |
|
102 |
" |
|
103 |
||
104 |
<resource: #canvas> |
|
105 |
||
106 |
^ |
|
107 |
#(#FullSpec |
|
108 |
#name: #windowSpec |
|
109 |
#window: |
|
110 |
#(#WindowSpec |
|
111 |
#label: 'SelectorList' |
|
112 |
#name: 'SelectorList' |
|
113 |
#min: #(#Point 0 0) |
|
114 |
#bounds: #(#Rectangle 12 22 312 322) |
|
115 |
) |
|
116 |
#component: |
|
117 |
#(#SpecCollection |
|
118 |
#collection: #( |
|
119 |
#(#SequenceViewSpec |
|
120 |
#name: 'List' |
|
121 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
122 |
#tabable: true |
|
123 |
#model: #selectedMethodNameIndices |
|
124 |
#menu: #menuHolder |
|
125 |
#hasHorizontalScrollBar: true |
|
126 |
#hasVerticalScrollBar: true |
|
127 |
#miniScrollerHorizontal: true |
|
128 |
#isMultiSelect: true |
|
129 |
#valueChangeSelector: #selectionChangedByClick |
|
130 |
#useIndex: true |
|
131 |
#sequenceList: #browserNameList |
|
132 |
#doubleClickChannel: #doubleClickChannel |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
133 |
#properties: |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
134 |
#(#PropertyListDictionary |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
135 |
#dragArgument: nil |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
136 |
#dropArgument: nil |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
137 |
#canDropSelector: #canDropContext: |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
138 |
#dropSelector: #doDropContext: |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
139 |
) |
5591 | 140 |
) |
141 |
) |
|
142 |
||
143 |
) |
|
144 |
) |
|
145 |
! ! |
|
146 |
||
147 |
!MethodList class methodsFor:'plugIn spec'! |
|
148 |
||
149 |
aspectSelectors |
|
150 |
"This resource specification was automatically generated |
|
151 |
by the UIPainter of ST/X." |
|
152 |
||
153 |
"Do not manually edit this. If it is corrupted, |
|
154 |
the UIPainter may not be able to read the specification." |
|
155 |
||
156 |
"Return a description of exported aspects; |
|
157 |
these can be connected to aspects of an embedding application |
|
158 |
(if this app is embedded in a subCanvas)." |
|
159 |
||
160 |
^ #( |
|
9421 | 161 |
"/ #classHolder |
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
162 |
#(#doubleClickChannel #action ) |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
163 |
#forceGeneratorTrigger |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
164 |
#immediateUpdate |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
165 |
#inGeneratorHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
166 |
#menuHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
167 |
#methodCategoryHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
168 |
#packageFilter |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
169 |
#selectedMethods |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
170 |
#selectionChangeCondition |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
171 |
#updateTrigger |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
172 |
#variableFilter |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
173 |
#filterClassVars |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
174 |
#showMethodInheritance |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
175 |
#showMethodComplexity |
6268 | 176 |
#showMethodTypeIcon |
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
177 |
#showImageResourceMethodsImages |
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
178 |
#sortBy |
9438 | 179 |
#showCoverageInformation |
5591 | 180 |
). |
9421 | 181 |
|
9438 | 182 |
"Modified: / 27-04-2010 / 16:13:57 / cg" |
5591 | 183 |
! ! |
184 |
||
185 |
!MethodList methodsFor:'aspects'! |
|
186 |
||
187 |
browserNameList |
|
188 |
browserNameList isNil ifTrue:[ |
|
189 |
browserNameList := List new. |
|
190 |
]. |
|
191 |
^ browserNameList. |
|
192 |
||
193 |
"Modified: / 31.1.2000 / 00:42:44 / cg" |
|
194 |
"Created: / 5.2.2000 / 22:38:32 / cg" |
|
195 |
! |
|
196 |
||
197 |
defaultSlaveModeValue |
|
198 |
^ false. |
|
199 |
! |
|
200 |
||
201 |
filterClassVars |
|
202 |
filterClassVars isNil ifTrue:[ |
|
203 |
filterClassVars := false asValue. |
|
204 |
filterClassVars addDependent:self |
|
205 |
]. |
|
206 |
^ filterClassVars |
|
207 |
! |
|
208 |
||
209 |
filterClassVars:aValueHolder |
|
210 |
filterClassVars notNil ifTrue:[ |
|
211 |
filterClassVars removeDependent:self |
|
212 |
]. |
|
213 |
filterClassVars := aValueHolder. |
|
214 |
filterClassVars notNil ifTrue:[ |
|
215 |
filterClassVars addDependent:self |
|
216 |
]. |
|
217 |
! |
|
218 |
||
219 |
methodLabelHolder |
|
220 |
^ self pseudoListLabelHolder |
|
221 |
||
222 |
"Created: / 1.3.2000 / 20:50:07 / cg" |
|
223 |
! |
|
224 |
||
225 |
methodList |
|
226 |
^ methodList |
|
227 |
! |
|
228 |
||
229 |
selectedMethodNameIndices |
|
230 |
selectedMethodNameIndices isNil ifTrue:[ |
|
231 |
selectedMethodNameIndices := ValueHolder new. |
|
232 |
selectedMethodNameIndices addDependent:self |
|
233 |
]. |
|
234 |
^ selectedMethodNameIndices. |
|
235 |
||
236 |
"Modified: / 5.2.2000 / 00:31:48 / cg" |
|
237 |
"Created: / 5.2.2000 / 22:59:31 / cg" |
|
238 |
! |
|
239 |
||
240 |
selectedMethods |
|
241 |
^ self selectionHolder |
|
242 |
! |
|
243 |
||
244 |
selectedMethods:aValueHolder |
|
245 |
^ self selectionHolder:aValueHolder |
|
246 |
! |
|
247 |
||
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
248 |
showImageResourceMethodsImages |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
249 |
showImageResourceMethodsImages isNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
250 |
showImageResourceMethodsImages := false asValue. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
251 |
showImageResourceMethodsImages addDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
252 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
253 |
^ showImageResourceMethodsImages |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
254 |
! |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
255 |
|
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
256 |
showImageResourceMethodsImages:aValueHolder |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
257 |
showImageResourceMethodsImages notNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
258 |
showImageResourceMethodsImages removeDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
259 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
260 |
showImageResourceMethodsImages := aValueHolder. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
261 |
showImageResourceMethodsImages notNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
262 |
showImageResourceMethodsImages addDependent:self |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
263 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
264 |
! |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
265 |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
266 |
showMethodComplexity |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
267 |
showMethodComplexity isNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
268 |
showMethodComplexity := false asValue. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
269 |
showMethodComplexity addDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
270 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
271 |
^ showMethodComplexity |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
272 |
! |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
273 |
|
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
274 |
showMethodComplexity:aValueHolder |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
275 |
showMethodComplexity notNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
276 |
showMethodComplexity removeDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
277 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
278 |
showMethodComplexity := aValueHolder. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
279 |
showMethodComplexity notNil ifTrue:[ |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
280 |
showMethodComplexity addDependent:self |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
281 |
]. |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
282 |
! |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
283 |
|
5591 | 284 |
showMethodInheritance |
285 |
showMethodInheritance isNil ifTrue:[ |
|
286 |
showMethodInheritance := false asValue. |
|
287 |
showMethodInheritance addDependent:self |
|
288 |
]. |
|
289 |
^ showMethodInheritance |
|
290 |
! |
|
291 |
||
292 |
showMethodInheritance:aValueHolder |
|
293 |
showMethodInheritance notNil ifTrue:[ |
|
294 |
showMethodInheritance removeDependent:self |
|
295 |
]. |
|
296 |
showMethodInheritance := aValueHolder. |
|
297 |
showMethodInheritance notNil ifTrue:[ |
|
298 |
showMethodInheritance addDependent:self |
|
299 |
]. |
|
300 |
! |
|
301 |
||
6268 | 302 |
showMethodTypeIcon |
303 |
showMethodTypeIcon isNil ifTrue:[ |
|
304 |
showMethodTypeIcon := true asValue. |
|
305 |
showMethodTypeIcon addDependent:self |
|
306 |
]. |
|
307 |
^ showMethodTypeIcon |
|
308 |
! |
|
309 |
||
310 |
showMethodTypeIcon:aValueHolder |
|
311 |
showMethodTypeIcon notNil ifTrue:[ |
|
312 |
showMethodTypeIcon removeDependent:self |
|
313 |
]. |
|
314 |
showMethodTypeIcon := aValueHolder. |
|
315 |
showMethodTypeIcon notNil ifTrue:[ |
|
316 |
showMethodTypeIcon addDependent:self |
|
317 |
]. |
|
318 |
! |
|
319 |
||
5591 | 320 |
variableFilter |
321 |
variableFilter isNil ifTrue:[ |
|
322 |
variableFilter := nil asValue. |
|
323 |
variableFilter addDependent:self |
|
324 |
]. |
|
325 |
^ variableFilter |
|
326 |
! |
|
327 |
||
328 |
variableFilter:aValueHolder |
|
329 |
variableFilter notNil ifTrue:[ |
|
330 |
variableFilter removeDependent:self |
|
331 |
]. |
|
332 |
variableFilter := aValueHolder. |
|
333 |
variableFilter notNil ifTrue:[ |
|
334 |
variableFilter addDependent:self |
|
335 |
]. |
|
336 |
! ! |
|
337 |
||
338 |
!MethodList methodsFor:'change & update'! |
|
339 |
||
340 |
delayedUpdate:something with:aParameter from:changedObject |
|
341 |
|cls sel oldMethod newMethod methods newSelection |
|
342 |
selectionHolder selection needSelectionChange| |
|
343 |
||
344 |
selectionHolder := self selectedMethods. |
|
345 |
selection := selectionHolder value. |
|
346 |
||
347 |
changedObject == Smalltalk ifTrue:[ |
|
5998 | 348 |
classes notNil ifTrue:[ |
349 |
something == #methodCategory ifTrue:[ |
|
350 |
"/ ignore here - methodCategoryList will tell me if required |
|
351 |
^ self |
|
352 |
]. |
|
6663
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
353 |
(something == #classOrganization |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
354 |
or:[ something == #methodCategoryAdded |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
355 |
or:[ something == #methodCategoryRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
356 |
or:[ something == #methodCategoriesRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
357 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
5998 | 358 |
"/ ignore here - methodCategoryList will tell me if required |
359 |
^ self |
|
360 |
]. |
|
5591 | 361 |
|
5998 | 362 |
something == #methodInClass ifTrue:[ |
363 |
"/ a method has been added/changed |
|
364 |
cls := aParameter at:1. |
|
365 |
(classes includesIdentical:cls) ifTrue:[ |
|
366 |
sel := aParameter at:2. |
|
367 |
oldMethod := aParameter at:3. |
|
368 |
newMethod := cls compiledMethodAt:sel. |
|
369 |
(oldMethod notNil and:[newMethod notNil]) ifTrue:[ |
|
370 |
"a method was changed & acccepted; |
|
371 |
No need for a rescan of the methodDictionary; |
|
372 |
however, ensure that the refs to the old method are updated |
|
373 |
" |
|
374 |
methods := selection. |
|
375 |
methods size > 0 ifTrue:[ |
|
376 |
(methods includesIdentical:oldMethod) ifTrue:[ |
|
377 |
needSelectionChange := true. |
|
378 |
] |
|
379 |
]. |
|
380 |
methodList replaceAllIdentical:oldMethod with:newMethod. |
|
381 |
lastSelectedMethods notNil ifTrue:[ |
|
382 |
lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
383 |
]. |
|
384 |
methods size > 0 ifTrue:[ |
|
385 |
methods := methods asOrderedCollection. |
|
386 |
methods replaceAllIdentical:oldMethod with:newMethod. |
|
387 |
]. |
|
5591 | 388 |
|
5998 | 389 |
needSelectionChange == true ifTrue:[ |
390 |
selectionHolder setValue:methods. |
|
6575
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
391 |
"/ self enqueueDelayedMethodsSelectionChanged. |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
392 |
"/ need this to inform my browser that method was changed |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
393 |
"/ by someone else. |
94f336bcb07b
update notifiaction from other browsers (refix)
Claus Gittinger <cg@exept.de>
parents:
6490
diff
changeset
|
394 |
selectionHolder changed. |
5998 | 395 |
]. |
396 |
(variableFilter value size > 0 |
|
397 |
or:[oldMethod package ~= newMethod package |
|
6260 | 398 |
or:[oldMethod resources ~= newMethod resources |
6694 | 399 |
or:[showMethodComplexity value == true]]]) ifTrue:[ |
5998 | 400 |
"/ only update that methods entry |
401 |
self updateListEntryFor:newMethod. |
|
402 |
"/ sigh - must invalidate |
|
403 |
"/ self invalidateList. |
|
404 |
]. |
|
405 |
^ self. |
|
406 |
]. |
|
407 |
"/ method was added - update the methodList |
|
408 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
409 |
self invalidateList. |
|
410 |
]. |
|
411 |
^ self. |
|
412 |
]. |
|
413 |
||
414 |
something == #methodInClassRemoved ifTrue:[ |
|
415 |
cls := aParameter at:1. |
|
416 |
(classes includesIdentical:cls) ifTrue:[ |
|
417 |
sel := aParameter at:2. |
|
418 |
"/ method was removed - update the methodList |
|
419 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
420 |
self invalidateList. |
|
421 |
]. |
|
422 |
^ self. |
|
423 |
]. |
|
5591 | 424 |
|
5998 | 425 |
(something == #methodTrap |
426 |
or:[ something == #privacyOfMethod ]) ifTrue:[ |
|
427 |
cls := aParameter at:1. |
|
428 |
sel := aParameter at:2. |
|
429 |
(classes includesIdentical:cls) ifFalse:[ ^ self]. |
|
430 |
newMethod := cls compiledMethodAt:sel. |
|
431 |
newMethod isNil ifTrue:[ |
|
432 |
self invalidateList. |
|
433 |
^ self |
|
434 |
]. |
|
5591 | 435 |
|
5998 | 436 |
(something == #privacyOfMethod) ifTrue:[ |
437 |
self updateListEntryFor:newMethod. |
|
438 |
]. |
|
439 |
||
440 |
(something == #methodTrap) ifTrue:[ |
|
441 |
newMethod isWrapped ifTrue:[ |
|
442 |
oldMethod := newMethod originalMethod |
|
443 |
] ifFalse:[ |
|
444 |
selection size > 0 ifTrue:[ |
|
445 |
oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
|
446 |
] |
|
447 |
]. |
|
5591 | 448 |
|
5998 | 449 |
selection size > 0 ifTrue:[ |
450 |
(selection includesIdentical:oldMethod) ifTrue:[ |
|
451 |
needSelectionChange := true. |
|
452 |
] |
|
453 |
]. |
|
454 |
methodList replaceAllIdentical:oldMethod with:newMethod. |
|
455 |
lastSelectedMethods notNil ifTrue:[ |
|
456 |
lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
457 |
]. |
|
458 |
selection size > 0 ifTrue:[ |
|
459 |
selection := selection asOrderedCollection. |
|
460 |
selection replaceAllIdentical:oldMethod with:newMethod. |
|
461 |
]. |
|
462 |
needSelectionChange == true ifTrue:[ |
|
463 |
selectionHolder changed. |
|
464 |
]. |
|
5591 | 465 |
|
5998 | 466 |
"/ actually, could just change that single item ... |
467 |
"/ ... might be cheaper, if list is huge. |
|
468 |
"/ only update that methods entry |
|
469 |
self updateListEntryFor:newMethod. |
|
470 |
"/ self invalidateList. |
|
471 |
]. |
|
472 |
^ self |
|
473 |
]. |
|
5591 | 474 |
|
6846 | 475 |
(something == #projectOrganization |
476 |
or:[something == #lastTestRunResult]) ifTrue:[ |
|
5998 | 477 |
aParameter notNil ifTrue:[ |
478 |
cls := aParameter at:1. |
|
479 |
cls notNil ifTrue:[ |
|
480 |
((classes includesIdentical:cls theNonMetaclass) |
|
481 |
or:[(classes includesIdentical:cls theMetaclass)]) ifTrue:[ |
|
482 |
self invalidateList. |
|
483 |
]. |
|
484 |
]. |
|
485 |
] ifFalse:[ |
|
486 |
self invalidateList. |
|
487 |
]. |
|
488 |
^ self |
|
489 |
]. |
|
6846 | 490 |
|
5998 | 491 |
"/ everything else is ignored |
492 |
"/ self halt. |
|
493 |
]. |
|
494 |
^ self |
|
5591 | 495 |
]. |
496 |
||
497 |
"/ something == #organization ifTrue:[ |
|
498 |
"/self halt:'no longer'. |
|
499 |
"/^ self. |
|
500 |
"/ "/ a methods cateory has changed |
|
501 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
502 |
"/ aParameter isSymbol ifTrue:[ |
|
503 |
"/ "/ a method with a new category |
|
504 |
"/ (self methodList includesIdentical:(changedObject compiledMethodAt:aParameter)) ifTrue:[ |
|
505 |
"/ self invalidateList. |
|
506 |
"/ ]. |
|
507 |
"/ ^ self. |
|
508 |
"/ ]. |
|
509 |
"/ "/ a new category (no method yet) |
|
510 |
"/ self invalidateList |
|
511 |
"/ ]. |
|
512 |
"/ ^ self |
|
513 |
"/ ]. |
|
514 |
||
515 |
"/ something == #methodDictionary ifTrue:[ |
|
516 |
"/self halt:'no longer'. |
|
517 |
"/^ self. |
|
518 |
"/ "/ a method has been added/removed |
|
519 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
520 |
"/ aParameter isArray ifTrue:[ |
|
521 |
"/ sel := aParameter at:1. |
|
522 |
"/ oldMethod := aParameter at:2. |
|
523 |
"/ newMethod := changedObject compiledMethodAt:sel. |
|
524 |
"/ oldMethod notNil ifTrue:[ |
|
525 |
"/ "a method was changed & acccepted; |
|
526 |
"/ No need for a rescan of the methodDictionary; |
|
527 |
"/ however, ensure that the refs to the old method are updated |
|
528 |
"/ " |
|
529 |
"/ methods := selection. |
|
530 |
"/ methods size > 0 ifTrue:[ |
|
531 |
"/ (methods includesIdentical:oldMethod) ifTrue:[ |
|
532 |
"/ needSelectionChange := true. |
|
533 |
"/ ] |
|
534 |
"/ ]. |
|
535 |
"/ methodList replaceAllIdentical:oldMethod with:newMethod. |
|
536 |
"/ lastSelectedMethods notNil ifTrue:[ |
|
537 |
"/ lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
538 |
"/ ]. |
|
539 |
"/ methods size > 0 ifTrue:[ |
|
540 |
"/ methods := methods asOrderedCollection. |
|
541 |
"/ methods replaceAllIdentical:oldMethod with:newMethod. |
|
542 |
"/ ]. |
|
543 |
"/ needSelectionChange == true ifTrue:[ |
|
544 |
"/ selectionHolder setValue:methods. |
|
545 |
"/ selectionHolder changed. |
|
546 |
"/ ]. |
|
547 |
"/ ^ self. |
|
548 |
"/ ] |
|
549 |
"/ ]. |
|
550 |
"/ "/ class has changed must update the methodList |
|
551 |
"/ self invalidateList. |
|
552 |
"/ ]. |
|
553 |
"/ ^ self. |
|
554 |
"/ ]. |
|
555 |
||
556 |
"/ something == #projectOrganization ifTrue:[ |
|
557 |
"/ ((classes includesIdentical:changedObject theNonMetaclass) |
|
558 |
"/ or:[(classes includesIdentical:changedObject theMetaclass)]) ifTrue:[ |
|
559 |
"/ self invalidateList. |
|
560 |
"/ ]. |
|
561 |
"/ ^ self |
|
562 |
"/ ]. |
|
563 |
||
564 |
changedObject == sortBy ifTrue:[ |
|
5998 | 565 |
listValid ~~ true ifTrue:[ "/ could be nil |
566 |
inGeneratorHolder value isNil ifTrue:[ |
|
567 |
"/ ok, no need to react on that one |
|
568 |
"/ (will invalidate anyway, once I have more info at hand) |
|
569 |
^ self |
|
570 |
]. |
|
571 |
]. |
|
572 |
self invalidateList. |
|
573 |
^ self |
|
5591 | 574 |
]. |
575 |
||
576 |
(changedObject == variableFilter |
|
577 |
or:[changedObject == filterClassVars |
|
6259
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
578 |
or:[changedObject == showMethodInheritance |
e440c14b02aa
experimental display of method complexity
Claus Gittinger <cg@exept.de>
parents:
5998
diff
changeset
|
579 |
or:[changedObject == showMethodComplexity]]]) ifTrue:[ |
5998 | 580 |
self invalidateList. |
581 |
^ self |
|
5591 | 582 |
]. |
583 |
||
584 |
changedObject == selectedMethodNameIndices ifTrue:[ |
|
5998 | 585 |
newSelection := self selectedMethodNameIndices value collect:[:idx | methodList at:idx]. |
586 |
newSelection ~= selection ifTrue:[ |
|
587 |
selectionHolder value:newSelection. |
|
588 |
lastSelectedMethods := newSelection. |
|
589 |
lastSelectedMethods notNil ifTrue:[ |
|
590 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
591 |
]. |
|
592 |
] ifFalse:[ |
|
593 |
"/ a reselect - force update |
|
5591 | 594 |
"/ selection size == 1 ifTrue:[ |
5998 | 595 |
selectionHolder setValue:newSelection. |
596 |
selectionHolder changed:#value. |
|
5591 | 597 |
"/ ]. |
5998 | 598 |
]. |
599 |
^ self |
|
5591 | 600 |
]. |
601 |
changedObject == selectionHolder ifTrue:[ |
|
5998 | 602 |
self selectedMethodsChanged. |
603 |
lastSelectedMethods := selectionHolder value. |
|
604 |
lastSelectedMethods notNil ifTrue:[ |
|
605 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
606 |
]. |
|
607 |
^ self |
|
5591 | 608 |
]. |
609 |
"/ something == #methodTrap ifTrue:[ |
|
610 |
"/self halt:'no longer'. |
|
611 |
"/^ self. |
|
612 |
"/ (classes includesIdentical:changedObject) ifTrue:[ |
|
613 |
"/ newMethod := changedObject compiledMethodAt:aParameter. |
|
614 |
"/ newMethod isNil ifTrue:[ |
|
615 |
"/ self invalidateList. |
|
616 |
"/ ^ self |
|
617 |
"/ ]. |
|
618 |
"/ newMethod isWrapped ifTrue:[ |
|
619 |
"/ oldMethod := newMethod originalMethod |
|
620 |
"/ ] ifFalse:[ |
|
621 |
"/ selection size > 0 ifTrue:[ |
|
622 |
"/ oldMethod := selection detect:[:each | each isWrapped and:[each originalMethod == newMethod]] ifNone:nil. |
|
623 |
"/ ] |
|
624 |
"/ ]. |
|
625 |
"/ |
|
626 |
"/ selection size > 0 ifTrue:[ |
|
627 |
"/ (selection includesIdentical:oldMethod) ifTrue:[ |
|
628 |
"/ needSelectionChange := true. |
|
629 |
"/ ] |
|
630 |
"/ ]. |
|
631 |
"/"/ methodList replaceAllIdentical:oldMethod with:newMethod. |
|
632 |
"/ lastSelectedMethods notNil ifTrue:[ |
|
633 |
"/ lastSelectedMethods replaceAllIdentical:oldMethod with:newMethod |
|
634 |
"/ ]. |
|
635 |
"/ selection size > 0 ifTrue:[ |
|
636 |
"/ selection := selection asOrderedCollection. |
|
637 |
"/ selection replaceAllIdentical:oldMethod with:newMethod. |
|
638 |
"/ ]. |
|
639 |
"/ needSelectionChange == true ifTrue:[ |
|
640 |
"/ selectionHolder changed. |
|
641 |
"/ ]. |
|
642 |
"/ self invalidateList. |
|
643 |
"/ ^ self |
|
644 |
"/ ]. |
|
645 |
"/ ^ self |
|
646 |
"/ ]. |
|
647 |
super delayedUpdate:something with:aParameter from:changedObject |
|
648 |
||
6846 | 649 |
"Created: / 05-02-2000 / 13:42:14 / cg" |
650 |
"Modified: / 06-08-2006 / 10:36:49 / cg" |
|
5591 | 651 |
! |
652 |
||
653 |
selectedMethodsChanged |
|
654 |
"the set of selected methods has changed; |
|
655 |
update the selection-index collection (for the selectionInListView)" |
|
656 |
||
657 |
|indices methods reverseMap |
|
658 |
selectedMethodsHolder selectedMethods selectedMethodNameIndicesHolder| |
|
659 |
||
660 |
methods := methodList ? #(). |
|
661 |
methods size == 0 ifTrue:[ |
|
662 |
"/ this may happen during early startup, |
|
663 |
"/ when invoked with a preset methodSelection, |
|
664 |
"/ and the methodGenerator has not yet been setup |
|
665 |
"/ to not clobber the selection, defer the update |
|
666 |
"/ until the methodList arrives ... |
|
667 |
^ self |
|
668 |
]. |
|
669 |
||
670 |
selectedMethodsHolder := self selectedMethods. |
|
671 |
selectedMethods := selectedMethodsHolder value. |
|
672 |
||
673 |
"/ check if all is selected (likely) |
|
674 |
((selectedMethods size == methodList size) |
|
675 |
and:[selectedMethods = methodList]) ifTrue:[ |
|
676 |
indices := (1 to:selectedMethods size) |
|
677 |
] ifFalse:[ |
|
678 |
selectedMethods size > 100 ifTrue:[ |
|
679 |
"/ check if all is selected (likely) |
|
680 |
((selectedMethods size == methodList size) |
|
681 |
and:[selectedMethods = methodList]) ifTrue:[ |
|
682 |
indices := (1 to:selectedMethods size) |
|
683 |
] ifFalse:[ |
|
684 |
"/ for big collections, generate a reverse map |
|
685 |
reverseMap := IdentityDictionary new. |
|
686 |
methods keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx]. |
|
687 |
indices := selectedMethods collect:[:eachSelectedMethod | |
|
688 |
reverseMap at:eachSelectedMethod ifAbsent:0 |
|
689 |
] |
|
690 |
] |
|
691 |
] ifFalse:[ |
|
692 |
indices := (selectedMethods ? #()) collect:[:eachSelectedMethod | |
|
693 |
methods identityIndexOf:eachSelectedMethod. |
|
694 |
] |
|
695 |
]. |
|
696 |
indices := indices select:[:idx | idx ~= 0]. |
|
697 |
]. |
|
698 |
||
699 |
selectedMethodNameIndicesHolder := self selectedMethodNameIndices. |
|
700 |
selectedMethodNameIndicesHolder value ~= indices ifTrue:[ |
|
701 |
selectedMethodNameIndicesHolder value:indices. |
|
702 |
] |
|
703 |
! |
|
704 |
||
705 |
selectionChanged |
|
706 |
|methods| |
|
707 |
||
708 |
methods := ((self selectedMethodNameIndices value) ? #()) collect:[:idx | methodList at:idx]. |
|
709 |
methods notEmpty ifTrue:[ |
|
710 |
lastSelectedMethods := methods asOrderedCollection. |
|
711 |
]. |
|
712 |
"/ to allow reselect, change my valueHolder, even if the same collection |
|
713 |
"/ self selectedMethods value ~= methods ifTrue:[ |
|
714 |
self selectedMethods value:methods |
|
715 |
"/ ] |
|
716 |
||
717 |
"Created: / 5.2.2000 / 13:42:14 / cg" |
|
718 |
"Modified: / 5.2.2000 / 23:32:20 / cg" |
|
719 |
! |
|
720 |
||
721 |
selectionChangedByClick |
|
722 |
"we are not interested in that - get another notification |
|
723 |
via the changed valueHolder" |
|
724 |
||
725 |
! |
|
726 |
||
727 |
update:something with:aParameter from:changedObject |
|
728 |
|cls| |
|
729 |
||
10228 | 730 |
changedObject == showCoverageInformation ifTrue:[self halt]. |
731 |
||
5591 | 732 |
"/ some can be ignored immediately |
733 |
changedObject == Smalltalk ifTrue:[ |
|
734 |
classes isNil ifTrue:[ |
|
735 |
^ self. |
|
736 |
]. |
|
737 |
something isNil ifTrue:[ |
|
738 |
"/ self halt "/ huh - Smalltalk changed - so what ? |
|
739 |
^ self. |
|
740 |
]. |
|
5998 | 741 |
|
5591 | 742 |
something == #classComment ifTrue:[ |
743 |
^ self. |
|
744 |
]. |
|
745 |
something == #classVariables ifTrue:[ |
|
746 |
^ self. |
|
747 |
]. |
|
748 |
something == #organization ifTrue:[ |
|
749 |
^ self. |
|
750 |
]. |
|
751 |
something == #methodCategory ifTrue:[ |
|
752 |
"/ ignore here - methodCategoryList will tell me if required |
|
753 |
^ self |
|
754 |
]. |
|
6663
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
755 |
(something == #classOrganization |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
756 |
or:[ something == #methodCategoryAdded |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
757 |
or:[ something == #methodCategoryRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
758 |
or:[ something == #methodCategoriesRemoved |
1453d4f33815
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6575
diff
changeset
|
759 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
5591 | 760 |
"/ ignore here - methodCategoryList will tell me if required |
761 |
^ self |
|
762 |
]. |
|
5998 | 763 |
(something == #methodTrap |
6846 | 764 |
or:[ something == #methodPrivacy |
765 |
or:[ something == #lastTestRunResult] ]) ifTrue:[ |
|
5998 | 766 |
self window shown ifFalse:[ |
767 |
changedObject removeDependent:self. "/ ????? |
|
768 |
^ self |
|
769 |
]. |
|
5591 | 770 |
cls := aParameter at:1. |
771 |
(classes includesIdentical:cls) ifFalse:[ |
|
5998 | 772 |
^ self "/ I dont care for that class |
5591 | 773 |
]. |
774 |
]. |
|
775 |
||
6846 | 776 |
"/ as the organisation changes, flush my remembered redefinition-cache-info |
5591 | 777 |
classAndSelectorsRedefinedBySubclassesOfClass := nil. |
778 |
||
779 |
something == #classDefinition ifTrue:[ |
|
780 |
cls := aParameter. |
|
781 |
(classes contains:[:aClass | aClass name == cls name]) ifFalse:[ |
|
782 |
^ self "/ I dont care for that class |
|
783 |
]. |
|
784 |
classes := classes collect:[:eachClass | eachClass isMeta ifTrue:[ |
|
785 |
(Smalltalk at:eachClass theNonMetaclass name) class |
|
786 |
] ifFalse:[ |
|
787 |
Smalltalk at:eachClass name |
|
788 |
] |
|
789 |
]. |
|
790 |
self updateList. |
|
791 |
^ self. |
|
792 |
]. |
|
793 |
something == #newClass ifTrue:[ |
|
794 |
^ self. |
|
795 |
]. |
|
796 |
something == #classRemove ifTrue:[ |
|
797 |
^ self. |
|
798 |
]. |
|
799 |
something == #classRename ifTrue:[ |
|
800 |
^ self. |
|
801 |
]. |
|
802 |
]. |
|
803 |
||
804 |
"/ these must lead to immediate update of the selectedMethods collection |
|
805 |
"/ (otherwise, that collection might be updated too late, leading to |
|
806 |
"/ an obsolete methods code being shown by the codeView. |
|
807 |
something == #methodInClass ifTrue:[ |
|
6846 | 808 |
"/ as the organisation changes, flush my remembered redefinition-cache-info |
5591 | 809 |
classAndSelectorsRedefinedBySubclassesOfClass := nil. |
810 |
cls := aParameter at:1. |
|
811 |
(classes includesIdentical:cls) ifFalse:[ |
|
812 |
^ self "/ I dont care for that class |
|
813 |
]. |
|
814 |
self enqueueDelayedUpdate:something with:aParameter from:changedObject. |
|
815 |
^ self |
|
816 |
]. |
|
817 |
||
818 |
something == #methodInClassRemoved ifTrue:[ |
|
819 |
cls := aParameter at:1. |
|
820 |
(classes includesIdentical:cls) ifFalse:[ |
|
821 |
^ self "/ I dont care for that class |
|
822 |
]. |
|
823 |
]. |
|
824 |
||
825 |
super update:something with:aParameter from:changedObject |
|
6846 | 826 |
|
10228 | 827 |
"Modified: / 06-07-2011 / 19:50:58 / cg" |
5591 | 828 |
! ! |
829 |
||
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
830 |
!MethodList methodsFor:'drag & drop'! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
831 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
832 |
canDropContext:aDropContext |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
833 |
|methods| |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
834 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
835 |
aDropContext sourceWidget == aDropContext targetWidget ifTrue:[^ false]. |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
836 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
837 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
7122 | 838 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
839 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
840 |
self masterApplication theSingleSelectedClass isNil ifTrue:[^ false]. |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
841 |
^ true |
7122 | 842 |
|
843 |
"Modified: / 13-09-2006 / 11:43:54 / cg" |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
844 |
! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
845 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
846 |
doDropContext:aDropContext |
8596 | 847 |
|methods browser| |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
848 |
|
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
849 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
7122 | 850 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
851 |
|
8596 | 852 |
browser := self masterApplication. |
853 |
aDropContext dragType == DropContext dragTypeCopy ifTrue:[ |
|
854 |
browser |
|
855 |
copyMethods:methods |
|
856 |
toClass:(browser theSingleSelectedClass). |
|
857 |
] ifFalse:[ |
|
858 |
browser |
|
859 |
moveMethods:methods |
|
860 |
toClass:(browser theSingleSelectedClass). |
|
861 |
]. |
|
7122 | 862 |
|
863 |
"Modified: / 13-09-2006 / 11:43:44 / cg" |
|
6774
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
864 |
! ! |
ae9ed5b0b548
move method via drag and drop
Claus Gittinger <cg@exept.de>
parents:
6697
diff
changeset
|
865 |
|
5591 | 866 |
!MethodList methodsFor:'private'! |
867 |
||
868 |
listOfMethodNames |
|
10257 | 869 |
|methods entries selectorBag newNameList allClasses newClasses |
870 |
allCategories "allSelectors" |
|
871 |
generator doShowClass doShowClassFirst doShowCategory enforceClassAndProtocolInList theMethod sortByClass anyMethodToWatch mclass| |
|
5591 | 872 |
|
873 |
generator := inGeneratorHolder value. |
|
10257 | 874 |
generator isNil ifTrue:[ |
875 |
^ #() |
|
876 |
]. |
|
5591 | 877 |
allClasses := IdentitySet new. |
10257 | 878 |
allCategories := IdentitySet new. |
879 |
||
5591 | 880 |
"/ allSelectors := Set new. |
10257 | 881 |
|
5591 | 882 |
newClasses := IdentitySet new. |
883 |
selectorBag := Bag new. |
|
884 |
entries := OrderedCollection new. |
|
885 |
enforceClassAndProtocolInList := false. |
|
886 |
anyMethodToWatch := false. |
|
10257 | 887 |
|
5591 | 888 |
"/ generator generates nil-selector entries |
889 |
"/ to pass multiple-class and multiple-protocol info |
|
10257 | 890 |
|
891 |
generator do:[:cls :cat :sel :mthd | |
|
892 |
(cls isNil and:[ cat isNil and:[ sel isNil ] ]) ifTrue:[ |
|
893 |
enforceClassAndProtocolInList := true |
|
894 |
] ifFalse:[ |
|
895 |
cls notNil ifTrue:[ |
|
896 |
allClasses add:cls. |
|
897 |
]. |
|
898 |
cat notNil ifTrue:[ |
|
899 |
allCategories add:cat. |
|
900 |
]. |
|
901 |
"JV: Filter method through package filter" |
|
902 |
(mthd notNil |
|
903 |
and:[ |
|
904 |
mthd isSynthetic not |
|
905 |
and:[ |
|
906 |
sel notNil |
|
907 |
and:[ |
|
908 |
packageFilter value isNil |
|
909 |
or:[ packageFilter value includes:mthd package ] |
|
910 |
] |
|
911 |
] |
|
912 |
]) |
|
913 |
ifTrue:[ |
|
914 |
entries add:(Array |
|
915 |
with:cls |
|
916 |
with:sel |
|
917 |
with:mthd). |
|
918 |
selectorBag add:sel. |
|
919 |
newClasses add:cls. |
|
920 |
||
921 |
"/ allSelectors add:sel. |
|
922 |
] |
|
923 |
]. |
|
924 |
(mthd notNil and:[ mthd isWrapped ]) ifTrue:[ |
|
925 |
(mthd isTiming or:[ mthd isCounting or:[ mthd isCountingMemoryUsage ] ]) ifTrue:[ |
|
926 |
anyMethodToWatch := true |
|
927 |
] |
|
928 |
]. |
|
929 |
]. |
|
5591 | 930 |
showMethodInheritance value ~~ false ifTrue:[ |
931 |
"/ collect redefinition information once (big speedup for #methodIsRedefinedbelow) |
|
932 |
classAndSelectorsRedefinedBySubclassesOfClass isNil ifTrue:[ |
|
933 |
classAndSelectorsRedefinedBySubclassesOfClass := IdentityDictionary new. |
|
934 |
]. |
|
10257 | 935 |
allClasses do:[:cls | |
936 |
|d| |
|
937 |
||
5591 | 938 |
d := classAndSelectorsRedefinedBySubclassesOfClass. |
939 |
(d notNil and:[ (d includesKey:cls) not ]) ifTrue:[ |
|
8206 | 940 |
cls isLoaded ifTrue:[ |
941 |
d at:cls put:(self setOfAllSelectorsImplementedBelow:cls) |
|
942 |
] |
|
5591 | 943 |
] |
944 |
]. |
|
945 |
]. |
|
10257 | 946 |
|
5591 | 947 |
"/ multiple classes must: add the className for some |
10257 | 948 |
|
949 |
doShowClass := enforceClassAndProtocolInList or:[ allClasses size > 1 ]. |
|
950 |
||
5591 | 951 |
"/ multiple categories: must add the categorie for some |
10257 | 952 |
|
953 |
doShowCategory := enforceClassAndProtocolInList |
|
954 |
or:[ allCategories size > 1 ]. |
|
955 |
doShowClassFirst := doShowClass. |
|
5591 | 956 |
doShowClassFirst := doShowClass and:[ sortBy value == #class ]. |
957 |
sortBy value == false ifTrue:[ |
|
958 |
"/ do not sort |
|
959 |
] ifFalse:[ |
|
960 |
(doShowClass not and:[ sortBy value == #class ]) ifTrue:[ |
|
961 |
"/ multiple classes must add the className for some |
|
962 |
"/ check, if doShowClass must be enforced |
|
10257 | 963 |
entries do:[:entry | |
5591 | 964 |
|cls sel mthd s needClass| |
965 |
||
966 |
cls := entry at:1. |
|
967 |
sel := entry at:2. |
|
968 |
mthd := entry at:3. |
|
969 |
doShowClass ifFalse:[ |
|
970 |
doShowClass := (selectorBag occurrencesOf:sel) > 1 |
|
971 |
]. |
|
972 |
]. |
|
973 |
]. |
|
974 |
sortByClass := doShowClass and:[ sortBy value == #class ]. |
|
975 |
sortByClass ifTrue:[ |
|
10257 | 976 |
entries |
977 |
sort:[:a :b | |
|
978 |
|nmA nmB clsNmA clsNmB nsNmA nsNmB| |
|
979 |
||
980 |
clsNmA := (a at:1) name. |
|
981 |
clsNmB := (b at:1) name. |
|
982 |
clsNmA = clsNmB ifTrue:[ |
|
983 |
nmA := (a at:2) asSymbol selector. |
|
984 |
nmB := (b at:2) asSymbol selector. |
|
985 |
nmA = nmB ifTrue:[ |
|
986 |
nsNmA := (a at:3) nameSpaceName. |
|
987 |
nsNmB := (b at:3) nameSpaceName. |
|
988 |
nsNmA < nsNmB |
|
989 |
] ifFalse:[ nmA < nmB ] |
|
990 |
] ifFalse:[ |
|
991 |
clsNmA < clsNmB |
|
992 |
] |
|
993 |
]. |
|
5591 | 994 |
] ifFalse:[ |
7610 | 995 |
sortBy value == #category ifTrue:[ |
10257 | 996 |
entries |
997 |
sort:[:a :b | |
|
998 |
|nmA nmB catA catB clsNmA clsNmB nsNmA nsNmB| |
|
999 |
||
1000 |
catA := (a at:3) category. |
|
1001 |
catB := (b at:3) category. |
|
1002 |
catA = catB ifTrue:[ |
|
1003 |
nmA := (a at:2) asSymbol selector. |
|
1004 |
nmB := (b at:2) asSymbol selector. |
|
1005 |
nmA = nmB ifTrue:[ |
|
1006 |
clsNmA := (a at:1) name. |
|
1007 |
clsNmB := (b at:1) name. |
|
1008 |
clsNmA = clsNmB ifTrue:[ |
|
1009 |
nsNmA := (a at:3) nameSpaceName. |
|
1010 |
nsNmB := (b at:3) nameSpaceName. |
|
1011 |
nsNmA < nsNmB |
|
1012 |
] ifFalse:[ |
|
1013 |
clsNmA < clsNmB |
|
1014 |
] |
|
1015 |
] ifFalse:[ nmA < nmB ] |
|
1016 |
] ifFalse:[ |
|
1017 |
catA < catB |
|
1018 |
] |
|
1019 |
]. |
|
7610 | 1020 |
] ifFalse:[ |
10257 | 1021 |
entries |
1022 |
sort:[:a :b | |
|
1023 |
|nmA nmB clsNmA clsNmB nsNmA nsNmB| |
|
1024 |
||
1025 |
nmA := (a at:2) asSymbol selector. |
|
1026 |
nmB := (b at:2) asSymbol selector. |
|
1027 |
nmA = nmB ifTrue:[ |
|
1028 |
clsNmA := (a at:1) name. |
|
1029 |
clsNmB := (b at:1) name. |
|
1030 |
clsNmA = clsNmB ifTrue:[ |
|
1031 |
nsNmA := (a at:3) nameSpaceName. |
|
1032 |
nsNmB := (b at:3) nameSpaceName. |
|
1033 |
nsNmA < nsNmB |
|
1034 |
] ifFalse:[ |
|
1035 |
clsNmA < clsNmB |
|
1036 |
] |
|
1037 |
] ifFalse:[ nmA < nmB ] |
|
1038 |
]. |
|
7610 | 1039 |
]. |
5591 | 1040 |
]. |
1041 |
]. |
|
1042 |
methods := OrderedCollection new:(entries size). |
|
10257 | 1043 |
|
5591 | 1044 |
"/ first generate the new methodList, and see if it is different ... |
10257 | 1045 |
|
1046 |
entries do:[:entry | |
|
5591 | 1047 |
|sel mthd| |
1048 |
||
1049 |
mthd := entry at:3. |
|
1050 |
methods add:mthd. |
|
1051 |
]. |
|
1052 |
false "methodList = methods" "does not care for changed icons" ifTrue:[ |
|
1053 |
"/ same list |
|
1054 |
newNameList := self browserNameList. |
|
1055 |
] ifFalse:[ |
|
1056 |
newNameList := OrderedCollection new:(entries size). |
|
10257 | 1057 |
|
5591 | 1058 |
"/ multiple classes must add the className for some |
10257 | 1059 |
|
1060 |
entries do:[:entry | |
|
5591 | 1061 |
|cls sel mthd s needClass| |
1062 |
||
1063 |
cls := entry at:1. |
|
1064 |
sel := entry at:2. |
|
1065 |
mthd := entry at:3. |
|
1066 |
needClass := doShowClass. |
|
10257 | 1067 |
|
5591 | 1068 |
"/ needClass ifFalse:[ |
1069 |
"/ needClass := (selectorBag occurrencesOf:sel) > 1 |
|
1070 |
"/ ]. |
|
10257 | 1071 |
|
5591 | 1072 |
s := self |
10257 | 1073 |
listEntryForMethod:mthd |
1074 |
selector:sel |
|
1075 |
class:cls |
|
1076 |
showClass:needClass |
|
1077 |
showCategory:doShowCategory |
|
1078 |
classFirst:doShowClassFirst. |
|
1079 |
||
5591 | 1080 |
"/ s := mthd printStringForBrowserWithSelector:sel inClass:cls. |
1081 |
"/ needClass ifTrue:[ |
|
1082 |
"/ s := s , ' [' , cls name , ']'. |
|
1083 |
"/ ]. |
|
1084 |
"/ doShowCategory ifTrue:[ |
|
1085 |
"/ s := s , ' {' , mthd category "asText allItalic" , '}' |
|
1086 |
"/ ]. |
|
10257 | 1087 |
|
5591 | 1088 |
newNameList add:s. |
1089 |
]. |
|
1090 |
]. |
|
1091 |
self makeIndependent. |
|
1092 |
classes := newClasses. |
|
1093 |
self makeDependent. |
|
1094 |
methodList := methods. |
|
1095 |
methods size == 1 ifTrue:[ |
|
1096 |
theMethod := methods first. |
|
1097 |
mclass := theMethod mclass. |
|
1098 |
mclass isNil ifTrue:[ |
|
1099 |
theMethod isWrapped ifTrue:[ |
|
1100 |
theMethod := theMethod originalMethod. |
|
1101 |
mclass := theMethod mclass. |
|
1102 |
]. |
|
1103 |
]. |
|
10257 | 1104 |
self methodLabelHolder value:(mclass isNil |
1105 |
ifTrue:[ ('???' , ' ' , '???') ] |
|
1106 |
ifFalse:[ (mclass name , ' ' , theMethod selector) ]) |
|
5591 | 1107 |
]. |
1108 |
anyMethodToWatch ifTrue:[ |
|
1109 |
self startWatchProcess. |
|
1110 |
] ifFalse:[ |
|
1111 |
self stopWatchProcess. |
|
1112 |
]. |
|
10257 | 1113 |
|
5591 | 1114 |
"/ remember these, in case of an incremental (single method only) |
1115 |
"/ update in the future. |
|
10257 | 1116 |
|
5591 | 1117 |
lastShowClass := doShowClass. |
1118 |
lastShowClassFirst := doShowClassFirst. |
|
1119 |
lastShowCategory := doShowCategory. |
|
1120 |
^ newNameList. |
|
1121 |
||
7610 | 1122 |
"Created: / 05-02-2000 / 22:43:40 / cg" |
1123 |
"Modified: / 26-01-2007 / 14:58:59 / cg" |
|
10257 | 1124 |
"Modified: / 20-07-2010 / 11:21:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1125 |
"Modified: / 24-08-2010 / 20:34:09 / Jan Vrany <enter your email here>" |
|
5591 | 1126 |
! |
1127 |
||
1128 |
makeDependent |
|
1129 |
Smalltalk addDependent:self. |
|
7502 | 1130 |
"/ ChangeSet addDependent:self. |
1131 |
||
1132 |
"Modified: / 10-11-2006 / 17:57:01 / cg" |
|
5591 | 1133 |
! |
1134 |
||
1135 |
makeIndependent |
|
1136 |
Smalltalk removeDependent:self. |
|
8218 | 1137 |
"/ ChangeSet removeDependent:self. |
5591 | 1138 |
! |
1139 |
||
1140 |
method:mthd includesModsOfClassVariable:variablesToHighLight |
|
1141 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
|
1142 |
! |
|
1143 |
||
1144 |
method:mthd includesModsOfInstanceVariable:variablesToHighLight |
|
1145 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
|
1146 |
! |
|
1147 |
||
1148 |
method:mthd includesRefsToClassVariable:variablesToHighLight |
|
1149 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
|
1150 |
! |
|
1151 |
||
1152 |
method:mthd includesRefsToInstanceVariable:variablesToHighLight |
|
1153 |
^ self method:mthd includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
|
1154 |
! |
|
1155 |
||
1156 |
method:mthd includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
1157 |
|cls src parser usedVars anyVarNameAccessable| |
|
1158 |
||
1159 |
cls := mthd mclass. |
|
5885 | 1160 |
cls isNil ifTrue:[^ false]. |
1161 |
||
5591 | 1162 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
1163 |
anyVarNameAccessable ifFalse:[ |
|
5885 | 1164 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
5591 | 1165 |
]. |
1166 |
anyVarNameAccessable ifFalse:[ |
|
5885 | 1167 |
"/ no need to parse |
1168 |
^ false |
|
5591 | 1169 |
]. |
1170 |
||
1171 |
src := mthd source. |
|
1172 |
src notNil ifTrue:[ |
|
5885 | 1173 |
" |
1174 |
before doing a slow parse, quickly scan the |
|
1175 |
methods source for the variables name ... |
|
1176 |
" |
|
1177 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
|
1178 |
parser := Parser |
|
1179 |
parseMethod:src |
|
1180 |
in:cls |
|
1181 |
ignoreErrors:true |
|
1182 |
ignoreWarnings:true. |
|
1183 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
1184 |
usedVars := parser perform:querySelector. |
|
1185 |
(usedVars includesAny:variablesToHighLight) |
|
1186 |
ifTrue:[ |
|
1187 |
^ true |
|
1188 |
] |
|
1189 |
] |
|
1190 |
] |
|
5591 | 1191 |
]. |
1192 |
^ false |
|
1193 |
! |
|
1194 |
||
1195 |
methodIsInheritedFromAbove:aMethod |
|
1196 |
|mClass| |
|
1197 |
||
1198 |
mClass := aMethod mclass. |
|
1199 |
(mClass notNil and:[mClass superclass notNil]) ifTrue:[ |
|
6789 | 1200 |
^ (mClass superclass whichClassIncludesSelector:aMethod selector) notNil. |
5591 | 1201 |
]. |
1202 |
^ false |
|
1203 |
! |
|
1204 |
||
1205 |
methodIsRedefinedBelow:aMethod |
|
1206 |
|mclass subClasses setOfRedefinedSelectors| |
|
1207 |
||
1208 |
mclass := aMethod mclass. |
|
1209 |
mclass isNil ifTrue:[^ false]. |
|
1210 |
||
1211 |
"/ if possible, make use of info prepared by listOfMethodNames |
|
1212 |
classAndSelectorsRedefinedBySubclassesOfClass notNil |
|
1213 |
ifTrue:[ |
|
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1214 |
setOfRedefinedSelectors := classAndSelectorsRedefinedBySubclassesOfClass at:mclass ifAbsent:nil. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1215 |
setOfRedefinedSelectors notNil ifTrue:[ |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1216 |
^ setOfRedefinedSelectors includes:aMethod selector |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1217 |
] |
5591 | 1218 |
]. |
1219 |
||
1220 |
lastMethodClass == mclass ifTrue:[ |
|
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1221 |
subClasses := lastMethodClassesSubclasses |
5591 | 1222 |
] ifFalse:[ |
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1223 |
subClasses := aMethod mclass allSubclasses. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1224 |
lastMethodClassesSubclasses := subClasses. |
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1225 |
lastMethodClass := mclass. |
5591 | 1226 |
]. |
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1227 |
^ subClasses contains:[:cls | cls includesSelector:aMethod selector]. |
5591 | 1228 |
! |
1229 |
||
1230 |
redefinedOrInheritedIconFor:aMethod |
|
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1231 |
|inherited redefined subclassResponsibility| |
5591 | 1232 |
|
1233 |
inherited := self methodIsInheritedFromAbove:aMethod. |
|
1234 |
redefined := self methodIsRedefinedBelow:aMethod. |
|
1235 |
||
1236 |
inherited ifTrue:[ |
|
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1237 |
redefined ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1238 |
^ self methodInheritedFromAboveAndRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1239 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1240 |
^ self methodInheritedFromAboveIcon. |
5591 | 1241 |
]. |
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1242 |
|
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1243 |
subclassResponsibility := aMethod sends:#subclassResponsibility. |
5591 | 1244 |
redefined ifTrue:[ |
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1245 |
subclassResponsibility ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1246 |
^ self methodIsSubclassResponsibilityAndRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1247 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1248 |
^ self methodRedefinedBelowIcon. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1249 |
]. |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1250 |
subclassResponsibility ifTrue:[ |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5591
diff
changeset
|
1251 |
^ self methodIsSubclassResponsibilityIcon. |
5591 | 1252 |
]. |
1253 |
||
1254 |
^ self methodEmptyInheritedIcon |
|
1255 |
! |
|
1256 |
||
1257 |
release |
|
1258 |
super release. |
|
1259 |
||
1260 |
filterClassVars removeDependent:self. |
|
1261 |
selectedMethodNameIndices removeDependent:self. |
|
1262 |
showMethodInheritance removeDependent:self. |
|
1263 |
variableFilter removeDependent:self. |
|
1264 |
! |
|
1265 |
||
1266 |
resourceIconForMethod:aMethod |
|
6903 | 1267 |
^ SystemBrowser resourceIconForMethod:aMethod |
5591 | 1268 |
|
6903 | 1269 |
"Modified: / 17-08-2006 / 09:09:01 / cg" |
5591 | 1270 |
! |
1271 |
||
1272 |
setOfAllSelectorsImplementedBelow:aClass |
|
1273 |
|set| |
|
1274 |
||
1275 |
set := IdentitySet new. |
|
1276 |
aClass allSubclassesDo:[:eachSubclass | |
|
1277 |
set addAll:(eachSubclass methodDictionary keys). |
|
1278 |
]. |
|
1279 |
^ set |
|
1280 |
! |
|
1281 |
||
1282 |
updateList |
|
1283 |
|prevSelection newList newSelection newSelIdx reverseMap sameContents newListSize oldListSize |
|
1284 |
prevClasses methodSet selectedMethodsHolder| |
|
1285 |
||
1286 |
selectedMethodsHolder := self selectedMethods. |
|
1287 |
prevSelection := selectedMethodsHolder value ? #(). |
|
1288 |
||
1289 |
prevClasses := classes ifNil:[ #() ] ifNotNil:[ classes copy ]. |
|
1290 |
||
1291 |
oldListSize := self browserNameList size. |
|
1292 |
||
8644 | 1293 |
self topApplication withWaitCursorDo:[ |
1294 |
newList := self listOfMethodNames. |
|
1295 |
]. |
|
7702 | 1296 |
newListSize := newList size. |
1297 |
sameContents := self updateListFor:newList. |
|
5591 | 1298 |
|
7702 | 1299 |
sameContents ifFalse:[ |
5591 | 1300 |
"/ self browserNameList value:newList. |
1301 |
||
7702 | 1302 |
(prevSelection size == 0 |
1303 |
and:[selectedMethodsHolder value size ~~ 0]) ifTrue:[ |
|
1304 |
"/ this happens during early startup time, |
|
1305 |
"/ when the selection is already (pre-)set, |
|
1306 |
"/ and the methodList is generated the first time |
|
1307 |
"/ (i.e. when opened with preset selection |
|
5591 | 1308 |
|
7702 | 1309 |
"/ do not clobber the selection in this case. |
1310 |
prevSelection := selectedMethodsHolder value. |
|
1311 |
]. |
|
5591 | 1312 |
|
7702 | 1313 |
(methodList size == 0 or:[prevSelection size == 0]) ifTrue:[ |
1314 |
newSelection := #() |
|
1315 |
] ifFalse:[ |
|
1316 |
methodSet := methodList. |
|
5591 | 1317 |
|
7702 | 1318 |
"/ inclusion test is much faster with sets, if the number of items is large |
1319 |
methodList size > 30 ifTrue:[ |
|
1320 |
"/ however, only if its worth building the set ... |
|
1321 |
prevSelection size > 5 ifTrue:[ |
|
1322 |
methodSet := methodSet asIdentitySet. |
|
1323 |
] |
|
1324 |
]. |
|
1325 |
newSelection := prevSelection select:[:item | methodSet includesIdentical:item]. |
|
1326 |
]. |
|
1327 |
newSelection size > 0 ifTrue:[ |
|
1328 |
newSelection size > 100 ifTrue:[ |
|
1329 |
"/ need selection indices - might be expensive if done straight forward... |
|
1330 |
reverseMap := IdentityDictionary new. |
|
1331 |
methodList keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx]. |
|
1332 |
newSelIdx := newSelection collect:[:mthd | reverseMap at:mthd]. |
|
1333 |
] ifFalse:[ |
|
1334 |
newSelIdx := newSelection collect:[:mthd | methodList identityIndexOf:mthd] |
|
1335 |
]. |
|
5591 | 1336 |
"/ self halt. |
7702 | 1337 |
"/ force change (for dependents) |
1338 |
newSelIdx ~= selectedMethodNameIndices value ifTrue:[ |
|
1339 |
selectedMethodNameIndices value:newSelIdx. |
|
1340 |
]. |
|
1341 |
] ifFalse:[ |
|
1342 |
lastSelectedMethods := selectedMethodsHolder value. |
|
1343 |
lastSelectedMethods notNil ifTrue:[ |
|
1344 |
lastSelectedMethods := lastSelectedMethods asOrderedCollection |
|
1345 |
]. |
|
1346 |
selectedMethodNameIndices value size > 0 ifTrue:[ |
|
1347 |
selectedMethodNameIndices value:#(). |
|
1348 |
] |
|
1349 |
]. |
|
5591 | 1350 |
|
7702 | 1351 |
newSelection ~= prevSelection ifTrue:[ |
1352 |
self selectionChanged. |
|
1353 |
] |
|
1354 |
] ifTrue:[ |
|
1355 |
"/ same list - but classes might have changed |
|
1356 |
"/ that is the case, if the class selection has been changed, |
|
1357 |
"/ to another class which has the same categories. |
|
5591 | 1358 |
|
7702 | 1359 |
(prevClasses size ~= classes size |
1360 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
|
1361 |
(newListSize > 0 or:[oldListSize > 0]) ifTrue:[ |
|
1362 |
self selectionChanged. |
|
1363 |
] |
|
1364 |
] |
|
1365 |
] |
|
5591 | 1366 |
"/ ]. |
1367 |
||
7702 | 1368 |
"Modified: / 05-03-2007 / 16:07:24 / cg" |
5591 | 1369 |
! |
1370 |
||
1371 |
updateListEntryFor:aMethod |
|
1372 |
"update my list for a single method. |
|
1373 |
(used when a single methods package, code or whatever changes, and a full udpate |
|
1374 |
would be too slow)" |
|
1375 |
||
1376 |
|s idx| |
|
1377 |
||
1378 |
s := self |
|
6268 | 1379 |
listEntryForMethod:aMethod |
1380 |
selector:aMethod selector |
|
1381 |
class:aMethod mclass |
|
1382 |
showClass:lastShowClass |
|
1383 |
showCategory:lastShowCategory |
|
1384 |
classFirst:lastShowClassFirst. |
|
5591 | 1385 |
|
1386 |
idx := methodList identityIndexOf:aMethod. |
|
1387 |
idx == 0 ifTrue:[ |
|
6268 | 1388 |
aMethod isWrapped ifTrue:[ |
1389 |
idx := methodList identityIndexOf:aMethod originalMethod. |
|
1390 |
] |
|
5591 | 1391 |
]. |
1392 |
idx == 0 ifTrue:[ |
|
6268 | 1393 |
self invalidateList |
5591 | 1394 |
] ifFalse:[ |
6268 | 1395 |
self browserNameList at:idx put:s. |
5591 | 1396 |
] |
1397 |
! ! |
|
1398 |
||
6271 | 1399 |
!MethodList methodsFor:'private-presentation'! |
1400 |
||
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1401 |
colorForCoverageInformationOfMethod:aMethod |
9430 | 1402 |
aMethod isInstrumented ifFalse:[^ nil]. |
9448
f9258f99d465
changed: #emphasisForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9438
diff
changeset
|
1403 |
aMethod category = 'documentation' ifTrue:[^ nil]. |
9430 | 1404 |
|
1405 |
aMethod hasBeenCalled ifTrue:[ |
|
1406 |
aMethod haveAllBlocksBeenExecuted ifTrue:[ |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1407 |
^ UserPreferences current colorForInstrumentedFullyCoveredCode |
9430 | 1408 |
]. |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1409 |
^ UserPreferences current colorForInstrumentedPartiallyCoveredCode |
9430 | 1410 |
]. |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1411 |
^ UserPreferences current colorForInstrumentedNeverCalledCode |
9430 | 1412 |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1413 |
"Created: / 30-04-2010 / 11:53:38 / cg" |
9430 | 1414 |
! |
1415 |
||
6271 | 1416 |
listEntryForMethod:aMethod selector:selector class:cls showClass:showClass showCategory:showCategory classFirst:showClassFirst |
1417 |
"answer a method list entry |
|
1418 |
gimmics: |
|
1419 |
adding a little image to breakPointed methods, |
|
1420 |
inheritance indicators, |
|
1421 |
highlight accessors of variable" |
|
1422 |
||
1423 |
|clsName s icn variablesToHighlight classVarsToHighLight |
|
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1424 |
doHighLight doHighLightRed clr emp cat l redefIcon |
7502 | 1425 |
metrics complexity complexityString complexityIcon mark| |
6271 | 1426 |
|
9038
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1427 |
aMethod isNil ifTrue:[ |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1428 |
"/ a non-existing (pseudo) method (such as required protocol) |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1429 |
^ selector colorizeAllWith:Color red. |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1430 |
]. |
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1431 |
|
6271 | 1432 |
aMethod isAssociation ifTrue:[ |
1433 |
self halt:'should not happen'. |
|
1434 |
]. |
|
1435 |
||
8638 | 1436 |
selector isNil ifTrue:[ |
1437 |
s := '???' |
|
1438 |
] ifFalse:[ |
|
1439 |
s := aMethod printStringForBrowserWithSelector:selector inClass:cls. |
|
1440 |
]. |
|
6271 | 1441 |
showClassFirst ifTrue:[ |
1442 |
clsName := cls nameInBrowser. |
|
1443 |
s := clsName , ' ' , s allBold |
|
1444 |
]. |
|
1445 |
||
1446 |
"/ |
|
1447 |
"/ wrap icons (i.e. break- or trace points) |
|
1448 |
"/ have higher prio ... |
|
1449 |
"/ |
|
9038
9b56d0b8c38e
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
9004
diff
changeset
|
1450 |
(aMethod notNil and:[aMethod isWrapped]) ifTrue:[ |
6271 | 1451 |
(s endsWith:' !!') ifTrue:[ |
1452 |
s := s copyWithoutLast:2 |
|
1453 |
]. |
|
1454 |
aMethod isBreakpointed ifTrue:[ |
|
1455 |
icn := self stopIcon |
|
1456 |
] ifFalse:[ |
|
1457 |
aMethod isTimed ifTrue:[ |
|
1458 |
icn := self timeIcon |
|
1459 |
] ifFalse:[ |
|
1460 |
icn := self traceIcon |
|
1461 |
] |
|
1462 |
]. |
|
1463 |
]. |
|
1464 |
||
1465 |
icn isNil ifTrue:[ |
|
8198 | 1466 |
self showImageResourceMethodsImages value ~~ false ifTrue:[ |
9252
ee7770f155ca
changed: #listEntryForMethod:selector:class:showClass:showCategory:classFirst:
Claus Gittinger <cg@exept.de>
parents:
9038
diff
changeset
|
1467 |
(aMethod hasImageResource) ifTrue:[ |
8474 | 1468 |
aMethod mclass isMeta ifTrue:[ |
1469 |
icn := aMethod valueWithReceiver:nil arguments:nil . |
|
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1470 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1471 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1472 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1473 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1474 |
|
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1475 |
icn isNil ifTrue:[ |
6271 | 1476 |
showMethodTypeIcon value ~~ false ifTrue:[ |
1477 |
icn := self resourceIconForMethod:aMethod. |
|
1478 |
]. |
|
1479 |
icn isNil ifTrue:[ |
|
1480 |
aMethod isProtected ifTrue:[ |
|
1481 |
icn := self protectedMethodIcon |
|
1482 |
] ifFalse:[ |
|
1483 |
aMethod isPrivate ifTrue:[ |
|
1484 |
icn := self privateMethodIcon |
|
1485 |
] ifFalse:[ |
|
1486 |
(aMethod isIgnored) ifTrue:[ |
|
1487 |
icn := self ignoredMethodIcon |
|
1488 |
] ifFalse:[ |
|
1489 |
(aMethod isJavaMethod and:[aMethod isAbstract]) ifTrue:[ |
|
1490 |
icn := self abstractMethodIcon |
|
1491 |
] |
|
1492 |
] |
|
1493 |
] |
|
1494 |
]. |
|
1495 |
]. |
|
1496 |
]. |
|
1497 |
icn isNil ifTrue:[ |
|
1498 |
(selector startsWith:'test') ifTrue:[ |
|
10257 | 1499 |
((cls isSubclassOf:TestCase) |
1500 |
and:[cls isAbstract not]) ifTrue:[ |
|
1501 |
cls lastTestRunResultOrNil "== false" notNil ifTrue:[ |
|
6271 | 1502 |
(cls testSelectorFailed:selector) ifTrue:[ |
1503 |
icn := SystemBrowser testCaseFailedIcon |
|
1504 |
] ifFalse:[ |
|
10257 | 1505 |
(cls testSelectorPassed: selector) ifTrue: |
1506 |
[icn := SystemBrowser testCasePassedIcon] |
|
6271 | 1507 |
]. |
1508 |
] |
|
1509 |
]. |
|
1510 |
] |
|
1511 |
]. |
|
1512 |
||
1513 |
showClass ifTrue:[ |
|
1514 |
showClassFirst ifFalse:[ |
|
1515 |
s := s , ' [' , cls name allBold , ']'. |
|
1516 |
] |
|
1517 |
]. |
|
1518 |
showCategory ifTrue:[ |
|
1519 |
cat := aMethod category. |
|
1520 |
cat notNil ifTrue:[ |
|
1521 |
s := s , ' {' , cat "asText allItalic" , '}' |
|
1522 |
] |
|
1523 |
]. |
|
7502 | 1524 |
|
10257 | 1525 |
self showCoverageInformation value ifTrue:[ |
9451
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1526 |
clr := self colorForCoverageInformationOfMethod:aMethod. |
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1527 |
clr notNil ifTrue:[ |
79d033f585b9
added: #colorForCoverageInformationOfMethod:
Claus Gittinger <cg@exept.de>
parents:
9448
diff
changeset
|
1528 |
s := self colorize:s with:(#color->clr). |
9430 | 1529 |
"/ aMethod isInstrumented ifTrue:[ |
1530 |
"/ icn := self instrumentationIcon |
|
1531 |
"/ ]. |
|
1532 |
]. |
|
1533 |
] ifFalse:[ |
|
1534 |
(ChangeSet current includesChangeForClass:cls selector:selector) ifTrue:[ |
|
1535 |
mark := self class markForBeingInChangeList. |
|
1536 |
"/ mark := self colorizeForChangedCode:mark. |
|
1537 |
s := s , mark. |
|
1538 |
"/ cg: I dont know why this was disabled - it is req'd to |
|
1539 |
"/ see changed methods in a method list (implementors...) |
|
1540 |
s := self colorizeForChangedCode:s. |
|
1541 |
]. |
|
1542 |
||
1543 |
(SmallTeam notNil and:[SmallTeam includesChangeForClass:cls selector:selector]) ifTrue:[ |
|
1544 |
s := (self colorizeForChangedCodeInSmallTeam:'!! '),s |
|
1545 |
]. |
|
6841
6d72f92ed6cd
mark changed methods with a '*'
Claus Gittinger <cg@exept.de>
parents:
6789
diff
changeset
|
1546 |
]. |
6271 | 1547 |
|
1548 |
variablesToHighlight := variableFilter value. |
|
1549 |
variablesToHighlight size > 0 ifTrue:[ |
|
1550 |
classVarsToHighLight := filterClassVars value. |
|
1551 |
classVarsToHighLight ifTrue:[ |
|
1552 |
doHighLight := self method:aMethod includesRefsToClassVariable:variablesToHighlight. |
|
1553 |
doHighLight ifTrue:[ |
|
1554 |
doHighLightRed := self method:aMethod includesModsOfClassVariable:variablesToHighlight. |
|
1555 |
]. |
|
1556 |
] ifFalse:[ |
|
1557 |
doHighLight := self method:aMethod includesRefsToInstanceVariable:variablesToHighlight. |
|
1558 |
doHighLight ifTrue:[ |
|
1559 |
doHighLightRed := self method:aMethod includesModsOfInstanceVariable:variablesToHighlight |
|
1560 |
] |
|
1561 |
]. |
|
1562 |
doHighLight ifTrue:[ |
|
1563 |
s := s allBold. |
|
1564 |
doHighLightRed ifTrue:[ |
|
1565 |
emp := (UserPreferences current emphasisForWrittenVariable) |
|
1566 |
] ifFalse:[ |
|
1567 |
emp := (UserPreferences current emphasisForReadVariable) |
|
1568 |
]. |
|
1569 |
s := s emphasisAllAdd:emp |
|
1570 |
] |
|
1571 |
]. |
|
1572 |
||
6694 | 1573 |
(showMethodComplexity value == true |
6271 | 1574 |
and:[ OOM::MethodMetrics notNil ]) ifTrue:[ |
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1575 |
icn isNil ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1576 |
metrics := OOM::MethodMetrics forMethod:aMethod. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1577 |
complexity := metrics complexity ? 0. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1578 |
complexityIcon := OOM::MethodMetrics iconForComplexity:complexity. |
6271 | 1579 |
|
8197
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1580 |
ShowComplexityValue == true ifTrue:[ |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1581 |
complexityString := '{' , complexity printString , '}'. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1582 |
s := complexityString , ' ' , s. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1583 |
]. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1584 |
"/ icn := icn ? complexityIcon. |
3b1c5bd94fdd
preps for showResourceImages
Claus Gittinger <cg@exept.de>
parents:
7994
diff
changeset
|
1585 |
s := LabelAndIcon icon:complexityIcon string:s. |
6271 | 1586 |
]. |
1587 |
]. |
|
1588 |
||
1589 |
showMethodInheritance value ~~ false ifTrue:[ |
|
1590 |
redefIcon := self redefinedOrInheritedIconFor:aMethod. |
|
1591 |
]. |
|
1592 |
||
1593 |
(icn notNil or:[redefIcon notNil]) ifTrue:[ |
|
10257 | 1594 |
"/eXept version |
1595 |
"/l := LabelAndIcon icon:redefIcon string:s. |
|
1596 |
"/l image:icn. |
|
1597 |
"/JV: |
|
1598 |
l := LabelAndIcon icon:icn string:s. |
|
1599 |
l image:redefIcon. |
|
1600 |
icn ifNil:[l offset: 13]. |
|
1601 |
l gap:1. |
|
6271 | 1602 |
^ l |
1603 |
]. |
|
1604 |
^ s |
|
1605 |
||
6841
6d72f92ed6cd
mark changed methods with a '*'
Claus Gittinger <cg@exept.de>
parents:
6789
diff
changeset
|
1606 |
"Created: / 22-10-1996 / 19:51:00 / cg" |
10257 | 1607 |
"Modified: / 30-04-2010 / 11:54:32 / cg" |
1608 |
"Modified: / 15-08-2009 / 13:13:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1609 |
"Modified: / 15-03-2010 / 18:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6271 | 1610 |
! ! |
1611 |
||
5591 | 1612 |
!MethodList methodsFor:'private-watching'! |
1613 |
||
1614 |
startWatchProcess |
|
1615 |
updateProcess notNil ifTrue:[ |
|
1616 |
^ self |
|
1617 |
]. |
|
1618 |
updateProcess := [ |
|
1619 |
[true] whileTrue:[ |
|
1620 |
Delay waitForSeconds:1. |
|
1621 |
self enqueueDelayedUpdateList |
|
1622 |
] |
|
1623 |
] fork. |
|
1624 |
! |
|
1625 |
||
1626 |
stopWatchProcess |
|
1627 |
|p| |
|
1628 |
||
1629 |
(p := updateProcess) notNil ifTrue:[ |
|
1630 |
updateProcess := nil. |
|
1631 |
p terminate |
|
1632 |
]. |
|
1633 |
! ! |
|
1634 |
||
1635 |
!MethodList methodsFor:'setup'! |
|
1636 |
||
1637 |
postBuildWith:aBuilder |
|
1638 |
|methodListView| |
|
1639 |
||
1640 |
super postBuildWith:aBuilder. |
|
1641 |
||
1642 |
methodListView := aBuilder componentAt:'List'. |
|
1643 |
methodListView notNil ifTrue:[ |
|
6277 | 1644 |
methodListView allowDrag:true. |
1645 |
methodListView dragObjectConverter:[:obj | |
|
1646 |
|nm method idx| |
|
5591 | 1647 |
|
6277 | 1648 |
nm := obj theObject asString string string. |
1649 |
idx := browserNameList value findFirst:[:item | item string string = nm]. |
|
1650 |
method := methodList value at:idx. |
|
1651 |
DropObject newMethod:method. |
|
1652 |
]. |
|
5591 | 1653 |
] |
1654 |
! ! |
|
1655 |
||
1656 |
!MethodList class methodsFor:'documentation'! |
|
1657 |
||
9004
fbd6a4c325f6
changed: #methodIsRedefinedBelow:
Claus Gittinger <cg@exept.de>
parents:
8644
diff
changeset
|
1658 |
version_CVS |
10257 | 1659 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.51 2011-07-07 14:14:07 vrany Exp $' |
5591 | 1660 |
! ! |