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