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