author | Claus Gittinger <cg@exept.de> |
Wed, 05 Oct 2016 16:26:52 +0200 | |
changeset 16896 | 9336d232a127 |
parent 16568 | 591a21c10e45 |
child 16939 | 4b950460cad2 |
child 17133 | f9f20407fbf9 |
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 |
|
568 |
|v newScrollableCodeView newCodeView | |
|
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 |
||
591 |
(UserPreferences current showAcceptCancelBarInBrowser |
|
592 |
and:[newCodeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
|
593 |
ViewWithAcceptAndCancelBar notNil ifTrue:[ |
|
594 |
v := ViewWithAcceptAndCancelBar new. |
|
595 |
v slaveView:newScrollableCodeView. |
|
596 |
v reallyModifiedHolder:self realModifiedStateHolder. |
|
597 |
v cancelAction: |
|
598 |
[ |
|
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 |
]. |
|
605 |
v compareAction: |
|
606 |
[ |
|
607 |
newCodeView application doCompareIn:self. |
|
608 |
newCodeView requestFocus |
|
609 |
]. |
|
610 |
newScrollableCodeView := v. |
|
611 |
] |
|
612 |
]. |
|
613 |
||
614 |
^newScrollableCodeView |
|
615 |
||
616 |
"Modified: / 05-07-2011 / 10:34:33 / cg" |
|
617 |
"Modified: / 05-08-2011 / 09:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
618 |
! |
|
619 |
||
620 |
specialEditorCanvasClassForResourceType:resourceTypeSymbol |
|
621 |
resourceTypeSymbol == #fileImage ifTrue:[ |
|
622 |
^ nil |
|
623 |
]. |
|
624 |
^ SystemBrowser resourceEditorClassFor:resourceTypeSymbol |
|
625 |
! |
|
626 |
||
627 |
specialEditorCanvasForResourceType:resourceTypeSymbol |
|
628 |
|appClass app editorView| |
|
629 |
||
630 |
specialEditors isNil ifTrue:[ |
|
631 |
specialEditors := Dictionary new. |
|
632 |
]. |
|
633 |
editorView := specialEditors at:resourceTypeSymbol ifAbsent:nil. |
|
634 |
editorView isNil ifTrue:[ |
|
635 |
appClass := self specialEditorCanvasClassForResourceType:resourceTypeSymbol. |
|
636 |
appClass notNil ifTrue:[ |
|
637 |
app := appClass new. |
|
638 |
app masterApplication:self canvas application. |
|
639 |
app isEmbeddedInBrowser:true. |
|
640 |
app infoLabelHolder:(self canvas application infoLabelHolder). |
|
641 |
||
642 |
editorView := ApplicationSubView new. |
|
643 |
editorView buildMenu:true. |
|
644 |
editorView client:app. |
|
645 |
app builder window:editorView. |
|
646 |
||
647 |
specialEditors at:resourceTypeSymbol put:editorView. |
|
648 |
]. |
|
649 |
]. |
|
650 |
^ editorView |
|
651 |
! ! |
|
652 |
||
653 |
!NavigationState methodsFor:'aspects'! |
|
654 |
||
655 |
bookmarkHolder |
|
656 |
"return/create the 'bookmarkHolder' value holder (automatically generated)" |
|
657 |
||
658 |
bookmarkHolder isNil ifTrue:[ |
|
659 |
bookmarkHolder := ValueHolder with: self theSingleSelectedBookmarkFromMethodOrClass. |
|
660 |
self selectedMethods onChangeSend: #updateBookmarkHolder to: self. |
|
661 |
self selectedClasses onChangeSend: #updateBookmarkHolder to: self. |
|
662 |
]. |
|
663 |
^ bookmarkHolder |
|
664 |
||
665 |
"Modified: / 03-06-2011 / 12:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
666 |
! |
|
667 |
||
668 |
categoryList |
|
669 |
categoryList isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
670 |
categoryList := ValueHolder with:nil. |
14138 | 671 |
]. |
672 |
^ categoryList |
|
673 |
||
674 |
"Modified: / 25.2.2000 / 01:35:42 / cg" |
|
675 |
"Created: / 25.2.2000 / 01:57:45 / cg" |
|
676 |
! |
|
677 |
||
678 |
categoryListGenerator |
|
679 |
categoryListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
680 |
categoryListGenerator := ValueHolder with:nil. |
14138 | 681 |
]. |
682 |
^ categoryListGenerator |
|
683 |
||
684 |
"Created: / 25.2.2000 / 01:34:30 / cg" |
|
685 |
"Modified: / 25.2.2000 / 01:35:42 / cg" |
|
686 |
! |
|
687 |
||
688 |
classDocumentationHolder |
|
689 |
classDocumentationHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
690 |
classDocumentationHolder := ValueHolder with:nil. |
14138 | 691 |
]. |
692 |
^ classDocumentationHolder |
|
693 |
! |
|
694 |
||
695 |
classHierarchyTopClass |
|
696 |
classHierarchyTopClass isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
697 |
classHierarchyTopClass := ValueHolder with:nil. |
14138 | 698 |
]. |
699 |
^ classHierarchyTopClass |
|
700 |
! |
|
701 |
||
702 |
classList |
|
703 |
classList isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
704 |
classList := ValueHolder with:nil. |
14138 | 705 |
]. |
706 |
^ classList |
|
707 |
||
708 |
"Created: / 25.2.2000 / 01:57:28 / cg" |
|
709 |
! |
|
710 |
||
711 |
classListGenerator |
|
712 |
classListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
713 |
classListGenerator := ValueHolder with:nil. |
14138 | 714 |
]. |
715 |
^ classListGenerator |
|
716 |
! |
|
717 |
||
718 |
classListPerNameSpaceGenerator |
|
719 |
classListPerNameSpaceGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
720 |
classListPerNameSpaceGenerator := ValueHolder with:nil. |
14138 | 721 |
]. |
722 |
^ classListPerNameSpaceGenerator |
|
723 |
||
724 |
"Created: / 18.8.2000 / 14:15:34 / cg" |
|
725 |
! |
|
726 |
||
727 |
codeHolder |
|
728 |
codeHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
729 |
codeHolder := ValueHolder with:nil. |
14138 | 730 |
]. |
731 |
^ codeHolder |
|
732 |
! |
|
733 |
||
734 |
codeModifiedHolder |
|
735 |
codeModifiedHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
736 |
codeModifiedHolder := ValueHolder with:false. |
14138 | 737 |
]. |
738 |
^ codeModifiedHolder |
|
739 |
! |
|
740 |
||
741 |
cursorColLabelHolder |
|
742 |
cursorColLabelHolder isNil ifTrue:[ |
|
743 |
"/ self codeView isNil ifTrue:[^ nil]. |
|
744 |
||
745 |
cursorColLabelHolder := BlockValue |
|
746 |
with:[:v | v printString] |
|
747 |
argument:self codeView cursorColHolder. |
|
748 |
]. |
|
749 |
^ cursorColLabelHolder |
|
750 |
! |
|
751 |
||
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
752 |
cursorLineAndColumnLabelHolder |
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
753 |
^ self codeView cursorLineAndColumnLabelHolder. |
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
754 |
! |
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
755 |
|
14138 | 756 |
cursorLineLabelHolder |
757 |
cursorLineLabelHolder isNil ifTrue:[ |
|
758 |
"/ self codeView isNil ifTrue:[^ nil]. |
|
759 |
||
760 |
cursorLineLabelHolder := BlockValue |
|
761 |
with:[:v | v printString] |
|
762 |
argument:self codeView cursorLineHolder. |
|
763 |
]. |
|
764 |
^ cursorLineLabelHolder |
|
765 |
! |
|
766 |
||
767 |
editModeHolder |
|
768 |
editModeHolder isNil ifTrue:[ |
|
769 |
editModeHolder := self codeView editModeHolder. |
|
770 |
]. |
|
771 |
^ editModeHolder |
|
772 |
! |
|
773 |
||
774 |
filterClassVars |
|
775 |
filterClassVars isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
776 |
filterClassVars := ValueHolder with:false. |
14138 | 777 |
]. |
778 |
^ filterClassVars |
|
779 |
||
780 |
"Created: / 24.2.2000 / 23:45:28 / cg" |
|
781 |
! |
|
782 |
||
783 |
hidePrivateClasses |
|
784 |
hidePrivateClasses isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
785 |
hidePrivateClasses := ValueHolder with:false. |
14138 | 786 |
]. |
787 |
^ hidePrivateClasses |
|
788 |
||
789 |
"Created: / 24.2.2000 / 16:17:02 / cg" |
|
790 |
! |
|
791 |
||
792 |
infoLabelHolder |
|
793 |
infoLabelHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
794 |
infoLabelHolder := ValueHolder with:''. |
14138 | 795 |
]. |
796 |
^ infoLabelHolder |
|
797 |
! |
|
798 |
||
799 |
languageHolder |
|
800 |
||
801 |
languageHolder ifNil:[ |
|
802 |
languageHolder := ValueHolder with: self theSingleSelectedLanguageFromMethodOrClass. |
|
803 |
self selectedMethods onChangeSend: #updateLanguageHolder to: self. |
|
804 |
self selectedClasses onChangeSend: #updateLanguageHolder to: self. |
|
805 |
]. |
|
806 |
^languageHolder |
|
807 |
||
808 |
"Created: / 20-07-2010 / 16:03:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
809 |
! |
|
810 |
||
811 |
lintRuleListGenerator |
|
812 |
lintRuleListGenerator ifNil: [ |
|
813 |
lintRuleListGenerator := ValueHolder new. |
|
814 |
]. |
|
815 |
^lintRuleListGenerator |
|
816 |
||
817 |
"Created: / 22-07-2009 / 15:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
818 |
! |
|
819 |
||
820 |
messageHolder |
|
821 |
"return/create the 'messageHolder' value holder (automatically generated)" |
|
822 |
||
823 |
messageHolder isNil ifTrue:[ |
|
824 |
messageHolder := ValueHolder new. |
|
825 |
]. |
|
826 |
^ messageHolder |
|
827 |
! |
|
828 |
||
829 |
messageHolder:aValueHolder |
|
830 |
"set the 'messageHolder' value holder (automatically generated)" |
|
831 |
||
832 |
messageHolder := aValueHolder. |
|
833 |
! |
|
834 |
||
835 |
messageSpecHolder |
|
836 |
"return/create the 'messageSpecHolder' value holder (automatically generated)" |
|
837 |
||
838 |
messageSpecHolder isNil ifTrue:[ |
|
839 |
messageSpecHolder := ValueHolder with:#messageInfoSpec. |
|
840 |
]. |
|
841 |
^ messageSpecHolder |
|
842 |
||
843 |
"Modified: / 28-08-2010 / 11:40:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
844 |
! |
|
845 |
||
846 |
messageSpecHolder:something |
|
847 |
"set the 'messageSpecHolder' value holder (automatically generated)" |
|
848 |
||
849 |
messageSpecHolder := something. |
|
850 |
! |
|
851 |
||
852 |
meta |
|
853 |
meta isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
854 |
meta := ValueHolder with:false. |
14138 | 855 |
]. |
856 |
^ meta |
|
857 |
! |
|
858 |
||
859 |
metaToggleLabelHolder |
|
860 |
metaToggleLabel isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
861 |
metaToggleLabel := ValueHolder with:'Class'. |
14138 | 862 |
]. |
863 |
^ metaToggleLabel |
|
864 |
! |
|
865 |
||
866 |
methodInfo |
|
867 |
methodInfo isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
868 |
methodInfo := ValueHolder with:nil. |
14138 | 869 |
]. |
870 |
^ methodInfo |
|
871 |
! |
|
872 |
||
873 |
methodList |
|
874 |
|methodListApplication| |
|
875 |
||
876 |
methodListApplication := self methodListApplication. |
|
877 |
methodListApplication isNil ifTrue:[^ nil]. |
|
878 |
||
879 |
^ methodListApplication methodList |
|
880 |
! |
|
881 |
||
882 |
modeLabelHolder |
|
883 |
modeLabelHolder isNil ifTrue:[ |
|
884 |
modeLabelHolder := self codeView modeLabelHolder. |
|
885 |
]. |
|
886 |
^ modeLabelHolder |
|
887 |
! |
|
888 |
||
889 |
nameSpaceFilter |
|
890 |
nameSpaceFilter isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
891 |
nameSpaceFilter := ValueHolder with:nil. |
14138 | 892 |
]. |
893 |
^ nameSpaceFilter |
|
894 |
||
895 |
"Created: / 18.8.2000 / 14:25:24 / cg" |
|
896 |
! |
|
897 |
||
898 |
nameSpaceListGenerator |
|
899 |
nameSpaceListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
900 |
nameSpaceListGenerator := ValueHolder with:nil. |
14138 | 901 |
]. |
902 |
^ nameSpaceListGenerator |
|
903 |
||
904 |
"Created: / 18.8.2000 / 14:26:19 / cg" |
|
905 |
"Modified: / 18.8.2000 / 14:27:59 / cg" |
|
906 |
! |
|
907 |
||
908 |
navigationHistory |
|
909 |
navigationHistory ifNil:[ |
|
910 |
navigationHistory := NavigationHistory new. |
|
911 |
]. |
|
912 |
^navigationHistory |
|
913 |
||
914 |
"Created: / 21-02-2008 / 20:08:43 / janfrog" |
|
915 |
"Modified: / 21-07-2009 / 22:39:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
916 |
! |
|
917 |
||
918 |
noAllItem |
|
919 |
noAllItem isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
920 |
noAllItem := ValueHolder with:nil. |
14138 | 921 |
]. |
922 |
^ noAllItem |
|
923 |
! |
|
924 |
||
925 |
organizerMode |
|
926 |
"return the organizerMode holder; |
|
927 |
holding a symbol describing how things are organized |
|
928 |
(#category, #hierarchy, #project or #namespace)" |
|
929 |
||
930 |
organizerMode isNil ifTrue:[ |
|
931 |
organizerMode := OrganizerCanvas organizerModeCategory asValue. |
|
932 |
]. |
|
933 |
^ organizerMode |
|
934 |
||
935 |
"Created: / 18.2.2000 / 13:33:55 / cg" |
|
936 |
"Modified: / 18.8.2000 / 18:37:22 / cg" |
|
937 |
! |
|
938 |
||
939 |
packageFilter |
|
940 |
packageFilter isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
941 |
packageFilter := ValueHolder with:nil. |
14138 | 942 |
]. |
943 |
^ packageFilter |
|
944 |
||
945 |
"Created: / 24.2.2000 / 23:45:28 / cg" |
|
946 |
! |
|
947 |
||
948 |
packageInfoBackgroundColorHolder |
|
949 |
||
950 |
packageInfoBackgroundColorHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
951 |
packageInfoBackgroundColorHolder := ValueHolder with:nil. |
14138 | 952 |
]. |
953 |
^ packageInfoBackgroundColorHolder |
|
954 |
||
955 |
"Created: / 03-10-2011 / 14:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
956 |
! |
|
957 |
||
958 |
packageLabelHolder |
|
959 |
packageLabelHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
960 |
packageLabelHolder := ValueHolder with:''. |
14138 | 961 |
]. |
962 |
^ packageLabelHolder |
|
963 |
! |
|
964 |
||
965 |
pluginVisibleHolder |
|
966 |
pluginVisibleHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
967 |
pluginVisibleHolder := ValueHolder with:false. |
14138 | 968 |
]. |
969 |
^ pluginVisibleHolder |
|
970 |
||
971 |
"Created: / 03-10-2010 / 17:50:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
972 |
! |
|
973 |
||
974 |
profilerStatistics |
|
975 |
profilerStatistics ifNil: [ |
|
976 |
profilerStatistics := ValueHolder new. |
|
977 |
]. |
|
978 |
^profilerStatistics |
|
979 |
||
980 |
"Created: / 22-07-2009 / 15:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
981 |
! |
|
982 |
||
983 |
profilerStatistics: aValueHolder |
|
984 |
profilerStatistics := aValueHolder |
|
985 |
||
986 |
"Created: / 21-02-2008 / 20:08:43 / janfrog" |
|
987 |
"Modified: / 21-07-2009 / 22:41:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
988 |
! |
|
989 |
||
990 |
progressHolder |
|
991 |
"return/create the 'progressHolder' value holder (automatically generated)" |
|
992 |
||
993 |
progressHolder isNil ifTrue:[ |
|
994 |
progressHolder := ValueHolder new. |
|
995 |
]. |
|
996 |
^ progressHolder |
|
997 |
! |
|
998 |
||
999 |
progressHolder:aValueHolder |
|
1000 |
"set the 'progressHolder' value holder (automatically generated)" |
|
1001 |
||
1002 |
progressHolder := aValueHolder. |
|
1003 |
! |
|
1004 |
||
1005 |
projectListGenerator |
|
1006 |
projectListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1007 |
projectListGenerator := ValueHolder with:nil. |
14138 | 1008 |
]. |
1009 |
^ projectListGenerator |
|
1010 |
||
1011 |
"Modified: / 25.2.2000 / 01:35:42 / cg" |
|
1012 |
"Created: / 25.2.2000 / 02:43:26 / cg" |
|
1013 |
! |
|
1014 |
||
1015 |
protocolListGenerator |
|
1016 |
protocolListGenerator isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1017 |
protocolListGenerator := ValueHolder with:nil. |
14138 | 1018 |
]. |
1019 |
^ protocolListGenerator |
|
1020 |
! |
|
1021 |
||
1022 |
selectedCategories |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1023 |
"a value holder on the currently selected class categories" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1024 |
|
14138 | 1025 |
selectedCategories isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1026 |
selectedCategories := ValueHolder with:nil. |
14138 | 1027 |
]. |
1028 |
^ selectedCategories |
|
1029 |
! |
|
1030 |
||
1031 |
selectedClasses |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1032 |
"a value holder on the currently selected classes" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1033 |
|
14138 | 1034 |
selectedClasses isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1035 |
selectedClasses := "SpecialValueHolder with:nil." ValueHolder with:nil. |
14138 | 1036 |
]. |
1037 |
^ selectedClasses |
|
1038 |
||
1039 |
"Modified: / 26-02-2013 / 12:29:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1040 |
! |
|
1041 |
||
1042 |
selectedLintRules |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1043 |
"a value holder on the currently selected lint rules" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1044 |
|
14138 | 1045 |
selectedLintRules isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1046 |
selectedLintRules := ValueHolder with:nil. |
14138 | 1047 |
]. |
1048 |
^ selectedLintRules |
|
1049 |
||
1050 |
"Modified: / 02-02-2010 / 20:42:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1051 |
! |
|
1052 |
||
1053 |
selectedMethods |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1054 |
"a value holder on the currently selected methods" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1055 |
|
14138 | 1056 |
selectedMethods isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1057 |
selectedMethods := ValueHolder with:nil. |
14138 | 1058 |
]. |
1059 |
^ selectedMethods |
|
1060 |
! |
|
1061 |
||
1062 |
selectedMethodsArrayAt:index |
|
1063 |
|holder| |
|
1064 |
||
1065 |
selectedMethodsArray isNil ifTrue:[ |
|
1066 |
selectedMethodsArray := OrderedCollection new |
|
1067 |
]. |
|
15651
064faa82f63f
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15343
diff
changeset
|
1068 |
selectedMethodsArray ensureSizeAtLeast:index. |
14138 | 1069 |
holder := selectedMethodsArray at:index. |
1070 |
holder isNil ifTrue:[ |
|
1071 |
selectedMethodsArray at:index put:(holder := ValueHolder new) |
|
1072 |
]. |
|
1073 |
^ holder. |
|
1074 |
! |
|
1075 |
||
1076 |
selectedNamespaces |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1077 |
"a value holder on the currently selected namespaces" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1078 |
|
14138 | 1079 |
selectedNamespaces isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1080 |
selectedNamespaces := ValueHolder with:nil. |
14138 | 1081 |
]. |
1082 |
^ selectedNamespaces |
|
1083 |
! |
|
1084 |
||
1085 |
selectedProjects |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1086 |
"a value holder on the currently selected projects" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1087 |
|
14138 | 1088 |
selectedProjects isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1089 |
selectedProjects := ValueHolder with:nil. |
14138 | 1090 |
]. |
1091 |
^ selectedProjects |
|
1092 |
! |
|
1093 |
||
1094 |
selectedProtocols |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1095 |
"a value holder on the currently selected protocols" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1096 |
|
14138 | 1097 |
selectedProtocols isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1098 |
selectedProtocols := ValueHolder with:nil. |
14138 | 1099 |
]. |
1100 |
^ selectedProtocols |
|
1101 |
! |
|
1102 |
||
1103 |
selectorListGenerator |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1104 |
"a value holder on the current selector generator" |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1105 |
|
14138 | 1106 |
selectorListGenerator isNil ifTrue:[ |
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1107 |
selectorListGenerator := ValueHolder with:nil. |
14138 | 1108 |
]. |
1109 |
^ selectorListGenerator |
|
1110 |
! |
|
1111 |
||
1112 |
selectorListGeneratorArray |
|
1113 |
self halt:'should not be invoked'. |
|
1114 |
! |
|
1115 |
||
1116 |
selectorListGeneratorArrayAt:index |
|
1117 |
|holder| |
|
1118 |
||
1119 |
selectorListGeneratorArray isNil ifTrue:[ |
|
1120 |
selectorListGeneratorArray := OrderedCollection new |
|
1121 |
]. |
|
15651
064faa82f63f
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15343
diff
changeset
|
1122 |
selectorListGeneratorArray ensureSizeAtLeast:index. |
14138 | 1123 |
holder := selectorListGeneratorArray at:index. |
1124 |
holder isNil ifTrue:[ |
|
1125 |
selectorListGeneratorArray at:index put:(holder := ValueHolder new) |
|
1126 |
]. |
|
1127 |
^ holder. |
|
1128 |
! |
|
1129 |
||
1130 |
sortBy |
|
1131 |
sortBy isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1132 |
sortBy := ValueHolder with:nil. |
14138 | 1133 |
]. |
1134 |
^ sortBy |
|
1135 |
! |
|
1136 |
||
1137 |
theSingleSelectedBookmarkFromMethodOrClass |
|
1138 |
||
1139 |
| mth cls | |
|
1140 |
||
1141 |
mth := self theSingleSelectedMethod. |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1142 |
(mth notNil and:[mth mclass notNil]) ifTrue:[ |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1143 |
^ Tools::NewSystemBrowser bookmarkForClass:mth mclass selector:mth selector |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1144 |
]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1145 |
(cls := self theSingleSelectedClass) notNil ifTrue:[ |
15343
8f3a9bc0b6dd
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15324
diff
changeset
|
1146 |
cls name notNil ifTrue:[ |
8f3a9bc0b6dd
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15324
diff
changeset
|
1147 |
^ Tools::NewSystemBrowser bookmarkForClass:cls selector:nil |
8f3a9bc0b6dd
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15324
diff
changeset
|
1148 |
]. |
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1149 |
]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1150 |
^ nil |
14138 | 1151 |
|
1152 |
"Created: / 02-06-2011 / 22:16:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1153 |
"Modified: / 02-06-2011 / 23:19:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1154 |
! |
|
1155 |
||
1156 |
theSingleSelectedClassFromMethodHolder |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1157 |
"computes the class from the current single selected method" |
14138 | 1158 |
|
1159 |
^BlockValue |
|
1160 |
with: |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1161 |
[:i1 :i2| |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1162 |
|
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1163 |
| mth cls | |
14138 | 1164 |
mth := self theSingleSelectedMethod. |
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1165 |
cls := mth isNil |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1166 |
ifTrue:[ nil ] |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1167 |
ifFalse:[ mth mclass ]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1168 |
cls isNil ifTrue:[ |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1169 |
cls := self theSingleSelectedClass |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1170 |
]. |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1171 |
cls |
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1172 |
] |
14138 | 1173 |
argument: self selectedMethods |
1174 |
argument: self selectedClasses. |
|
1175 |
||
1176 |
"Created: / 14-02-2010 / 10:05:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1177 |
! |
|
1178 |
||
1179 |
theSingleSelectedClassHolder |
|
1180 |
||
1181 |
^BlockValue |
|
1182 |
with: |
|
1183 |
[:i1 | self theSingleSelectedClass] |
|
1184 |
argument: |
|
1185 |
self selectedClasses |
|
1186 |
||
1187 |
"Created: / 05-08-2011 / 09:44:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1188 |
! |
|
1189 |
||
1190 |
theSingleSelectedLanguageFromMethodOrClass |
|
1191 |
||
1192 |
| mth cls | |
|
1193 |
||
1194 |
mth := self theSingleSelectedMethod. |
|
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1195 |
mth notNil ifTrue:[ ^ mth programmingLanguage ]. |
14138 | 1196 |
cls := self theSingleSelectedClass. |
14969
a77496b91db7
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14160
diff
changeset
|
1197 |
cls notNil ifTrue:[ ^ cls programmingLanguage ]. |
14138 | 1198 |
^SmalltalkLanguage instance |
1199 |
||
1200 |
"Created: / 20-07-2010 / 15:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1201 |
! |
|
1202 |
||
1203 |
theSingleSelectedMethodHolder |
|
1204 |
||
1205 |
^BlockValue |
|
1206 |
with: |
|
1207 |
[:i1 | self theSingleSelectedMethod] |
|
1208 |
argument: |
|
1209 |
self selectedMethods |
|
1210 |
||
1211 |
"Created: / 17-06-2011 / 12:39:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1212 |
! |
|
1213 |
||
1214 |
updateBookmarkHolder |
|
1215 |
||
1216 |
^self bookmarkHolder value: self theSingleSelectedBookmarkFromMethodOrClass |
|
1217 |
||
1218 |
"Created: / 02-06-2011 / 22:13:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1219 |
! |
|
1220 |
||
1221 |
updateLanguageHolder |
|
1222 |
||
1223 |
^self languageHolder value: self theSingleSelectedLanguageFromMethodOrClass |
|
1224 |
||
1225 |
"Created: / 20-07-2010 / 16:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1226 |
! |
|
1227 |
||
1228 |
variableFilter |
|
1229 |
variableFilter isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
1230 |
variableFilter := ValueHolder with:nil. |
14138 | 1231 |
]. |
1232 |
^ variableFilter |
|
1233 |
||
1234 |
"Created: / 24.2.2000 / 23:45:28 / cg" |
|
1235 |
! ! |
|
1236 |
||
15651
064faa82f63f
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15343
diff
changeset
|
1237 |
|
14138 | 1238 |
!NavigationState methodsFor:'aspects-kludges'! |
1239 |
||
1240 |
metaToggle |
|
1241 |
metaToggle isNil ifTrue:[ |
|
1242 |
metaToggle := PluggableAdaptor on:(self meta). |
|
1243 |
metaToggle |
|
1244 |
getBlock:[:m | m value == true] |
|
1245 |
putBlock:[:m :newValue | m value:(newValue ? false)] |
|
1246 |
updateBlock:[:m :aspect :param | true]. |
|
1247 |
]. |
|
1248 |
^ metaToggle |
|
1249 |
! |
|
1250 |
||
1251 |
notMetaToggle |
|
1252 |
notMetaToggle isNil ifTrue:[ |
|
1253 |
notMetaToggle := PluggableAdaptor on:(self meta). |
|
1254 |
notMetaToggle |
|
1255 |
getBlock:[:m | m value == false] |
|
1256 |
putBlock:[:m :newValue | m value:(newValue ? false) not] |
|
1257 |
updateBlock:[:m :aspect :param | true]. |
|
1258 |
]. |
|
1259 |
^ notMetaToggle |
|
1260 |
! ! |
|
1261 |
||
1262 |
!NavigationState methodsFor:'history'! |
|
1263 |
||
1264 |
addToHistory: class selector: selector |
|
1265 |
||
1266 |
| entry | |
|
1267 |
"/selector ifNil:[^self]. |
|
1268 |
entry := SystemBrowser historyEntryForClass: class selector: selector. |
|
1269 |
self navigationHistory goTo: entry. |
|
1270 |
^entry |
|
1271 |
||
1272 |
"Created: / 22-02-2008 / 08:44:05 / janfrog" |
|
1273 |
"Modified: / 22-02-2008 / 17:20:00 / janfrog" |
|
1274 |
"Modified: / 06-04-2012 / 10:55:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1275 |
! ! |
|
1276 |
||
1277 |
!NavigationState methodsFor:'printing & storing'! |
|
1278 |
||
1279 |
colorizeForModifiedBuffer:someString |
|
1280 |
^ someString asText emphasisAllAdd:(UserPreferences current emphasisForModifiedBuffer) |
|
1281 |
! |
|
1282 |
||
1283 |
nameString |
|
1284 |
"a descriptive string of what this state shows" |
|
1285 |
||
1286 |
|s| |
|
1287 |
||
1288 |
s := self rawNameStringOrNil ? 'nothing selected'. |
|
1289 |
||
1290 |
(self realModifiedState == true) ifTrue:[ |
|
1291 |
^ self colorizeForModifiedBuffer:s string |
|
1292 |
]. |
|
1293 |
^ s |
|
1294 |
! |
|
1295 |
||
1296 |
nameStringOrNil |
|
1297 |
"a descriptive string of what this state shows" |
|
1298 |
||
1299 |
|s "codeView"| |
|
1300 |
||
1301 |
s := self rawNameStringOrNil. |
|
1302 |
s notNil ifTrue:[ |
|
1303 |
self realModifiedState == true |
|
1304 |
"/ ((codeView := self codeView) notNil |
|
1305 |
"/ and:[codeView modified]) |
|
1306 |
ifTrue:[ |
|
1307 |
^ self colorizeForModifiedBuffer:s string |
|
1308 |
]. |
|
1309 |
]. |
|
1310 |
^ s |
|
1311 |
! |
|
1312 |
||
1313 |
rawNameStringForCategory |
|
1314 |
|categories theCategory| |
|
1315 |
||
1316 |
categories := self selectedCategories value. |
|
1317 |
categories size == 1 ifTrue:[ |
|
1318 |
theCategory := categories first. |
|
1319 |
theCategory notNil ifTrue:[ |
|
1320 |
^ theCategory string, ' [Category]' |
|
1321 |
]. |
|
1322 |
]. |
|
1323 |
^ nil |
|
1324 |
||
1325 |
"Created: / 18.8.2000 / 19:42:42 / cg" |
|
1326 |
! |
|
1327 |
||
1328 |
rawNameStringForNameSpace |
|
1329 |
|namespaces theNamespace nsName s| |
|
1330 |
||
1331 |
namespaces := self selectedNamespaces value. |
|
1332 |
namespaces size == 1 ifTrue:[ |
|
1333 |
theNamespace := namespaces first |
|
1334 |
]. |
|
1335 |
theNamespace notNil ifTrue:[ |
|
1336 |
theNamespace isNameSpace ifTrue:[ |
|
1337 |
nsName := theNamespace name |
|
1338 |
] ifFalse:[ |
|
1339 |
nsName := theNamespace |
|
1340 |
]. |
|
1341 |
s := nsName , ' [NameSpace]'. |
|
1342 |
(self isNameSpaceBrowser or:[self isNameSpaceFullBrowser]) ifTrue:[ |
|
1343 |
^ LabelAndIcon icon:(NewSystemBrowser nameSpaceIcon) string:s. |
|
1344 |
]. |
|
1345 |
^ s |
|
1346 |
]. |
|
1347 |
^ nil |
|
1348 |
||
1349 |
"Created: / 18.8.2000 / 20:15:02 / cg" |
|
1350 |
! |
|
1351 |
||
1352 |
rawNameStringForProject |
|
1353 |
|projects theProject s| |
|
1354 |
||
1355 |
projects := self selectedProjects value. |
|
1356 |
projects size == 1 ifTrue:[ |
|
1357 |
theProject := projects first |
|
1358 |
]. |
|
1359 |
theProject notNil ifTrue:[ |
|
1360 |
s := theProject , ' [Project]'. |
|
1361 |
(self isProjectBrowser or:[self isProjectFullBrowser]) ifTrue:[ |
|
1362 |
^ LabelAndIcon icon:(NewSystemBrowser packageIcon) string:s. |
|
1363 |
]. |
|
1364 |
^ s |
|
1365 |
]. |
|
1366 |
^ nil |
|
1367 |
||
1368 |
"Created: / 18.8.2000 / 20:18:34 / cg" |
|
1369 |
! |
|
1370 |
||
1371 |
rawNameStringOrNil |
|
1372 |
"a descriptive string of what this state shows; nil, if nothing is selected" |
|
1373 |
||
1374 |
^ self rawNameStringOrNilWantShort:false |
|
1375 |
! |
|
1376 |
||
1377 |
rawNameStringOrNilWantShort:shortName |
|
1378 |
"a descriptive string of what this state shows; nil, if nothing is selected" |
|
1379 |
||
1380 |
|lbl nr numClasses numMethods numCategories cats classes theClass |
|
1381 |
"protocols theProtocol" |
|
1382 |
methods theSingleMethod projects theProject longName nm methodName suffix cls| |
|
1383 |
||
1384 |
browserLabel notNil ifTrue:[ |
|
1385 |
"/ add the number of selected methods |
|
1386 |
((canvasType == #singleFullProtocolBrowserSpec) |
|
1387 |
or:[canvasType == #methodListBrowserSpec]) ifTrue:[ |
|
1388 |
nr := self selectedMethods value size. |
|
1389 |
nr > 5 ifTrue:[ |
|
1390 |
^ browserLabel string , ' - ' , nr printString , ' methods' |
|
1391 |
]. |
|
1392 |
]. |
|
1393 |
^ browserLabel |
|
1394 |
]. |
|
1395 |
||
1396 |
suffix := ''. |
|
1397 |
||
1398 |
self isProtocolOrFullProtocolBrowser ifTrue:[ |
|
1399 |
lbl := self rawNameStringForProject. |
|
1400 |
lbl notNil ifTrue:[^ lbl]. |
|
1401 |
suffix := ' [Protocol]'. |
|
1402 |
]. |
|
1403 |
||
1404 |
self isCategoryBrowser ifTrue:[ |
|
1405 |
lbl := self rawNameStringForCategory. |
|
1406 |
lbl notNil ifTrue:[^ lbl]. |
|
1407 |
suffix := ' [Category]'. |
|
1408 |
]. |
|
1409 |
||
1410 |
self isNameSpaceBrowser ifTrue:[ |
|
1411 |
lbl := self rawNameStringForNameSpace. |
|
1412 |
lbl notNil ifTrue:[^ lbl]. |
|
1413 |
suffix := ' [NameSpace]'. |
|
1414 |
]. |
|
1415 |
||
1416 |
self isProjectBrowser ifTrue:[ |
|
1417 |
projects := self selectedProjects value. |
|
1418 |
projects size == 1 ifTrue:[ |
|
1419 |
theProject := projects first |
|
1420 |
]. |
|
1421 |
suffix := ' [Project]'. |
|
1422 |
theProject notNil ifTrue:[ |
|
1423 |
^ theProject , suffix |
|
1424 |
] |
|
1425 |
]. |
|
1426 |
||
1427 |
classes := self selectedClasses value. |
|
1428 |
classes size == 1 ifTrue:[ |
|
1429 |
theClass := classes first. |
|
1430 |
theClass notNil ifTrue:[ |
|
1431 |
theClass := theClass theNonMetaclass |
|
1432 |
] |
|
1433 |
]. |
|
1434 |
||
1435 |
self isClassBrowser ifTrue:[ |
|
1436 |
suffix := ' [Class]'. |
|
1437 |
theClass notNil ifTrue:[ |
|
1438 |
^ theClass name , suffix |
|
1439 |
] |
|
1440 |
]. |
|
1441 |
||
1442 |
"/ protocols := self selectedProtocols value. |
|
1443 |
"/ protocols size == 1 ifTrue:[ |
|
1444 |
"/ theProtocol := protocols first |
|
1445 |
"/ ]. |
|
1446 |
||
1447 |
methods := self selectedMethods value. |
|
1448 |
methods size == 1 ifTrue:[ |
|
1449 |
theSingleMethod := methods first |
|
1450 |
]. |
|
1451 |
||
1452 |
theSingleMethod notNil ifTrue:[ |
|
1453 |
methodName := theSingleMethod selector. |
|
15324
190af6d17b2e
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15269
diff
changeset
|
1454 |
"/ cg: I see no reason to suppress this information |
190af6d17b2e
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15269
diff
changeset
|
1455 |
"/ methodName isSymbol ifTrue:[methodName := methodName selectorWithoutNameSpace]. |
14138 | 1456 |
theSingleMethod isJavaMethod ifTrue:[ |
1457 |
methodName := theSingleMethod printStringForBrowserWithSelector:methodName. |
|
1458 |
]. |
|
1459 |
]. |
|
1460 |
||
1461 |
self isMethodBrowser ifTrue:[ |
|
1462 |
suffix := ' [Selector]'. |
|
1463 |
||
1464 |
theSingleMethod notNil ifTrue:[ |
|
1465 |
theSingleMethod mclass isNil ifTrue:[ |
|
1466 |
^ '???' |
|
1467 |
]. |
|
1468 |
^ theSingleMethod mclass name , ' ' , methodName , suffix |
|
1469 |
] |
|
1470 |
]. |
|
1471 |
||
1472 |
self isCategoryBrowser ifTrue:[ |
|
1473 |
suffix := ' [Category]'. |
|
1474 |
] ifFalse:[ |
|
1475 |
self isFullClassSourceBrowser ifTrue:[ |
|
1476 |
suffix := ' [Full]'. |
|
1477 |
] ifFalse:[ |
|
1478 |
self isClassDocumentationBrowser ifTrue:[ |
|
1479 |
suffix := ' [Doc]'. |
|
1480 |
] ifFalse:[ |
|
1481 |
self isProjectBrowser ifTrue:[ |
|
1482 |
suffix := ' [Project]'. |
|
1483 |
] |
|
1484 |
] |
|
1485 |
] |
|
1486 |
]. |
|
1487 |
||
1488 |
nm := nil. |
|
1489 |
(numClasses := classes size) > 0 ifTrue:[ |
|
1490 |
numClasses > 1 ifTrue:[ |
|
1491 |
methods size > 0 ifTrue:[ |
|
1492 |
theSingleMethod notNil ifTrue:[ |
|
1493 |
cls := theSingleMethod mclass. |
|
1494 |
cls isNil ifTrue:[ |
|
1495 |
"/ oops - unbound |
|
1496 |
nm := '???' |
|
1497 |
] ifFalse:[ |
|
1498 |
longName := nm := cls nameInBrowser. |
|
1499 |
shortName ifTrue:[ |
|
1500 |
nm := cls nameWithoutPrefix. |
|
1501 |
cls isPrivate ifTrue:[ |
|
1502 |
nm := ':' , nm |
|
1503 |
] |
|
1504 |
]. |
|
1505 |
]. |
|
1506 |
nm := nm , ' ', (methodName ? '???') |
|
1507 |
] ifFalse:[ |
|
1508 |
nm := methods size printString , ' methods'. |
|
1509 |
numClasses := (methods collect:[:each | each mclass] as:IdentitySet) size. |
|
1510 |
numClasses > 1 ifTrue:[ |
|
1511 |
nm := nm , ' in ' , numClasses printString , ' classes'. |
|
1512 |
]. |
|
1513 |
]. |
|
1514 |
^ nm , suffix. |
|
1515 |
]. |
|
1516 |
||
1517 |
nm := numClasses printString , ' classes in '. |
|
1518 |
"/ cats := self selectedCategories value |
|
1519 |
cats := classes collect:[:each | each category] as:Set. |
|
1520 |
(numCategories := cats size) == 1 ifTrue:[ |
|
1521 |
nm := nm , cats first |
|
1522 |
] ifFalse:[ |
|
1523 |
nm := nm , numCategories printString , ' categories' |
|
1524 |
] |
|
1525 |
] ifFalse:[ |
|
1526 |
cls := theClass theNonMetaclass. |
|
1527 |
longName := nm := cls nameInBrowser. |
|
1528 |
shortName ifTrue:[ |
|
1529 |
nm := cls nameWithoutPrefix. |
|
1530 |
cls isPrivate ifTrue:[ |
|
1531 |
nm := ':' , nm |
|
1532 |
] |
|
1533 |
]. |
|
1534 |
methods := self selectedMethods value. |
|
1535 |
(numMethods := methods size) > 0 ifTrue:[ |
|
1536 |
numMethods == 1 ifTrue:[ |
|
1537 |
theSingleMethod := methods first. |
|
1538 |
nm := nm , ' ', (methodName ? '???') |
|
1539 |
] ifFalse:[ |
|
1540 |
nm := numMethods printString , ' methods in ' , nm |
|
1541 |
] |
|
1542 |
] |
|
1543 |
] |
|
1544 |
] ifFalse:[ |
|
1545 |
(self isNameSpaceBrowser |
|
1546 |
or:[self isNameSpaceFullBrowser |
|
1547 |
or:[organizerMode value == OrganizerCanvas organizerModeNamespace]]) ifTrue:[ |
|
1548 |
lbl := self rawNameStringForNameSpace. |
|
1549 |
lbl notNil ifTrue:[^ lbl]. |
|
1550 |
suffix := ' [NameSpace]'. |
|
1551 |
] ifFalse:[ |
|
1552 |
(self isProjectBrowser |
|
1553 |
or:[self isProjectFullBrowser |
|
1554 |
or:[organizerMode value == OrganizerCanvas organizerModeProject]]) ifTrue:[ |
|
1555 |
lbl := self rawNameStringForProject. |
|
1556 |
lbl notNil ifTrue:[^ lbl]. |
|
1557 |
suffix := ' [Project]'. |
|
1558 |
] ifFalse:[ |
|
1559 |
cats := self selectedCategories value. |
|
1560 |
cats size == 1 ifTrue:[ |
|
1561 |
nm := (cats first ? '') string |
|
1562 |
] |
|
1563 |
] |
|
1564 |
]. |
|
1565 |
]. |
|
1566 |
nm isNil ifTrue:[ ^ nil ]. |
|
1567 |
^ nm , suffix. |
|
1568 |
||
1569 |
"Created: / 11-02-2000 / 13:32:16 / cg" |
|
1570 |
"Modified: / 18-08-2000 / 21:06:35 / cg" |
|
1571 |
"Modified: / 20-07-2010 / 10:52:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1572 |
! |
|
1573 |
||
1574 |
shortNameString |
|
1575 |
"a descriptive string of what this state shows" |
|
1576 |
||
1577 |
|s| |
|
1578 |
||
1579 |
s := (self rawNameStringOrNilWantShort:true) ? 'nothing selected'. |
|
1580 |
||
1581 |
(self realModifiedState == true) ifTrue:[ |
|
1582 |
^ self colorizeForModifiedBuffer:s string |
|
1583 |
]. |
|
1584 |
^ s |
|
1585 |
! ! |
|
1586 |
||
1587 |
!NavigationState methodsFor:'queries'! |
|
1588 |
||
1589 |
isCategoryBrowser |
|
1590 |
^ canvasType == #categoryBrowserSpec |
|
1591 |
or:[ canvasType == #singleCategoryBrowserSpec |
|
1592 |
or:[ canvasType == #multipleCategoryBrowserSpec ]] |
|
1593 |
||
1594 |
"Modified: / 25.2.2000 / 01:17:02 / cg" |
|
1595 |
! |
|
1596 |
||
1597 |
isChainBrowser |
|
1598 |
^ canvasType == #chainBrowserSpec |
|
1599 |
! |
|
1600 |
||
1601 |
isCheckOutputBrowser |
|
1602 |
^ canvasType == #multipleClassWithInfoAndMethodWithInfoBrowserSpec |
|
1603 |
or:[canvasType == #multipleMethodWithInfoBrowserSpec |
|
1604 |
or:[canvasType == #multipleClassWithInfoBrowserSpec]] |
|
1605 |
! |
|
1606 |
||
1607 |
isClassBrowser |
|
1608 |
^ canvasType == #classBrowserSpec |
|
1609 |
or:[ canvasType == #singleClassBrowserSpec |
|
16568 | 1610 |
or:[ canvasType == #singleClassWithoutVariableListBrowserSpec |
1611 |
or:[ canvasType == #multipleClassBrowserSpec ]]] |
|
14138 | 1612 |
|
1613 |
"Modified: / 25.2.2000 / 00:38:07 / cg" |
|
1614 |
! |
|
1615 |
||
1616 |
isClassDocumentationBrowser |
|
1617 |
^ canvasType == #classDocumentationBrowserSpec |
|
1618 |
||
1619 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1620 |
! |
|
1621 |
||
1622 |
isClassExtensionBrowser |
|
1623 |
^ canvasType == #multipleClassExtensionBrowserSpec |
|
1624 |
||
1625 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1626 |
! |
|
1627 |
||
1628 |
isFullBrowser |
|
1629 |
^ canvasType == #fullBrowserSpec |
|
1630 |
! |
|
1631 |
||
1632 |
isFullClassSourceBrowser |
|
1633 |
^ canvasType == #fullClassSourceBrowserSpec |
|
1634 |
||
1635 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1636 |
! |
|
1637 |
||
1638 |
isFullProtocolBrowser |
|
1639 |
^ canvasType == #singleFullProtocolBrowserSpec |
|
1640 |
or:[ canvasType == #multipleFullProtocolBrowserSpec ] |
|
1641 |
||
1642 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1643 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1644 |
! |
|
1645 |
||
1646 |
isLintResultBrowser |
|
1647 |
^ canvasType == #smallLintByRuleResultBrowserSpec |
|
1648 |
! |
|
1649 |
||
1650 |
isMethodBrowser |
|
1651 |
^ canvasType == #methodListBrowserSpec |
|
1652 |
or:[ canvasType == #singleMethodBrowserSpec |
|
1653 |
or:[ canvasType == #multipleMethodBrowserSpec |
|
1654 |
or:[ canvasType == #multipleMethodWithInfoBrowserSpec ]]] |
|
1655 |
||
1656 |
"Modified: / 1.3.2000 / 13:35:12 / cg" |
|
1657 |
! |
|
1658 |
||
1659 |
isMethodListBrowser |
|
1660 |
canvasType == #methodListBrowserSpec ifTrue:[^ true]. |
|
1661 |
canvasType == #multipleMethodBrowserSpec ifTrue:[^ true]. |
|
1662 |
canvasType == #singleProtocolBrowserSpec ifTrue:[^ true]. |
|
1663 |
^ false. |
|
1664 |
! |
|
1665 |
||
1666 |
isNameSpaceBrowser |
|
1667 |
^ canvasType == #singleNameSpaceBrowserSpec |
|
1668 |
or:[ canvasType == #multipleNameSpaceBrowserSpec] |
|
1669 |
||
1670 |
"Modified: / 18.8.2000 / 16:12:34 / cg" |
|
1671 |
! |
|
1672 |
||
1673 |
isNameSpaceFullBrowser |
|
1674 |
^ canvasType == #singleNameSpaceFullBrowserSpec |
|
1675 |
or:[ canvasType == #multipleNameSpaceFullBrowserSpec ] |
|
1676 |
||
1677 |
"Created: / 18.8.2000 / 14:58:36 / cg" |
|
1678 |
! |
|
1679 |
||
1680 |
isProjectBrowser |
|
1681 |
^ canvasType == #singleProjectBrowserSpec |
|
1682 |
or:[ canvasType == #multipleProjectBrowserSpec ] |
|
1683 |
||
1684 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1685 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1686 |
! |
|
1687 |
||
1688 |
isProjectFullBrowser |
|
1689 |
^ canvasType == #singleProjectFullBrowserSpec |
|
1690 |
or:[ canvasType == #multipleProjectFullBrowserSpec ] |
|
1691 |
||
1692 |
"Created: / 18.8.2000 / 19:02:49 / cg" |
|
1693 |
! |
|
1694 |
||
1695 |
isProtocolBrowser |
|
1696 |
^ canvasType == #singleProtocolBrowserSpec |
|
1697 |
or:[ canvasType == #multipleProtocolBrowserSpec ] |
|
1698 |
||
1699 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1700 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1701 |
! |
|
1702 |
||
1703 |
isProtocolOrFullProtocolBrowser |
|
1704 |
^ self isProtocolBrowser |
|
1705 |
or:[ self isFullProtocolBrowser ] |
|
1706 |
! |
|
1707 |
||
1708 |
isSingleCategoryBrowser |
|
1709 |
^ canvasType == #singleCategoryBrowserSpec |
|
1710 |
! |
|
1711 |
||
1712 |
isSingleClassBrowser |
|
16568 | 1713 |
^ (canvasType == #singleClassBrowserSpec) |
1714 |
or:[ canvasType == #singleClassWithoutVariableListBrowserSpec ] |
|
14138 | 1715 |
! |
1716 |
||
1717 |
isSingleFullProtocolBrowser |
|
1718 |
^ canvasType == #singleFullProtocolBrowserSpec |
|
1719 |
! |
|
1720 |
||
1721 |
isSingleMethodBrowser |
|
1722 |
^ canvasType == #singleMethodBrowserSpec |
|
1723 |
||
1724 |
"Created: / 1.3.2000 / 13:35:52 / cg" |
|
1725 |
! |
|
1726 |
||
1727 |
isSingleNamespaceBrowser |
|
1728 |
^ canvasType == #singleNameSpaceBrowserSpec |
|
1729 |
! |
|
1730 |
||
1731 |
isSingleNamespaceFullBrowser |
|
1732 |
^ canvasType == #singleNameSpaceFullBrowserSpec |
|
1733 |
! |
|
1734 |
||
1735 |
isSingleProjectBrowser |
|
1736 |
^ canvasType == #singleProjectBrowserSpec |
|
1737 |
or:[ canvasType == #singleProjectFullBrowserSpec ] |
|
1738 |
||
1739 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1740 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1741 |
! |
|
1742 |
||
1743 |
isSingleProjectFullBrowser |
|
1744 |
^ canvasType == #singleProjectFullBrowserSpec |
|
1745 |
||
1746 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1747 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1748 |
! |
|
1749 |
||
1750 |
isSingleProtocolBrowser |
|
1751 |
^ canvasType == #singleProtocolBrowserSpec |
|
1752 |
! |
|
1753 |
||
1754 |
isVersionDiffBrowser |
|
1755 |
^ canvasType == #multipleClassRepositoryDiffBrowserSpec |
|
1756 |
! ! |
|
1757 |
||
1758 |
!NavigationState class methodsFor:'documentation'! |
|
1759 |
||
1760 |
version |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1761 |
^ '$Header$' |
14138 | 1762 |
! |
1763 |
||
1764 |
version_CVS |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1765 |
^ '$Header$' |
14138 | 1766 |
! |
1767 |
||
1768 |
version_SVN |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1769 |
^ '$Id$' |
14138 | 1770 |
! ! |
1771 |
||
1772 |
||
1773 |
NavigationState initialize! |