author | Claus Gittinger <cg@exept.de> |
Sat, 13 Jul 2019 16:02:10 +0200 | |
changeset 18898 | e786d72d82ef |
parent 18850 | 3158de790f36 |
child 19155 | 3fcbcd01f41d |
permissions | -rw-r--r-- |
18571 | 1 |
"{ Encoding: utf8 }" |
2 |
||
14138 | 3 |
" |
4 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libtool' }" |
|
15 |
||
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
Object subclass:#NavigationState |
|
19 |
instanceVariableNames:'browserLabel codeModifiedHolder categoryList classList |
|
20 |
packageFilter nameSpaceFilter hidePrivateClasses canvasType |
|
21 |
notMetaToggle metaToggle metaToggleLabel organizerMode codeAspect |
|
22 |
codeHolder classDocumentationHolder canvas selectorListGenerator |
|
23 |
protocolListGenerator classListPerNameSpaceGenerator |
|
24 |
classListGenerator categoryListGenerator nameSpaceListGenerator |
|
25 |
projectListGenerator classHierarchyTopClass meta selectedMethods |
|
26 |
selectedProtocols selectedClasses selectedCategories |
|
27 |
selectedProjects selectedNamespaces selectedLintRules |
|
28 |
variableFilter filterClassVars sortBy noAllItem autoSearchPattern |
|
16469 | 29 |
autoSearchIgnoreCase autoSearchIsMatch autoSearchAction |
30 |
realModifiedStateHolder methodInfo versionDiffApplication |
|
31 |
selectorListGeneratorArray selectedMethodsArray infoLabelHolder |
|
32 |
packageLabelHolder cursorLineLabelHolder cursorColLabelHolder |
|
33 |
modeLabelHolder sortVariablesBy editModeHolder scrollableCodeView |
|
34 |
specialEditors selectedEditorNoteBookTabIndexHolder |
|
35 |
editorNoteBookListHolder editorNoteBookCanvasHolder codeView |
|
36 |
stringSearchToolView noteBookView inheritanceView |
|
37 |
documentationView languageHolder messageSpecHolder messageHolder |
|
38 |
progressHolder tabContentView messagePaneView |
|
39 |
codePaneAndPluginView codePaneAndPluginViewRelativeCorners |
|
40 |
pluginVisibleHolder bookmarkHolder worker |
|
41 |
packageInfoBackgroundColorHolder packageInfoButton |
|
42 |
showMethodTemplate lastMethodShownInCodeView showingParseError |
|
43 |
navigationHistory lintRuleListGenerator profilerStatistics |
|
18847 | 44 |
inlineMessageApplication editModeAutoIndentHolder' |
14138 | 45 |
classVariableNames:'CodeAspectTranslations' |
46 |
poolDictionaries:'' |
|
47 |
category:'Interface-Browsers-New' |
|
48 |
! |
|
49 |
||
50 |
!NavigationState class methodsFor:'documentation'! |
|
51 |
||
52 |
copyright |
|
53 |
" |
|
54 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
55 |
All Rights Reserved |
|
56 |
||
57 |
This software is furnished under a license and may be used |
|
58 |
only in accordance with the terms of that license and with the |
|
59 |
inclusion of the above copyright notice. This software may not |
|
60 |
be provided or otherwise made available to, or used by, any |
|
61 |
other person. No title to or ownership of the software is |
|
62 |
hereby transferred. |
|
63 |
" |
|
18847 | 64 |
! |
65 |
||
66 |
documentation |
|
67 |
" |
|
68 |
documentation to be added. |
|
69 |
||
70 |
class: |
|
71 |
<a short class summary here, describing what instances represent> |
|
72 |
||
73 |
responsibilities: |
|
74 |
<describing what my main role is> |
|
75 |
||
76 |
collaborators: |
|
77 |
<describing with whom and how I talk to> |
|
78 |
||
79 |
API: |
|
80 |
<public api and main messages> |
|
81 |
||
82 |
example: |
|
83 |
<a one-line examples on how to use - can also be in a separate example method> |
|
84 |
||
85 |
implementation: |
|
86 |
<implementation points> |
|
87 |
||
88 |
[author:] |
|
89 |
Claus Gittinger |
|
90 |
||
91 |
[instance variables:] |
|
92 |
||
93 |
[class variables:] |
|
94 |
||
95 |
[see also:] |
|
96 |
||
97 |
" |
|
14138 | 98 |
! ! |
99 |
||
100 |
!NavigationState class methodsFor:'initialization'! |
|
101 |
||
102 |
initialize |
|
103 |
"Invoked at system start or when the class is dynamically loaded." |
|
104 |
||
105 |
"/ please change as required (and remove this comment) |
|
106 |
||
107 |
CodeAspectTranslations := Dictionary new. |
|
108 |
CodeAspectTranslations at: #newApplication put: SyntaxHighlighter codeAspectClassDefinition. |
|
109 |
CodeAspectTranslations at: #newError put: SyntaxHighlighter codeAspectClassDefinition. |
|
110 |
||
111 |
||
112 |
"/ Add more... |
|
113 |
||
114 |
"Modified: / 23-10-2012 / 11:27:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
115 |
! ! |
|
116 |
||
117 |
!NavigationState methodsFor:'accessing'! |
|
118 |
||
119 |
autoSearchAction |
|
120 |
^ autoSearchAction |
|
121 |
! |
|
122 |
||
16469 | 123 |
autoSearchAction:aBlock |
124 |
"define an autosearch action (for semantic searches)" |
|
125 |
||
126 |
autoSearchAction := aBlock. |
|
14138 | 127 |
! |
128 |
||
129 |
autoSearchIgnoreCase |
|
16469 | 130 |
"return true if the autoSearch is case-insensitive" |
14138 | 131 |
|
132 |
^ autoSearchIgnoreCase |
|
133 |
! |
|
134 |
||
135 |
autoSearchIgnoreCase:aBoolean |
|
16469 | 136 |
"define the autoSearches case-insensitivenes" |
14138 | 137 |
|
138 |
autoSearchIgnoreCase := aBoolean |
|
139 |
! |
|
140 |
||
16469 | 141 |
autoSearchIsMatch |
142 |
"return true if the autoSearch is a match search" |
|
143 |
||
144 |
^ autoSearchIsMatch |
|
145 |
! |
|
146 |
||
147 |
autoSearchIsMatch:aBoolean |
|
148 |
"define the automatic search pattern matching behavior" |
|
149 |
||
150 |
autoSearchIsMatch := aBoolean. |
|
151 |
! |
|
152 |
||
14138 | 153 |
autoSearchPattern |
16469 | 154 |
"return the automatic search pattern. |
155 |
The codeView will search for this automatically, |
|
156 |
whenever the navigation is changing the shown method." |
|
14138 | 157 |
|
158 |
^ autoSearchPattern |
|
159 |
! |
|
160 |
||
16469 | 161 |
autoSearchPattern:aStringOrPattern |
162 |
"define the automatic search pattern. |
|
163 |
The codeView will search for this automatically, |
|
164 |
whenever the navigation is changing the shown method." |
|
165 |
||
166 |
autoSearchPattern := aStringOrPattern. |
|
167 |
! |
|
14138 | 168 |
|
16469 | 169 |
autoSearchPattern:aStringOrPattern ignoreCase:ignoreCaseBoolean match:isMatchBoolean |
170 |
"define the automatic search pattern. |
|
171 |
The codeView will search for this automatically, |
|
172 |
whenever the navigation is changing the shown method." |
|
173 |
||
174 |
autoSearchPattern := aStringOrPattern. |
|
175 |
autoSearchIsMatch := isMatchBoolean. |
|
176 |
autoSearchIgnoreCase := ignoreCaseBoolean. |
|
14138 | 177 |
! |
178 |
||
179 |
browserLabel |
|
180 |
"return the assigned state-label (to be shown in the tab)." |
|
181 |
||
182 |
^ browserLabel |
|
183 |
! |
|
184 |
||
185 |
browserLabel:aString |
|
186 |
"set the assigned state-label (to be shown in the tab)." |
|
187 |
||
188 |
browserLabel := aString |
|
189 |
! |
|
190 |
||
191 |
canvas |
|
192 |
^ canvas |
|
193 |
! |
|
194 |
||
195 |
canvas:something |
|
196 |
canvas := something. |
|
197 |
canvasType isNil ifTrue:[ |
|
198 |
canvasType := something spec |
|
199 |
]. |
|
200 |
! |
|
201 |
||
202 |
canvasType |
|
203 |
"return the type of canvas" |
|
204 |
||
205 |
^ canvasType |
|
206 |
! |
|
207 |
||
208 |
canvasType:aSpecSymbol |
|
209 |
"set the type of canvas" |
|
210 |
||
211 |
canvasType notNil ifTrue:[ |
|
212 |
canvasType ~~ aSpecSymbol ifTrue:[ |
|
213 |
self halt:'cannot be changed, once set'. |
|
16561 | 214 |
^ self. |
14138 | 215 |
] |
216 |
]. |
|
217 |
canvasType := aSpecSymbol |
|
218 |
! |
|
219 |
||
220 |
codeAspect |
|
221 |
"return the codeAspect; a symbol describing what is shown in the codeView" |
|
222 |
||
223 |
^ codeAspect |
|
224 |
||
225 |
"Created: / 11.2.2000 / 12:43:29 / cg" |
|
226 |
! |
|
227 |
||
228 |
codeAspect:aSymbolOrNil |
|
229 |
"set the codeAspect; a symbol describing what is shown in the codeView" |
|
230 |
||
231 |
codeAspect := aSymbolOrNil. |
|
232 |
(codeView notNil and:[codeView isCodeView2]) ifTrue:[ |
|
233 |
| xlatedCodeAspect | |
|
234 |
||
16896 | 235 |
xlatedCodeAspect := CodeAspectTranslations at: aSymbolOrNil ifAbsent:[aSymbolOrNil]. |
14138 | 236 |
codeView codeAspect: xlatedCodeAspect |
237 |
]. |
|
238 |
||
239 |
"Created: / 11-02-2000 / 12:43:45 / cg" |
|
240 |
"Modified: / 22-10-2012 / 17:05:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
241 |
! |
|
242 |
||
243 |
codePaneAndPluginView |
|
244 |
^ codePaneAndPluginView |
|
245 |
! |
|
246 |
||
247 |
codePaneAndPluginView:something |
|
248 |
codePaneAndPluginView := something. |
|
249 |
! |
|
250 |
||
251 |
codePaneAndPluginViewRelativeCorners |
|
252 |
codePaneAndPluginViewRelativeCorners ifNil:[ |
|
253 |
codePaneAndPluginViewRelativeCorners := #(0.76 1.0) |
|
254 |
]. |
|
255 |
^ codePaneAndPluginViewRelativeCorners |
|
256 |
||
257 |
"Modified: / 04-10-2010 / 08:20:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
258 |
! |
|
259 |
||
260 |
codePaneAndPluginViewRelativeCorners: anArray |
|
261 |
||
262 |
codePaneAndPluginViewRelativeCorners := anArray. |
|
263 |
||
264 |
"Modified: / 04-10-2010 / 08:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
265 |
! |
|
266 |
||
267 |
editorNoteBookCanvasHolder |
|
268 |
editorNoteBookCanvasHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
269 |
editorNoteBookCanvasHolder := ValueHolder with:nil. |
14138 | 270 |
]. |
271 |
^ editorNoteBookCanvasHolder |
|
272 |
! |
|
273 |
||
274 |
editorNoteBookListHolder |
|
275 |
editorNoteBookListHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
276 |
editorNoteBookListHolder := ValueHolder with:#(). |
14138 | 277 |
]. |
278 |
^ editorNoteBookListHolder |
|
279 |
! |
|
280 |
||
281 |
environment |
|
282 |
^ Smalltalk |
|
283 |
! |
|
284 |
||
285 |
lastMethodShownInCodeView |
|
286 |
^ lastMethodShownInCodeView |
|
287 |
! |
|
288 |
||
289 |
lastMethodShownInCodeView:something |
|
290 |
lastMethodShownInCodeView := something. |
|
291 |
! |
|
292 |
||
293 |
messagePaneView |
|
294 |
^ messagePaneView |
|
295 |
! |
|
296 |
||
297 |
messagePaneView:something |
|
298 |
messagePaneView := something. |
|
299 |
! |
|
300 |
||
301 |
modified |
|
302 |
"check for modified code by asking the editTextView; |
|
303 |
this one returns true if ever modified - even if |
|
304 |
the modifications where undone in the editor |
|
305 |
(i.e. not really modified). |
|
306 |
Use #reallyModified if the contents should be compared |
|
307 |
against the original contents" |
|
308 |
||
309 |
|v| |
|
310 |
||
311 |
self realModifiedState == true ifTrue:[^ true]. |
|
312 |
self anySpecialEditorModified ifTrue:[^ true]. |
|
313 |
||
314 |
^ (v := self codeView) notNil and:[v modified] |
|
315 |
! |
|
316 |
||
317 |
modified:aBoolean |
|
318 |
|codeView| |
|
319 |
||
320 |
(codeView := self codeView) notNil ifTrue:[ |
|
321 |
codeView modified:aBoolean |
|
322 |
]. |
|
323 |
specialEditors notNil ifTrue:[ |
|
324 |
specialEditors do:[:anEditor | |
|
325 |
anEditor application modified:aBoolean |
|
326 |
]. |
|
327 |
]. |
|
328 |
! |
|
329 |
||
330 |
noteBookView |
|
331 |
^ noteBookView |
|
332 |
! |
|
333 |
||
334 |
noteBookView:something |
|
335 |
noteBookView := something. |
|
336 |
! |
|
337 |
||
338 |
realModifiedState |
|
339 |
^ self realModifiedStateHolder value |
|
340 |
! |
|
341 |
||
342 |
realModifiedState:aBoolean |
|
343 |
self realModifiedStateHolder value:aBoolean |
|
344 |
! |
|
345 |
||
346 |
realModifiedStateHolder |
|
347 |
realModifiedStateHolder isNil ifTrue:[ |
|
348 |
realModifiedStateHolder := ValueHolder new. |
|
349 |
]. |
|
350 |
^ realModifiedStateHolder |
|
351 |
! |
|
352 |
||
353 |
selectedEditorNoteBookTabIndexHolder |
|
354 |
selectedEditorNoteBookTabIndexHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
355 |
selectedEditorNoteBookTabIndexHolder := ValueHolder with:1. |
14138 | 356 |
]. |
357 |
^ selectedEditorNoteBookTabIndexHolder |
|
358 |
! |
|
359 |
||
360 |
showMethodTemplate |
|
361 |
^ showMethodTemplate ? true |
|
362 |
||
363 |
"Created: / 12-02-2012 / 08:49:32 / cg" |
|
364 |
! |
|
365 |
||
366 |
showMethodTemplate: aBoolean |
|
367 |
showMethodTemplate := aBoolean |
|
368 |
||
369 |
"Created: / 12-02-2012 / 08:49:45 / cg" |
|
370 |
! |
|
371 |
||
372 |
showingParseError |
|
373 |
^ showingParseError |
|
374 |
! |
|
375 |
||
376 |
showingParseError:something |
|
377 |
showingParseError := something. |
|
378 |
! |
|
379 |
||
380 |
stringSearchToolView |
|
381 |
^ stringSearchToolView |
|
382 |
! |
|
383 |
||
384 |
stringSearchToolView: aStringSearchTool |
|
385 |
||
386 |
stringSearchToolView := aStringSearchTool |
|
387 |
! |
|
388 |
||
389 |
tabContentView |
|
390 |
^ tabContentView |
|
391 |
! |
|
392 |
||
393 |
tabContentView:something |
|
394 |
tabContentView := something. |
|
395 |
! |
|
396 |
||
397 |
worker |
|
398 |
^ worker |
|
399 |
! |
|
400 |
||
401 |
worker:aProcess |
|
402 |
worker := aProcess. |
|
403 |
! ! |
|
404 |
||
405 |
!NavigationState methodsFor:'accessing-selection'! |
|
406 |
||
407 |
theSingleSelectedClass |
|
408 |
"if only one class is selected, return it. |
|
409 |
Otherwise, return nil" |
|
410 |
||
411 |
|classes| |
|
412 |
||
413 |
classes := self selectedClasses value. |
|
414 |
classes size == 1 ifTrue:[ |
|
415 |
^ classes first |
|
416 |
]. |
|
417 |
^ nil |
|
418 |
! |
|
419 |
||
420 |
theSingleSelectedMethod |
|
421 |
"if only one method is selected, return it. |
|
422 |
Otherwise, return nil" |
|
423 |
||
424 |
|methods| |
|
425 |
||
426 |
methods := self selectedMethods value. |
|
427 |
methods size == 1 ifTrue:[ |
|
18571 | 428 |
"/ self assert:methods first isMethod. |
14138 | 429 |
^ methods first |
430 |
]. |
|
431 |
^ nil |
|
18571 | 432 |
|
433 |
"Modified: / 29-01-2019 / 18:24:56 / Claus Gittinger" |
|
14138 | 434 |
! ! |
435 |
||
436 |
!NavigationState methodsFor:'accessing-subApps'! |
|
437 |
||
438 |
applicationOfComponent:aComponentName |
|
439 |
^ self applicationOfComponent:aComponentName or:nil |
|
440 |
||
441 |
! |
|
442 |
||
443 |
applicationOfComponent:aComponentName or:anotherComponentName |
|
444 |
|builder view| |
|
445 |
||
446 |
canvas isNil ifTrue:[^ nil]. |
|
447 |
||
448 |
builder := canvas builder. |
|
449 |
||
450 |
view := builder findVisibleComponentAt:aComponentName. |
|
451 |
(view isNil and:[anotherComponentName notNil]) ifTrue:[ |
|
452 |
view := builder findVisibleComponentAt:anotherComponentName. |
|
453 |
]. |
|
454 |
||
455 |
view notNil ifTrue:[ |
|
456 |
^ view application |
|
457 |
]. |
|
458 |
^ nil |
|
459 |
! |
|
460 |
||
461 |
classCategoryListApplication |
|
462 |
^ self applicationOfComponent:#ClassCategoryList |
|
463 |
||
464 |
! |
|
465 |
||
466 |
classHierarchyListApplication |
|
467 |
^ self applicationOfComponent:#ClassHierarchyList |
|
468 |
! |
|
469 |
||
470 |
classListApplication |
|
471 |
^ self applicationOfComponent:#ClassList |
|
472 |
||
473 |
! |
|
474 |
||
14160
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
475 |
inlineMessageApplication |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
476 |
inlineMessageApplication isNil ifTrue:[ |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
477 |
inlineMessageApplication := Tools::InlineMessageDialog new |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
478 |
]. |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
479 |
^ inlineMessageApplication |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
480 |
|
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
481 |
"Created: / 25-03-2014 / 17:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
482 |
! |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
483 |
|
14138 | 484 |
metaToggleComponent |
485 |
^ canvas builder findComponentAt:#ClassToggle. |
|
486 |
! |
|
487 |
||
488 |
methodCategoryListApplication |
|
489 |
^ self applicationOfComponent:#MethodCategoryList |
|
490 |
! |
|
491 |
||
492 |
methodListApplication |
|
493 |
^ self applicationOfComponent:#MethodList |
|
494 |
! |
|
495 |
||
496 |
nameSpaceListApplication |
|
497 |
^ self applicationOfComponent:#NamespaceList or:#PseudoNamespaceList |
|
498 |
! |
|
499 |
||
500 |
projectListApplication |
|
501 |
^ self applicationOfComponent:#ProjectList or:#PseudoProjectList |
|
502 |
! |
|
503 |
||
504 |
variableListApplication |
|
505 |
^ self applicationOfComponent:#VariableList |
|
506 |
! |
|
507 |
||
508 |
versionDiffApplication |
|
509 |
^ versionDiffApplication |
|
510 |
||
511 |
! |
|
512 |
||
513 |
versionDiffApplication:anApplication |
|
514 |
versionDiffApplication := anApplication |
|
515 |
||
516 |
! ! |
|
517 |
||
518 |
!NavigationState methodsFor:'accessing-subViews'! |
|
519 |
||
520 |
anySpecialEditorModified |
|
521 |
specialEditors notNil ifTrue:[ |
|
522 |
^ specialEditors contains:[:anEditor | anEditor application isModified]. |
|
523 |
]. |
|
524 |
^ false |
|
525 |
! |
|
526 |
||
527 |
codeView |
|
528 |
codeView isNil ifTrue:[ |
|
529 |
codeView := self scrollableCodeView scrolledView |
|
530 |
]. |
|
531 |
^ codeView |
|
532 |
! |
|
533 |
||
534 |
doSaveInSpecialEditors |
|
535 |
specialEditors notNil ifTrue:[ |
|
536 |
specialEditors do:[:anEditor | |
|
537 |
anEditor application isModified ifTrue:[ |
|
538 |
anEditor application save. |
|
539 |
^ self. |
|
540 |
] |
|
541 |
]. |
|
542 |
]. |
|
543 |
! |
|
544 |
||
545 |
documentationView |
|
546 |
|textView| |
|
547 |
||
548 |
documentationView isNil ifTrue:[ |
|
549 |
textView := CodeView new. |
|
550 |
documentationView := HVScrollableView forView:textView. |
|
551 |
]. |
|
552 |
^ documentationView |
|
553 |
! |
|
554 |
||
555 |
getCodeView |
|
556 |
^ codeView |
|
557 |
! |
|
558 |
||
559 |
inheritanceView |
|
560 |
inheritanceView isNil ifTrue:[ |
|
561 |
|classTreeView scrolledView| |
|
562 |
||
563 |
classTreeView := ClassTreeGraphView new. |
|
564 |
scrolledView := HVScrollableView forView:classTreeView. |
|
565 |
classTreeView middleButtonMenu:nil. |
|
566 |
inheritanceView := scrolledView |
|
567 |
]. |
|
568 |
^ inheritanceView |
|
569 |
! |
|
570 |
||
571 |
methodCategoryList: aView |
|
572 |
||
573 |
| builder | |
|
574 |
||
575 |
builder := canvas builder. |
|
576 |
builder namedComponents at: #MethodCategoryList put: aView. |
|
577 |
||
578 |
"Created: / 08-08-2011 / 09:18:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
579 |
! |
|
580 |
||
581 |
methodList: aView |
|
582 |
||
583 |
| builder | |
|
584 |
||
585 |
builder := canvas builder. |
|
586 |
builder namedComponents at: #MethodList put: aView. |
|
587 |
||
588 |
"Created: / 08-08-2011 / 15:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
589 |
! |
|
590 |
||
591 |
packageInfoButton |
|
592 |
^ packageInfoButton |
|
593 |
! |
|
594 |
||
595 |
packageInfoButton:something |
|
596 |
packageInfoButton := something. |
|
597 |
! |
|
598 |
||
599 |
scrollableCodeView |
|
600 |
scrollableCodeView isNil ifTrue:[ |
|
601 |
scrollableCodeView := self setUpScrollableCodeView. |
|
602 |
]. |
|
603 |
^ scrollableCodeView |
|
604 |
! |
|
605 |
||
606 |
setUpScrollableCodeView |
|
18067 | 607 |
|wrapperView newScrollableCodeView newCodeView | |
14138 | 608 |
|
609 |
(UserPreferences current useCodeView2In: #Browser) ifTrue:[ |
|
610 |
newCodeView := newScrollableCodeView := CodeView2 new. |
|
611 |
newCodeView mode: #method. |
|
612 |
newCodeView methodHolder: self theSingleSelectedMethodHolder. |
|
613 |
newCodeView classHolder: self theSingleSelectedClassHolder. |
|
614 |
] ifFalse:[ |
|
615 |
newScrollableCodeView := HVScrollableView for:CodeView. |
|
616 |
newCodeView := newScrollableCodeView scrolledView. |
|
617 |
newScrollableCodeView horizontalMini:true. |
|
618 |
]. |
|
619 |
||
620 |
newScrollableCodeView name:'CodeView'. |
|
621 |
newCodeView modifiedChannel:self codeModifiedHolder. |
|
622 |
newCodeView model:self codeHolder. |
|
623 |
newCodeView canTab:true. |
|
624 |
UserPreferences current useCodeView2InTools ifTrue:[ |
|
625 |
newCodeView |
|
626 |
classHolder:self theSingleSelectedClassFromMethodHolder; |
|
627 |
languageHolder:self languageHolder |
|
628 |
]. |
|
629 |
||
18067 | 630 |
UserPreferences current showAcceptCancelBarInBrowser ifTrue:[ |
631 |
(ViewWithAcceptAndCancelBar notNil |
|
632 |
and:[newCodeView isCodeView2 not |
|
633 |
or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
|
634 |
wrapperView := ViewWithAcceptAndCancelBar new. |
|
635 |
wrapperView slaveView:newScrollableCodeView. |
|
636 |
wrapperView reallyModifiedHolder:self realModifiedStateHolder. |
|
637 |
wrapperView cancelAction:[ |
|
14138 | 638 |
"/ codeView setClipboardText:(codeView contents). "/ for undo |
639 |
newCodeView device rememberInCopyBufferHistory:(newCodeView contents). "/ for undo |
|
640 |
newCodeView application |
|
641 |
delayedUpdateCodeWithAutoSearch:false checkModified:false. |
|
642 |
newCodeView requestFocus. |
|
643 |
]. |
|
18067 | 644 |
newScrollableCodeView := wrapperView. |
645 |
]. |
|
646 |
(wrapperView notNil or:[newCodeView isCodeView2]) ifTrue:[ |
|
647 |
newScrollableCodeView compareAction:[ |
|
14138 | 648 |
newCodeView application doCompareIn:self. |
649 |
newCodeView requestFocus |
|
650 |
]. |
|
18067 | 651 |
]. |
14138 | 652 |
]. |
653 |
||
654 |
^newScrollableCodeView |
|
655 |
||
656 |
"Modified: / 05-07-2011 / 10:34:33 / cg" |
|
657 |
"Modified: / 05-08-2011 / 09:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
18067 | 658 |
"Modified (format): / 27-04-2018 / 17:10:29 / stefan" |
14138 | 659 |
! |
660 |
||
661 |
specialEditorCanvasClassForResourceType:resourceTypeSymbol |
|
662 |
resourceTypeSymbol == #fileImage ifTrue:[ |
|
663 |
^ nil |
|
664 |
]. |
|
665 |
^ SystemBrowser resourceEditorClassFor:resourceTypeSymbol |
|
666 |
! |
|
667 |
||
668 |
specialEditorCanvasForResourceType:resourceTypeSymbol |
|
669 |
|appClass app editorView| |
|
670 |
||
671 |
specialEditors isNil ifTrue:[ |
|
672 |
specialEditors := Dictionary new. |
|
673 |
]. |
|
674 |
editorView := specialEditors at:resourceTypeSymbol ifAbsent:nil. |
|
675 |
editorView isNil ifTrue:[ |
|
676 |
appClass := self specialEditorCanvasClassForResourceType:resourceTypeSymbol. |
|
677 |
appClass notNil ifTrue:[ |
|
678 |
app := appClass new. |
|
679 |
app masterApplication:self canvas application. |
|
680 |
app isEmbeddedInBrowser:true. |
|
681 |
app infoLabelHolder:(self canvas application infoLabelHolder). |
|
682 |
||
683 |
editorView := ApplicationSubView new. |
|
684 |
editorView buildMenu:true. |
|
685 |
editorView client:app. |
|
686 |
app builder window:editorView. |
|
687 |
||
688 |
specialEditors at:resourceTypeSymbol put:editorView. |
|
689 |
]. |
|
690 |
]. |
|
691 |
^ editorView |
|
692 |
! ! |
|
693 |
||
694 |
!NavigationState methodsFor:'aspects'! |
|
695 |
||
696 |
bookmarkHolder |
|
697 |
"return/create the 'bookmarkHolder' value holder (automatically generated)" |
|
698 |
||
699 |
bookmarkHolder isNil ifTrue:[ |
|
700 |
bookmarkHolder := ValueHolder with: self theSingleSelectedBookmarkFromMethodOrClass. |
|
701 |
self selectedMethods onChangeSend: #updateBookmarkHolder to: self. |
|
702 |
self selectedClasses onChangeSend: #updateBookmarkHolder to: self. |
|
703 |
]. |
|
704 |
^ bookmarkHolder |
|
705 |
||
706 |
"Modified: / 03-06-2011 / 12:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
707 |
! |
|
708 |
||
709 |
categoryList |
|
710 |
categoryList isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
711 |
categoryList := ValueHolder with:nil. |
14138 | 712 |
]. |
713 |
^ categoryList |
|
714 |
||
715 |
"Modified: / 25.2.2000 / 01:35:42 / cg" |
|
716 |
"Created: / 25.2.2000 / 01:57:45 / cg" |
|
717 |
! |
|
718 |
||
719 |
categoryListGenerator |
|
720 |
categoryListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
721 |
categoryListGenerator := ValueHolder with:nil. |
14138 | 722 |
]. |
723 |
^ categoryListGenerator |
|
724 |
||
725 |
"Created: / 25.2.2000 / 01:34:30 / cg" |
|
726 |
"Modified: / 25.2.2000 / 01:35:42 / cg" |
|
727 |
! |
|
728 |
||
729 |
classDocumentationHolder |
|
730 |
classDocumentationHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
731 |
classDocumentationHolder := ValueHolder with:nil. |
14138 | 732 |
]. |
733 |
^ classDocumentationHolder |
|
734 |
! |
|
735 |
||
736 |
classHierarchyTopClass |
|
737 |
classHierarchyTopClass isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
738 |
classHierarchyTopClass := ValueHolder with:nil. |
14138 | 739 |
]. |
740 |
^ classHierarchyTopClass |
|
741 |
! |
|
742 |
||
743 |
classList |
|
744 |
classList isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
745 |
classList := ValueHolder with:nil. |
14138 | 746 |
]. |
747 |
^ classList |
|
748 |
||
749 |
"Created: / 25.2.2000 / 01:57:28 / cg" |
|
750 |
! |
|
751 |
||
752 |
classListGenerator |
|
753 |
classListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
754 |
classListGenerator := ValueHolder with:nil. |
14138 | 755 |
]. |
756 |
^ classListGenerator |
|
757 |
! |
|
758 |
||
759 |
classListPerNameSpaceGenerator |
|
760 |
classListPerNameSpaceGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
761 |
classListPerNameSpaceGenerator := ValueHolder with:nil. |
14138 | 762 |
]. |
763 |
^ classListPerNameSpaceGenerator |
|
764 |
||
765 |
"Created: / 18.8.2000 / 14:15:34 / cg" |
|
766 |
! |
|
767 |
||
768 |
codeHolder |
|
769 |
codeHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
770 |
codeHolder := ValueHolder with:nil. |
14138 | 771 |
]. |
772 |
^ codeHolder |
|
773 |
! |
|
774 |
||
775 |
codeModifiedHolder |
|
776 |
codeModifiedHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
777 |
codeModifiedHolder := ValueHolder with:false. |
14138 | 778 |
]. |
779 |
^ codeModifiedHolder |
|
780 |
! |
|
781 |
||
782 |
cursorColLabelHolder |
|
783 |
cursorColLabelHolder isNil ifTrue:[ |
|
784 |
"/ self codeView isNil ifTrue:[^ nil]. |
|
785 |
||
786 |
cursorColLabelHolder := BlockValue |
|
787 |
with:[:v | v printString] |
|
788 |
argument:self codeView cursorColHolder. |
|
789 |
]. |
|
790 |
^ cursorColLabelHolder |
|
791 |
! |
|
792 |
||
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
793 |
cursorLineAndColumnLabelHolder |
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
794 |
^ self codeView cursorLineAndColumnLabelHolder. |
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
795 |
! |
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
796 |
|
14138 | 797 |
cursorLineLabelHolder |
798 |
cursorLineLabelHolder isNil ifTrue:[ |
|
799 |
"/ self codeView isNil ifTrue:[^ nil]. |
|
800 |
||
801 |
cursorLineLabelHolder := BlockValue |
|
802 |
with:[:v | v printString] |
|
803 |
argument:self codeView cursorLineHolder. |
|
804 |
]. |
|
805 |
^ cursorLineLabelHolder |
|
806 |
! |
|
807 |
||
18847 | 808 |
editModeAutoIndentHolder |
809 |
editModeAutoIndentHolder isNil ifTrue:[ |
|
18850 | 810 |
editModeAutoIndentHolder := self codeView autoIndentHolder |
18847 | 811 |
]. |
812 |
^ editModeAutoIndentHolder |
|
813 |
||
814 |
"Created: / 26-06-2019 / 23:10:22 / Claus Gittinger" |
|
815 |
! |
|
816 |
||
14138 | 817 |
editModeHolder |
818 |
editModeHolder isNil ifTrue:[ |
|
819 |
editModeHolder := self codeView editModeHolder. |
|
820 |
]. |
|
821 |
^ editModeHolder |
|
822 |
! |
|
823 |
||
824 |
filterClassVars |
|
825 |
filterClassVars isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
826 |
filterClassVars := ValueHolder with:false. |
14138 | 827 |
]. |
828 |
^ filterClassVars |
|
829 |
||
830 |
"Created: / 24.2.2000 / 23:45:28 / cg" |
|
831 |
! |
|
832 |
||
833 |
hidePrivateClasses |
|
834 |
hidePrivateClasses isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
835 |
hidePrivateClasses := ValueHolder with:false. |
14138 | 836 |
]. |
837 |
^ hidePrivateClasses |
|
838 |
||
839 |
"Created: / 24.2.2000 / 16:17:02 / cg" |
|
840 |
! |
|
841 |
||
842 |
infoLabelHolder |
|
843 |
infoLabelHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
844 |
infoLabelHolder := ValueHolder with:''. |
14138 | 845 |
]. |
846 |
^ infoLabelHolder |
|
847 |
! |
|
848 |
||
849 |
languageHolder |
|
850 |
||
851 |
languageHolder ifNil:[ |
|
852 |
languageHolder := ValueHolder with: self theSingleSelectedLanguageFromMethodOrClass. |
|
853 |
self selectedMethods onChangeSend: #updateLanguageHolder to: self. |
|
854 |
self selectedClasses onChangeSend: #updateLanguageHolder to: self. |
|
855 |
]. |
|
856 |
^languageHolder |
|
857 |
||
858 |
"Created: / 20-07-2010 / 16:03:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
859 |
! |
|
860 |
||
861 |
lintRuleListGenerator |
|
862 |
lintRuleListGenerator ifNil: [ |
|
863 |
lintRuleListGenerator := ValueHolder new. |
|
864 |
]. |
|
865 |
^lintRuleListGenerator |
|
866 |
||
867 |
"Created: / 22-07-2009 / 15:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
868 |
! |
|
869 |
||
870 |
messageHolder |
|
871 |
"return/create the 'messageHolder' value holder (automatically generated)" |
|
872 |
||
873 |
messageHolder isNil ifTrue:[ |
|
874 |
messageHolder := ValueHolder new. |
|
875 |
]. |
|
876 |
^ messageHolder |
|
877 |
! |
|
878 |
||
879 |
messageHolder:aValueHolder |
|
880 |
"set the 'messageHolder' value holder (automatically generated)" |
|
881 |
||
882 |
messageHolder := aValueHolder. |
|
883 |
! |
|
884 |
||
885 |
messageSpecHolder |
|
886 |
"return/create the 'messageSpecHolder' value holder (automatically generated)" |
|
887 |
||
888 |
messageSpecHolder isNil ifTrue:[ |
|
889 |
messageSpecHolder := ValueHolder with:#messageInfoSpec. |
|
890 |
]. |
|
891 |
^ messageSpecHolder |
|
892 |
||
893 |
"Modified: / 28-08-2010 / 11:40:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
894 |
! |
|
895 |
||
896 |
messageSpecHolder:something |
|
897 |
"set the 'messageSpecHolder' value holder (automatically generated)" |
|
898 |
||
899 |
messageSpecHolder := something. |
|
900 |
! |
|
901 |
||
902 |
meta |
|
903 |
meta isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
904 |
meta := ValueHolder with:false. |
14138 | 905 |
]. |
906 |
^ meta |
|
907 |
! |
|
908 |
||
909 |
metaToggleLabelHolder |
|
910 |
metaToggleLabel isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
911 |
metaToggleLabel := ValueHolder with:'Class'. |
14138 | 912 |
]. |
913 |
^ metaToggleLabel |
|
914 |
! |
|
915 |
||
916 |
methodInfo |
|
917 |
methodInfo isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
918 |
methodInfo := ValueHolder with:nil. |
14138 | 919 |
]. |
920 |
^ methodInfo |
|
921 |
! |
|
922 |
||
923 |
methodList |
|
924 |
|methodListApplication| |
|
925 |
||
926 |
methodListApplication := self methodListApplication. |
|
927 |
methodListApplication isNil ifTrue:[^ nil]. |
|
928 |
||
929 |
^ methodListApplication methodList |
|
930 |
! |
|
931 |
||
932 |
modeLabelHolder |
|
933 |
modeLabelHolder isNil ifTrue:[ |
|
934 |
modeLabelHolder := self codeView modeLabelHolder. |
|
935 |
]. |
|
936 |
^ modeLabelHolder |
|
937 |
! |
|
938 |
||
939 |
nameSpaceFilter |
|
940 |
nameSpaceFilter isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
941 |
nameSpaceFilter := ValueHolder with:nil. |
14138 | 942 |
]. |
943 |
^ nameSpaceFilter |
|
944 |
||
945 |
"Created: / 18.8.2000 / 14:25:24 / cg" |
|
946 |
! |
|
947 |
||
948 |
nameSpaceListGenerator |
|
949 |
nameSpaceListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
950 |
nameSpaceListGenerator := ValueHolder with:nil. |
14138 | 951 |
]. |
952 |
^ nameSpaceListGenerator |
|
953 |
||
954 |
"Created: / 18.8.2000 / 14:26:19 / cg" |
|
955 |
"Modified: / 18.8.2000 / 14:27:59 / cg" |
|
956 |
! |
|
957 |
||
958 |
navigationHistory |
|
959 |
navigationHistory ifNil:[ |
|
960 |
navigationHistory := NavigationHistory new. |
|
961 |
]. |
|
962 |
^navigationHistory |
|
963 |
||
964 |
"Created: / 21-02-2008 / 20:08:43 / janfrog" |
|
965 |
"Modified: / 21-07-2009 / 22:39:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
966 |
! |
|
967 |
||
968 |
noAllItem |
|
969 |
noAllItem isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
970 |
noAllItem := ValueHolder with:nil. |
14138 | 971 |
]. |
972 |
^ noAllItem |
|
973 |
! |
|
974 |
||
975 |
organizerMode |
|
976 |
"return the organizerMode holder; |
|
977 |
holding a symbol describing how things are organized |
|
978 |
(#category, #hierarchy, #project or #namespace)" |
|
979 |
||
980 |
organizerMode isNil ifTrue:[ |
|
981 |
organizerMode := OrganizerCanvas organizerModeCategory asValue. |
|
982 |
]. |
|
983 |
^ organizerMode |
|
984 |
||
985 |
"Created: / 18.2.2000 / 13:33:55 / cg" |
|
986 |
"Modified: / 18.8.2000 / 18:37:22 / cg" |
|
987 |
! |
|
988 |
||
989 |
packageFilter |
|
990 |
packageFilter isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
991 |
packageFilter := ValueHolder with:nil. |
14138 | 992 |
]. |
993 |
^ packageFilter |
|
994 |
||
995 |
"Created: / 24.2.2000 / 23:45:28 / cg" |
|
996 |
! |
|
997 |
||
998 |
packageInfoBackgroundColorHolder |
|
999 |
||
1000 |
packageInfoBackgroundColorHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1001 |
packageInfoBackgroundColorHolder := ValueHolder with:nil. |
14138 | 1002 |
]. |
1003 |
^ packageInfoBackgroundColorHolder |
|
1004 |
||
1005 |
"Created: / 03-10-2011 / 14:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1006 |
! |
|
1007 |
||
1008 |
packageLabelHolder |
|
1009 |
packageLabelHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1010 |
packageLabelHolder := ValueHolder with:''. |
14138 | 1011 |
]. |
1012 |
^ packageLabelHolder |
|
1013 |
! |
|
1014 |
||
1015 |
pluginVisibleHolder |
|
1016 |
pluginVisibleHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1017 |
pluginVisibleHolder := ValueHolder with:false. |
14138 | 1018 |
]. |
1019 |
^ pluginVisibleHolder |
|
1020 |
||
1021 |
"Created: / 03-10-2010 / 17:50:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1022 |
! |
|
1023 |
||
1024 |
profilerStatistics |
|
1025 |
profilerStatistics ifNil: [ |
|
1026 |
profilerStatistics := ValueHolder new. |
|
1027 |
]. |
|
1028 |
^profilerStatistics |
|
1029 |
||
1030 |
"Created: / 22-07-2009 / 15:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1031 |
! |
|
1032 |
||
1033 |
profilerStatistics: aValueHolder |
|
1034 |
profilerStatistics := aValueHolder |
|
1035 |
||
1036 |
"Created: / 21-02-2008 / 20:08:43 / janfrog" |
|
1037 |
"Modified: / 21-07-2009 / 22:41:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1038 |
! |
|
1039 |
||
1040 |
progressHolder |
|
1041 |
"return/create the 'progressHolder' value holder (automatically generated)" |
|
1042 |
||
1043 |
progressHolder isNil ifTrue:[ |
|
1044 |
progressHolder := ValueHolder new. |
|
1045 |
]. |
|
1046 |
^ progressHolder |
|
1047 |
! |
|
1048 |
||
1049 |
progressHolder:aValueHolder |
|
1050 |
"set the 'progressHolder' value holder (automatically generated)" |
|
1051 |
||
1052 |
progressHolder := aValueHolder. |
|
1053 |
! |
|
1054 |
||
1055 |
projectListGenerator |
|
1056 |
projectListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1057 |
projectListGenerator := ValueHolder with:nil. |
14138 | 1058 |
]. |
1059 |
^ projectListGenerator |
|
1060 |
||
1061 |
"Modified: / 25.2.2000 / 01:35:42 / cg" |
|
1062 |
"Created: / 25.2.2000 / 02:43:26 / cg" |
|
1063 |
! |
|
1064 |
||
1065 |
protocolListGenerator |
|
1066 |
protocolListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1067 |
protocolListGenerator := ValueHolder with:nil. |
14138 | 1068 |
]. |
1069 |
^ protocolListGenerator |
|
1070 |
! |
|
1071 |
||
1072 |
selectedCategories |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1073 |
"a value holder on the currently selected class categories" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1074 |
|
14138 | 1075 |
selectedCategories isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1076 |
selectedCategories := ValueHolder with:nil. |
14138 | 1077 |
]. |
1078 |
^ selectedCategories |
|
1079 |
! |
|
1080 |
||
1081 |
selectedClasses |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1082 |
"a value holder on the currently selected classes" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1083 |
|
14138 | 1084 |
selectedClasses isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1085 |
selectedClasses := "SpecialValueHolder with:nil." ValueHolder with:nil. |
14138 | 1086 |
]. |
1087 |
^ selectedClasses |
|
1088 |
||
1089 |
"Modified: / 26-02-2013 / 12:29:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1090 |
! |
|
1091 |
||
1092 |
selectedLintRules |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1093 |
"a value holder on the currently selected lint rules" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1094 |
|
14138 | 1095 |
selectedLintRules isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1096 |
selectedLintRules := ValueHolder with:nil. |
14138 | 1097 |
]. |
1098 |
^ selectedLintRules |
|
1099 |
||
1100 |
"Modified: / 02-02-2010 / 20:42:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1101 |
! |
|
1102 |
||
1103 |
selectedMethods |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1104 |
"a value holder on the currently selected methods" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1105 |
|
14138 | 1106 |
selectedMethods isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1107 |
selectedMethods := ValueHolder with:nil. |
14138 | 1108 |
]. |
1109 |
^ selectedMethods |
|
1110 |
! |
|
1111 |
||
1112 |
selectedMethodsArrayAt:index |
|
1113 |
|holder| |
|
1114 |
||
1115 |
selectedMethodsArray isNil ifTrue:[ |
|
1116 |
selectedMethodsArray := OrderedCollection new |
|
1117 |
]. |
|
15651
064faa82f63f
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15343
diff
changeset
|
1118 |
selectedMethodsArray ensureSizeAtLeast:index. |
14138 | 1119 |
holder := selectedMethodsArray at:index. |
1120 |
holder isNil ifTrue:[ |
|
1121 |
selectedMethodsArray at:index put:(holder := ValueHolder new) |
|
1122 |
]. |
|
1123 |
^ holder. |
|
1124 |
! |
|
1125 |
||
1126 |
selectedNamespaces |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1127 |
"a value holder on the currently selected namespaces" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1128 |
|
14138 | 1129 |
selectedNamespaces isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1130 |
selectedNamespaces := ValueHolder with:nil. |
14138 | 1131 |
]. |
1132 |
^ selectedNamespaces |
|
1133 |
! |
|
1134 |
||
1135 |
selectedProjects |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1136 |
"a value holder on the currently selected projects" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1137 |
|
14138 | 1138 |
selectedProjects isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1139 |
selectedProjects := ValueHolder with:nil. |
14138 | 1140 |
]. |
1141 |
^ selectedProjects |
|
1142 |
! |
|
1143 |
||
1144 |
selectedProtocols |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1145 |
"a value holder on the currently selected protocols" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1146 |
|
14138 | 1147 |
selectedProtocols isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1148 |
selectedProtocols := ValueHolder with:nil. |
14138 | 1149 |
]. |
1150 |
^ selectedProtocols |
|
1151 |
! |
|
1152 |
||
1153 |
selectorListGenerator |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1154 |
"a value holder on the current selector generator" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1155 |
|
14138 | 1156 |
selectorListGenerator isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1157 |
selectorListGenerator := ValueHolder with:nil. |
14138 | 1158 |
]. |
1159 |
^ selectorListGenerator |
|
1160 |
! |
|
1161 |
||
1162 |
selectorListGeneratorArray |
|
1163 |
self halt:'should not be invoked'. |
|
1164 |
! |
|
1165 |
||
1166 |
selectorListGeneratorArrayAt:index |
|
1167 |
|holder| |
|
1168 |
||
1169 |
selectorListGeneratorArray isNil ifTrue:[ |
|
1170 |
selectorListGeneratorArray := OrderedCollection new |
|
1171 |
]. |
|
15651
064faa82f63f
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15343
diff
changeset
|
1172 |
selectorListGeneratorArray ensureSizeAtLeast:index. |
14138 | 1173 |
holder := selectorListGeneratorArray at:index. |
1174 |
holder isNil ifTrue:[ |
|
1175 |
selectorListGeneratorArray at:index put:(holder := ValueHolder new) |
|
1176 |
]. |
|
1177 |
^ holder. |
|
1178 |
! |
|
1179 |
||
1180 |
sortBy |
|
1181 |
sortBy isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1182 |
sortBy := ValueHolder with:nil. |
14138 | 1183 |
]. |
1184 |
^ sortBy |
|
1185 |
! |
|
1186 |
||
1187 |
theSingleSelectedBookmarkFromMethodOrClass |
|
1188 |
||
1189 |
| mth cls | |
|
1190 |
||
1191 |
mth := self theSingleSelectedMethod. |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1192 |
(mth notNil and:[mth mclass notNil]) ifTrue:[ |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1193 |
^ Tools::NewSystemBrowser bookmarkForClass:mth mclass selector:mth selector |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1194 |
]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1195 |
(cls := self theSingleSelectedClass) notNil ifTrue:[ |
15343
8f3a9bc0b6dd
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15324
diff
changeset
|
1196 |
cls name notNil ifTrue:[ |
8f3a9bc0b6dd
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15324
diff
changeset
|
1197 |
^ Tools::NewSystemBrowser bookmarkForClass:cls selector:nil |
8f3a9bc0b6dd
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15324
diff
changeset
|
1198 |
]. |
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1199 |
]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1200 |
^ nil |
14138 | 1201 |
|
1202 |
"Created: / 02-06-2011 / 22:16:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1203 |
"Modified: / 02-06-2011 / 23:19:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1204 |
! |
|
1205 |
||
1206 |
theSingleSelectedClassFromMethodHolder |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1207 |
"computes the class from the current single selected method" |
14138 | 1208 |
|
1209 |
^BlockValue |
|
1210 |
with: |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1211 |
[:i1 :i2| |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1212 |
|
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1213 |
| mth cls | |
14138 | 1214 |
mth := self theSingleSelectedMethod. |
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1215 |
cls := mth isNil |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1216 |
ifTrue:[ nil ] |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1217 |
ifFalse:[ mth mclass ]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1218 |
cls isNil ifTrue:[ |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1219 |
cls := self theSingleSelectedClass |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1220 |
]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1221 |
cls |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1222 |
] |
14138 | 1223 |
argument: self selectedMethods |
1224 |
argument: self selectedClasses. |
|
1225 |
||
1226 |
"Created: / 14-02-2010 / 10:05:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1227 |
! |
|
1228 |
||
1229 |
theSingleSelectedClassHolder |
|
1230 |
||
1231 |
^BlockValue |
|
1232 |
with: |
|
1233 |
[:i1 | self theSingleSelectedClass] |
|
1234 |
argument: |
|
1235 |
self selectedClasses |
|
1236 |
||
1237 |
"Created: / 05-08-2011 / 09:44:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1238 |
! |
|
1239 |
||
1240 |
theSingleSelectedLanguageFromMethodOrClass |
|
1241 |
||
1242 |
| mth cls | |
|
1243 |
||
1244 |
mth := self theSingleSelectedMethod. |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1245 |
mth notNil ifTrue:[ ^ mth programmingLanguage ]. |
14138 | 1246 |
cls := self theSingleSelectedClass. |
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1247 |
cls notNil ifTrue:[ ^ cls programmingLanguage ]. |
14138 | 1248 |
^SmalltalkLanguage instance |
1249 |
||
1250 |
"Created: / 20-07-2010 / 15:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1251 |
! |
|
1252 |
||
1253 |
theSingleSelectedMethodHolder |
|
1254 |
||
1255 |
^BlockValue |
|
1256 |
with: |
|
1257 |
[:i1 | self theSingleSelectedMethod] |
|
1258 |
argument: |
|
1259 |
self selectedMethods |
|
1260 |
||
1261 |
"Created: / 17-06-2011 / 12:39:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1262 |
! |
|
1263 |
||
1264 |
updateBookmarkHolder |
|
1265 |
||
1266 |
^self bookmarkHolder value: self theSingleSelectedBookmarkFromMethodOrClass |
|
1267 |
||
1268 |
"Created: / 02-06-2011 / 22:13:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1269 |
! |
|
1270 |
||
1271 |
updateLanguageHolder |
|
1272 |
||
1273 |
^self languageHolder value: self theSingleSelectedLanguageFromMethodOrClass |
|
1274 |
||
1275 |
"Created: / 20-07-2010 / 16:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1276 |
! |
|
1277 |
||
1278 |
variableFilter |
|
1279 |
variableFilter isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1280 |
variableFilter := ValueHolder with:nil. |
14138 | 1281 |
]. |
1282 |
^ variableFilter |
|
1283 |
||
1284 |
"Created: / 24.2.2000 / 23:45:28 / cg" |
|
1285 |
! ! |
|
1286 |
||
15651
064faa82f63f
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15343
diff
changeset
|
1287 |
|
14138 | 1288 |
!NavigationState methodsFor:'aspects-kludges'! |
1289 |
||
1290 |
metaToggle |
|
1291 |
metaToggle isNil ifTrue:[ |
|
1292 |
metaToggle := PluggableAdaptor on:(self meta). |
|
1293 |
metaToggle |
|
1294 |
getBlock:[:m | m value == true] |
|
1295 |
putBlock:[:m :newValue | m value:(newValue ? false)] |
|
1296 |
updateBlock:[:m :aspect :param | true]. |
|
1297 |
]. |
|
1298 |
^ metaToggle |
|
1299 |
! |
|
1300 |
||
1301 |
notMetaToggle |
|
1302 |
notMetaToggle isNil ifTrue:[ |
|
1303 |
notMetaToggle := PluggableAdaptor on:(self meta). |
|
1304 |
notMetaToggle |
|
1305 |
getBlock:[:m | m value == false] |
|
1306 |
putBlock:[:m :newValue | m value:(newValue ? false) not] |
|
1307 |
updateBlock:[:m :aspect :param | true]. |
|
1308 |
]. |
|
1309 |
^ notMetaToggle |
|
1310 |
! ! |
|
1311 |
||
1312 |
!NavigationState methodsFor:'history'! |
|
1313 |
||
1314 |
addToHistory: class selector: selector |
|
1315 |
||
1316 |
| entry | |
|
1317 |
"/selector ifNil:[^self]. |
|
1318 |
entry := SystemBrowser historyEntryForClass: class selector: selector. |
|
1319 |
self navigationHistory goTo: entry. |
|
1320 |
^entry |
|
1321 |
||
1322 |
"Created: / 22-02-2008 / 08:44:05 / janfrog" |
|
1323 |
"Modified: / 22-02-2008 / 17:20:00 / janfrog" |
|
1324 |
"Modified: / 06-04-2012 / 10:55:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1325 |
! ! |
|
1326 |
||
1327 |
!NavigationState methodsFor:'printing & storing'! |
|
1328 |
||
1329 |
colorizeForModifiedBuffer:someString |
|
1330 |
^ someString asText emphasisAllAdd:(UserPreferences current emphasisForModifiedBuffer) |
|
1331 |
! |
|
1332 |
||
1333 |
nameString |
|
1334 |
"a descriptive string of what this state shows" |
|
1335 |
||
1336 |
|s| |
|
1337 |
||
1338 |
s := self rawNameStringOrNil ? 'nothing selected'. |
|
1339 |
||
1340 |
(self realModifiedState == true) ifTrue:[ |
|
1341 |
^ self colorizeForModifiedBuffer:s string |
|
1342 |
]. |
|
1343 |
^ s |
|
1344 |
! |
|
1345 |
||
1346 |
nameStringOrNil |
|
1347 |
"a descriptive string of what this state shows" |
|
1348 |
||
1349 |
|s "codeView"| |
|
1350 |
||
1351 |
s := self rawNameStringOrNil. |
|
1352 |
s notNil ifTrue:[ |
|
1353 |
self realModifiedState == true |
|
1354 |
"/ ((codeView := self codeView) notNil |
|
1355 |
"/ and:[codeView modified]) |
|
1356 |
ifTrue:[ |
|
1357 |
^ self colorizeForModifiedBuffer:s string |
|
1358 |
]. |
|
1359 |
]. |
|
1360 |
^ s |
|
1361 |
! |
|
1362 |
||
1363 |
rawNameStringForCategory |
|
1364 |
|categories theCategory| |
|
1365 |
||
1366 |
categories := self selectedCategories value. |
|
1367 |
categories size == 1 ifTrue:[ |
|
1368 |
theCategory := categories first. |
|
1369 |
theCategory notNil ifTrue:[ |
|
1370 |
^ theCategory string, ' [Category]' |
|
1371 |
]. |
|
1372 |
]. |
|
1373 |
^ nil |
|
1374 |
||
1375 |
"Created: / 18.8.2000 / 19:42:42 / cg" |
|
1376 |
! |
|
1377 |
||
1378 |
rawNameStringForNameSpace |
|
1379 |
|namespaces theNamespace nsName s| |
|
1380 |
||
1381 |
namespaces := self selectedNamespaces value. |
|
1382 |
namespaces size == 1 ifTrue:[ |
|
1383 |
theNamespace := namespaces first |
|
1384 |
]. |
|
1385 |
theNamespace notNil ifTrue:[ |
|
1386 |
theNamespace isNameSpace ifTrue:[ |
|
1387 |
nsName := theNamespace name |
|
1388 |
] ifFalse:[ |
|
1389 |
nsName := theNamespace |
|
1390 |
]. |
|
1391 |
s := nsName , ' [NameSpace]'. |
|
1392 |
(self isNameSpaceBrowser or:[self isNameSpaceFullBrowser]) ifTrue:[ |
|
1393 |
^ LabelAndIcon icon:(NewSystemBrowser nameSpaceIcon) string:s. |
|
1394 |
]. |
|
1395 |
^ s |
|
1396 |
]. |
|
1397 |
^ nil |
|
1398 |
||
1399 |
"Created: / 18.8.2000 / 20:15:02 / cg" |
|
1400 |
! |
|
1401 |
||
1402 |
rawNameStringForProject |
|
1403 |
|projects theProject s| |
|
1404 |
||
1405 |
projects := self selectedProjects value. |
|
1406 |
projects size == 1 ifTrue:[ |
|
1407 |
theProject := projects first |
|
1408 |
]. |
|
1409 |
theProject notNil ifTrue:[ |
|
1410 |
s := theProject , ' [Project]'. |
|
1411 |
(self isProjectBrowser or:[self isProjectFullBrowser]) ifTrue:[ |
|
1412 |
^ LabelAndIcon icon:(NewSystemBrowser packageIcon) string:s. |
|
1413 |
]. |
|
1414 |
^ s |
|
1415 |
]. |
|
1416 |
^ nil |
|
1417 |
||
1418 |
"Created: / 18.8.2000 / 20:18:34 / cg" |
|
1419 |
! |
|
1420 |
||
1421 |
rawNameStringOrNil |
|
1422 |
"a descriptive string of what this state shows; nil, if nothing is selected" |
|
1423 |
||
1424 |
^ self rawNameStringOrNilWantShort:false |
|
1425 |
! |
|
1426 |
||
1427 |
rawNameStringOrNilWantShort:shortName |
|
1428 |
"a descriptive string of what this state shows; nil, if nothing is selected" |
|
1429 |
||
1430 |
|lbl nr numClasses numMethods numCategories cats classes theClass |
|
1431 |
"protocols theProtocol" |
|
1432 |
methods theSingleMethod projects theProject longName nm methodName suffix cls| |
|
1433 |
||
1434 |
browserLabel notNil ifTrue:[ |
|
1435 |
"/ add the number of selected methods |
|
1436 |
((canvasType == #singleFullProtocolBrowserSpec) |
|
1437 |
or:[canvasType == #methodListBrowserSpec]) ifTrue:[ |
|
1438 |
nr := self selectedMethods value size. |
|
1439 |
nr > 5 ifTrue:[ |
|
1440 |
^ browserLabel string , ' - ' , nr printString , ' methods' |
|
1441 |
]. |
|
1442 |
]. |
|
1443 |
^ browserLabel |
|
1444 |
]. |
|
1445 |
||
1446 |
suffix := ''. |
|
1447 |
||
1448 |
self isProtocolOrFullProtocolBrowser ifTrue:[ |
|
1449 |
lbl := self rawNameStringForProject. |
|
1450 |
lbl notNil ifTrue:[^ lbl]. |
|
1451 |
suffix := ' [Protocol]'. |
|
1452 |
]. |
|
1453 |
||
1454 |
self isCategoryBrowser ifTrue:[ |
|
1455 |
lbl := self rawNameStringForCategory. |
|
1456 |
lbl notNil ifTrue:[^ lbl]. |
|
1457 |
suffix := ' [Category]'. |
|
1458 |
]. |
|
1459 |
||
1460 |
self isNameSpaceBrowser ifTrue:[ |
|
1461 |
lbl := self rawNameStringForNameSpace. |
|
1462 |
lbl notNil ifTrue:[^ lbl]. |
|
1463 |
suffix := ' [NameSpace]'. |
|
1464 |
]. |
|
1465 |
||
1466 |
self isProjectBrowser ifTrue:[ |
|
1467 |
projects := self selectedProjects value. |
|
1468 |
projects size == 1 ifTrue:[ |
|
1469 |
theProject := projects first |
|
1470 |
]. |
|
1471 |
suffix := ' [Project]'. |
|
1472 |
theProject notNil ifTrue:[ |
|
1473 |
^ theProject , suffix |
|
1474 |
] |
|
1475 |
]. |
|
1476 |
||
1477 |
classes := self selectedClasses value. |
|
1478 |
classes size == 1 ifTrue:[ |
|
1479 |
theClass := classes first. |
|
1480 |
theClass notNil ifTrue:[ |
|
1481 |
theClass := theClass theNonMetaclass |
|
1482 |
] |
|
1483 |
]. |
|
1484 |
||
1485 |
self isClassBrowser ifTrue:[ |
|
1486 |
suffix := ' [Class]'. |
|
1487 |
theClass notNil ifTrue:[ |
|
1488 |
^ theClass name , suffix |
|
1489 |
] |
|
1490 |
]. |
|
1491 |
||
1492 |
"/ protocols := self selectedProtocols value. |
|
1493 |
"/ protocols size == 1 ifTrue:[ |
|
1494 |
"/ theProtocol := protocols first |
|
1495 |
"/ ]. |
|
1496 |
||
1497 |
methods := self selectedMethods value. |
|
1498 |
methods size == 1 ifTrue:[ |
|
1499 |
theSingleMethod := methods first |
|
1500 |
]. |
|
1501 |
||
1502 |
theSingleMethod notNil ifTrue:[ |
|
1503 |
methodName := theSingleMethod selector. |
|
15324
190af6d17b2e
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15269
diff
changeset
|
1504 |
"/ cg: I see no reason to suppress this information |
190af6d17b2e
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15269
diff
changeset
|
1505 |
"/ methodName isSymbol ifTrue:[methodName := methodName selectorWithoutNameSpace]. |
14138 | 1506 |
theSingleMethod isJavaMethod ifTrue:[ |
1507 |
methodName := theSingleMethod printStringForBrowserWithSelector:methodName. |
|
1508 |
]. |
|
1509 |
]. |
|
1510 |
||
1511 |
self isMethodBrowser ifTrue:[ |
|
1512 |
suffix := ' [Selector]'. |
|
1513 |
||
1514 |
theSingleMethod notNil ifTrue:[ |
|
1515 |
theSingleMethod mclass isNil ifTrue:[ |
|
1516 |
^ '???' |
|
1517 |
]. |
|
1518 |
^ theSingleMethod mclass name , ' ' , methodName , suffix |
|
1519 |
] |
|
1520 |
]. |
|
1521 |
||
1522 |
self isCategoryBrowser ifTrue:[ |
|
1523 |
suffix := ' [Category]'. |
|
1524 |
] ifFalse:[ |
|
1525 |
self isFullClassSourceBrowser ifTrue:[ |
|
1526 |
suffix := ' [Full]'. |
|
1527 |
] ifFalse:[ |
|
1528 |
self isClassDocumentationBrowser ifTrue:[ |
|
1529 |
suffix := ' [Doc]'. |
|
1530 |
] ifFalse:[ |
|
1531 |
self isProjectBrowser ifTrue:[ |
|
1532 |
suffix := ' [Project]'. |
|
1533 |
] |
|
1534 |
] |
|
1535 |
] |
|
1536 |
]. |
|
1537 |
||
1538 |
nm := nil. |
|
1539 |
(numClasses := classes size) > 0 ifTrue:[ |
|
1540 |
numClasses > 1 ifTrue:[ |
|
1541 |
methods size > 0 ifTrue:[ |
|
1542 |
theSingleMethod notNil ifTrue:[ |
|
1543 |
cls := theSingleMethod mclass. |
|
1544 |
cls isNil ifTrue:[ |
|
1545 |
"/ oops - unbound |
|
1546 |
nm := '???' |
|
1547 |
] ifFalse:[ |
|
1548 |
longName := nm := cls nameInBrowser. |
|
1549 |
shortName ifTrue:[ |
|
1550 |
nm := cls nameWithoutPrefix. |
|
1551 |
cls isPrivate ifTrue:[ |
|
1552 |
nm := ':' , nm |
|
1553 |
] |
|
1554 |
]. |
|
1555 |
]. |
|
1556 |
nm := nm , ' ', (methodName ? '???') |
|
1557 |
] ifFalse:[ |
|
1558 |
nm := methods size printString , ' methods'. |
|
1559 |
numClasses := (methods collect:[:each | each mclass] as:IdentitySet) size. |
|
1560 |
numClasses > 1 ifTrue:[ |
|
1561 |
nm := nm , ' in ' , numClasses printString , ' classes'. |
|
1562 |
]. |
|
1563 |
]. |
|
1564 |
^ nm , suffix. |
|
1565 |
]. |
|
1566 |
||
1567 |
nm := numClasses printString , ' classes in '. |
|
1568 |
"/ cats := self selectedCategories value |
|
1569 |
cats := classes collect:[:each | each category] as:Set. |
|
1570 |
(numCategories := cats size) == 1 ifTrue:[ |
|
1571 |
nm := nm , cats first |
|
1572 |
] ifFalse:[ |
|
1573 |
nm := nm , numCategories printString , ' categories' |
|
1574 |
] |
|
1575 |
] ifFalse:[ |
|
1576 |
cls := theClass theNonMetaclass. |
|
1577 |
longName := nm := cls nameInBrowser. |
|
1578 |
shortName ifTrue:[ |
|
1579 |
nm := cls nameWithoutPrefix. |
|
1580 |
cls isPrivate ifTrue:[ |
|
1581 |
nm := ':' , nm |
|
1582 |
] |
|
1583 |
]. |
|
1584 |
methods := self selectedMethods value. |
|
1585 |
(numMethods := methods size) > 0 ifTrue:[ |
|
1586 |
numMethods == 1 ifTrue:[ |
|
1587 |
theSingleMethod := methods first. |
|
1588 |
nm := nm , ' ', (methodName ? '???') |
|
1589 |
] ifFalse:[ |
|
1590 |
nm := numMethods printString , ' methods in ' , nm |
|
1591 |
] |
|
1592 |
] |
|
1593 |
] |
|
1594 |
] ifFalse:[ |
|
1595 |
(self isNameSpaceBrowser |
|
1596 |
or:[self isNameSpaceFullBrowser |
|
1597 |
or:[organizerMode value == OrganizerCanvas organizerModeNamespace]]) ifTrue:[ |
|
1598 |
lbl := self rawNameStringForNameSpace. |
|
1599 |
lbl notNil ifTrue:[^ lbl]. |
|
1600 |
suffix := ' [NameSpace]'. |
|
1601 |
] ifFalse:[ |
|
1602 |
(self isProjectBrowser |
|
1603 |
or:[self isProjectFullBrowser |
|
1604 |
or:[organizerMode value == OrganizerCanvas organizerModeProject]]) ifTrue:[ |
|
1605 |
lbl := self rawNameStringForProject. |
|
1606 |
lbl notNil ifTrue:[^ lbl]. |
|
1607 |
suffix := ' [Project]'. |
|
1608 |
] ifFalse:[ |
|
1609 |
cats := self selectedCategories value. |
|
1610 |
cats size == 1 ifTrue:[ |
|
1611 |
nm := (cats first ? '') string |
|
1612 |
] |
|
1613 |
] |
|
1614 |
]. |
|
1615 |
]. |
|
1616 |
nm isNil ifTrue:[ ^ nil ]. |
|
1617 |
^ nm , suffix. |
|
1618 |
||
1619 |
"Created: / 11-02-2000 / 13:32:16 / cg" |
|
1620 |
"Modified: / 18-08-2000 / 21:06:35 / cg" |
|
1621 |
"Modified: / 20-07-2010 / 10:52:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1622 |
! |
|
1623 |
||
1624 |
shortNameString |
|
1625 |
"a descriptive string of what this state shows" |
|
1626 |
||
1627 |
|s| |
|
1628 |
||
1629 |
s := (self rawNameStringOrNilWantShort:true) ? 'nothing selected'. |
|
1630 |
||
1631 |
(self realModifiedState == true) ifTrue:[ |
|
1632 |
^ self colorizeForModifiedBuffer:s string |
|
1633 |
]. |
|
1634 |
^ s |
|
1635 |
! ! |
|
1636 |
||
1637 |
!NavigationState methodsFor:'queries'! |
|
1638 |
||
1639 |
isCategoryBrowser |
|
1640 |
^ canvasType == #categoryBrowserSpec |
|
1641 |
or:[ canvasType == #singleCategoryBrowserSpec |
|
1642 |
or:[ canvasType == #multipleCategoryBrowserSpec ]] |
|
1643 |
||
1644 |
"Modified: / 25.2.2000 / 01:17:02 / cg" |
|
1645 |
! |
|
1646 |
||
1647 |
isChainBrowser |
|
1648 |
^ canvasType == #chainBrowserSpec |
|
1649 |
! |
|
1650 |
||
1651 |
isCheckOutputBrowser |
|
1652 |
^ canvasType == #multipleClassWithInfoAndMethodWithInfoBrowserSpec |
|
1653 |
or:[canvasType == #multipleMethodWithInfoBrowserSpec |
|
1654 |
or:[canvasType == #multipleClassWithInfoBrowserSpec]] |
|
1655 |
! |
|
1656 |
||
1657 |
isClassBrowser |
|
1658 |
^ canvasType == #classBrowserSpec |
|
1659 |
or:[ canvasType == #singleClassBrowserSpec |
|
16568 | 1660 |
or:[ canvasType == #singleClassWithoutVariableListBrowserSpec |
1661 |
or:[ canvasType == #multipleClassBrowserSpec ]]] |
|
14138 | 1662 |
|
1663 |
"Modified: / 25.2.2000 / 00:38:07 / cg" |
|
1664 |
! |
|
1665 |
||
1666 |
isClassDocumentationBrowser |
|
1667 |
^ canvasType == #classDocumentationBrowserSpec |
|
1668 |
||
1669 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1670 |
! |
|
1671 |
||
1672 |
isClassExtensionBrowser |
|
1673 |
^ canvasType == #multipleClassExtensionBrowserSpec |
|
1674 |
||
1675 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1676 |
! |
|
1677 |
||
1678 |
isFullBrowser |
|
1679 |
^ canvasType == #fullBrowserSpec |
|
1680 |
! |
|
1681 |
||
1682 |
isFullClassSourceBrowser |
|
1683 |
^ canvasType == #fullClassSourceBrowserSpec |
|
1684 |
||
1685 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1686 |
! |
|
1687 |
||
1688 |
isFullProtocolBrowser |
|
1689 |
^ canvasType == #singleFullProtocolBrowserSpec |
|
1690 |
or:[ canvasType == #multipleFullProtocolBrowserSpec ] |
|
1691 |
||
1692 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1693 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1694 |
! |
|
1695 |
||
1696 |
isLintResultBrowser |
|
1697 |
^ canvasType == #smallLintByRuleResultBrowserSpec |
|
1698 |
! |
|
1699 |
||
1700 |
isMethodBrowser |
|
1701 |
^ canvasType == #methodListBrowserSpec |
|
1702 |
or:[ canvasType == #singleMethodBrowserSpec |
|
1703 |
or:[ canvasType == #multipleMethodBrowserSpec |
|
1704 |
or:[ canvasType == #multipleMethodWithInfoBrowserSpec ]]] |
|
1705 |
||
1706 |
"Modified: / 1.3.2000 / 13:35:12 / cg" |
|
1707 |
! |
|
1708 |
||
1709 |
isMethodListBrowser |
|
1710 |
canvasType == #methodListBrowserSpec ifTrue:[^ true]. |
|
1711 |
canvasType == #multipleMethodBrowserSpec ifTrue:[^ true]. |
|
1712 |
canvasType == #singleProtocolBrowserSpec ifTrue:[^ true]. |
|
1713 |
^ false. |
|
1714 |
! |
|
1715 |
||
1716 |
isNameSpaceBrowser |
|
1717 |
^ canvasType == #singleNameSpaceBrowserSpec |
|
1718 |
or:[ canvasType == #multipleNameSpaceBrowserSpec] |
|
1719 |
||
1720 |
"Modified: / 18.8.2000 / 16:12:34 / cg" |
|
1721 |
! |
|
1722 |
||
1723 |
isNameSpaceFullBrowser |
|
1724 |
^ canvasType == #singleNameSpaceFullBrowserSpec |
|
1725 |
or:[ canvasType == #multipleNameSpaceFullBrowserSpec ] |
|
1726 |
||
1727 |
"Created: / 18.8.2000 / 14:58:36 / cg" |
|
1728 |
! |
|
1729 |
||
1730 |
isProjectBrowser |
|
1731 |
^ canvasType == #singleProjectBrowserSpec |
|
1732 |
or:[ canvasType == #multipleProjectBrowserSpec ] |
|
1733 |
||
1734 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1735 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1736 |
! |
|
1737 |
||
1738 |
isProjectFullBrowser |
|
16939 | 1739 |
"showing a single or multiple full projects |
1740 |
(but not a regular browser, in projects-mode." |
|
1741 |
||
14138 | 1742 |
^ canvasType == #singleProjectFullBrowserSpec |
1743 |
or:[ canvasType == #multipleProjectFullBrowserSpec ] |
|
1744 |
||
1745 |
"Created: / 18.8.2000 / 19:02:49 / cg" |
|
1746 |
! |
|
1747 |
||
1748 |
isProtocolBrowser |
|
1749 |
^ canvasType == #singleProtocolBrowserSpec |
|
1750 |
or:[ canvasType == #multipleProtocolBrowserSpec ] |
|
1751 |
||
1752 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1753 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1754 |
! |
|
1755 |
||
1756 |
isProtocolOrFullProtocolBrowser |
|
1757 |
^ self isProtocolBrowser |
|
1758 |
or:[ self isFullProtocolBrowser ] |
|
1759 |
! |
|
1760 |
||
1761 |
isSingleCategoryBrowser |
|
1762 |
^ canvasType == #singleCategoryBrowserSpec |
|
1763 |
! |
|
1764 |
||
1765 |
isSingleClassBrowser |
|
16568 | 1766 |
^ (canvasType == #singleClassBrowserSpec) |
1767 |
or:[ canvasType == #singleClassWithoutVariableListBrowserSpec ] |
|
14138 | 1768 |
! |
1769 |
||
1770 |
isSingleFullProtocolBrowser |
|
1771 |
^ canvasType == #singleFullProtocolBrowserSpec |
|
1772 |
! |
|
1773 |
||
1774 |
isSingleMethodBrowser |
|
1775 |
^ canvasType == #singleMethodBrowserSpec |
|
1776 |
||
1777 |
"Created: / 1.3.2000 / 13:35:52 / cg" |
|
1778 |
! |
|
1779 |
||
1780 |
isSingleNamespaceBrowser |
|
1781 |
^ canvasType == #singleNameSpaceBrowserSpec |
|
1782 |
! |
|
1783 |
||
1784 |
isSingleNamespaceFullBrowser |
|
1785 |
^ canvasType == #singleNameSpaceFullBrowserSpec |
|
1786 |
! |
|
1787 |
||
1788 |
isSingleProjectBrowser |
|
1789 |
^ canvasType == #singleProjectBrowserSpec |
|
1790 |
or:[ canvasType == #singleProjectFullBrowserSpec ] |
|
1791 |
||
1792 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1793 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1794 |
! |
|
1795 |
||
1796 |
isSingleProjectFullBrowser |
|
1797 |
^ canvasType == #singleProjectFullBrowserSpec |
|
1798 |
||
1799 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1800 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1801 |
! |
|
1802 |
||
1803 |
isSingleProtocolBrowser |
|
1804 |
^ canvasType == #singleProtocolBrowserSpec |
|
1805 |
! |
|
1806 |
||
1807 |
isVersionDiffBrowser |
|
1808 |
^ canvasType == #multipleClassRepositoryDiffBrowserSpec |
|
1809 |
! ! |
|
1810 |
||
1811 |
!NavigationState class methodsFor:'documentation'! |
|
1812 |
||
1813 |
version |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1814 |
^ '$Header$' |
14138 | 1815 |
! |
1816 |
||
1817 |
version_CVS |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1818 |
^ '$Header$' |
14138 | 1819 |
! |
1820 |
||
1821 |
version_SVN |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1822 |
^ '$Id$' |
14138 | 1823 |
! ! |
1824 |
||
1825 |
||
1826 |
NavigationState initialize! |