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