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