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