author | Patrik Svestka <patrik.svestka@gmail.com> |
Fri, 05 Nov 2021 14:28:53 +0100 | |
branch | jv |
changeset 19617 | 96a62e7ef902 |
parent 19611 | a4b9d283ca40 |
permissions | -rw-r--r-- |
14138 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
19611
a4b9d283ca40
Themes: use stylesheet to define color and style for modified buffer label
Jan Vrany <jan.vrany@labware.com>
parents:
17134
diff
changeset
|
3 |
COPYRIGHT (c) 2021 LabWare |
14138 | 4 |
All Rights Reserved |
5 |
||
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
13 |
"{ Package: 'stx:libtool' }" |
|
14 |
||
15 |
"{ NameSpace: Tools }" |
|
16 |
||
17 |
Object subclass:#NavigationState |
|
18 |
instanceVariableNames:'browserLabel codeModifiedHolder categoryList classList |
|
19 |
packageFilter nameSpaceFilter hidePrivateClasses canvasType |
|
20 |
notMetaToggle metaToggle metaToggleLabel organizerMode codeAspect |
|
21 |
codeHolder classDocumentationHolder canvas selectorListGenerator |
|
22 |
protocolListGenerator classListPerNameSpaceGenerator |
|
23 |
classListGenerator categoryListGenerator nameSpaceListGenerator |
|
24 |
projectListGenerator classHierarchyTopClass meta selectedMethods |
|
25 |
selectedProtocols selectedClasses selectedCategories |
|
26 |
selectedProjects selectedNamespaces selectedLintRules |
|
27 |
variableFilter filterClassVars sortBy noAllItem autoSearchPattern |
|
16469 | 28 |
autoSearchIgnoreCase autoSearchIsMatch autoSearchAction |
29 |
realModifiedStateHolder methodInfo versionDiffApplication |
|
30 |
selectorListGeneratorArray selectedMethodsArray infoLabelHolder |
|
31 |
packageLabelHolder cursorLineLabelHolder cursorColLabelHolder |
|
32 |
modeLabelHolder sortVariablesBy editModeHolder scrollableCodeView |
|
33 |
specialEditors selectedEditorNoteBookTabIndexHolder |
|
34 |
editorNoteBookListHolder editorNoteBookCanvasHolder codeView |
|
35 |
stringSearchToolView noteBookView inheritanceView |
|
36 |
documentationView languageHolder messageSpecHolder messageHolder |
|
37 |
progressHolder tabContentView messagePaneView |
|
38 |
codePaneAndPluginView codePaneAndPluginViewRelativeCorners |
|
39 |
pluginVisibleHolder bookmarkHolder worker |
|
40 |
packageInfoBackgroundColorHolder packageInfoButton |
|
41 |
showMethodTemplate lastMethodShownInCodeView showingParseError |
|
42 |
navigationHistory lintRuleListGenerator profilerStatistics |
|
43 |
inlineMessageApplication' |
|
14138 | 44 |
classVariableNames:'CodeAspectTranslations' |
45 |
poolDictionaries:'' |
|
46 |
category:'Interface-Browsers-New' |
|
47 |
! |
|
48 |
||
49 |
!NavigationState class methodsFor:'documentation'! |
|
50 |
||
51 |
copyright |
|
52 |
" |
|
53 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
19611
a4b9d283ca40
Themes: use stylesheet to define color and style for modified buffer label
Jan Vrany <jan.vrany@labware.com>
parents:
17134
diff
changeset
|
54 |
COPYRIGHT (c) 2021 LabWare |
14138 | 55 |
All Rights Reserved |
56 |
||
57 |
This software is furnished under a license and may be used |
|
58 |
only in accordance with the terms of that license and with the |
|
59 |
inclusion of the above copyright notice. This software may not |
|
60 |
be provided or otherwise made available to, or used by, any |
|
61 |
other person. No title to or ownership of the software is |
|
62 |
hereby transferred. |
|
63 |
" |
|
64 |
! ! |
|
65 |
||
66 |
!NavigationState class methodsFor:'initialization'! |
|
67 |
||
68 |
initialize |
|
69 |
"Invoked at system start or when the class is dynamically loaded." |
|
70 |
||
71 |
"/ please change as required (and remove this comment) |
|
72 |
||
73 |
CodeAspectTranslations := Dictionary new. |
|
74 |
CodeAspectTranslations at: #newApplication put: SyntaxHighlighter codeAspectClassDefinition. |
|
75 |
CodeAspectTranslations at: #newError put: SyntaxHighlighter codeAspectClassDefinition. |
|
76 |
||
77 |
||
78 |
"/ Add more... |
|
79 |
||
80 |
"Modified: / 23-10-2012 / 11:27:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
81 |
! ! |
|
82 |
||
83 |
!NavigationState methodsFor:'accessing'! |
|
84 |
||
85 |
autoSearchAction |
|
86 |
^ autoSearchAction |
|
87 |
! |
|
88 |
||
16469 | 89 |
autoSearchAction:aBlock |
90 |
"define an autosearch action (for semantic searches)" |
|
91 |
||
92 |
autoSearchAction := aBlock. |
|
14138 | 93 |
! |
94 |
||
95 |
autoSearchIgnoreCase |
|
16469 | 96 |
"return true if the autoSearch is case-insensitive" |
14138 | 97 |
|
98 |
^ autoSearchIgnoreCase |
|
99 |
! |
|
100 |
||
101 |
autoSearchIgnoreCase:aBoolean |
|
16469 | 102 |
"define the autoSearches case-insensitivenes" |
14138 | 103 |
|
104 |
autoSearchIgnoreCase := aBoolean |
|
105 |
! |
|
106 |
||
16469 | 107 |
autoSearchIsMatch |
108 |
"return true if the autoSearch is a match search" |
|
109 |
||
110 |
^ autoSearchIsMatch |
|
111 |
! |
|
112 |
||
113 |
autoSearchIsMatch:aBoolean |
|
114 |
"define the automatic search pattern matching behavior" |
|
115 |
||
116 |
autoSearchIsMatch := aBoolean. |
|
117 |
! |
|
118 |
||
14138 | 119 |
autoSearchPattern |
16469 | 120 |
"return the automatic search pattern. |
121 |
The codeView will search for this automatically, |
|
122 |
whenever the navigation is changing the shown method." |
|
14138 | 123 |
|
124 |
^ autoSearchPattern |
|
125 |
! |
|
126 |
||
16469 | 127 |
autoSearchPattern:aStringOrPattern |
128 |
"define the automatic search pattern. |
|
129 |
The codeView will search for this automatically, |
|
130 |
whenever the navigation is changing the shown method." |
|
131 |
||
132 |
autoSearchPattern := aStringOrPattern. |
|
133 |
! |
|
14138 | 134 |
|
16469 | 135 |
autoSearchPattern:aStringOrPattern ignoreCase:ignoreCaseBoolean match:isMatchBoolean |
136 |
"define the automatic search pattern. |
|
137 |
The codeView will search for this automatically, |
|
138 |
whenever the navigation is changing the shown method." |
|
139 |
||
140 |
autoSearchPattern := aStringOrPattern. |
|
141 |
autoSearchIsMatch := isMatchBoolean. |
|
142 |
autoSearchIgnoreCase := ignoreCaseBoolean. |
|
14138 | 143 |
! |
144 |
||
145 |
browserLabel |
|
146 |
"return the assigned state-label (to be shown in the tab)." |
|
147 |
||
148 |
^ browserLabel |
|
149 |
! |
|
150 |
||
151 |
browserLabel:aString |
|
152 |
"set the assigned state-label (to be shown in the tab)." |
|
153 |
||
154 |
browserLabel := aString |
|
155 |
! |
|
156 |
||
157 |
canvas |
|
158 |
^ canvas |
|
159 |
! |
|
160 |
||
161 |
canvas:something |
|
162 |
canvas := something. |
|
163 |
canvasType isNil ifTrue:[ |
|
164 |
canvasType := something spec |
|
165 |
]. |
|
166 |
! |
|
167 |
||
168 |
canvasType |
|
169 |
"return the type of canvas" |
|
170 |
||
171 |
^ canvasType |
|
172 |
! |
|
173 |
||
174 |
canvasType:aSpecSymbol |
|
175 |
"set the type of canvas" |
|
176 |
||
177 |
canvasType notNil ifTrue:[ |
|
178 |
canvasType ~~ aSpecSymbol ifTrue:[ |
|
179 |
self halt:'cannot be changed, once set'. |
|
16561 | 180 |
^ self. |
14138 | 181 |
] |
182 |
]. |
|
183 |
canvasType := aSpecSymbol |
|
184 |
! |
|
185 |
||
186 |
codeAspect |
|
187 |
"return the codeAspect; a symbol describing what is shown in the codeView" |
|
188 |
||
189 |
^ codeAspect |
|
190 |
||
191 |
"Created: / 11.2.2000 / 12:43:29 / cg" |
|
192 |
! |
|
193 |
||
194 |
codeAspect:aSymbolOrNil |
|
195 |
"set the codeAspect; a symbol describing what is shown in the codeView" |
|
196 |
||
197 |
codeAspect := aSymbolOrNil. |
|
198 |
(codeView notNil and:[codeView isCodeView2]) ifTrue:[ |
|
199 |
| xlatedCodeAspect | |
|
200 |
||
16896 | 201 |
xlatedCodeAspect := CodeAspectTranslations at: aSymbolOrNil ifAbsent:[aSymbolOrNil]. |
14138 | 202 |
codeView codeAspect: xlatedCodeAspect |
203 |
]. |
|
204 |
||
205 |
"Created: / 11-02-2000 / 12:43:45 / cg" |
|
206 |
"Modified: / 22-10-2012 / 17:05:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
207 |
! |
|
208 |
||
209 |
codePaneAndPluginView |
|
210 |
^ codePaneAndPluginView |
|
211 |
! |
|
212 |
||
213 |
codePaneAndPluginView:something |
|
214 |
codePaneAndPluginView := something. |
|
215 |
! |
|
216 |
||
217 |
codePaneAndPluginViewRelativeCorners |
|
218 |
codePaneAndPluginViewRelativeCorners ifNil:[ |
|
219 |
codePaneAndPluginViewRelativeCorners := #(0.76 1.0) |
|
220 |
]. |
|
221 |
^ codePaneAndPluginViewRelativeCorners |
|
222 |
||
223 |
"Modified: / 04-10-2010 / 08:20:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
224 |
! |
|
225 |
||
226 |
codePaneAndPluginViewRelativeCorners: anArray |
|
227 |
||
228 |
codePaneAndPluginViewRelativeCorners := anArray. |
|
229 |
||
230 |
"Modified: / 04-10-2010 / 08:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
231 |
! |
|
232 |
||
233 |
editorNoteBookCanvasHolder |
|
234 |
editorNoteBookCanvasHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
235 |
editorNoteBookCanvasHolder := ValueHolder with:nil. |
14138 | 236 |
]. |
237 |
^ editorNoteBookCanvasHolder |
|
238 |
! |
|
239 |
||
240 |
editorNoteBookListHolder |
|
241 |
editorNoteBookListHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
242 |
editorNoteBookListHolder := ValueHolder with:#(). |
14138 | 243 |
]. |
244 |
^ editorNoteBookListHolder |
|
245 |
! |
|
246 |
||
247 |
environment |
|
248 |
^ Smalltalk |
|
249 |
! |
|
250 |
||
251 |
lastMethodShownInCodeView |
|
252 |
^ lastMethodShownInCodeView |
|
253 |
! |
|
254 |
||
255 |
lastMethodShownInCodeView:something |
|
256 |
lastMethodShownInCodeView := something. |
|
257 |
! |
|
258 |
||
259 |
messagePaneView |
|
260 |
^ messagePaneView |
|
261 |
! |
|
262 |
||
263 |
messagePaneView:something |
|
264 |
messagePaneView := something. |
|
265 |
! |
|
266 |
||
267 |
modified |
|
268 |
"check for modified code by asking the editTextView; |
|
269 |
this one returns true if ever modified - even if |
|
270 |
the modifications where undone in the editor |
|
271 |
(i.e. not really modified). |
|
272 |
Use #reallyModified if the contents should be compared |
|
273 |
against the original contents" |
|
274 |
||
275 |
|v| |
|
276 |
||
277 |
self realModifiedState == true ifTrue:[^ true]. |
|
278 |
self anySpecialEditorModified ifTrue:[^ true]. |
|
279 |
||
280 |
^ (v := self codeView) notNil and:[v modified] |
|
281 |
! |
|
282 |
||
283 |
modified:aBoolean |
|
284 |
|codeView| |
|
285 |
||
286 |
(codeView := self codeView) notNil ifTrue:[ |
|
287 |
codeView modified:aBoolean |
|
288 |
]. |
|
289 |
specialEditors notNil ifTrue:[ |
|
290 |
specialEditors do:[:anEditor | |
|
291 |
anEditor application modified:aBoolean |
|
292 |
]. |
|
293 |
]. |
|
294 |
! |
|
295 |
||
296 |
noteBookView |
|
297 |
^ noteBookView |
|
298 |
! |
|
299 |
||
300 |
noteBookView:something |
|
301 |
noteBookView := something. |
|
302 |
! |
|
303 |
||
304 |
realModifiedState |
|
305 |
^ self realModifiedStateHolder value |
|
306 |
! |
|
307 |
||
308 |
realModifiedState:aBoolean |
|
309 |
self realModifiedStateHolder value:aBoolean |
|
310 |
! |
|
311 |
||
312 |
realModifiedStateHolder |
|
313 |
realModifiedStateHolder isNil ifTrue:[ |
|
314 |
realModifiedStateHolder := ValueHolder new. |
|
315 |
]. |
|
316 |
^ realModifiedStateHolder |
|
317 |
! |
|
318 |
||
319 |
selectedEditorNoteBookTabIndexHolder |
|
320 |
selectedEditorNoteBookTabIndexHolder isNil ifTrue:[ |
|
15269
bca25e16f601
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
14969
diff
changeset
|
321 |
selectedEditorNoteBookTabIndexHolder := ValueHolder with:1. |
14138 | 322 |
]. |
323 |
^ selectedEditorNoteBookTabIndexHolder |
|
324 |
! |
|
325 |
||
326 |
showMethodTemplate |
|
327 |
^ showMethodTemplate ? true |
|
328 |
||
329 |
"Created: / 12-02-2012 / 08:49:32 / cg" |
|
330 |
! |
|
331 |
||
332 |
showMethodTemplate: aBoolean |
|
333 |
showMethodTemplate := aBoolean |
|
334 |
||
335 |
"Created: / 12-02-2012 / 08:49:45 / cg" |
|
336 |
! |
|
337 |
||
338 |
showingParseError |
|
339 |
^ showingParseError |
|
340 |
! |
|
341 |
||
342 |
showingParseError:something |
|
343 |
showingParseError := something. |
|
344 |
! |
|
345 |
||
346 |
stringSearchToolView |
|
347 |
^ stringSearchToolView |
|
348 |
! |
|
349 |
||
350 |
stringSearchToolView: aStringSearchTool |
|
351 |
||
352 |
stringSearchToolView := aStringSearchTool |
|
353 |
! |
|
354 |
||
355 |
tabContentView |
|
356 |
^ tabContentView |
|
357 |
! |
|
358 |
||
359 |
tabContentView:something |
|
360 |
tabContentView := something. |
|
361 |
! |
|
362 |
||
363 |
worker |
|
364 |
^ worker |
|
365 |
! |
|
366 |
||
367 |
worker:aProcess |
|
368 |
worker := aProcess. |
|
369 |
! ! |
|
370 |
||
371 |
!NavigationState methodsFor:'accessing-selection'! |
|
372 |
||
373 |
theSingleSelectedClass |
|
374 |
"if only one class is selected, return it. |
|
375 |
Otherwise, return nil" |
|
376 |
||
377 |
|classes| |
|
378 |
||
379 |
classes := self selectedClasses value. |
|
380 |
classes size == 1 ifTrue:[ |
|
381 |
^ classes first |
|
382 |
]. |
|
383 |
^ nil |
|
384 |
! |
|
385 |
||
386 |
theSingleSelectedMethod |
|
387 |
"if only one method is selected, return it. |
|
388 |
Otherwise, return nil" |
|
389 |
||
390 |
|methods| |
|
391 |
||
392 |
methods := self selectedMethods value. |
|
393 |
methods size == 1 ifTrue:[ |
|
394 |
^ methods first |
|
395 |
]. |
|
396 |
^ nil |
|
397 |
! ! |
|
398 |
||
399 |
!NavigationState methodsFor:'accessing-subApps'! |
|
400 |
||
401 |
applicationOfComponent:aComponentName |
|
402 |
^ self applicationOfComponent:aComponentName or:nil |
|
403 |
||
404 |
! |
|
405 |
||
406 |
applicationOfComponent:aComponentName or:anotherComponentName |
|
407 |
|builder view| |
|
408 |
||
409 |
canvas isNil ifTrue:[^ nil]. |
|
410 |
||
411 |
builder := canvas builder. |
|
412 |
||
413 |
view := builder findVisibleComponentAt:aComponentName. |
|
414 |
(view isNil and:[anotherComponentName notNil]) ifTrue:[ |
|
415 |
view := builder findVisibleComponentAt:anotherComponentName. |
|
416 |
]. |
|
417 |
||
418 |
view notNil ifTrue:[ |
|
419 |
^ view application |
|
420 |
]. |
|
421 |
^ nil |
|
422 |
! |
|
423 |
||
424 |
classCategoryListApplication |
|
425 |
^ self applicationOfComponent:#ClassCategoryList |
|
426 |
||
427 |
! |
|
428 |
||
429 |
classHierarchyListApplication |
|
430 |
^ self applicationOfComponent:#ClassHierarchyList |
|
431 |
! |
|
432 |
||
433 |
classListApplication |
|
434 |
^ self applicationOfComponent:#ClassList |
|
435 |
||
436 |
! |
|
437 |
||
14160
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 |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
439 |
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
|
440 |
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
|
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 |
^ inlineMessageApplication |
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 |
"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
|
445 |
! |
2f0da065a87f
Message pane refactored to use reusable InlineMessageDialog instead hand-coded solution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14138
diff
changeset
|
446 |
|
14138 | 447 |
metaToggleComponent |
448 |
^ canvas builder findComponentAt:#ClassToggle. |
|
449 |
! |
|
450 |
||
451 |
methodCategoryListApplication |
|
452 |
^ self applicationOfComponent:#MethodCategoryList |
|
453 |
! |
|
454 |
||
455 |
methodListApplication |
|
456 |
^ self applicationOfComponent:#MethodList |
|
457 |
! |
|
458 |
||
459 |
nameSpaceListApplication |
|
460 |
^ self applicationOfComponent:#NamespaceList or:#PseudoNamespaceList |
|
461 |
! |
|
462 |
||
463 |
projectListApplication |
|
464 |
^ self applicationOfComponent:#ProjectList or:#PseudoProjectList |
|
465 |
! |
|
466 |
||
467 |
variableListApplication |
|
468 |
^ self applicationOfComponent:#VariableList |
|
469 |
! |
|
470 |
||
471 |
versionDiffApplication |
|
472 |
^ versionDiffApplication |
|
473 |
||
474 |
! |
|
475 |
||
476 |
versionDiffApplication:anApplication |
|
477 |
versionDiffApplication := anApplication |
|
478 |
||
479 |
! ! |
|
480 |
||
481 |
!NavigationState methodsFor:'accessing-subViews'! |
|
482 |
||
483 |
anySpecialEditorModified |
|
484 |
specialEditors notNil ifTrue:[ |
|
485 |
^ specialEditors contains:[:anEditor | anEditor application isModified]. |
|
486 |
]. |
|
487 |
^ false |
|
488 |
! |
|
489 |
||
490 |
codeView |
|
491 |
codeView isNil ifTrue:[ |
|
492 |
codeView := self scrollableCodeView scrolledView |
|
493 |
]. |
|
494 |
^ codeView |
|
495 |
! |
|
496 |
||
497 |
doSaveInSpecialEditors |
|
498 |
specialEditors notNil ifTrue:[ |
|
499 |
specialEditors do:[:anEditor | |
|
500 |
anEditor application isModified ifTrue:[ |
|
501 |
anEditor application save. |
|
502 |
^ self. |
|
503 |
] |
|
504 |
]. |
|
505 |
]. |
|
506 |
! |
|
507 |
||
508 |
documentationView |
|
509 |
|textView| |
|
510 |
||
511 |
documentationView isNil ifTrue:[ |
|
512 |
textView := CodeView new. |
|
513 |
documentationView := HVScrollableView forView:textView. |
|
514 |
]. |
|
515 |
^ documentationView |
|
516 |
! |
|
517 |
||
518 |
getCodeView |
|
519 |
^ codeView |
|
520 |
! |
|
521 |
||
522 |
inheritanceView |
|
523 |
inheritanceView isNil ifTrue:[ |
|
524 |
|classTreeView scrolledView| |
|
525 |
||
526 |
classTreeView := ClassTreeGraphView new. |
|
527 |
scrolledView := HVScrollableView forView:classTreeView. |
|
528 |
classTreeView middleButtonMenu:nil. |
|
529 |
inheritanceView := scrolledView |
|
530 |
]. |
|
531 |
^ inheritanceView |
|
532 |
! |
|
533 |
||
534 |
methodCategoryList: aView |
|
535 |
||
536 |
| builder | |
|
537 |
||
538 |
builder := canvas builder. |
|
539 |
builder namedComponents at: #MethodCategoryList put: aView. |
|
540 |
||
541 |
"Created: / 08-08-2011 / 09:18:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
542 |
! |
|
543 |
||
544 |
methodList: aView |
|
545 |
||
546 |
| builder | |
|
547 |
||
548 |
builder := canvas builder. |
|
549 |
builder namedComponents at: #MethodList put: aView. |
|
550 |
||
551 |
"Created: / 08-08-2011 / 15:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
552 |
! |
|
553 |
||
554 |
packageInfoButton |
|
555 |
^ packageInfoButton |
|
556 |
! |
|
557 |
||
558 |
packageInfoButton:something |
|
559 |
packageInfoButton := something. |
|
560 |
! |
|
561 |
||
562 |
scrollableCodeView |
|
563 |
scrollableCodeView isNil ifTrue:[ |
|
564 |
scrollableCodeView := self setUpScrollableCodeView. |
|
565 |
]. |
|
566 |
^ scrollableCodeView |
|
567 |
! |
|
568 |
||
569 |
setUpScrollableCodeView |
|
570 |
|v newScrollableCodeView newCodeView | |
|
571 |
||
572 |
(UserPreferences current useCodeView2In: #Browser) ifTrue:[ |
|
573 |
newCodeView := newScrollableCodeView := CodeView2 new. |
|
574 |
newCodeView mode: #method. |
|
575 |
newCodeView methodHolder: self theSingleSelectedMethodHolder. |
|
576 |
newCodeView classHolder: self theSingleSelectedClassHolder. |
|
577 |
] ifFalse:[ |
|
578 |
newScrollableCodeView := HVScrollableView for:CodeView. |
|
579 |
newCodeView := newScrollableCodeView scrolledView. |
|
580 |
newScrollableCodeView horizontalMini:true. |
|
581 |
]. |
|
582 |
||
583 |
newScrollableCodeView name:'CodeView'. |
|
584 |
newCodeView modifiedChannel:self codeModifiedHolder. |
|
585 |
newCodeView model:self codeHolder. |
|
586 |
newCodeView canTab:true. |
|
587 |
UserPreferences current useCodeView2InTools ifTrue:[ |
|
588 |
newCodeView |
|
589 |
classHolder:self theSingleSelectedClassFromMethodHolder; |
|
590 |
languageHolder:self languageHolder |
|
591 |
]. |
|
592 |
||
593 |
(UserPreferences current showAcceptCancelBarInBrowser |
|
594 |
and:[newCodeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
|
595 |
ViewWithAcceptAndCancelBar notNil ifTrue:[ |
|
596 |
v := ViewWithAcceptAndCancelBar new. |
|
597 |
v slaveView:newScrollableCodeView. |
|
598 |
v reallyModifiedHolder:self realModifiedStateHolder. |
|
599 |
v cancelAction: |
|
600 |
[ |
|
601 |
"/ codeView setClipboardText:(codeView contents). "/ for undo |
|
602 |
newCodeView device rememberInCopyBufferHistory:(newCodeView contents). "/ for undo |
|
603 |
newCodeView application |
|
604 |
delayedUpdateCodeWithAutoSearch:false checkModified:false. |
|
605 |
newCodeView requestFocus. |
|
606 |
]. |
|
607 |
v compareAction: |
|
608 |
[ |
|
609 |
newCodeView application doCompareIn:self. |
|
610 |
newCodeView requestFocus |
|
611 |
]. |
|
612 |
newScrollableCodeView := v. |
|
613 |
] |
|
614 |
]. |
|
615 |
||
616 |
^newScrollableCodeView |
|
617 |
||
618 |
"Modified: / 05-07-2011 / 10:34:33 / cg" |
|
619 |
"Modified: / 05-08-2011 / 09:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
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 |
|
19611
a4b9d283ca40
Themes: use stylesheet to define color and style for modified buffer label
Jan Vrany <jan.vrany@labware.com>
parents:
17134
diff
changeset
|
1282 |
^ someString asText emphasisAllAdd:(SystemBrowser emphasisForModifiedBuffer) |
a4b9d283ca40
Themes: use stylesheet to define color and style for modified buffer label
Jan Vrany <jan.vrany@labware.com>
parents:
17134
diff
changeset
|
1283 |
|
a4b9d283ca40
Themes: use stylesheet to define color and style for modified buffer label
Jan Vrany <jan.vrany@labware.com>
parents:
17134
diff
changeset
|
1284 |
"Modified: / 17-09-2021 / 15:00:37 / Jan Vrany <jan.vrany@labware.com>" |
14138 | 1285 |
! |
1286 |
||
1287 |
nameString |
|
1288 |
"a descriptive string of what this state shows" |
|
1289 |
||
1290 |
|s| |
|
1291 |
||
1292 |
s := self rawNameStringOrNil ? 'nothing selected'. |
|
1293 |
||
1294 |
(self realModifiedState == true) ifTrue:[ |
|
1295 |
^ self colorizeForModifiedBuffer:s string |
|
1296 |
]. |
|
1297 |
^ s |
|
1298 |
! |
|
1299 |
||
1300 |
nameStringOrNil |
|
1301 |
"a descriptive string of what this state shows" |
|
1302 |
||
1303 |
|s "codeView"| |
|
1304 |
||
1305 |
s := self rawNameStringOrNil. |
|
1306 |
s notNil ifTrue:[ |
|
1307 |
self realModifiedState == true |
|
1308 |
"/ ((codeView := self codeView) notNil |
|
1309 |
"/ and:[codeView modified]) |
|
1310 |
ifTrue:[ |
|
1311 |
^ self colorizeForModifiedBuffer:s string |
|
1312 |
]. |
|
1313 |
]. |
|
1314 |
^ s |
|
1315 |
! |
|
1316 |
||
1317 |
rawNameStringForCategory |
|
1318 |
|categories theCategory| |
|
1319 |
||
1320 |
categories := self selectedCategories value. |
|
1321 |
categories size == 1 ifTrue:[ |
|
1322 |
theCategory := categories first. |
|
1323 |
theCategory notNil ifTrue:[ |
|
1324 |
^ theCategory string, ' [Category]' |
|
1325 |
]. |
|
1326 |
]. |
|
1327 |
^ nil |
|
1328 |
||
1329 |
"Created: / 18.8.2000 / 19:42:42 / cg" |
|
1330 |
! |
|
1331 |
||
1332 |
rawNameStringForNameSpace |
|
1333 |
|namespaces theNamespace nsName s| |
|
1334 |
||
1335 |
namespaces := self selectedNamespaces value. |
|
1336 |
namespaces size == 1 ifTrue:[ |
|
1337 |
theNamespace := namespaces first |
|
1338 |
]. |
|
1339 |
theNamespace notNil ifTrue:[ |
|
1340 |
theNamespace isNameSpace ifTrue:[ |
|
1341 |
nsName := theNamespace name |
|
1342 |
] ifFalse:[ |
|
1343 |
nsName := theNamespace |
|
1344 |
]. |
|
1345 |
s := nsName , ' [NameSpace]'. |
|
1346 |
(self isNameSpaceBrowser or:[self isNameSpaceFullBrowser]) ifTrue:[ |
|
1347 |
^ LabelAndIcon icon:(NewSystemBrowser nameSpaceIcon) string:s. |
|
1348 |
]. |
|
1349 |
^ s |
|
1350 |
]. |
|
1351 |
^ nil |
|
1352 |
||
1353 |
"Created: / 18.8.2000 / 20:15:02 / cg" |
|
1354 |
! |
|
1355 |
||
1356 |
rawNameStringForProject |
|
1357 |
|projects theProject s| |
|
1358 |
||
1359 |
projects := self selectedProjects value. |
|
1360 |
projects size == 1 ifTrue:[ |
|
1361 |
theProject := projects first |
|
1362 |
]. |
|
1363 |
theProject notNil ifTrue:[ |
|
1364 |
s := theProject , ' [Project]'. |
|
1365 |
(self isProjectBrowser or:[self isProjectFullBrowser]) ifTrue:[ |
|
1366 |
^ LabelAndIcon icon:(NewSystemBrowser packageIcon) string:s. |
|
1367 |
]. |
|
1368 |
^ s |
|
1369 |
]. |
|
1370 |
^ nil |
|
1371 |
||
1372 |
"Created: / 18.8.2000 / 20:18:34 / cg" |
|
1373 |
! |
|
1374 |
||
1375 |
rawNameStringOrNil |
|
1376 |
"a descriptive string of what this state shows; nil, if nothing is selected" |
|
1377 |
||
1378 |
^ self rawNameStringOrNilWantShort:false |
|
1379 |
! |
|
1380 |
||
1381 |
rawNameStringOrNilWantShort:shortName |
|
1382 |
"a descriptive string of what this state shows; nil, if nothing is selected" |
|
1383 |
||
1384 |
|lbl nr numClasses numMethods numCategories cats classes theClass |
|
1385 |
"protocols theProtocol" |
|
1386 |
methods theSingleMethod projects theProject longName nm methodName suffix cls| |
|
1387 |
||
1388 |
browserLabel notNil ifTrue:[ |
|
1389 |
"/ add the number of selected methods |
|
1390 |
((canvasType == #singleFullProtocolBrowserSpec) |
|
1391 |
or:[canvasType == #methodListBrowserSpec]) ifTrue:[ |
|
1392 |
nr := self selectedMethods value size. |
|
1393 |
nr > 5 ifTrue:[ |
|
1394 |
^ browserLabel string , ' - ' , nr printString , ' methods' |
|
1395 |
]. |
|
1396 |
]. |
|
1397 |
^ browserLabel |
|
1398 |
]. |
|
1399 |
||
1400 |
suffix := ''. |
|
1401 |
||
1402 |
self isProtocolOrFullProtocolBrowser ifTrue:[ |
|
1403 |
lbl := self rawNameStringForProject. |
|
1404 |
lbl notNil ifTrue:[^ lbl]. |
|
1405 |
suffix := ' [Protocol]'. |
|
1406 |
]. |
|
1407 |
||
1408 |
self isCategoryBrowser ifTrue:[ |
|
1409 |
lbl := self rawNameStringForCategory. |
|
1410 |
lbl notNil ifTrue:[^ lbl]. |
|
1411 |
suffix := ' [Category]'. |
|
1412 |
]. |
|
1413 |
||
1414 |
self isNameSpaceBrowser ifTrue:[ |
|
1415 |
lbl := self rawNameStringForNameSpace. |
|
1416 |
lbl notNil ifTrue:[^ lbl]. |
|
1417 |
suffix := ' [NameSpace]'. |
|
1418 |
]. |
|
1419 |
||
1420 |
self isProjectBrowser ifTrue:[ |
|
1421 |
projects := self selectedProjects value. |
|
1422 |
projects size == 1 ifTrue:[ |
|
1423 |
theProject := projects first |
|
1424 |
]. |
|
1425 |
suffix := ' [Project]'. |
|
1426 |
theProject notNil ifTrue:[ |
|
1427 |
^ theProject , suffix |
|
1428 |
] |
|
1429 |
]. |
|
1430 |
||
1431 |
classes := self selectedClasses value. |
|
1432 |
classes size == 1 ifTrue:[ |
|
1433 |
theClass := classes first. |
|
1434 |
theClass notNil ifTrue:[ |
|
1435 |
theClass := theClass theNonMetaclass |
|
1436 |
] |
|
1437 |
]. |
|
1438 |
||
1439 |
self isClassBrowser ifTrue:[ |
|
1440 |
suffix := ' [Class]'. |
|
1441 |
theClass notNil ifTrue:[ |
|
1442 |
^ theClass name , suffix |
|
1443 |
] |
|
1444 |
]. |
|
1445 |
||
1446 |
"/ protocols := self selectedProtocols value. |
|
1447 |
"/ protocols size == 1 ifTrue:[ |
|
1448 |
"/ theProtocol := protocols first |
|
1449 |
"/ ]. |
|
1450 |
||
1451 |
methods := self selectedMethods value. |
|
1452 |
methods size == 1 ifTrue:[ |
|
1453 |
theSingleMethod := methods first |
|
1454 |
]. |
|
1455 |
||
1456 |
theSingleMethod notNil ifTrue:[ |
|
1457 |
methodName := theSingleMethod selector. |
|
15324
190af6d17b2e
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15269
diff
changeset
|
1458 |
"/ cg: I see no reason to suppress this information |
190af6d17b2e
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15269
diff
changeset
|
1459 |
"/ methodName isSymbol ifTrue:[methodName := methodName selectorWithoutNameSpace]. |
14138 | 1460 |
theSingleMethod isJavaMethod ifTrue:[ |
1461 |
methodName := theSingleMethod printStringForBrowserWithSelector:methodName. |
|
1462 |
]. |
|
1463 |
]. |
|
1464 |
||
1465 |
self isMethodBrowser ifTrue:[ |
|
1466 |
suffix := ' [Selector]'. |
|
1467 |
||
1468 |
theSingleMethod notNil ifTrue:[ |
|
1469 |
theSingleMethod mclass isNil ifTrue:[ |
|
1470 |
^ '???' |
|
1471 |
]. |
|
1472 |
^ theSingleMethod mclass name , ' ' , methodName , suffix |
|
1473 |
] |
|
1474 |
]. |
|
1475 |
||
1476 |
self isCategoryBrowser ifTrue:[ |
|
1477 |
suffix := ' [Category]'. |
|
1478 |
] ifFalse:[ |
|
1479 |
self isFullClassSourceBrowser ifTrue:[ |
|
1480 |
suffix := ' [Full]'. |
|
1481 |
] ifFalse:[ |
|
1482 |
self isClassDocumentationBrowser ifTrue:[ |
|
1483 |
suffix := ' [Doc]'. |
|
1484 |
] ifFalse:[ |
|
1485 |
self isProjectBrowser ifTrue:[ |
|
1486 |
suffix := ' [Project]'. |
|
1487 |
] |
|
1488 |
] |
|
1489 |
] |
|
1490 |
]. |
|
1491 |
||
1492 |
nm := nil. |
|
1493 |
(numClasses := classes size) > 0 ifTrue:[ |
|
1494 |
numClasses > 1 ifTrue:[ |
|
1495 |
methods size > 0 ifTrue:[ |
|
1496 |
theSingleMethod notNil ifTrue:[ |
|
1497 |
cls := theSingleMethod mclass. |
|
1498 |
cls isNil ifTrue:[ |
|
1499 |
"/ oops - unbound |
|
1500 |
nm := '???' |
|
1501 |
] ifFalse:[ |
|
1502 |
longName := nm := cls nameInBrowser. |
|
1503 |
shortName ifTrue:[ |
|
1504 |
nm := cls nameWithoutPrefix. |
|
1505 |
cls isPrivate ifTrue:[ |
|
1506 |
nm := ':' , nm |
|
1507 |
] |
|
1508 |
]. |
|
1509 |
]. |
|
1510 |
nm := nm , ' ', (methodName ? '???') |
|
1511 |
] ifFalse:[ |
|
1512 |
nm := methods size printString , ' methods'. |
|
1513 |
numClasses := (methods collect:[:each | each mclass] as:IdentitySet) size. |
|
1514 |
numClasses > 1 ifTrue:[ |
|
1515 |
nm := nm , ' in ' , numClasses printString , ' classes'. |
|
1516 |
]. |
|
1517 |
]. |
|
1518 |
^ nm , suffix. |
|
1519 |
]. |
|
1520 |
||
1521 |
nm := numClasses printString , ' classes in '. |
|
1522 |
"/ cats := self selectedCategories value |
|
1523 |
cats := classes collect:[:each | each category] as:Set. |
|
1524 |
(numCategories := cats size) == 1 ifTrue:[ |
|
1525 |
nm := nm , cats first |
|
1526 |
] ifFalse:[ |
|
1527 |
nm := nm , numCategories printString , ' categories' |
|
1528 |
] |
|
1529 |
] ifFalse:[ |
|
1530 |
cls := theClass theNonMetaclass. |
|
1531 |
longName := nm := cls nameInBrowser. |
|
1532 |
shortName ifTrue:[ |
|
1533 |
nm := cls nameWithoutPrefix. |
|
1534 |
cls isPrivate ifTrue:[ |
|
1535 |
nm := ':' , nm |
|
1536 |
] |
|
1537 |
]. |
|
1538 |
methods := self selectedMethods value. |
|
1539 |
(numMethods := methods size) > 0 ifTrue:[ |
|
1540 |
numMethods == 1 ifTrue:[ |
|
1541 |
theSingleMethod := methods first. |
|
1542 |
nm := nm , ' ', (methodName ? '???') |
|
1543 |
] ifFalse:[ |
|
1544 |
nm := numMethods printString , ' methods in ' , nm |
|
1545 |
] |
|
1546 |
] |
|
1547 |
] |
|
1548 |
] ifFalse:[ |
|
1549 |
(self isNameSpaceBrowser |
|
1550 |
or:[self isNameSpaceFullBrowser |
|
1551 |
or:[organizerMode value == OrganizerCanvas organizerModeNamespace]]) ifTrue:[ |
|
1552 |
lbl := self rawNameStringForNameSpace. |
|
1553 |
lbl notNil ifTrue:[^ lbl]. |
|
1554 |
suffix := ' [NameSpace]'. |
|
1555 |
] ifFalse:[ |
|
1556 |
(self isProjectBrowser |
|
1557 |
or:[self isProjectFullBrowser |
|
1558 |
or:[organizerMode value == OrganizerCanvas organizerModeProject]]) ifTrue:[ |
|
1559 |
lbl := self rawNameStringForProject. |
|
1560 |
lbl notNil ifTrue:[^ lbl]. |
|
1561 |
suffix := ' [Project]'. |
|
1562 |
] ifFalse:[ |
|
1563 |
cats := self selectedCategories value. |
|
1564 |
cats size == 1 ifTrue:[ |
|
1565 |
nm := (cats first ? '') string |
|
1566 |
] |
|
1567 |
] |
|
1568 |
]. |
|
1569 |
]. |
|
1570 |
nm isNil ifTrue:[ ^ nil ]. |
|
1571 |
^ nm , suffix. |
|
1572 |
||
1573 |
"Created: / 11-02-2000 / 13:32:16 / cg" |
|
1574 |
"Modified: / 18-08-2000 / 21:06:35 / cg" |
|
1575 |
"Modified: / 20-07-2010 / 10:52:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1576 |
! |
|
1577 |
||
1578 |
shortNameString |
|
1579 |
"a descriptive string of what this state shows" |
|
1580 |
||
1581 |
|s| |
|
1582 |
||
1583 |
s := (self rawNameStringOrNilWantShort:true) ? 'nothing selected'. |
|
1584 |
||
1585 |
(self realModifiedState == true) ifTrue:[ |
|
1586 |
^ self colorizeForModifiedBuffer:s string |
|
1587 |
]. |
|
1588 |
^ s |
|
1589 |
! ! |
|
1590 |
||
1591 |
!NavigationState methodsFor:'queries'! |
|
1592 |
||
1593 |
isCategoryBrowser |
|
1594 |
^ canvasType == #categoryBrowserSpec |
|
1595 |
or:[ canvasType == #singleCategoryBrowserSpec |
|
1596 |
or:[ canvasType == #multipleCategoryBrowserSpec ]] |
|
1597 |
||
1598 |
"Modified: / 25.2.2000 / 01:17:02 / cg" |
|
1599 |
! |
|
1600 |
||
1601 |
isChainBrowser |
|
1602 |
^ canvasType == #chainBrowserSpec |
|
1603 |
! |
|
1604 |
||
1605 |
isCheckOutputBrowser |
|
1606 |
^ canvasType == #multipleClassWithInfoAndMethodWithInfoBrowserSpec |
|
1607 |
or:[canvasType == #multipleMethodWithInfoBrowserSpec |
|
1608 |
or:[canvasType == #multipleClassWithInfoBrowserSpec]] |
|
1609 |
! |
|
1610 |
||
1611 |
isClassBrowser |
|
1612 |
^ canvasType == #classBrowserSpec |
|
1613 |
or:[ canvasType == #singleClassBrowserSpec |
|
16568 | 1614 |
or:[ canvasType == #singleClassWithoutVariableListBrowserSpec |
1615 |
or:[ canvasType == #multipleClassBrowserSpec ]]] |
|
14138 | 1616 |
|
1617 |
"Modified: / 25.2.2000 / 00:38:07 / cg" |
|
1618 |
! |
|
1619 |
||
1620 |
isClassDocumentationBrowser |
|
1621 |
^ canvasType == #classDocumentationBrowserSpec |
|
1622 |
||
1623 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1624 |
! |
|
1625 |
||
1626 |
isClassExtensionBrowser |
|
1627 |
^ canvasType == #multipleClassExtensionBrowserSpec |
|
1628 |
||
1629 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1630 |
! |
|
1631 |
||
1632 |
isFullBrowser |
|
1633 |
^ canvasType == #fullBrowserSpec |
|
1634 |
! |
|
1635 |
||
1636 |
isFullClassSourceBrowser |
|
1637 |
^ canvasType == #fullClassSourceBrowserSpec |
|
1638 |
||
1639 |
"Created: / 24.2.2000 / 14:54:40 / cg" |
|
1640 |
! |
|
1641 |
||
1642 |
isFullProtocolBrowser |
|
1643 |
^ canvasType == #singleFullProtocolBrowserSpec |
|
1644 |
or:[ canvasType == #multipleFullProtocolBrowserSpec ] |
|
1645 |
||
1646 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1647 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1648 |
! |
|
1649 |
||
1650 |
isLintResultBrowser |
|
1651 |
^ canvasType == #smallLintByRuleResultBrowserSpec |
|
1652 |
! |
|
1653 |
||
1654 |
isMethodBrowser |
|
1655 |
^ canvasType == #methodListBrowserSpec |
|
1656 |
or:[ canvasType == #singleMethodBrowserSpec |
|
1657 |
or:[ canvasType == #multipleMethodBrowserSpec |
|
1658 |
or:[ canvasType == #multipleMethodWithInfoBrowserSpec ]]] |
|
1659 |
||
1660 |
"Modified: / 1.3.2000 / 13:35:12 / cg" |
|
1661 |
! |
|
1662 |
||
1663 |
isMethodListBrowser |
|
1664 |
canvasType == #methodListBrowserSpec ifTrue:[^ true]. |
|
1665 |
canvasType == #multipleMethodBrowserSpec ifTrue:[^ true]. |
|
1666 |
canvasType == #singleProtocolBrowserSpec ifTrue:[^ true]. |
|
1667 |
^ false. |
|
1668 |
! |
|
1669 |
||
1670 |
isNameSpaceBrowser |
|
1671 |
^ canvasType == #singleNameSpaceBrowserSpec |
|
1672 |
or:[ canvasType == #multipleNameSpaceBrowserSpec] |
|
1673 |
||
1674 |
"Modified: / 18.8.2000 / 16:12:34 / cg" |
|
1675 |
! |
|
1676 |
||
1677 |
isNameSpaceFullBrowser |
|
1678 |
^ canvasType == #singleNameSpaceFullBrowserSpec |
|
1679 |
or:[ canvasType == #multipleNameSpaceFullBrowserSpec ] |
|
1680 |
||
1681 |
"Created: / 18.8.2000 / 14:58:36 / cg" |
|
1682 |
! |
|
1683 |
||
1684 |
isProjectBrowser |
|
1685 |
^ canvasType == #singleProjectBrowserSpec |
|
1686 |
or:[ canvasType == #multipleProjectBrowserSpec ] |
|
1687 |
||
1688 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1689 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1690 |
! |
|
1691 |
||
1692 |
isProjectFullBrowser |
|
16939 | 1693 |
"showing a single or multiple full projects |
1694 |
(but not a regular browser, in projects-mode." |
|
1695 |
||
14138 | 1696 |
^ canvasType == #singleProjectFullBrowserSpec |
1697 |
or:[ canvasType == #multipleProjectFullBrowserSpec ] |
|
1698 |
||
1699 |
"Created: / 18.8.2000 / 19:02:49 / cg" |
|
1700 |
! |
|
1701 |
||
1702 |
isProtocolBrowser |
|
1703 |
^ canvasType == #singleProtocolBrowserSpec |
|
1704 |
or:[ canvasType == #multipleProtocolBrowserSpec ] |
|
1705 |
||
1706 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1707 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1708 |
! |
|
1709 |
||
1710 |
isProtocolOrFullProtocolBrowser |
|
1711 |
^ self isProtocolBrowser |
|
1712 |
or:[ self isFullProtocolBrowser ] |
|
1713 |
! |
|
1714 |
||
1715 |
isSingleCategoryBrowser |
|
1716 |
^ canvasType == #singleCategoryBrowserSpec |
|
1717 |
! |
|
1718 |
||
1719 |
isSingleClassBrowser |
|
16568 | 1720 |
^ (canvasType == #singleClassBrowserSpec) |
1721 |
or:[ canvasType == #singleClassWithoutVariableListBrowserSpec ] |
|
14138 | 1722 |
! |
1723 |
||
1724 |
isSingleFullProtocolBrowser |
|
1725 |
^ canvasType == #singleFullProtocolBrowserSpec |
|
1726 |
! |
|
1727 |
||
1728 |
isSingleMethodBrowser |
|
1729 |
^ canvasType == #singleMethodBrowserSpec |
|
1730 |
||
1731 |
"Created: / 1.3.2000 / 13:35:52 / cg" |
|
1732 |
! |
|
1733 |
||
1734 |
isSingleNamespaceBrowser |
|
1735 |
^ canvasType == #singleNameSpaceBrowserSpec |
|
1736 |
! |
|
1737 |
||
1738 |
isSingleNamespaceFullBrowser |
|
1739 |
^ canvasType == #singleNameSpaceFullBrowserSpec |
|
1740 |
! |
|
1741 |
||
1742 |
isSingleProjectBrowser |
|
1743 |
^ canvasType == #singleProjectBrowserSpec |
|
1744 |
or:[ canvasType == #singleProjectFullBrowserSpec ] |
|
1745 |
||
1746 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1747 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1748 |
! |
|
1749 |
||
1750 |
isSingleProjectFullBrowser |
|
1751 |
^ canvasType == #singleProjectFullBrowserSpec |
|
1752 |
||
1753 |
"Created: / 24.2.2000 / 21:32:09 / cg" |
|
1754 |
"Modified: / 25.2.2000 / 03:11:00 / cg" |
|
1755 |
! |
|
1756 |
||
1757 |
isSingleProtocolBrowser |
|
1758 |
^ canvasType == #singleProtocolBrowserSpec |
|
1759 |
! |
|
1760 |
||
1761 |
isVersionDiffBrowser |
|
1762 |
^ canvasType == #multipleClassRepositoryDiffBrowserSpec |
|
1763 |
! ! |
|
1764 |
||
1765 |
!NavigationState class methodsFor:'documentation'! |
|
1766 |
||
1767 |
version |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1768 |
^ '$Header$' |
14138 | 1769 |
! |
1770 |
||
1771 |
version_CVS |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1772 |
^ '$Header$' |
14138 | 1773 |
! |
1774 |
||
1775 |
version_SVN |
|
15820
51e0d4036100
class: Tools::NavigationState
Claus Gittinger <cg@exept.de>
parents:
15651
diff
changeset
|
1776 |
^ '$Id$' |
14138 | 1777 |
! ! |
1778 |
||
1779 |
||
1780 |
NavigationState initialize! |