author | Claus Gittinger <cg@exept.de> |
Tue, 14 Mar 2017 20:30:21 +0100 | |
changeset 17465 | 27a2e4012a0a |
parent 14062 | 3bddd74364ba |
permissions | -rw-r--r-- |
6179 | 1 |
" |
2 |
COPYRIGHT (c) 2004 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 |
" |
|
5591 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
5596 | 16 |
NavigatorModel subclass:#BrowserList |
5591 | 17 |
instanceVariableNames:'menuHolder inGeneratorHolder outGeneratorHolder |
18 |
selectionChangeCondition immediateUpdate doubleClickChannel |
|
19 |
filter updateTrigger forceGeneratorTrigger hideUnloadedClasses |
|
20 |
showClassPackages selectionHolder packageFilter nameSpaceFilter |
|
21 |
organizerMode slaveMode listValid pseudoListLabelHolder icons |
|
9758 | 22 |
sortBy autoSelect showAllClassesInNameSpaceOrganisation |
11507 | 23 |
nameFilter showCoverageInformation searchHandler |
24 |
autoUpdateOnChange' |
|
5591 | 25 |
classVariableNames:'SynchronousUpdate Icons' |
26 |
poolDictionaries:'' |
|
27 |
category:'Interface-Browsers-New' |
|
28 |
! |
|
29 |
||
10415 | 30 |
Object subclass:#SearchHandler |
10430 | 31 |
instanceVariableNames:'listView listHolder listSelectionHolder searchField searchWindow |
32 |
searchHolder' |
|
10415 | 33 |
classVariableNames:'' |
34 |
poolDictionaries:'' |
|
35 |
privateIn:BrowserList |
|
36 |
! |
|
37 |
||
5591 | 38 |
!BrowserList class methodsFor:'documentation'! |
39 |
||
6179 | 40 |
copyright |
41 |
" |
|
42 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
43 |
All Rights Reserved |
|
44 |
||
45 |
This software is furnished under a license and may be used |
|
46 |
only in accordance with the terms of that license and with the |
|
47 |
inclusion of the above copyright notice. This software may not |
|
48 |
be provided or otherwise made available to, or used by, any |
|
49 |
other person. No title to or ownership of the software is |
|
50 |
hereby transferred. |
|
51 |
" |
|
52 |
! |
|
53 |
||
5591 | 54 |
documentation |
55 |
" |
|
56 |
embeddable application displaying the class-categories. |
|
57 |
Provides an outputGenerator, which enumerates the classes in |
|
58 |
the selected categories. |
|
59 |
||
60 |
[author:] |
|
9758 | 61 |
Claus Gittinger (cg@exept.de) |
62 |
||
63 |
[instance variables:] |
|
64 |
can someone please write a few words here... |
|
65 |
||
66 |
menuHolder |
|
67 |
inGeneratorHolder |
|
68 |
outGeneratorHolder |
|
69 |
selectionChangeCondition |
|
70 |
immediateUpdate |
|
71 |
doubleClickChannel |
|
72 |
filter a filterblock by the one who embedds this |
|
73 |
updateTrigger |
|
74 |
forceGeneratorTrigger |
|
75 |
hideUnloadedClasses |
|
76 |
showClassPackages |
|
77 |
selectionHolder |
|
78 |
packageFilter |
|
79 |
nameSpaceFilter |
|
80 |
organizerMode |
|
81 |
slaveMode |
|
82 |
listValid |
|
83 |
pseudoListLabelHolder |
|
84 |
icons |
|
85 |
sortBy |
|
86 |
autoSelect |
|
87 |
showAllClassesInNameSpaceOrganisation |
|
88 |
nameFilter a string or glob pattern (from the user, if a GUI for that is present) |
|
5591 | 89 |
" |
90 |
! ! |
|
91 |
||
92 |
!BrowserList class methodsFor:'image specs'! |
|
93 |
||
10137 | 94 |
checkedIcon |
95 |
"This resource specification was automatically generated |
|
96 |
by the ImageEditor of ST/X." |
|
97 |
||
98 |
"Do not manually edit this!! If it is corrupted, |
|
99 |
the ImageEditor may not be able to read the specification." |
|
100 |
||
101 |
" |
|
102 |
self checkedIcon inspect |
|
103 |
ImageEditor openOnClass:self andSelector:#checkedIcon |
|
104 |
Icon flushCachedIcons |
|
105 |
" |
|
106 |
||
107 |
<resource: #image> |
|
108 |
||
10956 | 109 |
^ MenuPanel iconIndicationOn |
110 |
||
111 |
"/ ^Icon |
|
112 |
"/ constantNamed:#'Tools::HierarchicalPackageFilterList::PackageItem class checkedIcon' |
|
113 |
"/ ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?<O?0??C?<O?0??C?<O?07?C?<O?0??@@@@@@b') ; colorMapFromArray:#[0 0 0 33 161 33]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
114 |
"/?????<@C0@O@D<@30GOH8<7C38OG@<HC0@O@@?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
115 |
"/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
116 |
"/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
10137 | 117 |
|
118 |
"Created: / 06-11-2008 / 16:32:46 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10956 | 119 |
"Modified: / 04-12-2011 / 15:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10137 | 120 |
! |
121 |
||
5591 | 122 |
nameSpaceIcon |
123 |
^ SystemBrowser nameSpaceIcon |
|
124 |
! |
|
125 |
||
126 |
packageIcon |
|
127 |
^ SystemBrowser packageIcon |
|
128 |
! |
|
129 |
||
130 |
padLockBlueMiniIcon |
|
131 |
^ SystemBrowser padLockBlueMiniIcon |
|
132 |
! |
|
133 |
||
134 |
padLockGrayMiniIcon |
|
135 |
^ SystemBrowser padLockGrayMiniIcon |
|
136 |
! |
|
137 |
||
138 |
padLockGreenMiniIcon |
|
139 |
^ SystemBrowser padLockGreenMiniIcon |
|
140 |
! |
|
141 |
||
142 |
padLockRedMiniIcon |
|
143 |
^ SystemBrowser padLockRedMiniIcon |
|
144 |
! |
|
145 |
||
146 |
programImageIcon |
|
147 |
^ SystemBrowser programImageIcon |
|
148 |
! |
|
149 |
||
150 |
protectedMethod |
|
151 |
^ self padLockRedMiniIcon |
|
152 |
! |
|
153 |
||
154 |
redLockIcon |
|
155 |
^ SystemBrowser redLockIcon |
|
10137 | 156 |
! |
157 |
||
158 |
uncheckedIcon |
|
159 |
"This resource specification was automatically generated |
|
160 |
by the ImageEditor of ST/X." |
|
161 |
||
162 |
"Do not manually edit this!! If it is corrupted, |
|
163 |
the ImageEditor may not be able to read the specification." |
|
164 |
||
165 |
" |
|
166 |
self checkFrameForm inspect |
|
167 |
ImageEditor openOnClass:self andSelector:#checkFrameForm |
|
168 |
Icon flushCachedIcons |
|
169 |
" |
|
170 |
||
171 |
<resource: #image> |
|
172 |
||
10956 | 173 |
^MenuPanel iconIndicationOff |
174 |
||
175 |
"/ ^Icon |
|
176 |
"/ constantNamed:#'Tools::HierarchicalPackageFilterList::PackageItem class checkFrameForm' |
|
177 |
"/ ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?<O?0??C?<O?0??C?<O?0??C?<O?0??@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
178 |
"/?????<@C0@O@@<@C0@O@@<@C0@O@@<@C0@O@@?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
179 |
"/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
180 |
"/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
10137 | 181 |
|
182 |
"Created: / 06-11-2008 / 16:32:46 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10956 | 183 |
"Modified: / 04-12-2011 / 15:35:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 184 |
! ! |
185 |
||
9760 | 186 |
!BrowserList methodsFor:'accessing'! |
187 |
||
188 |
nameFilter:something |
|
189 |
nameFilter := something. |
|
190 |
! ! |
|
191 |
||
5591 | 192 |
!BrowserList methodsFor:'aspects'! |
193 |
||
11507 | 194 |
autoUpdateOnChange |
195 |
"automatic update of the list, when the system changes. |
|
196 |
For some (slow) search lists (such as string-search), autoupdate is |
|
197 |
disabled as it would otherwise make the browser unusable. |
|
198 |
Those lists need an explicit menu-update action." |
|
199 |
||
200 |
^ autoUpdateOnChange ? true. |
|
201 |
||
202 |
"Modified: / 24-02-2000 / 23:57:13 / cg" |
|
203 |
"Created: / 15-05-2012 / 11:16:07 / cg" |
|
204 |
! |
|
205 |
||
206 |
autoUpdateOnChange: aBoolean |
|
207 |
"automatic update of the list, when the system changes. |
|
208 |
For some (slow) search lists (such as string-search), autoupdate is |
|
209 |
disabled as it would otherwise make the browser unusable. |
|
210 |
Those lists need an explicit menu-update action." |
|
211 |
||
212 |
autoUpdateOnChange := aBoolean |
|
213 |
||
214 |
"Modified: / 24-02-2000 / 23:57:13 / cg" |
|
215 |
"Created: / 15-05-2012 / 11:17:18 / cg" |
|
216 |
! |
|
217 |
||
5591 | 218 |
defaultSlaveModeValue |
219 |
^ nil. |
|
220 |
||
221 |
"Created: / 25.2.2000 / 22:36:40 / cg" |
|
222 |
! |
|
223 |
||
224 |
doubleClickChannel |
|
225 |
doubleClickChannel isNil ifTrue:[ |
|
226 |
doubleClickChannel := TriggerValue new. |
|
227 |
]. |
|
228 |
^ doubleClickChannel. |
|
229 |
||
230 |
"Modified: / 31.1.2000 / 00:42:44 / cg" |
|
231 |
"Created: / 5.2.2000 / 22:38:32 / cg" |
|
232 |
! |
|
233 |
||
234 |
doubleClickChannel:aChannel |
|
235 |
doubleClickChannel := aChannel |
|
236 |
! |
|
237 |
||
238 |
filter:aValueHolder |
|
239 |
filter notNil ifTrue:[ |
|
240 |
filter removeDependent:self |
|
241 |
]. |
|
242 |
filter := aValueHolder. |
|
243 |
filter notNil ifTrue:[ |
|
244 |
filter addDependent:self |
|
245 |
]. |
|
246 |
||
247 |
"Modified: / 4.2.2000 / 23:29:30 / cg" |
|
248 |
"Created: / 5.2.2000 / 13:42:12 / cg" |
|
249 |
! |
|
250 |
||
251 |
forceGeneratorTrigger |
|
252 |
forceGeneratorTrigger isNil ifTrue:[ |
|
253 |
forceGeneratorTrigger := TriggerValue new. |
|
254 |
forceGeneratorTrigger addDependent:self. |
|
255 |
]. |
|
256 |
^ forceGeneratorTrigger. |
|
257 |
||
258 |
"Modified: / 18.2.2000 / 02:02:52 / cg" |
|
259 |
"Created: / 18.2.2000 / 02:46:40 / cg" |
|
260 |
! |
|
261 |
||
262 |
forceGeneratorTrigger:aTriggerValue |
|
263 |
forceGeneratorTrigger notNil ifTrue:[ |
|
264 |
forceGeneratorTrigger removeDependent:self |
|
265 |
]. |
|
266 |
forceGeneratorTrigger := aTriggerValue. |
|
267 |
forceGeneratorTrigger notNil ifTrue:[ |
|
268 |
forceGeneratorTrigger addDependent:self |
|
269 |
]. |
|
270 |
||
271 |
"Modified: / 4.2.2000 / 23:29:30 / cg" |
|
272 |
"Created: / 18.2.2000 / 02:46:52 / cg" |
|
273 |
! |
|
274 |
||
275 |
hideUnloadedClasses |
|
276 |
hideUnloadedClasses isNil ifTrue:[ |
|
277 |
hideUnloadedClasses := false asValue. |
|
278 |
hideUnloadedClasses addDependent:self. |
|
279 |
]. |
|
280 |
^ hideUnloadedClasses. |
|
281 |
||
282 |
"Modified: / 18.2.2000 / 02:02:52 / cg" |
|
283 |
"Created: / 18.2.2000 / 17:36:30 / cg" |
|
284 |
! |
|
285 |
||
286 |
hideUnloadedClasses:aValueHolder |
|
287 |
hideUnloadedClasses notNil ifTrue:[ |
|
288 |
hideUnloadedClasses removeDependent:self |
|
289 |
]. |
|
290 |
hideUnloadedClasses := aValueHolder. |
|
291 |
hideUnloadedClasses notNil ifTrue:[ |
|
292 |
hideUnloadedClasses addDependent:self |
|
293 |
]. |
|
294 |
||
295 |
"Modified: / 4.2.2000 / 23:29:30 / cg" |
|
296 |
"Created: / 18.2.2000 / 17:46:36 / cg" |
|
297 |
! |
|
298 |
||
299 |
menuHolder |
|
300 |
^ menuHolder |
|
301 |
||
302 |
"Created: / 5.2.2000 / 13:42:06 / cg" |
|
303 |
! |
|
304 |
||
305 |
menuHolder:aValueHolder |
|
306 |
menuHolder := aValueHolder. |
|
307 |
||
308 |
"Created: / 5.2.2000 / 13:42:06 / cg" |
|
309 |
! |
|
310 |
||
311 |
nameSpaceFilter |
|
312 |
nameSpaceFilter isNil ifTrue:[ |
|
313 |
nameSpaceFilter := ValueHolder new. |
|
314 |
nameSpaceFilter addDependent:self. |
|
315 |
]. |
|
316 |
^ nameSpaceFilter. |
|
317 |
||
318 |
"Modified: / 24.2.2000 / 23:57:13 / cg" |
|
319 |
"Created: / 18.8.2000 / 14:18:56 / cg" |
|
320 |
! |
|
321 |
||
322 |
nameSpaceFilter:aValueHolder |
|
323 |
nameSpaceFilter notNil ifTrue:[ |
|
324 |
nameSpaceFilter removeDependent:self |
|
325 |
]. |
|
326 |
nameSpaceFilter := aValueHolder. |
|
327 |
nameSpaceFilter notNil ifTrue:[ |
|
328 |
nameSpaceFilter addDependent:self |
|
329 |
]. |
|
330 |
||
331 |
"Modified: / 24.2.2000 / 23:56:22 / cg" |
|
332 |
"Created: / 18.8.2000 / 14:19:06 / cg" |
|
333 |
! |
|
334 |
||
335 |
organizerMode |
|
336 |
organizerMode isNil ifTrue:[ |
|
6739
cd001606f090
magic constants (organizerMode) removed
Claus Gittinger <cg@exept.de>
parents:
6711
diff
changeset
|
337 |
organizerMode := OrganizerCanvas organizerModeCategory asValue. |
cd001606f090
magic constants (organizerMode) removed
Claus Gittinger <cg@exept.de>
parents:
6711
diff
changeset
|
338 |
organizerMode addDependent:self. |
5591 | 339 |
]. |
340 |
^ organizerMode |
|
341 |
||
342 |
"Modified: / 31.1.2000 / 00:51:06 / cg" |
|
343 |
"Created: / 25.2.2000 / 22:36:15 / cg" |
|
344 |
! |
|
345 |
||
346 |
organizerMode:aValueHolder |
|
347 |
organizerMode notNil ifTrue:[ |
|
348 |
organizerMode removeDependent:self |
|
349 |
]. |
|
350 |
organizerMode := aValueHolder. |
|
351 |
organizerMode notNil ifTrue:[ |
|
352 |
organizerMode addDependent:self |
|
353 |
]. |
|
354 |
||
355 |
"Modified: / 4.2.2000 / 23:34:28 / cg" |
|
356 |
"Created: / 25.2.2000 / 22:36:28 / cg" |
|
357 |
! |
|
358 |
||
359 |
packageFilter |
|
360 |
packageFilter isNil ifTrue:[ |
|
361 |
packageFilter := ValueHolder new. |
|
362 |
packageFilter addDependent:self. |
|
363 |
||
364 |
"/ debug-check only |
|
365 |
"/ packageFilter onChangeEvaluate:[packageFilter value isValueModel ifTrue:[self halt:'debug halt']]. |
|
366 |
]. |
|
367 |
^ packageFilter. |
|
368 |
||
369 |
"Modified: / 18.8.2000 / 19:26:36 / cg" |
|
370 |
! |
|
371 |
||
372 |
packageFilter:aValueHolder |
|
373 |
packageFilter notNil ifTrue:[ |
|
374 |
packageFilter removeDependent:self |
|
375 |
]. |
|
376 |
packageFilter := aValueHolder. |
|
377 |
packageFilter notNil ifTrue:[ |
|
378 |
packageFilter addDependent:self. |
|
379 |
||
380 |
"/ debug-check only |
|
381 |
"/ packageFilter onChangeEvaluate:[packageFilter value isValueModel ifTrue:[self halt:'debug halt']]. |
|
382 |
]. |
|
383 |
||
384 |
"Modified: / 18.8.2000 / 19:26:40 / cg" |
|
385 |
! |
|
386 |
||
387 |
pseudoListLabelHolder |
|
388 |
pseudoListLabelHolder isNil ifTrue:[ |
|
389 |
pseudoListLabelHolder := '' asValue. |
|
390 |
]. |
|
391 |
^ pseudoListLabelHolder |
|
392 |
! |
|
393 |
||
394 |
selectionChangeCondition:aBlockOrValueHolder |
|
395 |
selectionChangeCondition := aBlockOrValueHolder |
|
396 |
! |
|
397 |
||
398 |
selectionHolder |
|
399 |
selectionHolder isNil ifTrue:[ |
|
400 |
selectionHolder := ValueHolder new. |
|
401 |
selectionHolder addDependent:self |
|
402 |
]. |
|
403 |
^ selectionHolder. |
|
404 |
||
405 |
! |
|
406 |
||
407 |
selectionHolder:aValueHolder |
|
408 |
|prevSelection| |
|
409 |
||
410 |
prevSelection := selectionHolder value ? #(). |
|
411 |
||
412 |
selectionHolder notNil ifTrue:[ |
|
413 |
selectionHolder removeDependent:self |
|
414 |
]. |
|
415 |
selectionHolder := aValueHolder. |
|
416 |
selectionHolder notNil ifTrue:[ |
|
417 |
selectionHolder addDependent:self |
|
418 |
]. |
|
419 |
(selectionHolder value ? #()) ~= prevSelection ifTrue:[ |
|
420 |
"/ update |
|
421 |
self update:#value with:nil from:selectionHolder |
|
422 |
]. |
|
423 |
||
424 |
||
425 |
! |
|
426 |
||
7707 | 427 |
showAllClassesInNameSpaceOrganisation |
428 |
^[ |
|
429 |
|holder| |
|
430 |
||
431 |
showAllClassesInNameSpaceOrganisation notNil ifTrue:[ |
|
432 |
holder := showAllClassesInNameSpaceOrganisation |
|
433 |
] ifFalse:[ |
|
434 |
masterApplication notNil ifTrue:[ |
|
10141
6ffa30070e0e
changed: #showAllClassesInNameSpaceOrganisation
Claus Gittinger <cg@exept.de>
parents:
10137
diff
changeset
|
435 |
holder := masterApplication perform:#showAllClassesInNameSpaceOrganisation ifNotUnderstood:nil. |
6ffa30070e0e
changed: #showAllClassesInNameSpaceOrganisation
Claus Gittinger <cg@exept.de>
parents:
10137
diff
changeset
|
436 |
]. |
6ffa30070e0e
changed: #showAllClassesInNameSpaceOrganisation
Claus Gittinger <cg@exept.de>
parents:
10137
diff
changeset
|
437 |
holder notNil ifTrue:[ |
7707 | 438 |
holder addDependent:self. |
439 |
] ifFalse:[ |
|
440 |
showAllClassesInNameSpaceOrganisation isNil ifTrue:[ |
|
441 |
showAllClassesInNameSpaceOrganisation := false asValue. |
|
442 |
showAllClassesInNameSpaceOrganisation addDependent:self. |
|
443 |
]. |
|
444 |
holder := showAllClassesInNameSpaceOrganisation. |
|
445 |
]. |
|
446 |
]. |
|
447 |
holder value |
|
448 |
]. |
|
449 |
||
450 |
"Created: / 05-03-2007 / 16:47:03 / cg" |
|
10141
6ffa30070e0e
changed: #showAllClassesInNameSpaceOrganisation
Claus Gittinger <cg@exept.de>
parents:
10137
diff
changeset
|
451 |
"Modified: / 04-07-2011 / 21:49:10 / cg" |
7707 | 452 |
! |
453 |
||
454 |
showAllClassesInNameSpaceOrganisation:aValueHolder |
|
455 |
showAllClassesInNameSpaceOrganisation notNil ifTrue:[ |
|
456 |
showAllClassesInNameSpaceOrganisation removeDependent:self |
|
457 |
]. |
|
458 |
showAllClassesInNameSpaceOrganisation := aValueHolder. |
|
459 |
showAllClassesInNameSpaceOrganisation notNil ifTrue:[ |
|
460 |
showAllClassesInNameSpaceOrganisation addDependent:self |
|
461 |
]. |
|
462 |
||
463 |
"Created: / 05-03-2007 / 16:47:13 / cg" |
|
464 |
! |
|
465 |
||
5591 | 466 |
showClassPackages |
467 |
showClassPackages isNil ifTrue:[ |
|
468 |
showClassPackages := false asValue. |
|
469 |
showClassPackages addDependent:self. |
|
470 |
]. |
|
471 |
^ showClassPackages. |
|
472 |
||
473 |
"Modified: / 18.2.2000 / 02:02:52 / cg" |
|
474 |
"Created: / 18.2.2000 / 17:36:30 / cg" |
|
475 |
! |
|
476 |
||
477 |
showClassPackages:aValueHolder |
|
478 |
showClassPackages notNil ifTrue:[ |
|
479 |
showClassPackages removeDependent:self |
|
480 |
]. |
|
481 |
showClassPackages := aValueHolder. |
|
482 |
showClassPackages notNil ifTrue:[ |
|
483 |
showClassPackages addDependent:self |
|
484 |
]. |
|
485 |
! |
|
486 |
||
10229 | 487 |
showCoverageInformation |
488 |
showCoverageInformation isNil ifTrue:[ |
|
489 |
showCoverageInformation := false asValue. |
|
490 |
showCoverageInformation addDependent:self. |
|
491 |
]. |
|
492 |
^ showCoverageInformation. |
|
493 |
||
494 |
"Created: / 27-04-2010 / 16:13:16 / cg" |
|
495 |
! |
|
496 |
||
497 |
showCoverageInformation:aValueHolder |
|
498 |
showCoverageInformation notNil ifTrue:[ |
|
499 |
showCoverageInformation removeDependent:self |
|
500 |
]. |
|
501 |
showCoverageInformation := aValueHolder. |
|
502 |
showCoverageInformation notNil ifTrue:[ |
|
503 |
showCoverageInformation addDependent:self |
|
504 |
]. |
|
505 |
||
506 |
"Created: / 27-04-2010 / 16:13:20 / cg" |
|
507 |
! |
|
508 |
||
5591 | 509 |
slaveMode |
510 |
slaveMode isNil ifTrue:[ |
|
511 |
slaveMode := self defaultSlaveModeValue asValue. |
|
512 |
slaveMode addDependent:self. |
|
513 |
]. |
|
514 |
^ slaveMode. |
|
515 |
||
516 |
"Created: / 25.2.2000 / 22:36:40 / cg" |
|
517 |
! |
|
518 |
||
519 |
slaveMode:aValueHolder |
|
520 |
|prev| |
|
521 |
||
522 |
slaveMode notNil ifTrue:[ |
|
523 |
slaveMode removeDependent:self. |
|
524 |
prev := slaveMode value. |
|
525 |
]. |
|
526 |
slaveMode := aValueHolder. |
|
527 |
slaveMode notNil ifTrue:[ |
|
528 |
slaveMode addDependent:self |
|
529 |
]. |
|
530 |
prev ~~ slaveMode value ifTrue:[ |
|
531 |
(prev isNil and:[slaveMode value]) ifFalse:[ |
|
532 |
self update:#value with:nil from:slaveMode. |
|
533 |
] |
|
534 |
]. |
|
535 |
! |
|
536 |
||
537 |
sortBy |
|
538 |
sortBy isNil ifTrue:[ |
|
539 |
sortBy := nil asValue. |
|
540 |
sortBy addDependent:self. |
|
541 |
]. |
|
542 |
^ sortBy. |
|
543 |
||
544 |
"Created: / 25.2.2000 / 22:36:40 / cg" |
|
545 |
! |
|
546 |
||
547 |
sortBy:aValueHolder |
|
548 |
|prev| |
|
549 |
||
550 |
prev := sortBy value. |
|
551 |
sortBy notNil ifTrue:[ |
|
552 |
sortBy removeDependent:self |
|
553 |
]. |
|
554 |
sortBy := aValueHolder. |
|
555 |
sortBy notNil ifTrue:[ |
|
556 |
sortBy addDependent:self |
|
557 |
]. |
|
558 |
prev ~~ sortBy value ifTrue:[ |
|
559 |
self update:#value with:nil from:sortBy. |
|
560 |
]. |
|
561 |
||
562 |
"Modified: / 4.2.2000 / 23:29:30 / cg" |
|
563 |
"Created: / 5.2.2000 / 13:42:12 / cg" |
|
564 |
! |
|
565 |
||
566 |
updateTrigger |
|
567 |
updateTrigger isNil ifTrue:[ |
|
568 |
updateTrigger := TriggerValue new. |
|
569 |
updateTrigger addDependent:self. |
|
570 |
]. |
|
571 |
^ updateTrigger. |
|
572 |
||
573 |
"Created: / 18.2.2000 / 01:59:58 / cg" |
|
574 |
"Modified: / 18.2.2000 / 02:02:52 / cg" |
|
575 |
! |
|
576 |
||
577 |
updateTrigger:aTriggerValue |
|
578 |
updateTrigger notNil ifTrue:[ |
|
579 |
updateTrigger removeDependent:self |
|
580 |
]. |
|
581 |
updateTrigger := aTriggerValue. |
|
582 |
updateTrigger notNil ifTrue:[ |
|
583 |
updateTrigger addDependent:self |
|
584 |
]. |
|
585 |
||
586 |
"Modified: / 4.2.2000 / 23:29:30 / cg" |
|
587 |
"Created: / 18.2.2000 / 02:03:15 / cg" |
|
588 |
! ! |
|
589 |
||
590 |
!BrowserList methodsFor:'change & update'! |
|
591 |
||
11974 | 592 |
applicationIsActive |
593 |
"true if I am the active view" |
|
594 |
||
595 |
|wg activeView| |
|
596 |
||
597 |
(wg := self windowGroup) isNil ifTrue:[ ^ true ]. "/ I am being initialized |
|
598 |
self device isNil ifTrue:[ ^ true ]. "/ I am being initialized |
|
599 |
||
12057 | 600 |
(activeView := self device activeView) isNil ifTrue:[ "Transcript showCR:'nil active'." ^ false ]. |
11974 | 601 |
"/Transcript showCR:'active view: ',(activeView printString). |
602 |
"/Transcript showCR:'active wg: ',(activeView windowGroup printString). |
|
603 |
"/Transcript showCR:'my wg: ',wg printString. |
|
604 |
^ activeView windowGroup == wg |
|
605 |
! |
|
606 |
||
5591 | 607 |
delayedUpdate:something with:aParameter from:changedObject |
608 |
||
609 |
"/ if any of my subclasses want those, they should look for them. |
|
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12503
diff
changeset
|
610 |
changedObject == environment ifTrue:[ |
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
611 |
(something == #Language or:[something == #LanguageTerritory]) ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
612 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
613 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
614 |
something == #organization ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
615 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
616 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
617 |
something == #classDefinition ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
618 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
619 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
620 |
something == #classVariables ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
621 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
622 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
623 |
something == #methodTrap ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
624 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
625 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
626 |
something == #methodInClassRemoved ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
627 |
^ self. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
628 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
629 |
something == #methodDictionary ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
630 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
631 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
632 |
something == #newClass ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
633 |
^ self |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
634 |
]. |
5591 | 635 |
]. |
636 |
||
637 |
changedObject == slaveMode ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
638 |
slaveMode value ~~ true ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
639 |
listValid ~~ true ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
640 |
self updateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
641 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
642 |
self updateOutputGenerator. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
643 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
644 |
^ self. |
5591 | 645 |
]. |
646 |
||
647 |
changedObject == selectionHolder ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
648 |
listValid ifFalse:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
649 |
self updateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
650 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
651 |
^ self selectionChanged |
5591 | 652 |
]. |
653 |
||
654 |
changedObject == forceGeneratorTrigger ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
655 |
self updateOutputGenerator. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
656 |
^ self. |
5591 | 657 |
]. |
658 |
||
659 |
changedObject == hideUnloadedClasses ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
660 |
self invalidateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
661 |
slaveMode value ~~ true ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
662 |
self updateOutputGenerator. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
663 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
664 |
^ self. |
5591 | 665 |
]. |
666 |
||
667 |
changedObject == updateTrigger ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
668 |
self enqueueDelayedUpdateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
669 |
^ self |
5591 | 670 |
]. |
671 |
||
672 |
changedObject == inGeneratorHolder ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
673 |
self invalidateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
674 |
^ self |
5591 | 675 |
]. |
676 |
||
677 |
"/ changedObject == outGeneratorHolder ifTrue:[ |
|
678 |
"/ self enqueueDelayedUpdateList. |
|
679 |
"/ ^ self |
|
680 |
"/ ]. |
|
681 |
||
682 |
changedObject == packageFilter ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
683 |
self invalidateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
684 |
^ self |
5591 | 685 |
]. |
686 |
changedObject == nameSpaceFilter ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
687 |
self invalidateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
688 |
^ self |
5591 | 689 |
]. |
690 |
||
691 |
changedObject == organizerMode ifTrue:[ |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
692 |
^ self |
5591 | 693 |
]. |
694 |
||
695 |
self invalidateList. |
|
696 |
^ self |
|
697 |
||
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
698 |
"Created: / 05-02-2000 / 13:42:06 / cg" |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
699 |
"Modified: / 18-08-2000 / 14:19:24 / cg" |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
700 |
"Modified (format): / 25-02-2014 / 10:02:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 701 |
! |
702 |
||
703 |
enqueueDelayedUpdateList |
|
11563 | 704 |
listValid := false. |
705 |
||
5591 | 706 |
(NewSystemBrowser synchronousUpdate == true |
707 |
or:[ immediateUpdate value == true ]) |
|
708 |
ifTrue:[ |
|
11563 | 709 |
self updateList. |
710 |
^ self. |
|
5591 | 711 |
]. |
712 |
||
11977
2a5289cec862
changed: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
11976
diff
changeset
|
713 |
(self applicationIsActive) ifTrue:[ |
11974 | 714 |
self enqueueMessage:#updateList for:self arguments:#() |
715 |
] ifFalse:[ |
|
716 |
self enqueueMessage:#updateListInBackground for:self arguments:#() |
|
717 |
]. |
|
11563 | 718 |
|
719 |
"Modified: / 05-06-2012 / 23:38:18 / cg" |
|
5591 | 720 |
! |
721 |
||
722 |
enqueueDelayedUpdateOutputGenerator |
|
723 |
(NewSystemBrowser synchronousUpdate == true |
|
724 |
or:[ immediateUpdate value == true ]) |
|
725 |
ifTrue:[ |
|
6926 | 726 |
self updateOutputGenerator. |
727 |
^ self. |
|
5591 | 728 |
]. |
6926 | 729 |
"/ listValid := false. |
5591 | 730 |
self enqueueMessage:#updateOutputGenerator for:self arguments:#() |
731 |
! |
|
732 |
||
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
733 |
environmentChanged |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
734 |
super environmentChanged. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
735 |
self updateList. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
736 |
|
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
737 |
"Created: / 24-02-2014 / 10:20:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
738 |
! |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
739 |
|
5591 | 740 |
forceReselect |
741 |
|selectionHolder prevSelection| |
|
742 |
||
743 |
selectionHolder := self selectionHolder. |
|
744 |
prevSelection := selectionHolder value. |
|
6558 | 745 |
|
746 |
selectionHolder class == ValueHolder ifTrue:[ |
|
747 |
selectionHolder changed:#value with:prevSelection. |
|
748 |
] ifFalse:[ |
|
749 |
selectionHolder setValue:nil. |
|
750 |
selectionHolder value:prevSelection. |
|
751 |
] |
|
5591 | 752 |
! |
753 |
||
754 |
forceSelectionClear |
|
755 |
self selectionHolder setValue:nil |
|
756 |
! |
|
757 |
||
758 |
forceUpdateList |
|
6926 | 759 |
"/ |listView| |
760 |
"/ |
|
761 |
"/ listView := builder componentAt:#List. |
|
762 |
"/ listView notNil ifTrue:[ |
|
763 |
"/ listView list:#() |
|
764 |
"/ ]. |
|
5591 | 765 |
self updateList |
766 |
! |
|
767 |
||
768 |
immediateUpdate:aBooleanOrBooleanHolder |
|
769 |
immediateUpdate := aBooleanOrBooleanHolder |
|
770 |
||
771 |
"Created: / 13.2.2000 / 22:26:06 / cg" |
|
772 |
"Modified: / 13.2.2000 / 22:28:09 / cg" |
|
773 |
! |
|
774 |
||
775 |
prioDelayedUpdate:something with:aParameter from:changedObject |
|
6464 | 776 |
Processor activeProcess withLowerPriorityDo:[ |
6448
a33af45f2f4b
do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents:
6260
diff
changeset
|
777 |
self delayedUpdate:something with:aParameter from:changedObject |
5591 | 778 |
] |
779 |
! |
|
780 |
||
781 |
selectionChangeAllowed |
|
782 |
selectionChangeCondition isNil ifTrue:[^ true]. |
|
783 |
selectionChangeCondition isBlock ifTrue:[ |
|
784 |
selectionChangeCondition numArgs == 1 ifTrue:[ |
|
785 |
^ selectionChangeCondition value:self |
|
786 |
] |
|
787 |
]. |
|
788 |
^ selectionChangeCondition value |
|
789 |
! |
|
790 |
||
791 |
selectionChanged |
|
792 |
slaveMode value ~~ true ifTrue:[ |
|
793 |
self enqueueDelayedUpdateOutputGenerator |
|
794 |
"/ self updateOutputGenerator. |
|
795 |
] |
|
796 |
||
797 |
"Modified: / 4.2.2000 / 15:49:23 / cg" |
|
798 |
"Created: / 5.2.2000 / 13:42:07 / cg" |
|
799 |
! |
|
800 |
||
801 |
selectionChangedByClick |
|
802 |
||
803 |
"Created: / 25.2.2000 / 21:19:25 / cg" |
|
804 |
! |
|
805 |
||
806 |
syncDelayedUpdateList |
|
807 |
|sensor| |
|
808 |
||
809 |
sensor := self window sensor. |
|
810 |
sensor isNil ifTrue:[ |
|
811 |
^ self |
|
812 |
]. |
|
813 |
||
814 |
"/ |
|
815 |
"/ if an update is in the queue, process it. |
|
816 |
"/ |
|
817 |
(sensor |
|
818 |
hasEvent:#updateList |
|
819 |
for:self |
|
820 |
withArguments:#() |
|
821 |
) ifTrue:[ |
|
822 |
sensor flushEventsFor:self withType:#updateList. |
|
823 |
self updateList. |
|
824 |
^ self |
|
825 |
]. |
|
826 |
! |
|
827 |
||
828 |
update:something with:aParameter from:changedObject |
|
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
829 |
|
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
830 |
changedObject == environmentHolder ifTrue:[ |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
831 |
self environmentChanged. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
832 |
^ self. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
833 |
]. |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
834 |
|
5591 | 835 |
(NewSystemBrowser synchronousUpdate == true |
836 |
or:[ immediateUpdate value == true ]) |
|
837 |
ifTrue:[ |
|
11899 | 838 |
self delayedUpdate:something with:aParameter from:changedObject. |
839 |
^ self. |
|
5591 | 840 |
]. |
841 |
||
842 |
"/ changedObject == selectionHolder ifTrue:[ |
|
843 |
"/ listValid ifFalse:[ |
|
12046 | 844 |
"/ self inSlaveMode ifTrue:[ |
5591 | 845 |
"/ ^ self |
846 |
"/ ] |
|
847 |
"/ ] |
|
848 |
"/ ]. |
|
849 |
||
850 |
changedObject == inGeneratorHolder ifTrue:[ |
|
11899 | 851 |
listValid := false. |
852 |
"/ if not already shown, avoid the processing until shown |
|
853 |
"/ cg: does not work (for whatever reason) - try implementors... |
|
854 |
true "self window shown" ifFalse:[ |
|
855 |
^ self |
|
856 |
]. |
|
5591 | 857 |
]. |
858 |
self enqueueDelayedUpdate:something with:aParameter from:changedObject. |
|
859 |
||
14040
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
860 |
"Created: / 05-02-2000 / 13:42:07 / cg" |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
861 |
"Modified: / 13-11-2001 / 11:30:19 / cg" |
3a6d81d27264
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13980
diff
changeset
|
862 |
"Modified: / 25-02-2014 / 09:05:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11974 | 863 |
! |
864 |
||
865 |
updateListInBackground |
|
866 |
self executeInBackground:[self updateList] |
|
5591 | 867 |
! ! |
868 |
||
7422
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
869 |
!BrowserList methodsFor:'drag & drop'! |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
870 |
|
7813 | 871 |
canDrop: aDropContext |
872 |
^ self canDropContext: aDropContext |
|
873 |
||
874 |
"Created: / 03-07-2007 / 15:59:06 / cg" |
|
875 |
! |
|
876 |
||
877 |
doDrop: aDropContext |
|
878 |
^ self doDropContext: aDropContext |
|
879 |
||
880 |
"Created: / 03-07-2007 / 15:59:33 / cg" |
|
881 |
! |
|
882 |
||
7422
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
883 |
dropClassFiles:files |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
884 |
files do:[:fn | |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
885 |
(Dialog confirm:(resources string:'FileIn %1 ?' with:fn baseName allBold)) ifTrue:[ |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12503
diff
changeset
|
886 |
environment fileIn:fn logged:true. |
7422
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
887 |
] |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
888 |
]. |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
889 |
|
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
890 |
"Created: / 17-10-2006 / 18:24:36 / cg" |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
891 |
! |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
892 |
|
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
893 |
objectsAreClassFiles:objects |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
894 |
(objects conform:[:anObject | anObject isFilename]) ifTrue:[ |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
895 |
|files| |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
896 |
|
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
897 |
files := objects. |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
898 |
^ files conform:[:aFilename | aFilename exists |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
899 |
and:[ aFilename suffix = 'st' |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
900 |
and:[ aFilename isRegularFile ]]] |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
901 |
]. |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
902 |
^ false |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
903 |
|
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
904 |
"Created: / 17-10-2006 / 18:25:40 / cg" |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
905 |
! ! |
b4d123daf81a
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
6926
diff
changeset
|
906 |
|
5591 | 907 |
!BrowserList methodsFor:'generators'! |
908 |
||
909 |
inGeneratorHolder |
|
910 |
^ inGeneratorHolder |
|
911 |
||
912 |
"Created: / 5.2.2000 / 13:42:07 / cg" |
|
913 |
! |
|
914 |
||
915 |
inGeneratorHolder:aConditionBlockHolder |
|
916 |
|prevHolder| |
|
917 |
||
918 |
(prevHolder := inGeneratorHolder) notNil ifTrue:[ |
|
7737 | 919 |
inGeneratorHolder removeDependent:self |
5591 | 920 |
]. |
921 |
inGeneratorHolder := aConditionBlockHolder. |
|
922 |
inGeneratorHolder notNil ifTrue:[ |
|
7737 | 923 |
inGeneratorHolder addDependent:self |
5591 | 924 |
]. |
7737 | 925 |
(prevHolder notNil or:[inGeneratorHolder notNil]) ifTrue:[ |
11933
d30d44475b30
changed: #inGeneratorHolder:
Claus Gittinger <cg@exept.de>
parents:
11919
diff
changeset
|
926 |
true "self window shown" ifFalse:[ |
11899 | 927 |
"/ self enqueueDelayedUpdateList - will be done anyway, when shown |
928 |
] ifTrue:[ |
|
929 |
(prevHolder value isNil and:[ inGeneratorHolder value isEmptyOrNil]) |
|
930 |
ifFalse:[ |
|
931 |
self update:#value with:nil from:inGeneratorHolder |
|
932 |
]. |
|
7737 | 933 |
]. |
5591 | 934 |
]. |
7737 | 935 |
|
936 |
"Modified: / 12-03-2007 / 11:31:23 / cg" |
|
5591 | 937 |
! |
938 |
||
939 |
makeGenerator |
|
940 |
self subclassResponsibility |
|
941 |
||
942 |
"Created: / 5.2.2000 / 13:42:07 / cg" |
|
943 |
! |
|
944 |
||
945 |
outGeneratorHolder |
|
946 |
outGeneratorHolder isNil ifTrue:[ |
|
947 |
outGeneratorHolder := ValueHolder new |
|
948 |
]. |
|
949 |
^ outGeneratorHolder |
|
950 |
||
951 |
"Modified: / 4.2.2000 / 17:17:16 / cg" |
|
952 |
"Created: / 5.2.2000 / 13:42:07 / cg" |
|
953 |
! |
|
954 |
||
955 |
outGeneratorHolder:aConditionBlockHolder |
|
956 |
outGeneratorHolder := aConditionBlockHolder. |
|
957 |
||
958 |
"Created: / 5.2.2000 / 13:42:08 / cg" |
|
959 |
! |
|
960 |
||
961 |
updateOutputGenerator |
|
962 |
"create a generator which enumerates my elements, |
|
963 |
and place it into the outputGenerator holder" |
|
964 |
||
965 |
self outGeneratorHolder value: self makeGenerator. |
|
966 |
||
967 |
"Modified: / 4.2.2000 / 17:16:34 / cg" |
|
968 |
"Created: / 5.2.2000 / 13:42:08 / cg" |
|
969 |
! ! |
|
970 |
||
971 |
!BrowserList methodsFor:'icons'! |
|
972 |
||
973 |
abstractMethodIcon |
|
974 |
"answer an icon to mark abstract methods" |
|
975 |
||
976 |
^ self fetchIcon:#abstractMethod selector:#abstractMethodIcon |
|
977 |
! |
|
978 |
||
12503
4b1b58046747
do not cache icons on the class side (in classVars)
Claus Gittinger <cg@exept.de>
parents:
12452
diff
changeset
|
979 |
breakPointedIcon |
4b1b58046747
do not cache icons on the class side (in classVars)
Claus Gittinger <cg@exept.de>
parents:
12452
diff
changeset
|
980 |
"answer an icon to mark breakPointed methods" |
4b1b58046747
do not cache icons on the class side (in classVars)
Claus Gittinger <cg@exept.de>
parents:
12452
diff
changeset
|
981 |
|
4b1b58046747
do not cache icons on the class side (in classVars)
Claus Gittinger <cg@exept.de>
parents:
12452
diff
changeset
|
982 |
^ self fetchIcon:#breakPointed selector:#breakPointedIcon |
4b1b58046747
do not cache icons on the class side (in classVars)
Claus Gittinger <cg@exept.de>
parents:
12452
diff
changeset
|
983 |
! |
4b1b58046747
do not cache icons on the class side (in classVars)
Claus Gittinger <cg@exept.de>
parents:
12452
diff
changeset
|
984 |
|
5591 | 985 |
canvasIcon |
986 |
"answer an icon to mark canvas spec methods" |
|
987 |
||
988 |
^ self fetchIcon:#canvas selector:#canvasIcon |
|
989 |
||
990 |
! |
|
991 |
||
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
992 |
deprecatedMethodIcon |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
993 |
^ self fetchIcon:#deprecatedMethodIcon selector:#deprecatedMethodIcon |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
994 |
! |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
995 |
|
5591 | 996 |
fetchIcon:name selector:fetchSelector |
7993 | 997 |
"answer an icon to mark methods" |
5591 | 998 |
|
999 |
icons isNil ifTrue:[icons := IdentityDictionary new]. |
|
1000 |
||
1001 |
^ icons at:name ifAbsentPut:[ |
|
14062 | 1002 |
|icn fh h| |
5591 | 1003 |
|
14062 | 1004 |
icn := (SystemBrowser perform:fetchSelector) onDevice:device. |
1005 |
icn clearMaskedPixels. |
|
1006 |
||
7993 | 1007 |
h := icn height. |
1008 |
h > (fh := SelectionInListView defaultFont heightOn:device) ifTrue:[ |
|
1009 |
icn := icn magnifiedBy:(fh / h) |
|
1010 |
]. |
|
1011 |
icn onDevice:device |
|
5591 | 1012 |
] |
1013 |
! |
|
1014 |
||
1015 |
fileImageIcon |
|
1016 |
"answer an icon to mark file-image spec methods" |
|
1017 |
||
1018 |
^ self fetchIcon:#fileImage selector:#fileImageIcon |
|
1019 |
! |
|
1020 |
||
1021 |
helpIcon |
|
1022 |
"answer an icon to mark help spec methods" |
|
1023 |
||
1024 |
^ self fetchIcon:#help selector:#helpIcon |
|
1025 |
||
1026 |
! |
|
1027 |
||
1028 |
hierarchicalListIcon |
|
1029 |
"answer an icon to mark hierarchicalList spec methods" |
|
1030 |
||
1031 |
^ self fetchIcon:#hierarchicalList selector:#hierarchicalListIcon |
|
1032 |
||
1033 |
! |
|
1034 |
||
5999 | 1035 |
ignoredMethodIcon |
1036 |
"answer an icon to mark ignored methods" |
|
1037 |
||
1038 |
^ self fetchIcon:#ignoredMethod selector:#ignoredMethodIcon |
|
1039 |
! |
|
1040 |
||
5591 | 1041 |
imageIcon |
1042 |
"answer an icon to mark image spec methods" |
|
1043 |
||
1044 |
^ self fetchIcon:#image selector:#imageIcon |
|
1045 |
! |
|
1046 |
||
7993 | 1047 |
instrumentationIcon |
1048 |
"answer an icon to mark instrumented methods" |
|
1049 |
||
1050 |
"/ ^ self fetchIcon:#watch selector:#watchIcon |
|
1051 |
^ self fetchIcon:#instrumentation selector:#instrumentationIcon |
|
1052 |
! |
|
1053 |
||
5591 | 1054 |
menuIcon |
1055 |
"answer an icon to mark menu spec methods" |
|
1056 |
||
1057 |
^ self fetchIcon:#menu selector:#menuIcon |
|
1058 |
||
1059 |
! |
|
1060 |
||
1061 |
methodEmptyInheritedIcon |
|
1062 |
^ self fetchIcon:#methodEmptyInherited selector:#methodEmptyInheritedIcon |
|
1063 |
! |
|
1064 |
||
1065 |
methodInheritedFromAboveAndRedefinedBelowIcon |
|
1066 |
^ self fetchIcon:#methodInheritedFromAboveAndRedefinedBelow selector:#methodInheritedFromAboveAndRedefinedBelowIcon |
|
1067 |
! |
|
1068 |
||
1069 |
methodInheritedFromAboveIcon |
|
1070 |
^ self fetchIcon:#methodInheritedFromAbove selector:#methodInheritedFromAboveIcon |
|
1071 |
! |
|
1072 |
||
5761
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1073 |
methodIsSubclassResponsibilityAndRedefinedBelowIcon |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1074 |
^ self fetchIcon:#methodIsSubclassResponsibilityAndRedefinedBelowIcon selector:#methodIsSubclassResponsibilityAndRedefinedBelowIcon |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1075 |
! |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1076 |
|
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1077 |
methodIsSubclassResponsibilityIcon |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1078 |
^ self fetchIcon:#methodIsSubclassResponsibilityIcon selector:#methodIsSubclassResponsibilityIcon |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1079 |
! |
b350e042dc9f
Icons for subclassResponsibility and deprecated methods
Stefan Vogel <sv@exept.de>
parents:
5596
diff
changeset
|
1080 |
|
5591 | 1081 |
methodRedefinedBelowIcon |
1082 |
^ self fetchIcon:#methodRedefinedBelow selector:#methodRedefinedBelowIcon |
|
1083 |
! |
|
1084 |
||
1085 |
privateMethodIcon |
|
1086 |
"answer an icon to mark private methods" |
|
1087 |
||
1088 |
^ self fetchIcon:#privateMethod selector:#privateMethodIcon |
|
1089 |
! |
|
1090 |
||
1091 |
programImageIcon |
|
1092 |
"answer an icon to mark image spec methods" |
|
1093 |
||
1094 |
^ self fetchIcon:#programImage selector:#programImageIcon |
|
1095 |
! |
|
1096 |
||
1097 |
programMenuIcon |
|
1098 |
"answer an icon to mark program generated menu methods" |
|
1099 |
||
1100 |
^ self fetchIcon:#programMenu selector:#programMenuIcon |
|
1101 |
||
1102 |
! |
|
1103 |
||
1104 |
protectedMethodIcon |
|
1105 |
"answer an icon to mark protected methods" |
|
1106 |
||
1107 |
^ self fetchIcon:#protectedMethod selector:#protectedMethodIcon |
|
1108 |
! |
|
1109 |
||
1110 |
stopIcon |
|
1111 |
"answer an icon to mark breakPointed methods" |
|
1112 |
||
1113 |
^ self fetchIcon:#stop selector:#stopIcon |
|
1114 |
||
1115 |
||
1116 |
! |
|
1117 |
||
1118 |
tabListIcon |
|
1119 |
"answer an icon to mark tabList spec methods" |
|
1120 |
||
1121 |
^ self fetchIcon:#tabList selector:#tabListIcon |
|
1122 |
||
1123 |
! |
|
1124 |
||
1125 |
tableColumnsIcon |
|
1126 |
"answer an icon to mark tableColumns spec methods" |
|
1127 |
||
1128 |
^ self fetchIcon:#tableColumns selector:#tableColumnsIcon |
|
1129 |
||
1130 |
! |
|
1131 |
||
1132 |
timeIcon |
|
1133 |
"answer an icon to mark timed methods" |
|
1134 |
||
1135 |
^ self fetchIcon:#time selector:#timeIcon |
|
1136 |
||
1137 |
! |
|
1138 |
||
1139 |
traceIcon |
|
1140 |
"answer an icon to mark traced methods" |
|
1141 |
||
1142 |
"/ ^ self fetchIcon:#watch selector:#watchIcon |
|
1143 |
^ self fetchIcon:#trace selector:#traceIcon |
|
1144 |
! ! |
|
1145 |
||
11257 | 1146 |
!BrowserList methodsFor:'initialize-release'! |
1147 |
||
11899 | 1148 |
initialize |
1149 |
listValid := false. |
|
1150 |
super initialize. |
|
1151 |
! |
|
1152 |
||
11257 | 1153 |
release |
1154 |
self makeIndependent. |
|
1155 |
super release. |
|
1156 |
||
1157 |
filter removeDependent:self. |
|
1158 |
forceGeneratorTrigger removeDependent:self. |
|
1159 |
hideUnloadedClasses removeDependent:self. |
|
1160 |
inGeneratorHolder removeDependent:self. |
|
1161 |
nameSpaceFilter removeDependent:self. |
|
1162 |
organizerMode removeDependent:self. |
|
1163 |
packageFilter removeDependent:self. |
|
1164 |
selectionHolder removeDependent:self. |
|
1165 |
showClassPackages removeDependent:self. |
|
1166 |
slaveMode removeDependent:self. |
|
1167 |
sortBy removeDependent:self. |
|
1168 |
updateTrigger removeDependent:self. |
|
1169 |
||
1170 |
"Created: / 5.2.2000 / 13:42:09 / cg" |
|
1171 |
"Modified: / 13.2.2000 / 23:32:23 / cg" |
|
1172 |
! ! |
|
1173 |
||
5591 | 1174 |
!BrowserList methodsFor:'misc'! |
1175 |
||
1176 |
invalidateList |
|
1177 |
listValid := false. |
|
1178 |
slaveMode value ~~ true ifTrue:[ |
|
1179 |
self enqueueDelayedUpdateList. |
|
1180 |
] |
|
1181 |
! ! |
|
1182 |
||
1183 |
!BrowserList methodsFor:'private'! |
|
1184 |
||
1185 |
browserNameList |
|
1186 |
self subclassResponsibility |
|
1187 |
! |
|
1188 |
||
1189 |
classesToProcessForClasses:classes withVisibility:visibility |
|
10186
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1190 |
"for methodCategory and methodList, depending on the setting |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1191 |
of visibility (allButObject, includeAllSupers or class only), |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1192 |
return a combined hull set of classes for a given set." |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1193 |
|
5591 | 1194 |
|classesToProcess classesToProcessInOrder| |
1195 |
||
1196 |
visibility isNil ifTrue:[^classes]. |
|
1197 |
visibility == #class ifTrue:[^classes]. |
|
1198 |
||
1199 |
classesToProcess := IdentitySet new. |
|
1200 |
classesToProcessInOrder := OrderedCollection new. |
|
1201 |
classes notNil ifTrue:[ |
|
10186
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1202 |
classes do:[:eachClass | |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1203 |
|withAllSupers| |
5591 | 1204 |
|
10186
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1205 |
withAllSupers := eachClass withAllSuperclasses. |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1206 |
visibility == #allButObject ifTrue:[ |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1207 |
eachClass isMeta ifTrue:[ |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1208 |
withAllSupers removeAllFoundIn:(Object class withAllSuperclasses) |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1209 |
] ifFalse:[ |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1210 |
withAllSupers remove:Object ifAbsent:nil |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1211 |
] |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1212 |
]. |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1213 |
withAllSupers do:[:each | |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1214 |
(classesToProcess includes:each) ifFalse:[ |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1215 |
classesToProcess add:each. |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1216 |
classesToProcessInOrder add:each. |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1217 |
] |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1218 |
] |
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1219 |
]. |
5591 | 1220 |
]. |
1221 |
^ classesToProcessInOrder |
|
10186
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1222 |
|
9a68df671079
commented: #classesToProcessForClasses:withVisibility:
Claus Gittinger <cg@exept.de>
parents:
10141
diff
changeset
|
1223 |
"Modified (comment): / 06-07-2011 / 11:21:16 / cg" |
5591 | 1224 |
! |
1225 |
||
9432 | 1226 |
colorize:aString with:emphasis |
1227 |
^ aString asText emphasisAllAdd:emphasis |
|
1228 |
||
1229 |
"Created: / 27-04-2010 / 15:36:34 / cg" |
|
1230 |
! |
|
1231 |
||
5591 | 1232 |
colorizeForChangedCode:someString |
1233 |
^ someString asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode) |
|
1234 |
||
1235 |
"Created: / 31.10.2001 / 10:17:56 / cg" |
|
1236 |
! |
|
1237 |
||
7505
e364eb9079fe
changed #colorizeForChangedCodeInSmallTeam:
Claus Gittinger <cg@exept.de>
parents:
7426
diff
changeset
|
1238 |
colorizeForChangedCodeInSmallTeam:someString |
e364eb9079fe
changed #colorizeForChangedCodeInSmallTeam:
Claus Gittinger <cg@exept.de>
parents:
7426
diff
changeset
|
1239 |
^ someString asText emphasisAllAdd:(UserPreferences current emphasisForChangedCodeInSmallTeam) |
e364eb9079fe
changed #colorizeForChangedCodeInSmallTeam:
Claus Gittinger <cg@exept.de>
parents:
7426
diff
changeset
|
1240 |
|
e364eb9079fe
changed #colorizeForChangedCodeInSmallTeam:
Claus Gittinger <cg@exept.de>
parents:
7426
diff
changeset
|
1241 |
"Created: / 10-11-2006 / 16:53:53 / cg" |
e364eb9079fe
changed #colorizeForChangedCodeInSmallTeam:
Claus Gittinger <cg@exept.de>
parents:
7426
diff
changeset
|
1242 |
! |
e364eb9079fe
changed #colorizeForChangedCodeInSmallTeam:
Claus Gittinger <cg@exept.de>
parents:
7426
diff
changeset
|
1243 |
|
5591 | 1244 |
colorizeForDifferentPackage:someString |
1245 |
^ someString asText emphasisAllAdd:(UserPreferences current emphasisForDifferentPackage) |
|
1246 |
! |
|
1247 |
||
9428 | 1248 |
colorizeForInstrumentedFullyCoveredCode:someString |
9432 | 1249 |
^ self colorize:someString with:(UserPreferences current emphasisForInstrumentedFullyCoveredCode) |
9428 | 1250 |
|
1251 |
"Created: / 27-04-2010 / 13:01:24 / cg" |
|
9432 | 1252 |
"Modified: / 27-04-2010 / 15:36:49 / cg" |
9428 | 1253 |
! |
1254 |
||
1255 |
colorizeForInstrumentedNeverCalledCode:someString |
|
9432 | 1256 |
^ self colorize:someString with:(UserPreferences current emphasisForInstrumentedNeverCalledCode) |
9428 | 1257 |
|
1258 |
"Created: / 27-04-2010 / 12:59:56 / cg" |
|
9432 | 1259 |
"Modified: / 27-04-2010 / 15:37:02 / cg" |
9428 | 1260 |
! |
1261 |
||
1262 |
colorizeForInstrumentedPartiallyCoveredCode:someString |
|
9432 | 1263 |
^ self colorize:someString with:(UserPreferences current emphasisForInstrumentedPartiallyCoveredCode) |
9428 | 1264 |
|
1265 |
"Created: / 27-04-2010 / 13:01:31 / cg" |
|
9432 | 1266 |
"Modified: / 27-04-2010 / 15:37:06 / cg" |
9428 | 1267 |
! |
1268 |
||
5591 | 1269 |
colorizeGrey:someString |
1270 |
^ someString asText emphasisAllAdd:(#color->Color darkGrey) |
|
1271 |
! |
|
1272 |
||
1273 |
emphasizeForChangedCode:someString |
|
1274 |
^ self colorizeForChangedCode:someString |
|
1275 |
||
1276 |
"Modified: / 31.10.2001 / 10:18:57 / cg" |
|
1277 |
! |
|
1278 |
||
1279 |
emphasizeForDifferentPackage:someString |
|
6006 | 1280 |
^ self colorizeForDifferentPackage:(' [' , (' ' , someString , ' ') "allItalic" , ']') |
5591 | 1281 |
|
1282 |
"Modified: / 31.10.2001 / 10:13:35 / cg" |
|
1283 |
! |
|
1284 |
||
11974 | 1285 |
executeInBackground:aBlock |
1286 |
"used to update when I do not have the focus (i.e. being iconified or non-active). |
|
1287 |
Run aBlock at suerBackgroundPrio, but go back to normal prio, if I get the focus" |
|
1288 |
||
1289 |
|activeProcess watcher done| |
|
1290 |
||
1291 |
activeProcess := Processor activeProcess. |
|
1292 |
||
1293 |
done := false. |
|
1294 |
||
1295 |
watcher := |
|
1296 |
[ |
|
1297 |
|wg| |
|
1298 |
||
1299 |
[done] whileFalse:[ |
|
1300 |
Delay waitForSeconds:0.2. |
|
1301 |
self applicationIsActive ifTrue:[ |
|
1302 |
activeProcess priority:(Processor userSchedulingPriority). |
|
1303 |
done := true. |
|
1304 |
]. |
|
1305 |
]. |
|
1306 |
] fork. |
|
1307 |
||
1308 |
[ |
|
1309 |
activeProcess withUserBackgroundPriorityDo:aBlock |
|
1310 |
] ensure:[ |
|
1311 |
done := true. |
|
1312 |
watcher terminate |
|
1313 |
]. |
|
1314 |
! |
|
1315 |
||
12046 | 1316 |
inSlaveMode |
1317 |
^ (self slaveMode value == true) |
|
1318 |
! |
|
1319 |
||
5591 | 1320 |
inSlaveModeOrInvisible |
1321 |
(self slaveMode value == true) ifTrue:[^ true]. |
|
1322 |
"/ self slaveMode value isNil ifTrue:[ |
|
1323 |
"/ self window shown ifFalse:[ |
|
1324 |
"/ ^ true |
|
1325 |
"/ ]. |
|
1326 |
"/ ]. |
|
1327 |
^ false |
|
1328 |
! |
|
1329 |
||
1330 |
isClass:aClass shownWithNameSpaceFilter:nameSpaceFilter |
|
1331 |
|nsName| |
|
1332 |
||
1333 |
nameSpaceFilter isNil ifTrue:[^ true]. |
|
1334 |
nsName := aClass topNameSpace name. |
|
1335 |
||
1336 |
(nameSpaceFilter includes:nsName) ifTrue:[^ true]. |
|
1337 |
(nameSpaceFilter contains:[:ns | nsName startsWith:(ns , '::')]) ifTrue:[^ true]. |
|
1338 |
^ false |
|
1339 |
! |
|
1340 |
||
1341 |
isClass:aClass shownWithPackageFilter:packageFilter |
|
6892 | 1342 |
|classPackage| |
1343 |
||
1344 |
packageFilter isNil ifTrue:[^ true]. |
|
1345 |
classPackage := aClass package. |
|
1346 |
(packageFilter includes:classPackage) ifTrue:[^ true]. |
|
11939
b5bec33f8092
changed: #isClass:shownWithPackageFilter:
Claus Gittinger <cg@exept.de>
parents:
11933
diff
changeset
|
1347 |
(packageFilter includes:self class nameListEntryForChanged) ifTrue:[^ true]. |
6892 | 1348 |
|
1349 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
1350 |
|mthdPackage| |
|
5591 | 1351 |
|
6892 | 1352 |
mthdPackage := mthd package. |
1353 |
mthdPackage ~~ classPackage ifTrue:[ |
|
1354 |
(packageFilter includes:mthdPackage) ifTrue:[^ true]. |
|
1355 |
]. |
|
1356 |
]. |
|
1357 |
^ false |
|
1358 |
||
1359 |
"Modified: / 11-08-2006 / 15:15:28 / cg" |
|
5591 | 1360 |
! |
1361 |
||
1362 |
makeDependent |
|
1363 |
self subclassResponsibility |
|
1364 |
||
1365 |
"Created: / 5.2.2000 / 13:42:08 / cg" |
|
1366 |
! |
|
1367 |
||
1368 |
makeIndependent |
|
1369 |
self subclassResponsibility |
|
1370 |
||
1371 |
"Created: / 5.2.2000 / 13:42:08 / cg" |
|
1372 |
! |
|
1373 |
||
1374 |
releaseAsSubCanvas |
|
1375 |
self makeIndependent. |
|
1376 |
super releaseAsSubCanvas. |
|
1377 |
||
1378 |
"Created: / 13.2.2000 / 23:11:29 / cg" |
|
1379 |
"Modified: / 13.2.2000 / 23:32:29 / cg" |
|
1380 |
! |
|
1381 |
||
1382 |
updateList |
|
1383 |
self subclassResponsibility. |
|
1384 |
! |
|
1385 |
||
1386 |
updateListFor:newList |
|
1387 |
"update the browsers list in a way which avoids scrolls |
|
1388 |
and flicker; returns true, if the newList is the same." |
|
1389 |
||
1390 |
|"oldListSize newListSize" sameContents sameStrings oldEntry browserNameList |
|
1391 |
"firstDifferentFromBeginning firstDifferentFromEnd" listView prevMode sav| |
|
1392 |
||
1393 |
browserNameList := self browserNameList value. |
|
1394 |
sameContents := sameStrings := (newList size == browserNameList size). |
|
1395 |
||
1396 |
sameContents ifTrue:[ |
|
6260 | 1397 |
newList with:browserNameList do:[:newLine :oldLine | |
1398 |
sameStrings ifTrue:[ |
|
1399 |
sameStrings := ((newLine ? '') = (oldLine ? '')). |
|
1400 |
]. |
|
1401 |
sameContents ifTrue:[ |
|
1402 |
((newLine ? '') sameStringAndEmphasisAs:(oldLine ? '')) ifFalse:[ |
|
1403 |
sameContents := false |
|
1404 |
] |
|
1405 |
]. |
|
1406 |
] |
|
5591 | 1407 |
]. |
1408 |
||
1409 |
listView := builder componentAt:#List. |
|
1410 |
listView isNil ifTrue:[ |
|
6260 | 1411 |
"/ called early during setup ... |
1412 |
browserNameList contents:newList. |
|
1413 |
^ sameContents. |
|
5591 | 1414 |
]. |
1415 |
||
1416 |
sameContents ifTrue:[ |
|
6260 | 1417 |
^ sameContents |
5591 | 1418 |
]. |
1419 |
sameStrings ifTrue:[ |
|
6260 | 1420 |
newList keysAndValuesDo:[:lineNr :line | |
1421 |
oldEntry := browserNameList at:lineNr. |
|
1422 |
(oldEntry sameStringAndEmphasisAs:line) ifFalse:[ |
|
1423 |
browserNameList at:lineNr put:line. |
|
1424 |
] |
|
1425 |
]. |
|
1426 |
^ sameContents |
|
5591 | 1427 |
]. |
1428 |
||
1429 |
listView := listView scrolledView. |
|
6260 | 1430 |
listView isNil ifTrue:[^ false]. |
5591 | 1431 |
prevMode := listView scrollWhenUpdating. |
1432 |
listView scrollWhenUpdating:nil. |
|
1433 |
||
1434 |
[ |
|
6260 | 1435 |
"/ dont want to be called if selection is changed by selListView |
1436 |
sav := listView action. |
|
1437 |
listView action:nil. |
|
1438 |
browserNameList contents:newList. |
|
5591 | 1439 |
] ensure:[ |
6260 | 1440 |
listView action:sav. |
5591 | 1441 |
]. |
1442 |
||
1443 |
listView scrollWhenUpdating:prevMode. |
|
1444 |
^ sameContents. |
|
1445 |
||
1446 |
"/ oldListSize := browserNameList size. |
|
1447 |
"/ newListSize := newList size. |
|
1448 |
"/ newListSize == 0 ifTrue:[ |
|
1449 |
"/ oldListSize == 0 ifTrue:[ |
|
1450 |
"/ ^ true "/ same |
|
1451 |
"/ ]. |
|
1452 |
"/ browserNameList removeAll. |
|
1453 |
"/ ^ false "/ not same |
|
1454 |
"/ ]. |
|
1455 |
"/ |
|
1456 |
"/ oldListSize == 0 ifTrue:[ |
|
1457 |
"/ browserNameList contents:newList. |
|
1458 |
"/ ^ false. "/ not same |
|
1459 |
"/ ]. |
|
1460 |
"/ |
|
1461 |
"/ (newListSize between:(oldListSize-1) and:(oldListSize+1)) ifTrue:[ |
|
1462 |
"/ "/ individually exchange changed lines, to avoid flicker. |
|
1463 |
"/ "/ the old code was: self browserNameList value:newList |
|
1464 |
"/ "/ but if only a single method is changed (or an instrumentation icon changes), |
|
1465 |
"/ "/ this results in avoidable flicker. |
|
1466 |
"/ |
|
1467 |
"/ newListSize > oldListSize ifTrue:[ |
|
1468 |
"/ "/ an entry seems to be added |
|
1469 |
"/ "/ try to find it. |
|
1470 |
"/ firstDifferentFromBeginning := 1. |
|
1471 |
"/ |
|
1472 |
"/ [firstDifferentFromBeginning <= oldListSize |
|
1473 |
"/ and:[(newList at:firstDifferentFromBeginning) sameStringAndEmphasisAs: (browserNameList at:firstDifferentFromBeginning)]] |
|
1474 |
"/ whileTrue:[ |
|
1475 |
"/ firstDifferentFromBeginning := firstDifferentFromBeginning + 1. |
|
1476 |
"/ ]. |
|
1477 |
"/ firstDifferentFromEnd := newListSize. |
|
1478 |
"/ [firstDifferentFromEnd >= 1 |
|
1479 |
"/ and:[(newList at:firstDifferentFromEnd) sameStringAndEmphasisAs: (browserNameList at:firstDifferentFromEnd-1)]] |
|
1480 |
"/ whileTrue:[ |
|
1481 |
"/ firstDifferentFromEnd := firstDifferentFromEnd - 1. |
|
1482 |
"/ ]. |
|
1483 |
"/ (firstDifferentFromEnd - firstDifferentFromBeginning) > (newList size // 10) ifTrue:[ |
|
1484 |
"/ "/ too many differences - exchange the list en-bloque |
|
1485 |
"/ browserNameList contents:newList. |
|
1486 |
"/ ^ false. "/ not same |
|
1487 |
"/ ]. |
|
1488 |
"/ "/ entries from firstDifferentFromBeginning to firstDifferentFromEnd in newList are different |
|
1489 |
"/ |
|
1490 |
"/ (firstDifferentFromEnd - firstDifferentFromBeginning + 1 "number of different items") == (newListSize - oldListSize) ifTrue:[ |
|
1491 |
"/ "/ for now, only handle single-added-item case |
|
1492 |
"/ firstDifferentFromEnd ~~ firstDifferentFromBeginning ifTrue:[ |
|
1493 |
"/ self halt |
|
1494 |
"/ ]. |
|
1495 |
"/ |
|
1496 |
"/ "/ item at firstDifferentFromBeginning has been inserted. |
|
1497 |
"/ browserNameList add:(newList at:firstDifferentFromBeginning) beforeIndex:firstDifferentFromEnd. |
|
1498 |
"/ ^ false "/ not the same |
|
1499 |
"/ ]. |
|
1500 |
"/ ] ifFalse:[ |
|
1501 |
"/ newListSize < oldListSize ifTrue:[ |
|
1502 |
"/ "/ an entry seems to be removed |
|
1503 |
"/ "/ try to find it. |
|
1504 |
"/ firstDifferentFromBeginning := 1. |
|
1505 |
"/ |
|
1506 |
"/ [firstDifferentFromBeginning <= newListSize |
|
1507 |
"/ and:[(newList at:firstDifferentFromBeginning) sameStringAndEmphasisAs: (browserNameList at:firstDifferentFromBeginning)]] |
|
1508 |
"/ whileTrue:[ |
|
1509 |
"/ firstDifferentFromBeginning := firstDifferentFromBeginning + 1. |
|
1510 |
"/ ]. |
|
1511 |
"/ firstDifferentFromEnd := newListSize. |
|
1512 |
"/ [firstDifferentFromEnd >= 1 |
|
1513 |
"/ and:[(newList at:firstDifferentFromEnd) sameStringAndEmphasisAs: (browserNameList at:firstDifferentFromEnd+1)]] |
|
1514 |
"/ whileTrue:[ |
|
1515 |
"/ firstDifferentFromEnd := firstDifferentFromEnd - 1. |
|
1516 |
"/ ]. |
|
1517 |
"/ (firstDifferentFromEnd - firstDifferentFromBeginning) > (newList size // 10) ifTrue:[ |
|
1518 |
"/ "/ too many differences - exchange the list en-bloque |
|
1519 |
"/ browserNameList contents:newList. |
|
1520 |
"/ ^ false. "/ not same |
|
1521 |
"/ ]. |
|
1522 |
"/ "/ entries from firstDifferentFromBeginning to firstDifferentFromEnd in newList are different |
|
1523 |
"/ |
|
1524 |
"/ (firstDifferentFromBeginning - firstDifferentFromEnd) == (oldListSize - newListSize) ifTrue:[ |
|
1525 |
"/ "/ for now, only handle single-removed-item case |
|
1526 |
"/ firstDifferentFromEnd ~~ (firstDifferentFromBeginning-1) ifTrue:[self halt]. |
|
1527 |
"/ |
|
1528 |
"/ "/ item at firstDifferentFromBeginning has been removed. |
|
1529 |
"/ browserNameList removeFromIndex:firstDifferentFromBeginning toIndex:firstDifferentFromBeginning. |
|
1530 |
"/ ^ false "/ not the same |
|
1531 |
"/ ]. |
|
1532 |
"/ ] |
|
1533 |
"/ ]. |
|
1534 |
"/ |
|
1535 |
"/ sameContents := true. |
|
1536 |
"/ newList keysAndValuesDo:[:lineNr :line | |
|
1537 |
"/ lineNr > browserNameList size ifTrue:[ |
|
1538 |
"/ browserNameList add:line. |
|
1539 |
"/ sameContents := false. |
|
1540 |
"/ ] ifFalse:[ |
|
1541 |
"/ oldEntry := browserNameList at:lineNr. |
|
1542 |
"/ (oldEntry ~= line |
|
1543 |
"/ or:[(oldEntry sameStringAndEmphasisAs:line) not]) ifTrue:[ |
|
1544 |
"/ browserNameList at:lineNr put:line. |
|
1545 |
"/ sameContents := false. |
|
1546 |
"/ ] |
|
1547 |
"/ ] |
|
1548 |
"/ ]. |
|
1549 |
"/ newList size < browserNameList size ifTrue:[ |
|
1550 |
"/ browserNameList removeFromIndex:(newList size + 1) toIndex:(browserNameList size). |
|
1551 |
"/ sameContents := false. |
|
1552 |
"/ ]. |
|
1553 |
"/ ^ sameContents |
|
1554 |
"/ ]. |
|
1555 |
"/ |
|
1556 |
"/ browserNameList contents:newList. |
|
1557 |
"/ ^ false "/ not the same |
|
1558 |
! ! |
|
1559 |
||
10415 | 1560 |
!BrowserList methodsFor:'queries'! |
1561 |
||
1562 |
supportsSearch |
|
1563 |
||
1564 |
^true |
|
1565 |
||
1566 |
"Created: / 27-07-2011 / 20:31:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1567 |
! ! |
|
1568 |
||
5591 | 1569 |
!BrowserList methodsFor:'setup'! |
1570 |
||
6711 | 1571 |
autoSelect:aBoolean |
6748
f866429016aa
fixes for use in MetricViewer
Claus Gittinger <cg@exept.de>
parents:
6739
diff
changeset
|
1572 |
autoSelect := aBoolean. |
6711 | 1573 |
! |
1574 |
||
5909 | 1575 |
commonPostBuild |
5591 | 1576 |
|list| |
1577 |
||
12046 | 1578 |
self inSlaveMode ifFalse:[ |
12081 | 1579 |
"/ listValid ifFalse:[self enqueueDelayedUpdateList "updateList"]. |
1580 |
listValid := false. |
|
5591 | 1581 |
] ifTrue:[ |
11919
9fa21d589eba
comment/format in: #inGeneratorHolder:
Claus Gittinger <cg@exept.de>
parents:
11899
diff
changeset
|
1582 |
listValid := false. |
12046 | 1583 |
"/ self enqueueDelayedUpdateList. |
12081 | 1584 |
"/ self invalidateList |
5591 | 1585 |
]. |
1586 |
||
1587 |
self makeDependent. |
|
1588 |
||
5909 | 1589 |
list := builder componentAt:#List. |
5591 | 1590 |
list notNil ifTrue:[ |
5909 | 1591 |
list selectConditionBlock:[:item | self selectionChangeAllowed]. |
1592 |
list ignoreReselect:false. |
|
5591 | 1593 |
]. |
10415 | 1594 |
|
10419 | 1595 |
UserPreferences current useInPlaceSearchInBrowserLists ifTrue:[ |
10415 | 1596 |
self supportsSearch ifTrue:[ |
1597 |
list notNil ifTrue:[ |
|
1598 |
searchHandler := SearchHandler for: list |
|
1599 |
] ifFalse:[ |
|
1600 |
self breakPoint: #jv info: 'Should support search but list is nil. Wrong spec?' |
|
1601 |
]. |
|
1602 |
] |
|
1603 |
] |
|
1604 |
||
10419 | 1605 |
"Modified: / 28-07-2011 / 09:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12014 | 1606 |
! |
1607 |
||
1608 |
commonPostOpen |
|
1609 |
super commonPostOpen. |
|
1610 |
listValid ifFalse:[ |
|
12081 | 1611 |
"/ self enqueueDelayedUpdateList. |
12014 | 1612 |
]. |
10415 | 1613 |
! ! |
1614 |
||
1615 |
!BrowserList::SearchHandler class methodsFor:'instance creation'! |
|
1616 |
||
1617 |
for: aView |
|
1618 |
||
1619 |
^self new initializeFor: aView. |
|
1620 |
||
1621 |
"Created: / 27-07-2011 / 20:30:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1622 |
! ! |
|
1623 |
||
1624 |
!BrowserList::SearchHandler methodsFor:'event handling'! |
|
1625 |
||
1626 |
keyPress:key x:x y:y view:aView |
|
12109 | 1627 |
<resource: #keyboard (#Escape #Accept #Return #CursorUp #CursorDown)> |
10415 | 1628 |
|
10835 | 1629 |
| v | |
1630 |
||
10415 | 1631 |
aView == listView ifTrue:[ |
10835 | 1632 |
|
1633 |
"Forward the event to the view under pointer. |
|
1634 |
Therefore, the seach is started only iff the |
|
1635 |
pointer points to the list. Based on experience, |
|
1636 |
this improves usability because: does not require |
|
1637 |
to click in the list to focus it (which may change |
|
1638 |
the selection)" |
|
1639 |
(v := aView windowGroup pointerView) ~~ aView ifTrue:[ |
|
10884 | 1640 |
v notNil ifTrue:[ |
1641 |
aView windowGroup focusView: v. |
|
1642 |
v sensor keyPress:key x:x y:y view:v. |
|
1643 |
^self. |
|
1644 |
]. |
|
10835 | 1645 |
]. |
1646 |
||
10415 | 1647 |
searchWindow isNil ifTrue:[ |
1648 |
key isCharacter ifTrue:[ |
|
1649 |
searchHolder setValue: key asString. |
|
1650 |
self startSearch |
|
1651 |
] |
|
1652 |
] ifFalse:[ |
|
1653 |
key == #Escape ifTrue:[self stopSearch]. |
|
1654 |
key == #Accept ifTrue:[self stopSearch]. |
|
1655 |
key == #Return ifTrue:[self stopSearch]. |
|
1656 |
] |
|
1657 |
]. |
|
1658 |
||
1659 |
aView == searchField ifTrue:[ |
|
1660 |
key == #Escape ifTrue:[self stopSearch]. |
|
1661 |
key == #Accept ifTrue:[self stopSearch]. |
|
1662 |
key == #Return ifTrue:[self stopSearch]. |
|
1663 |
(key == #CursorUp or:[key == #CursorDown]) ifTrue:[ |
|
1664 |
listView sensor setCtrlDown: false. |
|
10419 | 1665 |
listView sensor setShiftDown: false. |
10415 | 1666 |
listView keyPress:key x:x y:y |
1667 |
]. |
|
1668 |
||
1669 |
] |
|
1670 |
||
1671 |
"Created: / 27-07-2011 / 20:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1672 |
! ! |
|
1673 |
||
1674 |
!BrowserList::SearchHandler methodsFor:'event handling-queries'! |
|
1675 |
||
1676 |
handlesKeyPress:key inView:aView |
|
12109 | 1677 |
<resource: #keyboard (#Escape #Accept #Return #CursorUp #CursorDown)> |
10415 | 1678 |
|
1679 |
aView == listView ifTrue:[ |
|
1680 |
key isCharacter ifTrue:[ |
|
1681 |
^true |
|
1682 |
] |
|
1683 |
]. |
|
1684 |
aView == searchField ifTrue:[ |
|
12109 | 1685 |
(#(#Escape #Accept #Return #CursorUp #CursorDown) includes: key) ifTrue:[ |
10415 | 1686 |
^true |
1687 |
] |
|
1688 |
]. |
|
1689 |
^false |
|
1690 |
||
1691 |
"Created: / 27-07-2011 / 20:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1692 |
! ! |
|
1693 |
||
1694 |
!BrowserList::SearchHandler methodsFor:'initialization'! |
|
1695 |
||
1696 |
initializeFor: aView |
|
1697 |
||
1698 |
aView isScrollWrapper ifTrue:[ |
|
1699 |
listView := aView scrolledView |
|
1700 |
] ifFalse:[ |
|
1701 |
listView := aView. |
|
1702 |
]. |
|
1703 |
listView delegate: self. |
|
1704 |
searchHolder := ValueHolder with: nil. |
|
1705 |
searchHolder onChangeSend: #updateList to: self. |
|
1706 |
||
1707 |
"Created: / 27-07-2011 / 20:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1708 |
! ! |
|
1709 |
||
1710 |
!BrowserList::SearchHandler methodsFor:'private'! |
|
1711 |
||
1712 |
absoluteLeftOfListView |
|
1713 |
||
1714 |
| absoluteLeft view | |
|
1715 |
absoluteLeft := 1. |
|
1716 |
view := listView. |
|
1717 |
[ view notNil ] whileTrue: |
|
1718 |
[absoluteLeft := absoluteLeft + view left - 2. |
|
1719 |
view := view superView]. |
|
1720 |
^absoluteLeft |
|
1721 |
||
1722 |
"Created: / 08-08-2009 / 22:30:07 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1723 |
"Created: / 27-07-2011 / 21:54:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1724 |
! |
|
1725 |
||
1726 |
absoluteTopOfListView |
|
1727 |
||
1728 |
| absoluteTop view | |
|
1729 |
absoluteTop := 1. |
|
1730 |
view := listView. |
|
1731 |
[ view notNil ] whileTrue: |
|
1732 |
[absoluteTop := absoluteTop + view top - 1. |
|
1733 |
view := view superView]. |
|
1734 |
^absoluteTop |
|
1735 |
||
1736 |
"Created: / 08-08-2009 / 22:30:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1737 |
"Created: / 27-07-2011 / 21:54:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1738 |
! |
|
1739 |
||
1740 |
filter |
|
1741 |
||
10835 | 1742 |
| pattern | |
1743 |
pattern := StringPattern fromString: searchHolder value. |
|
1744 |
||
1745 |
^[:entry :relax| |
|
1746 |
pattern match: entry asString trimSeparators relax: relax |
|
10415 | 1747 |
] |
1748 |
||
1749 |
"Created: / 27-07-2011 / 22:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1750 |
! |
|
1751 |
||
1752 |
hideSearchWindow |
|
1753 |
||
1754 |
searchWindow |
|
1755 |
ifNotNil:[ |
|
1756 |
searchWindow destroy. |
|
1757 |
searchWindow := nil. |
|
1758 |
searchField := nil. |
|
1759 |
] |
|
1760 |
||
1761 |
"Created: / 27-07-2011 / 21:38:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1762 |
! |
|
1763 |
||
1764 |
restoreList |
|
1765 |
||
10430 | 1766 |
self updateSelection. |
1767 |
listView listHolder: listHolder. |
|
1768 |
listSelectionHolder notNil ifTrue:[ |
|
1769 |
listView model: listSelectionHolder. |
|
10419 | 1770 |
]. |
10430 | 1771 |
listSelectionHolder changed: #value |
10415 | 1772 |
|
1773 |
"Created: / 27-07-2011 / 22:14:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1774 |
! |
|
1775 |
||
1776 |
saveList |
|
1777 |
||
10430 | 1778 |
listHolder := listView listHolder. |
1779 |
listSelectionHolder := listView model. |
|
10415 | 1780 |
|
1781 |
"Created: / 27-07-2011 / 22:14:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1782 |
! |
|
1783 |
||
1784 |
showSearchWindow |
|
1785 |
||
1786 |
searchWindow := StandardSystemView new |
|
1787 |
bePopUpView; |
|
1788 |
beSlave; |
|
1789 |
origin:(self absoluteLeftOfListView + 5" - optionsView textStartLeft") |
|
1790 |
@ (self absoluteTopOfListView + listView height + 1 + 5) |
|
1791 |
extent:(listView width + 0"((optionsView textStartLeft) * 2)") @ (listView font height * 1.5) ceiling. |
|
1792 |
||
1793 |
searchField := (EditField |
|
1794 |
origin: 0.0@0.0 |
|
1795 |
corner: 1.0@1.0 |
|
1796 |
in: searchWindow) |
|
1797 |
model: searchHolder; |
|
1798 |
immediateAccept: true; |
|
1799 |
delegate: self; |
|
1800 |
yourself. |
|
1801 |
||
1802 |
searchWindow openModal. |
|
1803 |
||
1804 |
"Created: / 27-07-2011 / 21:37:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1805 |
! |
|
1806 |
||
1807 |
startSearch |
|
1808 |
||
1809 |
self saveList. |
|
1810 |
self updateList. |
|
1811 |
self showSearchWindow. |
|
1812 |
||
1813 |
"Created: / 27-07-2011 / 21:37:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1814 |
! |
|
1815 |
||
1816 |
stopSearch |
|
1817 |
||
1818 |
self hideSearchWindow. |
|
1819 |
self restoreList. |
|
1820 |
||
1821 |
"Created: / 27-07-2011 / 21:37:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1822 |
! |
|
1823 |
||
1824 |
updateList |
|
1825 |
||
1826 |
| filter filteredList | |
|
1827 |
filter := self filter. |
|
10835 | 1828 |
|
1829 |
filteredList := listHolder value select:[:each|filter value: each value: 1]. |
|
1830 |
filteredList isEmpty ifTrue:[ |
|
1831 |
filteredList := listHolder value select:[:each|filter value: each value: 2]. |
|
1832 |
filteredList isEmpty ifTrue:[ |
|
1833 |
filteredList := listHolder value select:[:each|filter value: each value: 3]. |
|
1834 |
]]. |
|
1835 |
||
1836 |
||
10419 | 1837 |
listView listHolder == listHolder ifTrue:[ |
1838 |
listView listHolder: (ValueHolder with: filteredList) |
|
1839 |
] ifFalse:[ |
|
1840 |
listView listHolder value: filteredList. |
|
1841 |
]. |
|
10430 | 1842 |
listView model == listSelectionHolder ifTrue:[ |
1843 |
listView model: ValueHolder new. |
|
1844 |
listView model onChangeSend: #updateSelection to: self. |
|
1845 |
]. |
|
10419 | 1846 |
filteredList size == 1 ifTrue:[ |
1847 |
listView selection: 1 |
|
1848 |
] |
|
10415 | 1849 |
|
1850 |
"Created: / 27-07-2011 / 22:18:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10430 | 1851 |
! |
1852 |
||
1853 |
updateSelection |
|
1854 |
||
1855 |
| sel | |
|
1856 |
||
1857 |
listSelectionHolder isNil ifTrue:[^self]. |
|
1858 |
||
1859 |
sel := listView selection. |
|
1860 |
sel notNil ifTrue:[ |
|
1861 |
sel isInteger ifTrue:[ |
|
1862 |
sel := listHolder identityIndexOf: (listView list at: sel) |
|
1863 |
] ifFalse:[ |
|
1864 |
sel := sel collect:[:each|listHolder value identityIndexOf: (listView list at: each)] |
|
1865 |
]. |
|
1866 |
] ifFalse:[ |
|
1867 |
listView multipleSelectOk ifTrue:[ |
|
1868 |
sel := #() |
|
1869 |
] |
|
1870 |
]. |
|
1871 |
listView useIndex ifFalse:[ |
|
1872 |
sel isInteger ifTrue:[ |
|
1873 |
sel := listHolder value at: sel |
|
1874 |
] ifFalse:[ |
|
1875 |
sel := sel collect:[:each|listHolder value at: each]. |
|
1876 |
] |
|
1877 |
]. |
|
1878 |
||
1879 |
||
1880 |
listSelectionHolder value: sel. |
|
1881 |
||
1882 |
"Created: / 02-08-2011 / 09:08:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 1883 |
! ! |
1884 |
||
1885 |
!BrowserList class methodsFor:'documentation'! |
|
1886 |
||
11976
42399e2f1b18
background update disabled for now (seems to make it slower)
Claus Gittinger <cg@exept.de>
parents:
11974
diff
changeset
|
1887 |
version |
14062 | 1888 |
^ '$Header: /cvs/stx/stx/libtool/Tools_BrowserList.st,v 1.63 2014-02-26 13:51:11 stefan Exp $' |
11976
42399e2f1b18
background update disabled for now (seems to make it slower)
Claus Gittinger <cg@exept.de>
parents:
11974
diff
changeset
|
1889 |
! |
42399e2f1b18
background update disabled for now (seems to make it slower)
Claus Gittinger <cg@exept.de>
parents:
11974
diff
changeset
|
1890 |
|
9428 | 1891 |
version_CVS |
14062 | 1892 |
^ '$Header: /cvs/stx/stx/libtool/Tools_BrowserList.st,v 1.63 2014-02-26 13:51:11 stefan Exp $' |
5591 | 1893 |
! ! |
12109 | 1894 |