Tools__NavigationState.st
branchjv
changeset 15566 184cea584be5
parent 13750 0846f23cae65
parent 15343 8f3a9bc0b6dd
child 15653 1a50d41800d9
--- a/Tools__NavigationState.st	Sun Jan 12 23:30:25 2014 +0000
+++ b/Tools__NavigationState.st	Wed Apr 01 10:38:01 2015 +0100
@@ -37,7 +37,8 @@
 		codePaneAndPluginViewRelativeCorners pluginVisibleHolder
 		bookmarkHolder worker packageInfoBackgroundColorHolder
 		packageInfoButton showMethodTemplate lastMethodShownInCodeView
-		showingParseError'
+		showingParseError navigationHistory lintRuleListGenerator
+		profilerStatistics inlineMessageApplication'
 	classVariableNames:'CodeAspectTranslations'
 	poolDictionaries:''
 	category:'Interface-Browsers-New'
@@ -199,14 +200,14 @@
 
 editorNoteBookCanvasHolder
     editorNoteBookCanvasHolder isNil ifTrue:[
-        editorNoteBookCanvasHolder := nil asValue.
+        editorNoteBookCanvasHolder := ValueHolder with:nil.
     ].
     ^ editorNoteBookCanvasHolder
 !
 
 editorNoteBookListHolder
     editorNoteBookListHolder isNil ifTrue:[
-        editorNoteBookListHolder := #() asValue.
+        editorNoteBookListHolder := ValueHolder with:#().
     ].
     ^ editorNoteBookListHolder
 !
@@ -285,7 +286,7 @@
 
 selectedEditorNoteBookTabIndexHolder
     selectedEditorNoteBookTabIndexHolder isNil ifTrue:[
-        selectedEditorNoteBookTabIndexHolder := 1 asValue.
+        selectedEditorNoteBookTabIndexHolder := ValueHolder with:1.
     ].
     ^ selectedEditorNoteBookTabIndexHolder
 !
@@ -402,6 +403,15 @@
 
 !
 
+inlineMessageApplication
+    inlineMessageApplication isNil ifTrue:[
+        inlineMessageApplication := Tools::InlineMessageDialog new
+    ].
+    ^ inlineMessageApplication
+
+    "Created: / 25-03-2014 / 17:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 metaToggleComponent
     ^ canvas builder findComponentAt:#ClassToggle.
 !
@@ -627,7 +637,7 @@
 
 categoryList
     categoryList isNil ifTrue:[
-        categoryList := nil asValue.
+        categoryList := ValueHolder with:nil.
     ].
     ^ categoryList
 
@@ -637,7 +647,7 @@
 
 categoryListGenerator
     categoryListGenerator isNil ifTrue:[
-        categoryListGenerator := nil asValue.
+        categoryListGenerator := ValueHolder with:nil.
     ].
     ^ categoryListGenerator
 
@@ -647,22 +657,21 @@
 
 classDocumentationHolder
     classDocumentationHolder isNil ifTrue:[
-        classDocumentationHolder := nil asValue.
+        classDocumentationHolder := ValueHolder with:nil.
     ].
     ^ classDocumentationHolder
 !
 
 classHierarchyTopClass
     classHierarchyTopClass isNil ifTrue:[
-        classHierarchyTopClass := nil asValue.
+        classHierarchyTopClass := ValueHolder with:nil.
     ].
     ^ classHierarchyTopClass
-
 !
 
 classList
     classList isNil ifTrue:[
-        classList := nil asValue.
+        classList := ValueHolder with:nil.
     ].
     ^ classList
 
@@ -671,16 +680,14 @@
 
 classListGenerator
     classListGenerator isNil ifTrue:[
-        classListGenerator := nil asValue.
+        classListGenerator := ValueHolder with:nil.
     ].
     ^ classListGenerator
-
-
 !
 
 classListPerNameSpaceGenerator
     classListPerNameSpaceGenerator isNil ifTrue:[
-        classListPerNameSpaceGenerator := nil asValue.
+        classListPerNameSpaceGenerator := ValueHolder with:nil.
     ].
     ^ classListPerNameSpaceGenerator
 
@@ -689,15 +696,14 @@
 
 codeHolder
     codeHolder isNil ifTrue:[
-        codeHolder := nil asValue.
+        codeHolder := ValueHolder with:nil.
     ].
     ^ codeHolder
-
 !
 
 codeModifiedHolder
     codeModifiedHolder isNil ifTrue:[
-        codeModifiedHolder := false asValue.
+        codeModifiedHolder := ValueHolder with:false.
     ].
     ^ codeModifiedHolder
 !
@@ -733,7 +739,7 @@
 
 filterClassVars
     filterClassVars isNil ifTrue:[
-        filterClassVars := false asValue.
+        filterClassVars := ValueHolder with:false.
     ].
     ^ filterClassVars
 
@@ -742,7 +748,7 @@
 
 hidePrivateClasses
     hidePrivateClasses isNil ifTrue:[
-        hidePrivateClasses := false asValue.
+        hidePrivateClasses := ValueHolder with:false.
     ].
     ^ hidePrivateClasses
 
@@ -751,7 +757,7 @@
 
 infoLabelHolder 
     infoLabelHolder isNil ifTrue:[
-        infoLabelHolder := '' asValue.
+        infoLabelHolder := ValueHolder with:''.
     ].
     ^ infoLabelHolder
 !
@@ -769,13 +775,10 @@
 !
 
 lintRuleListGenerator
-
-    | result |
-    result := self objectAttributeAt: #lintRuleListGenerator.
-    result ifNil:
-        [result := ValueHolder new.
-        self objectAttributeAt: #lintRuleListGenerator put: result].
-    ^result
+    lintRuleListGenerator ifNil: [
+        lintRuleListGenerator := ValueHolder new.
+    ].
+    ^lintRuleListGenerator
 
     "Created: / 22-07-2009 / 15:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
@@ -814,26 +817,23 @@
 
 meta
     meta isNil ifTrue:[
-        meta := false asValue.
+        meta := ValueHolder with:false.
     ].
     ^ meta
-
-
 !
 
 metaToggleLabelHolder
     metaToggleLabel isNil ifTrue:[
-        metaToggleLabel := 'Class' asValue.
+        metaToggleLabel := ValueHolder with:'Class'.
     ].
     ^ metaToggleLabel
 !
 
 methodInfo
     methodInfo isNil ifTrue:[
-        methodInfo := nil asValue.
+        methodInfo := ValueHolder with:nil.
     ].
     ^ methodInfo
-
 !
 
 methodList
@@ -854,7 +854,7 @@
 
 nameSpaceFilter
     nameSpaceFilter isNil ifTrue:[
-        nameSpaceFilter := nil asValue.
+        nameSpaceFilter := ValueHolder with:nil.
     ].
     ^ nameSpaceFilter
 
@@ -863,7 +863,7 @@
 
 nameSpaceListGenerator
     nameSpaceListGenerator isNil ifTrue:[
-        nameSpaceListGenerator := nil asValue.
+        nameSpaceListGenerator := ValueHolder with:nil.
     ].
     ^ nameSpaceListGenerator
 
@@ -872,13 +872,10 @@
 !
 
 navigationHistory
-
-    | history |
-    history := self objectAttributeAt: #navigationHistory.
-    history ifNil:
-        [history := NavigationHistory new.
-        self objectAttributeAt: #navigationHistory put: history].
-    ^history
+    navigationHistory ifNil:[
+        navigationHistory := NavigationHistory new.
+    ].
+    ^navigationHistory
 
     "Created: / 21-02-2008 / 20:08:43 / janfrog"
     "Modified: / 21-07-2009 / 22:39:57 / Jan Vrany <vranyj1@fel.cvut.cz>"
@@ -886,7 +883,7 @@
 
 noAllItem
     noAllItem isNil ifTrue:[
-        noAllItem := nil asValue.
+        noAllItem := ValueHolder with:nil.
     ].
     ^ noAllItem
 !
@@ -907,7 +904,7 @@
 
 packageFilter
     packageFilter isNil ifTrue:[
-        packageFilter := nil asValue.
+        packageFilter := ValueHolder with:nil.
     ].
     ^ packageFilter
 
@@ -917,7 +914,7 @@
 packageInfoBackgroundColorHolder
 
     packageInfoBackgroundColorHolder isNil ifTrue:[
-        packageInfoBackgroundColorHolder := nil asValue.
+        packageInfoBackgroundColorHolder := ValueHolder with:nil.
     ].
     ^ packageInfoBackgroundColorHolder
 
@@ -926,14 +923,14 @@
 
 packageLabelHolder
     packageLabelHolder isNil ifTrue:[
-        packageLabelHolder := '' asValue.
+        packageLabelHolder := ValueHolder with:''.
     ].
     ^ packageLabelHolder
 !
 
 pluginVisibleHolder
     pluginVisibleHolder isNil ifTrue:[
-        pluginVisibleHolder := false asValue.
+        pluginVisibleHolder := ValueHolder with:false.
     ].
     ^ pluginVisibleHolder
 
@@ -941,21 +938,16 @@
 !
 
 profilerStatistics
+    profilerStatistics ifNil: [
+        profilerStatistics := ValueHolder new.
+    ].
+    ^profilerStatistics
 
-    | statistics |
-    statistics := self objectAttributeAt: #profilerStatistics.
-    statistics ifNil:
-        [statistics := ValueHolder new.
-        self objectAttributeAt: #profilerStatistics put: statistics].
-    ^statistics
-
-    "Created: / 21-02-2008 / 20:08:43 / janfrog"
-    "Modified: / 21-07-2009 / 22:40:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Created: / 22-07-2009 / 15:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
-profilerStatistics: anObject
-
-    self objectAttributeAt: #profilerStatistics put: anObject
+profilerStatistics: aValueHolder
+    profilerStatistics := aValueHolder
 
     "Created: / 21-02-2008 / 20:08:43 / janfrog"
     "Modified: / 21-07-2009 / 22:41:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
@@ -978,7 +970,7 @@
 
 projectListGenerator
     projectListGenerator isNil ifTrue:[
-        projectListGenerator := nil asValue.
+        projectListGenerator := ValueHolder with:nil.
     ].
     ^ projectListGenerator
 
@@ -988,23 +980,25 @@
 
 protocolListGenerator
     protocolListGenerator isNil ifTrue:[
-        protocolListGenerator := nil asValue.
+        protocolListGenerator := ValueHolder with:nil.
     ].
     ^ protocolListGenerator
-
 !
 
 selectedCategories
+    "a value holder on the currently selected class categories"
+
     selectedCategories isNil ifTrue:[
-        selectedCategories := nil asValue.
+        selectedCategories := ValueHolder with:nil.
     ].
     ^ selectedCategories
-
 !
 
 selectedClasses
+    "a value holder on the currently selected classes"
+
     selectedClasses isNil ifTrue:[
-        selectedClasses := "SpecialValueHolder with:nil." nil asValue.
+        selectedClasses := "SpecialValueHolder with:nil." ValueHolder with:nil.
     ].
     ^ selectedClasses
 
@@ -1012,8 +1006,10 @@
 !
 
 selectedLintRules
+    "a value holder on the currently selected lint rules"
+
     selectedLintRules isNil ifTrue:[
-        selectedLintRules := nil asValue.
+        selectedLintRules := ValueHolder with:nil.
     ].
     ^ selectedLintRules
 
@@ -1021,11 +1017,12 @@
 !
 
 selectedMethods
+    "a value holder on the currently selected methods"
+
     selectedMethods isNil ifTrue:[
-        selectedMethods := nil asValue.
+        selectedMethods := ValueHolder with:nil.
     ].
     ^ selectedMethods
-
 !
 
 selectedMethodsArrayAt:index
@@ -1045,35 +1042,39 @@
 !
 
 selectedNamespaces
+    "a value holder on the currently selected namespaces"
+
     selectedNamespaces isNil ifTrue:[
-        selectedNamespaces := nil asValue.
+        selectedNamespaces := ValueHolder with:nil.
     ].
     ^ selectedNamespaces
-
 !
 
 selectedProjects
+    "a value holder on the currently selected projects"
+
     selectedProjects isNil ifTrue:[
-        selectedProjects := nil asValue.
+        selectedProjects := ValueHolder with:nil.
     ].
     ^ selectedProjects
-
 !
 
 selectedProtocols
+    "a value holder on the currently selected protocols"
+
     selectedProtocols isNil ifTrue:[
-        selectedProtocols := nil asValue.
+        selectedProtocols := ValueHolder with:nil.
     ].
     ^ selectedProtocols
-
 !
 
 selectorListGenerator
+    "a value holder on the current selector generator"
+
     selectorListGenerator isNil ifTrue:[
-        selectorListGenerator := nil asValue.
+        selectorListGenerator := ValueHolder with:nil.
     ].
     ^ selectorListGenerator
-
 !
 
 selectorListGeneratorArray
@@ -1098,7 +1099,7 @@
 
 sortBy
     sortBy isNil ifTrue:[
-        sortBy := nil asValue.
+        sortBy := ValueHolder with:nil.
     ].
     ^ sortBy
 !
@@ -1108,27 +1109,37 @@
     | mth cls |
 
     mth := self theSingleSelectedMethod. 
-    (mth notNil and:[mth mclass notNil])
-        ifTrue:[^Tools::NewSystemBrowser bookmarkForClass:mth mclass selector:mth selector].
-    cls := self theSingleSelectedClass.
-    cls 
-        ifNotNil:[^Tools::NewSystemBrowser bookmarkForClass:cls selector:nil].
-    ^nil
+    (mth notNil and:[mth mclass notNil]) ifTrue:[
+        ^ Tools::NewSystemBrowser bookmarkForClass:mth mclass selector:mth selector
+    ].
+    (cls := self theSingleSelectedClass) notNil ifTrue:[
+        cls name notNil ifTrue:[
+            ^ Tools::NewSystemBrowser bookmarkForClass:cls selector:nil
+        ].
+    ].
+    ^ nil
 
     "Created: / 02-06-2011 / 22:16:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 02-06-2011 / 23:19:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 theSingleSelectedClassFromMethodHolder
+    "computes the class from the current single selected method"
 
     ^BlockValue 
         with:
-            [:i1 :i2| | mth cls |
+            [:i1 :i2| 
+
+            | mth cls |
             mth := self theSingleSelectedMethod. 
-            cls := mth ifNil:[nil] ifNotNil:[mth mclass].
-            cls ifNil:[
-            cls := self theSingleSelectedClass].
-            cls]
+            cls := mth isNil 
+                    ifTrue:[ nil ] 
+                    ifFalse:[ mth mclass ].
+            cls isNil ifTrue:[
+                cls := self theSingleSelectedClass
+            ].
+            cls
+        ]
         argument: self selectedMethods
         argument: self selectedClasses.
 
@@ -1151,9 +1162,9 @@
     | mth cls |
 
     mth := self theSingleSelectedMethod. 
-    mth ifNotNil:[^mth programmingLanguage].
+    mth notNil ifTrue:[ ^ mth programmingLanguage ].
     cls := self theSingleSelectedClass.
-    cls ifNotNil:[^cls programmingLanguage].
+    cls notNil ifTrue:[ ^ cls programmingLanguage ].
     ^SmalltalkLanguage instance
 
     "Created: / 20-07-2010 / 15:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1186,14 +1197,13 @@
 
 variableFilter
     variableFilter isNil ifTrue:[
-        variableFilter := nil asValue.
+        variableFilter := ValueHolder with:nil.
     ].
     ^ variableFilter
 
     "Created: / 24.2.2000 / 23:45:28 / cg"
 ! !
 
-
 !NavigationState methodsFor:'aspects-kludges'!
 
 metaToggle
@@ -1410,7 +1420,8 @@
 
     theSingleMethod notNil ifTrue:[
         methodName := theSingleMethod selector.
-        methodName isSymbol ifTrue:[methodName := methodName selector].
+        "/ cg: I see no reason to suppress this information
+        "/ methodName isSymbol ifTrue:[methodName := methodName selectorWithoutNameSpace].
         theSingleMethod isJavaMethod ifTrue:[
             methodName := theSingleMethod printStringForBrowserWithSelector:methodName.
         ].
@@ -1714,20 +1725,15 @@
 !NavigationState class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_NavigationState.st,v 1.50 2013-06-20 23:22:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NavigationState.st,v 1.60 2015-02-20 21:46:26 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_NavigationState.st,v 1.50 2013-06-20 23:22:15 cg Exp $'
-!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NavigationState.st,v 1.60 2015-02-20 21:46:26 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: Tools_NavigationState.st,v 1.50 2013-06-20 23:22:15 cg Exp $'
+    ^ '$Id: Tools__NavigationState.st,v 1.60 2015-02-20 21:46:26 cg Exp $'
 ! !