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