5591
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2000 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
"{ Package: 'stx:__NoProject__' }"
|
|
14 |
|
|
15 |
"{ NameSpace: Tools }"
|
|
16 |
|
|
17 |
Object subclass:#NavigationState
|
|
18 |
instanceVariableNames:'browserLabel codeModifiedHolder categoryList classList
|
|
19 |
packageFilter nameSpaceFilter hidePrivateClasses canvasType
|
|
20 |
notMetaToggle metaToggle metaToggleLabel organizerMode codeAspect
|
|
21 |
codeHolder classDocumentationHolder canvas selectorListGenerator
|
|
22 |
protocolListGenerator classListPerNameSpaceGenerator
|
|
23 |
classListGenerator categoryListGenerator nameSpaceListGenerator
|
|
24 |
projectListGenerator classHierarchyTopClass meta selectedMethods
|
|
25 |
selectedProtocols selectedClasses selectedCategories
|
|
26 |
selectedProjects selectedNamespaces variableFilter
|
|
27 |
filterClassVars sortBy noAllItem autoSearchPattern
|
|
28 |
autoSearchIgnoreCase autoSearchAction realModifiedState
|
|
29 |
methodInfo versionDiffApplication selectorListGeneratorArray
|
|
30 |
selectedMethodsArray infoLabelHolder packageLabelHolder
|
|
31 |
cursorLineLabelHolder cursorColLabelHolder modeLabelHolder
|
|
32 |
sortVariablesBy'
|
|
33 |
classVariableNames:''
|
|
34 |
poolDictionaries:''
|
|
35 |
category:'Interface-Browsers-New'
|
|
36 |
!
|
|
37 |
|
|
38 |
!NavigationState class methodsFor:'documentation'!
|
|
39 |
|
|
40 |
copyright
|
|
41 |
"
|
|
42 |
COPYRIGHT (c) 2000 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 |
|
|
54 |
!NavigationState methodsFor:'accessing'!
|
|
55 |
|
|
56 |
autoSearchAction
|
|
57 |
^ autoSearchAction
|
|
58 |
!
|
|
59 |
|
|
60 |
autoSearchAction:something
|
|
61 |
autoSearchAction := something.
|
|
62 |
!
|
|
63 |
|
|
64 |
autoSearchIgnoreCase
|
|
65 |
"return true if the autSearch is to be case-insensitive"
|
|
66 |
|
|
67 |
^ autoSearchIgnoreCase
|
|
68 |
!
|
|
69 |
|
|
70 |
autoSearchIgnoreCase:aBoolean
|
|
71 |
"change the autSearches case-insensitivenes"
|
|
72 |
|
|
73 |
autoSearchIgnoreCase := aBoolean
|
|
74 |
!
|
|
75 |
|
|
76 |
autoSearchPattern
|
|
77 |
"return the automatic search pattern"
|
|
78 |
|
|
79 |
^ autoSearchPattern
|
|
80 |
!
|
|
81 |
|
|
82 |
autoSearchPattern:aPattern
|
|
83 |
"change the automatic search pattern"
|
|
84 |
|
|
85 |
autoSearchPattern := aPattern.
|
|
86 |
!
|
|
87 |
|
|
88 |
browserLabel
|
|
89 |
"return the assigned state-label (to be shown in the tab)."
|
|
90 |
|
|
91 |
^ browserLabel
|
|
92 |
!
|
|
93 |
|
|
94 |
browserLabel:aString
|
|
95 |
"set the assigned state-label (to be shown in the tab)."
|
|
96 |
|
|
97 |
browserLabel := aString
|
|
98 |
!
|
|
99 |
|
|
100 |
canvas
|
|
101 |
"return the value of the instance variable 'canvas' (automatically generated)"
|
|
102 |
|
|
103 |
^ canvas
|
|
104 |
!
|
|
105 |
|
|
106 |
canvas:something
|
|
107 |
"set the value of the instance variable 'canvas' (automatically generated)"
|
|
108 |
|
|
109 |
canvas := something.
|
|
110 |
canvasType isNil ifTrue:[
|
|
111 |
canvasType := something spec
|
|
112 |
].
|
|
113 |
!
|
|
114 |
|
|
115 |
canvasType
|
|
116 |
"return the type of canvas"
|
|
117 |
|
|
118 |
^ canvasType
|
|
119 |
!
|
|
120 |
|
|
121 |
canvasType:aSpecSymbol
|
|
122 |
"set the type of canvas"
|
|
123 |
|
|
124 |
canvasType notNil ifTrue:[
|
|
125 |
canvasType ~~ aSpecSymbol ifTrue:[
|
|
126 |
self halt:'cannot be changed, once set'.
|
|
127 |
]
|
|
128 |
].
|
|
129 |
canvasType := aSpecSymbol
|
|
130 |
!
|
|
131 |
|
|
132 |
codeAspect
|
|
133 |
"return the codeAspect; a symbol describing what is shown in the codeView"
|
|
134 |
|
|
135 |
^ codeAspect
|
|
136 |
|
|
137 |
"Created: / 11.2.2000 / 12:43:29 / cg"
|
|
138 |
!
|
|
139 |
|
|
140 |
codeAspect:aSymbolOrNil
|
|
141 |
"set the codeAspect; a symbol describing what is shown in the codeView"
|
|
142 |
|
|
143 |
codeAspect := aSymbolOrNil
|
|
144 |
|
|
145 |
"Created: / 11.2.2000 / 12:43:45 / cg"
|
|
146 |
!
|
|
147 |
|
|
148 |
codeView
|
|
149 |
|builder v|
|
|
150 |
|
|
151 |
canvas notNil ifTrue:[
|
|
152 |
builder := canvas builder.
|
|
153 |
builder notNil ifTrue:[
|
|
154 |
v := builder componentAt:#CodeView.
|
|
155 |
v notNil ifTrue:[
|
|
156 |
^ v scrolledView
|
|
157 |
].
|
|
158 |
]
|
|
159 |
].
|
|
160 |
^ nil
|
|
161 |
|
|
162 |
"Created: / 11.2.2000 / 13:28:25 / cg"
|
|
163 |
!
|
|
164 |
|
|
165 |
environment
|
|
166 |
^ Smalltalk
|
|
167 |
!
|
|
168 |
|
|
169 |
modified
|
|
170 |
"check for modified code by asking the editTextView;
|
|
171 |
this one returns true if ever modified - even if
|
|
172 |
the modifiecations where undone in the editor
|
|
173 |
(i.e. not really modified).
|
|
174 |
Use #reallyModified if the contents should be compared
|
|
175 |
against the original contents"
|
|
176 |
|
|
177 |
|codeView|
|
|
178 |
|
|
179 |
realModifiedState == true ifTrue:[^ true].
|
|
180 |
^ (codeView := self codeView) notNil
|
|
181 |
and:[codeView modified]
|
|
182 |
!
|
|
183 |
|
|
184 |
modified:aBoolean
|
|
185 |
|codeView|
|
|
186 |
|
|
187 |
(codeView := self codeView) notNil ifTrue:[
|
|
188 |
codeView modified:aBoolean
|
|
189 |
].
|
|
190 |
!
|
|
191 |
|
|
192 |
realModifiedState
|
|
193 |
^ realModifiedState
|
|
194 |
!
|
|
195 |
|
|
196 |
realModifiedState:aBoolean
|
|
197 |
realModifiedState := aBoolean
|
|
198 |
! !
|
|
199 |
|
|
200 |
!NavigationState methodsFor:'accessing-selection'!
|
|
201 |
|
|
202 |
theSingleSelectedClass
|
|
203 |
"if only one class is selected, return it.
|
|
204 |
Otherwise, return nil"
|
|
205 |
|
|
206 |
|classes|
|
|
207 |
|
|
208 |
classes := self selectedClasses value.
|
|
209 |
classes size == 1 ifTrue:[
|
|
210 |
^ classes first
|
|
211 |
].
|
|
212 |
^ nil
|
|
213 |
!
|
|
214 |
|
|
215 |
theSingleSelectedMethod
|
|
216 |
"if only one method is selected, return it.
|
|
217 |
Otherwise, return nil"
|
|
218 |
|
|
219 |
|methods|
|
|
220 |
|
|
221 |
methods := self selectedMethods value.
|
|
222 |
methods size == 1 ifTrue:[
|
|
223 |
^ methods first
|
|
224 |
].
|
|
225 |
^ nil
|
|
226 |
! !
|
|
227 |
|
|
228 |
!NavigationState methodsFor:'accessing-subApps'!
|
|
229 |
|
|
230 |
applicationOfComponent:aComponentName
|
|
231 |
^ self applicationOfComponent:aComponentName or:nil
|
|
232 |
|
|
233 |
!
|
|
234 |
|
|
235 |
applicationOfComponent:aComponentName or:anotherComponentName
|
|
236 |
|builder view|
|
|
237 |
|
|
238 |
builder := canvas builder.
|
|
239 |
view := builder findComponentAt:aComponentName.
|
|
240 |
(view isNil and:[anotherComponentName notNil]) ifTrue:[
|
|
241 |
view := builder findComponentAt:anotherComponentName.
|
|
242 |
].
|
|
243 |
view notNil ifTrue:[
|
|
244 |
^ view application
|
|
245 |
].
|
|
246 |
^ nil
|
|
247 |
!
|
|
248 |
|
|
249 |
classCategoryListApplication
|
|
250 |
^ self applicationOfComponent:#ClassCategoryList
|
|
251 |
|
|
252 |
!
|
|
253 |
|
|
254 |
classListApplication
|
|
255 |
^ self applicationOfComponent:#ClassList
|
|
256 |
|
|
257 |
!
|
|
258 |
|
|
259 |
metaToggleComponent
|
|
260 |
^ canvas builder findComponentAt:#ClassToggle.
|
|
261 |
!
|
|
262 |
|
|
263 |
methodCategoryListApplication
|
|
264 |
^ self applicationOfComponent:#MethodCategoryList
|
|
265 |
!
|
|
266 |
|
|
267 |
methodListApplication
|
|
268 |
^ self applicationOfComponent:#MethodList
|
|
269 |
!
|
|
270 |
|
|
271 |
nameSpaceListApplication
|
|
272 |
^ self applicationOfComponent:#NamespaceList or:#PseudoNamespaceList
|
|
273 |
!
|
|
274 |
|
|
275 |
projectListApplication
|
|
276 |
^ self applicationOfComponent:#ProjectList or:#PseudoProjectList
|
|
277 |
!
|
|
278 |
|
|
279 |
variableListApplication
|
|
280 |
^ self applicationOfComponent:#VariableList
|
|
281 |
!
|
|
282 |
|
|
283 |
versionDiffApplication
|
|
284 |
^ versionDiffApplication
|
|
285 |
|
|
286 |
!
|
|
287 |
|
|
288 |
versionDiffApplication:anApplication
|
|
289 |
versionDiffApplication := anApplication
|
|
290 |
|
|
291 |
! !
|
|
292 |
|
|
293 |
!NavigationState methodsFor:'aspects'!
|
|
294 |
|
|
295 |
categoryList
|
|
296 |
categoryList isNil ifTrue:[
|
|
297 |
categoryList := nil asValue.
|
|
298 |
].
|
|
299 |
^ categoryList
|
|
300 |
|
|
301 |
"Modified: / 25.2.2000 / 01:35:42 / cg"
|
|
302 |
"Created: / 25.2.2000 / 01:57:45 / cg"
|
|
303 |
!
|
|
304 |
|
|
305 |
categoryListGenerator
|
|
306 |
categoryListGenerator isNil ifTrue:[
|
|
307 |
categoryListGenerator := nil asValue.
|
|
308 |
].
|
|
309 |
^ categoryListGenerator
|
|
310 |
|
|
311 |
"Created: / 25.2.2000 / 01:34:30 / cg"
|
|
312 |
"Modified: / 25.2.2000 / 01:35:42 / cg"
|
|
313 |
!
|
|
314 |
|
|
315 |
classDocumentationHolder
|
|
316 |
classDocumentationHolder isNil ifTrue:[
|
|
317 |
classDocumentationHolder := nil asValue.
|
|
318 |
].
|
|
319 |
^ classDocumentationHolder
|
|
320 |
!
|
|
321 |
|
|
322 |
classHierarchyTopClass
|
|
323 |
classHierarchyTopClass isNil ifTrue:[
|
|
324 |
classHierarchyTopClass := nil asValue.
|
|
325 |
].
|
|
326 |
^ classHierarchyTopClass
|
|
327 |
|
|
328 |
!
|
|
329 |
|
|
330 |
classList
|
|
331 |
classList isNil ifTrue:[
|
|
332 |
classList := nil asValue.
|
|
333 |
].
|
|
334 |
^ classList
|
|
335 |
|
|
336 |
"Created: / 25.2.2000 / 01:57:28 / cg"
|
|
337 |
!
|
|
338 |
|
|
339 |
classListGenerator
|
|
340 |
classListGenerator isNil ifTrue:[
|
|
341 |
classListGenerator := nil asValue.
|
|
342 |
].
|
|
343 |
^ classListGenerator
|
|
344 |
|
|
345 |
|
|
346 |
!
|
|
347 |
|
|
348 |
classListPerNameSpaceGenerator
|
|
349 |
classListPerNameSpaceGenerator isNil ifTrue:[
|
|
350 |
classListPerNameSpaceGenerator := nil asValue.
|
|
351 |
].
|
|
352 |
^ classListPerNameSpaceGenerator
|
|
353 |
|
|
354 |
"Created: / 18.8.2000 / 14:15:34 / cg"
|
|
355 |
!
|
|
356 |
|
|
357 |
codeHolder
|
|
358 |
codeHolder isNil ifTrue:[
|
|
359 |
codeHolder := nil asValue.
|
|
360 |
].
|
|
361 |
^ codeHolder
|
|
362 |
|
|
363 |
!
|
|
364 |
|
|
365 |
codeModifiedHolder
|
|
366 |
codeModifiedHolder isNil ifTrue:[
|
|
367 |
codeModifiedHolder := false asValue.
|
|
368 |
].
|
|
369 |
^ codeModifiedHolder
|
|
370 |
!
|
|
371 |
|
|
372 |
cursorColLabelHolder
|
|
373 |
cursorColLabelHolder isNil ifTrue:[
|
|
374 |
cursorColLabelHolder := BlockValue
|
|
375 |
with:[:v | v printString]
|
|
376 |
argument:self codeView cursorColHolder.
|
|
377 |
].
|
|
378 |
^ cursorColLabelHolder
|
|
379 |
!
|
|
380 |
|
|
381 |
cursorLineLabelHolder
|
|
382 |
cursorLineLabelHolder isNil ifTrue:[
|
|
383 |
cursorLineLabelHolder := BlockValue
|
|
384 |
with:[:v | v printString]
|
|
385 |
argument:self codeView cursorLineHolder.
|
|
386 |
].
|
|
387 |
^ cursorLineLabelHolder
|
|
388 |
!
|
|
389 |
|
|
390 |
filterClassVars
|
|
391 |
filterClassVars isNil ifTrue:[
|
|
392 |
filterClassVars := false asValue.
|
|
393 |
].
|
|
394 |
^ filterClassVars
|
|
395 |
|
|
396 |
"Created: / 24.2.2000 / 23:45:28 / cg"
|
|
397 |
!
|
|
398 |
|
|
399 |
hidePrivateClasses
|
|
400 |
hidePrivateClasses isNil ifTrue:[
|
|
401 |
hidePrivateClasses := false asValue.
|
|
402 |
].
|
|
403 |
^ hidePrivateClasses
|
|
404 |
|
|
405 |
"Created: / 24.2.2000 / 16:17:02 / cg"
|
|
406 |
!
|
|
407 |
|
|
408 |
infoLabelHolder
|
|
409 |
infoLabelHolder isNil ifTrue:[
|
|
410 |
infoLabelHolder := '' asValue.
|
|
411 |
].
|
|
412 |
^ infoLabelHolder
|
|
413 |
!
|
|
414 |
|
|
415 |
meta
|
|
416 |
meta isNil ifTrue:[
|
|
417 |
meta := false asValue.
|
|
418 |
].
|
|
419 |
^ meta
|
|
420 |
|
|
421 |
|
|
422 |
!
|
|
423 |
|
|
424 |
metaToggleLabelHolder
|
|
425 |
metaToggleLabel isNil ifTrue:[
|
|
426 |
metaToggleLabel := 'Class' asValue.
|
|
427 |
].
|
|
428 |
^ metaToggleLabel
|
|
429 |
!
|
|
430 |
|
|
431 |
methodInfo
|
|
432 |
methodInfo isNil ifTrue:[
|
|
433 |
methodInfo := nil asValue.
|
|
434 |
].
|
|
435 |
^ methodInfo
|
|
436 |
|
|
437 |
!
|
|
438 |
|
|
439 |
methodList
|
|
440 |
|methodListApplication|
|
|
441 |
|
|
442 |
methodListApplication := self methodListApplication.
|
|
443 |
methodListApplication isNil ifTrue:[^ nil].
|
|
444 |
|
|
445 |
^ methodListApplication methodList
|
|
446 |
!
|
|
447 |
|
|
448 |
modeLabelHolder
|
|
449 |
modeLabelHolder isNil ifTrue:[
|
|
450 |
modeLabelHolder := self codeView modeLabelHolder.
|
|
451 |
].
|
|
452 |
^ modeLabelHolder
|
|
453 |
!
|
|
454 |
|
|
455 |
nameSpaceFilter
|
|
456 |
nameSpaceFilter isNil ifTrue:[
|
|
457 |
nameSpaceFilter := nil asValue.
|
|
458 |
].
|
|
459 |
^ nameSpaceFilter
|
|
460 |
|
|
461 |
"Created: / 18.8.2000 / 14:25:24 / cg"
|
|
462 |
!
|
|
463 |
|
|
464 |
nameSpaceListGenerator
|
|
465 |
nameSpaceListGenerator isNil ifTrue:[
|
|
466 |
nameSpaceListGenerator := nil asValue.
|
|
467 |
].
|
|
468 |
^ nameSpaceListGenerator
|
|
469 |
|
|
470 |
"Created: / 18.8.2000 / 14:26:19 / cg"
|
|
471 |
"Modified: / 18.8.2000 / 14:27:59 / cg"
|
|
472 |
!
|
|
473 |
|
|
474 |
noAllItem
|
|
475 |
noAllItem isNil ifTrue:[
|
|
476 |
noAllItem := nil asValue.
|
|
477 |
].
|
|
478 |
^ noAllItem
|
|
479 |
!
|
|
480 |
|
|
481 |
organizerMode
|
|
482 |
"return the organizerMode holder;
|
|
483 |
holding a symbol describing how things are organized
|
|
484 |
(#category, #hierarchy, #project or #namespace)"
|
|
485 |
|
|
486 |
organizerMode isNil ifTrue:[
|
|
487 |
organizerMode := #category asValue.
|
|
488 |
].
|
|
489 |
^ organizerMode
|
|
490 |
|
|
491 |
"Created: / 18.2.2000 / 13:33:55 / cg"
|
|
492 |
"Modified: / 18.8.2000 / 18:37:22 / cg"
|
|
493 |
!
|
|
494 |
|
|
495 |
packageFilter
|
|
496 |
packageFilter isNil ifTrue:[
|
|
497 |
packageFilter := nil asValue.
|
|
498 |
].
|
|
499 |
^ packageFilter
|
|
500 |
|
|
501 |
"Created: / 24.2.2000 / 23:45:28 / cg"
|
|
502 |
!
|
|
503 |
|
|
504 |
packageLabelHolder
|
|
505 |
packageLabelHolder isNil ifTrue:[
|
|
506 |
packageLabelHolder := '' asValue.
|
|
507 |
].
|
|
508 |
^ packageLabelHolder
|
|
509 |
!
|
|
510 |
|
|
511 |
projectListGenerator
|
|
512 |
projectListGenerator isNil ifTrue:[
|
|
513 |
projectListGenerator := nil asValue.
|
|
514 |
].
|
|
515 |
^ projectListGenerator
|
|
516 |
|
|
517 |
"Modified: / 25.2.2000 / 01:35:42 / cg"
|
|
518 |
"Created: / 25.2.2000 / 02:43:26 / cg"
|
|
519 |
!
|
|
520 |
|
|
521 |
protocolListGenerator
|
|
522 |
protocolListGenerator isNil ifTrue:[
|
|
523 |
protocolListGenerator := nil asValue.
|
|
524 |
].
|
|
525 |
^ protocolListGenerator
|
|
526 |
|
|
527 |
!
|
|
528 |
|
|
529 |
selectedCategories
|
|
530 |
selectedCategories isNil ifTrue:[
|
|
531 |
selectedCategories := nil asValue.
|
|
532 |
].
|
|
533 |
^ selectedCategories
|
|
534 |
|
|
535 |
!
|
|
536 |
|
|
537 |
selectedClasses
|
|
538 |
selectedClasses isNil ifTrue:[
|
|
539 |
selectedClasses := "SpecialValueHolder with:nil." nil asValue.
|
|
540 |
].
|
|
541 |
^ selectedClasses
|
|
542 |
!
|
|
543 |
|
|
544 |
selectedMethods
|
|
545 |
selectedMethods isNil ifTrue:[
|
|
546 |
selectedMethods := nil asValue.
|
|
547 |
].
|
|
548 |
^ selectedMethods
|
|
549 |
|
|
550 |
!
|
|
551 |
|
|
552 |
selectedMethodsArrayAt:index
|
|
553 |
|holder|
|
|
554 |
|
|
555 |
selectedMethodsArray isNil ifTrue:[
|
|
556 |
selectedMethodsArray := OrderedCollection new
|
|
557 |
].
|
|
558 |
index > selectedMethodsArray size ifTrue:[
|
|
559 |
selectedMethodsArray grow:index
|
|
560 |
].
|
|
561 |
holder := selectedMethodsArray at:index.
|
|
562 |
holder isNil ifTrue:[
|
|
563 |
selectedMethodsArray at:index put:(holder := ValueHolder new)
|
|
564 |
].
|
|
565 |
^ holder.
|
|
566 |
!
|
|
567 |
|
|
568 |
selectedNamespaces
|
|
569 |
selectedNamespaces isNil ifTrue:[
|
|
570 |
selectedNamespaces := nil asValue.
|
|
571 |
].
|
|
572 |
^ selectedNamespaces
|
|
573 |
|
|
574 |
!
|
|
575 |
|
|
576 |
selectedProjects
|
|
577 |
selectedProjects isNil ifTrue:[
|
|
578 |
selectedProjects := nil asValue.
|
|
579 |
].
|
|
580 |
^ selectedProjects
|
|
581 |
|
|
582 |
!
|
|
583 |
|
|
584 |
selectedProtocols
|
|
585 |
selectedProtocols isNil ifTrue:[
|
|
586 |
selectedProtocols := nil asValue.
|
|
587 |
].
|
|
588 |
^ selectedProtocols
|
|
589 |
|
|
590 |
!
|
|
591 |
|
|
592 |
selectorListGenerator
|
|
593 |
selectorListGenerator isNil ifTrue:[
|
|
594 |
selectorListGenerator := nil asValue.
|
|
595 |
].
|
|
596 |
^ selectorListGenerator
|
|
597 |
|
|
598 |
!
|
|
599 |
|
|
600 |
selectorListGeneratorArray
|
|
601 |
self halt:'should not be invoked'.
|
|
602 |
!
|
|
603 |
|
|
604 |
selectorListGeneratorArrayAt:index
|
|
605 |
|holder|
|
|
606 |
|
|
607 |
selectorListGeneratorArray isNil ifTrue:[
|
|
608 |
selectorListGeneratorArray := OrderedCollection new
|
|
609 |
].
|
|
610 |
index > selectorListGeneratorArray size ifTrue:[
|
|
611 |
selectorListGeneratorArray grow:index
|
|
612 |
].
|
|
613 |
holder := selectorListGeneratorArray at:index.
|
|
614 |
holder isNil ifTrue:[
|
|
615 |
selectorListGeneratorArray at:index put:(holder := ValueHolder new)
|
|
616 |
].
|
|
617 |
^ holder.
|
|
618 |
!
|
|
619 |
|
|
620 |
sortBy
|
|
621 |
sortBy isNil ifTrue:[
|
|
622 |
sortBy := nil asValue.
|
|
623 |
].
|
|
624 |
^ sortBy
|
|
625 |
!
|
|
626 |
|
|
627 |
variableFilter
|
|
628 |
variableFilter isNil ifTrue:[
|
|
629 |
variableFilter := nil asValue.
|
|
630 |
].
|
|
631 |
^ variableFilter
|
|
632 |
|
|
633 |
"Created: / 24.2.2000 / 23:45:28 / cg"
|
|
634 |
! !
|
|
635 |
|
|
636 |
!NavigationState methodsFor:'aspects-kludges'!
|
|
637 |
|
|
638 |
metaToggle
|
|
639 |
metaToggle isNil ifTrue:[
|
|
640 |
metaToggle := PluggableAdaptor on:(self meta).
|
|
641 |
metaToggle
|
|
642 |
getBlock:[:m | m value == true]
|
|
643 |
putBlock:[:m :newValue | m value:(newValue ? false)]
|
|
644 |
updateBlock:[:m :aspect :param | true].
|
|
645 |
].
|
|
646 |
^ metaToggle
|
|
647 |
!
|
|
648 |
|
|
649 |
notMetaToggle
|
|
650 |
notMetaToggle isNil ifTrue:[
|
|
651 |
notMetaToggle := PluggableAdaptor on:(self meta).
|
|
652 |
notMetaToggle
|
|
653 |
getBlock:[:m | m value == false]
|
|
654 |
putBlock:[:m :newValue | m value:(newValue ? false) not]
|
|
655 |
updateBlock:[:m :aspect :param | true].
|
|
656 |
].
|
|
657 |
^ notMetaToggle
|
|
658 |
! !
|
|
659 |
|
|
660 |
!NavigationState methodsFor:'printing & storing'!
|
|
661 |
|
|
662 |
colorizeForModifiedBuffer:someString
|
|
663 |
^ someString asText emphasisAllAdd:(UserPreferences current emphasisForModifiedBuffer)
|
|
664 |
!
|
|
665 |
|
|
666 |
nameString
|
|
667 |
"a descriptive string of what this state shows"
|
|
668 |
|
|
669 |
|s|
|
|
670 |
|
|
671 |
s := self rawNameStringOrNil ? 'nothing selected'.
|
|
672 |
|
|
673 |
(realModifiedState == true) ifTrue:[
|
|
674 |
^ self colorizeForModifiedBuffer:s string
|
|
675 |
].
|
|
676 |
^ s
|
|
677 |
!
|
|
678 |
|
|
679 |
nameStringOrNil
|
|
680 |
"a descriptive string of what this state shows"
|
|
681 |
|
|
682 |
|s "codeView"|
|
|
683 |
|
|
684 |
s := self rawNameStringOrNil.
|
|
685 |
s notNil ifTrue:[
|
|
686 |
realModifiedState == true
|
|
687 |
"/ ((codeView := self codeView) notNil
|
|
688 |
"/ and:[codeView modified])
|
|
689 |
ifTrue:[
|
|
690 |
^ self colorizeForModifiedBuffer:s string
|
|
691 |
].
|
|
692 |
].
|
|
693 |
^ s
|
|
694 |
!
|
|
695 |
|
|
696 |
rawNameStringForCategory
|
|
697 |
|categories theCategory|
|
|
698 |
|
|
699 |
categories := self selectedCategories value.
|
|
700 |
categories size == 1 ifTrue:[
|
|
701 |
theCategory := categories first.
|
|
702 |
theCategory notNil ifTrue:[
|
|
703 |
^ theCategory string, ' [Category]'
|
|
704 |
].
|
|
705 |
].
|
|
706 |
^ nil
|
|
707 |
|
|
708 |
"Created: / 18.8.2000 / 19:42:42 / cg"
|
|
709 |
!
|
|
710 |
|
|
711 |
rawNameStringForNameSpace
|
|
712 |
|namespaces theNamespace nsName s|
|
|
713 |
|
|
714 |
namespaces := self selectedNamespaces value.
|
|
715 |
namespaces size == 1 ifTrue:[
|
|
716 |
theNamespace := namespaces first
|
|
717 |
].
|
|
718 |
theNamespace notNil ifTrue:[
|
|
719 |
theNamespace isNameSpace ifTrue:[
|
|
720 |
nsName := theNamespace name
|
|
721 |
] ifFalse:[
|
|
722 |
nsName := theNamespace
|
|
723 |
].
|
|
724 |
s := nsName , ' [NameSpace]'.
|
|
725 |
(self isNameSpaceBrowser or:[self isNameSpaceFullBrowser]) ifTrue:[
|
|
726 |
^ LabelAndIcon icon:(NewSystemBrowser nameSpaceIcon) string:s.
|
|
727 |
].
|
|
728 |
^ s
|
|
729 |
].
|
|
730 |
^ nil
|
|
731 |
|
|
732 |
"Created: / 18.8.2000 / 20:15:02 / cg"
|
|
733 |
!
|
|
734 |
|
|
735 |
rawNameStringForProject
|
|
736 |
|projects theProject s|
|
|
737 |
|
|
738 |
projects := self selectedProjects value.
|
|
739 |
projects size == 1 ifTrue:[
|
|
740 |
theProject := projects first
|
|
741 |
].
|
|
742 |
theProject notNil ifTrue:[
|
|
743 |
s := theProject , ' [Project]'.
|
|
744 |
(self isProjectBrowser or:[self isProjectFullBrowser]) ifTrue:[
|
|
745 |
^ LabelAndIcon icon:(NewSystemBrowser packageIcon) string:s.
|
|
746 |
].
|
|
747 |
^ s
|
|
748 |
].
|
|
749 |
^ nil
|
|
750 |
|
|
751 |
"Created: / 18.8.2000 / 20:18:34 / cg"
|
|
752 |
!
|
|
753 |
|
|
754 |
rawNameStringOrNil
|
|
755 |
"a descriptive string of what this state shows; nil, if nothing is selected"
|
|
756 |
|
|
757 |
^ self rawNameStringOrNilWantShort:false
|
|
758 |
!
|
|
759 |
|
|
760 |
rawNameStringOrNilWantShort:shortName
|
|
761 |
"a descriptive string of what this state shows; nil, if nothing is selected"
|
|
762 |
|
|
763 |
|lbl nr numClasses numMethods numCategories cats classes theClass
|
|
764 |
"protocols theProtocol"
|
|
765 |
methods theSingleMethod projects theProject longName nm methodName suffix cls|
|
|
766 |
|
|
767 |
browserLabel notNil ifTrue:[
|
|
768 |
"/ add the number of selected methods
|
|
769 |
((canvasType == #singleFullProtocolBrowserSpec)
|
|
770 |
or:[canvasType == #methodListBrowserSpec]) ifTrue:[
|
|
771 |
nr := self selectedMethods value size.
|
|
772 |
nr > 5 ifTrue:[
|
|
773 |
^ browserLabel string , ' - ' , nr printString , ' methods'
|
|
774 |
].
|
|
775 |
].
|
|
776 |
^ browserLabel
|
|
777 |
].
|
|
778 |
|
|
779 |
suffix := ''.
|
|
780 |
|
|
781 |
self isProtocolOrFullProtocolBrowser ifTrue:[
|
|
782 |
lbl := self rawNameStringForProject.
|
|
783 |
lbl notNil ifTrue:[^ lbl].
|
|
784 |
suffix := ' [Protocol]'.
|
|
785 |
].
|
|
786 |
|
|
787 |
self isCategoryBrowser ifTrue:[
|
|
788 |
lbl := self rawNameStringForCategory.
|
|
789 |
lbl notNil ifTrue:[^ lbl].
|
|
790 |
suffix := ' [Category]'.
|
|
791 |
].
|
|
792 |
|
|
793 |
self isNameSpaceBrowser ifTrue:[
|
|
794 |
lbl := self rawNameStringForNameSpace.
|
|
795 |
lbl notNil ifTrue:[^ lbl].
|
|
796 |
suffix := ' [NameSpace]'.
|
|
797 |
].
|
|
798 |
|
|
799 |
self isProjectBrowser ifTrue:[
|
|
800 |
projects := self selectedProjects value.
|
|
801 |
projects size == 1 ifTrue:[
|
|
802 |
theProject := projects first
|
|
803 |
].
|
|
804 |
suffix := ' [Project]'.
|
|
805 |
theProject notNil ifTrue:[
|
|
806 |
^ theProject , suffix
|
|
807 |
]
|
|
808 |
].
|
|
809 |
|
|
810 |
classes := self selectedClasses value.
|
|
811 |
classes size == 1 ifTrue:[
|
|
812 |
theClass := classes first.
|
|
813 |
theClass notNil ifTrue:[
|
|
814 |
theClass := theClass theNonMetaclass
|
|
815 |
]
|
|
816 |
].
|
|
817 |
|
|
818 |
self isClassBrowser ifTrue:[
|
|
819 |
suffix := ' [Class]'.
|
|
820 |
theClass notNil ifTrue:[
|
|
821 |
^ theClass name , suffix
|
|
822 |
]
|
|
823 |
].
|
|
824 |
|
|
825 |
"/ protocols := self selectedProtocols value.
|
|
826 |
"/ protocols size == 1 ifTrue:[
|
|
827 |
"/ theProtocol := protocols first
|
|
828 |
"/ ].
|
|
829 |
|
|
830 |
methods := self selectedMethods value.
|
|
831 |
methods size == 1 ifTrue:[
|
|
832 |
theSingleMethod := methods first
|
|
833 |
].
|
|
834 |
|
|
835 |
theSingleMethod notNil ifTrue:[
|
|
836 |
methodName := theSingleMethod selector.
|
|
837 |
theSingleMethod isJavaMethod ifTrue:[
|
|
838 |
methodName := theSingleMethod printStringForBrowserWithSelector:methodName.
|
|
839 |
].
|
|
840 |
].
|
|
841 |
|
|
842 |
self isMethodBrowser ifTrue:[
|
|
843 |
suffix := ' [Selector]'.
|
|
844 |
|
|
845 |
theSingleMethod notNil ifTrue:[
|
|
846 |
theSingleMethod mclass isNil ifTrue:[
|
|
847 |
^ '???'
|
|
848 |
].
|
|
849 |
^ theSingleMethod mclass name , ' ' , methodName , suffix
|
|
850 |
]
|
|
851 |
].
|
|
852 |
|
|
853 |
self isCategoryBrowser ifTrue:[
|
|
854 |
suffix := ' [Category]'.
|
|
855 |
] ifFalse:[
|
|
856 |
self isFullClassSourceBrowser ifTrue:[
|
|
857 |
suffix := ' [Full]'.
|
|
858 |
] ifFalse:[
|
|
859 |
self isClassDocumentationBrowser ifTrue:[
|
|
860 |
suffix := ' [Doc]'.
|
|
861 |
] ifFalse:[
|
|
862 |
self isProjectBrowser ifTrue:[
|
|
863 |
suffix := ' [Project]'.
|
|
864 |
]
|
|
865 |
]
|
|
866 |
]
|
|
867 |
].
|
|
868 |
|
|
869 |
nm := nil.
|
|
870 |
(numClasses := classes size) > 0 ifTrue:[
|
|
871 |
numClasses > 1 ifTrue:[
|
|
872 |
methods size > 0 ifTrue:[
|
|
873 |
theSingleMethod notNil ifTrue:[
|
|
874 |
cls := theSingleMethod mclass.
|
|
875 |
cls isNil ifTrue:[
|
|
876 |
"/ oops - unbound
|
|
877 |
nm := '???'
|
|
878 |
] ifFalse:[
|
|
879 |
longName := nm := cls nameInBrowser.
|
|
880 |
shortName ifTrue:[
|
|
881 |
nm := cls nameWithoutPrefix.
|
|
882 |
cls isPrivate ifTrue:[
|
|
883 |
nm := ':' , nm
|
|
884 |
]
|
|
885 |
].
|
|
886 |
].
|
|
887 |
nm := nm , ' ', (methodName ? '???')
|
|
888 |
] ifFalse:[
|
|
889 |
nm := methods size printString , ' methods'.
|
|
890 |
numClasses := (methods collect:[:each | each mclass]) asIdentitySet size.
|
|
891 |
numClasses > 1 ifTrue:[
|
|
892 |
nm := nm , ' in ' , numClasses printString , ' classes'.
|
|
893 |
].
|
|
894 |
].
|
|
895 |
^ nm , suffix.
|
|
896 |
].
|
|
897 |
|
|
898 |
nm := numClasses printString , ' classes in '.
|
|
899 |
"/ cats := self selectedCategories value
|
|
900 |
cats := (classes collect:[:each | each category]) asSet.
|
|
901 |
(numCategories := cats size) == 1 ifTrue:[
|
|
902 |
nm := nm , cats first
|
|
903 |
] ifFalse:[
|
|
904 |
nm := nm , numCategories printString , ' categories'
|
|
905 |
]
|
|
906 |
] ifFalse:[
|
|
907 |
cls := theClass theNonMetaclass.
|
|
908 |
longName := nm := cls nameInBrowser.
|
|
909 |
shortName ifTrue:[
|
|
910 |
nm := cls nameWithoutPrefix.
|
|
911 |
cls isPrivate ifTrue:[
|
|
912 |
nm := ':' , nm
|
|
913 |
]
|
|
914 |
].
|
|
915 |
methods := self selectedMethods value.
|
|
916 |
(numMethods := methods size) > 0 ifTrue:[
|
|
917 |
numMethods == 1 ifTrue:[
|
|
918 |
theSingleMethod := methods first.
|
|
919 |
nm := nm , ' ', (methodName ? '???')
|
|
920 |
] ifFalse:[
|
|
921 |
nm := numMethods printString , ' methods in ' , nm
|
|
922 |
]
|
|
923 |
]
|
|
924 |
]
|
|
925 |
] ifFalse:[
|
|
926 |
(self isNameSpaceBrowser
|
|
927 |
or:[self isNameSpaceFullBrowser
|
|
928 |
or:[organizerMode value == #namespace]]) ifTrue:[
|
|
929 |
lbl := self rawNameStringForNameSpace.
|
|
930 |
lbl notNil ifTrue:[^ lbl].
|
|
931 |
suffix := ' [NameSpace]'.
|
|
932 |
] ifFalse:[
|
|
933 |
(self isProjectBrowser
|
|
934 |
or:[self isProjectFullBrowser
|
|
935 |
or:[organizerMode value == #project]]) ifTrue:[
|
|
936 |
lbl := self rawNameStringForProject.
|
|
937 |
lbl notNil ifTrue:[^ lbl].
|
|
938 |
suffix := ' [Project]'.
|
|
939 |
] ifFalse:[
|
|
940 |
cats := self selectedCategories value.
|
|
941 |
cats size == 1 ifTrue:[
|
|
942 |
nm := cats first string
|
|
943 |
]
|
|
944 |
]
|
|
945 |
].
|
|
946 |
].
|
|
947 |
nm isNil ifTrue:[ ^ nil ].
|
|
948 |
^ nm , suffix.
|
|
949 |
|
|
950 |
"Created: / 11.2.2000 / 13:32:16 / cg"
|
|
951 |
"Modified: / 18.8.2000 / 21:06:35 / cg"
|
|
952 |
!
|
|
953 |
|
|
954 |
shortNameString
|
|
955 |
"a descriptive string of what this state shows"
|
|
956 |
|
|
957 |
|s|
|
|
958 |
|
|
959 |
s := (self rawNameStringOrNilWantShort:true) ? 'nothing selected'.
|
|
960 |
|
|
961 |
(realModifiedState == true) ifTrue:[
|
|
962 |
^ self colorizeForModifiedBuffer:s string
|
|
963 |
].
|
|
964 |
^ s
|
|
965 |
! !
|
|
966 |
|
|
967 |
!NavigationState methodsFor:'queries'!
|
|
968 |
|
|
969 |
isCategoryBrowser
|
|
970 |
^ canvasType == #categoryBrowserSpec
|
|
971 |
or:[ canvasType == #singleCategoryBrowserSpec
|
|
972 |
or:[ canvasType == #multipleCategoryBrowserSpec ]]
|
|
973 |
|
|
974 |
"Modified: / 25.2.2000 / 01:17:02 / cg"
|
|
975 |
!
|
|
976 |
|
|
977 |
isChainBrowser
|
|
978 |
^ canvasType == #chainBrowserSpec
|
|
979 |
!
|
|
980 |
|
|
981 |
isCheckOutputBrowser
|
|
982 |
^ canvasType == #multipleClassWithInfoAndMethodWithInfoBrowserSpec
|
|
983 |
or:[canvasType == #multipleMethodWithInfoBrowserSpec
|
|
984 |
or:[canvasType == #multipleClassWithInfoBrowserSpec]]
|
|
985 |
!
|
|
986 |
|
|
987 |
isClassBrowser
|
|
988 |
^ canvasType == #classBrowserSpec
|
|
989 |
or:[ canvasType == #singleClassBrowserSpec
|
|
990 |
or:[ canvasType == #multipleClassBrowserSpec ]]
|
|
991 |
|
|
992 |
"Modified: / 25.2.2000 / 00:38:07 / cg"
|
|
993 |
!
|
|
994 |
|
|
995 |
isClassDocumentationBrowser
|
|
996 |
^ canvasType == #classDocumentationBrowserSpec
|
|
997 |
|
|
998 |
"Created: / 24.2.2000 / 14:54:40 / cg"
|
|
999 |
!
|
|
1000 |
|
|
1001 |
isFullBrowser
|
|
1002 |
^ canvasType == #fullBrowserSpec
|
|
1003 |
!
|
|
1004 |
|
|
1005 |
isFullClassSourceBrowser
|
|
1006 |
^ canvasType == #fullClassSourceBrowserSpec
|
|
1007 |
|
|
1008 |
"Created: / 24.2.2000 / 14:54:40 / cg"
|
|
1009 |
!
|
|
1010 |
|
|
1011 |
isFullProtocolBrowser
|
|
1012 |
^ canvasType == #singleFullProtocolBrowserSpec
|
|
1013 |
or:[ canvasType == #multipleFullProtocolBrowserSpec ]
|
|
1014 |
|
|
1015 |
"Created: / 24.2.2000 / 21:32:09 / cg"
|
|
1016 |
"Modified: / 25.2.2000 / 03:11:00 / cg"
|
|
1017 |
!
|
|
1018 |
|
|
1019 |
isMethodBrowser
|
|
1020 |
^ canvasType == #methodListBrowserSpec
|
|
1021 |
or:[ canvasType == #singleMethodBrowserSpec
|
|
1022 |
or:[ canvasType == #multipleMethodBrowserSpec
|
|
1023 |
or:[ canvasType == #multipleMethodWithInfoBrowserSpec ]]]
|
|
1024 |
|
|
1025 |
"Modified: / 1.3.2000 / 13:35:12 / cg"
|
|
1026 |
!
|
|
1027 |
|
|
1028 |
isMethodListBrowser
|
|
1029 |
^ canvasType == #methodListBrowserSpec
|
|
1030 |
or:[canvasType == #multipleMethodBrowserSpec]
|
|
1031 |
!
|
|
1032 |
|
|
1033 |
isNameSpaceBrowser
|
|
1034 |
^ canvasType == #singleNameSpaceBrowserSpec
|
|
1035 |
or:[ canvasType == #multipleNameSpaceBrowserSpec]
|
|
1036 |
|
|
1037 |
"Modified: / 18.8.2000 / 16:12:34 / cg"
|
|
1038 |
!
|
|
1039 |
|
|
1040 |
isNameSpaceFullBrowser
|
|
1041 |
^ canvasType == #singleNameSpaceFullBrowserSpec
|
|
1042 |
or:[ canvasType == #multipleNameSpaceFullBrowserSpec ]
|
|
1043 |
|
|
1044 |
"Created: / 18.8.2000 / 14:58:36 / cg"
|
|
1045 |
!
|
|
1046 |
|
|
1047 |
isProjectBrowser
|
|
1048 |
^ canvasType == #singleProjectBrowserSpec
|
|
1049 |
or:[ canvasType == #multipleProjectBrowserSpec ]
|
|
1050 |
|
|
1051 |
"Created: / 24.2.2000 / 21:32:09 / cg"
|
|
1052 |
"Modified: / 25.2.2000 / 03:11:00 / cg"
|
|
1053 |
!
|
|
1054 |
|
|
1055 |
isProjectFullBrowser
|
|
1056 |
^ canvasType == #singleProjectFullBrowserSpec
|
|
1057 |
or:[ canvasType == #multipleProjectFullBrowserSpec ]
|
|
1058 |
|
|
1059 |
"Created: / 18.8.2000 / 19:02:49 / cg"
|
|
1060 |
!
|
|
1061 |
|
|
1062 |
isProtocolBrowser
|
|
1063 |
^ canvasType == #singleProtocolBrowserSpec
|
|
1064 |
or:[ canvasType == #multipleProtocolBrowserSpec ]
|
|
1065 |
|
|
1066 |
"Created: / 24.2.2000 / 21:32:09 / cg"
|
|
1067 |
"Modified: / 25.2.2000 / 03:11:00 / cg"
|
|
1068 |
!
|
|
1069 |
|
|
1070 |
isProtocolOrFullProtocolBrowser
|
|
1071 |
^ self isProtocolBrowser
|
|
1072 |
or:[ self isFullProtocolBrowser ]
|
|
1073 |
!
|
|
1074 |
|
|
1075 |
isSingleCategoryBrowser
|
|
1076 |
^ canvasType == #singleCategoryBrowserSpec
|
|
1077 |
!
|
|
1078 |
|
|
1079 |
isSingleClassBrowser
|
|
1080 |
^ canvasType == #singleClassBrowserSpec
|
|
1081 |
!
|
|
1082 |
|
|
1083 |
isSingleFullProtocolBrowser
|
|
1084 |
^ canvasType == #singleFullProtocolBrowserSpec
|
|
1085 |
!
|
|
1086 |
|
|
1087 |
isSingleMethodBrowser
|
|
1088 |
^ canvasType == #singleMethodBrowserSpec
|
|
1089 |
|
|
1090 |
"Created: / 1.3.2000 / 13:35:52 / cg"
|
|
1091 |
!
|
|
1092 |
|
|
1093 |
isSingleNamespaceBrowser
|
|
1094 |
^ canvasType == #singleNameSpaceBrowserSpec
|
|
1095 |
!
|
|
1096 |
|
|
1097 |
isSingleNamespaceFullBrowser
|
|
1098 |
^ canvasType == #singleNameSpaceFullBrowserSpec
|
|
1099 |
!
|
|
1100 |
|
|
1101 |
isSingleProjectBrowser
|
|
1102 |
^ canvasType == #singleProjectBrowserSpec
|
|
1103 |
|
|
1104 |
"Created: / 24.2.2000 / 21:32:09 / cg"
|
|
1105 |
"Modified: / 25.2.2000 / 03:11:00 / cg"
|
|
1106 |
!
|
|
1107 |
|
|
1108 |
isSingleProjectFullBrowser
|
|
1109 |
^ canvasType == #singleProjectFullBrowserSpec
|
|
1110 |
|
|
1111 |
"Created: / 24.2.2000 / 21:32:09 / cg"
|
|
1112 |
"Modified: / 25.2.2000 / 03:11:00 / cg"
|
|
1113 |
!
|
|
1114 |
|
|
1115 |
isSingleProtocolBrowser
|
|
1116 |
^ canvasType == #singleProtocolBrowserSpec
|
|
1117 |
!
|
|
1118 |
|
|
1119 |
isVersionDiffBrowser
|
|
1120 |
^ canvasType == #multipleClassRepositoryDiffBrowserSpec
|
|
1121 |
! !
|
|
1122 |
|
|
1123 |
!NavigationState class methodsFor:'documentation'!
|
|
1124 |
|
|
1125 |
version
|
|
1126 |
^ '$Header: /cvs/stx/stx/libtool/Tools_NavigationState.st,v 1.1 2004-02-26 18:56:57 cg Exp $'
|
|
1127 |
! !
|