Tools__TagsBrowser.st
changeset 10766 eaaed81115db
parent 10765 9f7805ebbad2
child 10768 dcbc7f03c1a0
--- a/Tools__TagsBrowser.st	Thu Oct 06 12:50:51 2011 +0200
+++ b/Tools__TagsBrowser.st	Thu Oct 06 14:06:07 2011 +0200
@@ -75,6 +75,27 @@
     )
 
     "Created: / 06-10-2011 / 12:04:51 / cg"
+!
+
+helpSpec
+    "This resource specification was automatically generated
+     by the UIHelpTool of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIHelpTool may not be able to read the specification."
+
+    "
+     UIHelpTool openOnClass:Tools::TagsBrowser    
+    "
+
+    <resource: #help>
+
+    ^ super helpSpec addPairsFrom:#(
+
+#functionsOnly
+''
+
+)
 ! !
 
 !TagsBrowser class methodsFor:'interface specs'!
@@ -979,7 +1000,7 @@
             itemValue: functionsOnly:
             translateLabel: true
             isButton: true
-            indication: functionsOnly
+            indication: functionsOnlyHolder
             labelImage: (ResourceRetriever ToolbarIconLibrary functionsOnly16x16Icon)
           )
          )
@@ -1128,11 +1149,14 @@
 !
 
 functionsOnly:aBool
+    self functionsOnlyHolder value:aBool.
     aBool ifTrue:[
         tagList hideFunctions:false.
     ].
     tagList functionsOnly:aBool.
     self updateTagList
+
+    "Modified: / 06-10-2011 / 14:03:45 / cg"
 !
 
 hideClasses
@@ -1839,6 +1863,20 @@
 
 !TagsBrowser methodsFor:'menu actions'!
 
+keepingSelectionDo:aBlock
+    |oldSelection oldLabel|
+
+    oldSelection := tagView selectionValue.
+    aBlock value.
+
+    oldSelection notNil ifTrue:[ 
+        oldLabel := oldSelection label.
+        tagView selectElementForWhich:[:el | el label = oldLabel] ifAbsent:[self halt].
+    ].
+
+    "Created: / 06-10-2011 / 13:41:57 / cg"
+!
+
 middleButtonMenu
     ^ [ 
         |menu suffix file item|
@@ -1890,17 +1928,21 @@
 !
 
 sortByLineNumber
-    tagList sortedByLineNumber:true.
-    self sortIsByName value:false.
-    self sortIsByLineNumber value:true.
+    self keepingSelectionDo:[
+        tagList sortedByLineNumber:true.
+        self sortIsByName value:false.
+        self sortIsByLineNumber value:true.
+    ]
 
     "Created: / 03-08-2011 / 11:04:51 / cg"
 !
 
 sortByName
-    tagList sortedByNameIgnoringLeadingUnderscoresAndCase: "sortedByName:" true.
-    self sortIsByLineNumber value:false.
-    self sortIsByName value:true.
+    self keepingSelectionDo:[
+        tagList sortedByNameIgnoringLeadingUnderscoresAndCase: "sortedByName:" true.
+        self sortIsByLineNumber value:false.
+        self sortIsByName value:true.
+    ].
 
     "Created: / 03-08-2011 / 11:04:37 / cg"
 !
@@ -1909,7 +1951,7 @@
     "reload tags
     "
 
-    |file target|
+    |file target oldSelection|
 
     (true "(self tagsVisibilityHolder value == true)"
         and:[(file := self editedFile) notNil
@@ -1920,12 +1962,22 @@
                 target := nil
             ]
         ].
-        tagView generateTagsFor:file onTarget:target
+        oldSelection := tagView selectionValue.
+        tagView generateTagsFor:file onTarget:target 
+                finally:[
+                    |oldLabel|
+
+                    oldSelection notNil ifTrue:[ 
+                        oldLabel := oldSelection label.
+                        tagView selectElementForWhich:[:el | el label = oldLabel] ifAbsent:[self halt].
+                    ].
+                ].
     ] ifFalse:[
-        tagView stopGeneratingTags
+        tagView stopGeneratingTags.
+        tagView clearList.
     ].
 
-    "Modified: / 07-05-2011 / 11:50:50 / cg"
+    "Modified: / 06-10-2011 / 14:05:30 / cg"
 ! !
 
 !TagsBrowser methodsFor:'startup & release'!
@@ -2080,7 +2132,7 @@
 
 !TagsBrowser::TagView methodsFor:'generating tags'!
 
-generateTagsFor:aFile onTarget:aTarget
+generateTagsFor:aFile onTarget:aTarget finally:aBlock
     "generate tags for a file (optionally on a remote target)
     "
     |tagFile|
@@ -2129,6 +2181,7 @@
                     ].
                     tagLineNr := nil
                 ].
+                aBlock value.
             ]
         ] valueNowOrOnUnwindDo:[
             process := nil.
@@ -2138,7 +2191,7 @@
 
     process priorityRange:(4 to:8).
 
-    "Modified: / 07-05-2011 / 15:39:26 / cg"
+    "Created: / 06-10-2011 / 13:56:18 / cg"
 !
 
 stopGeneratingTags
@@ -2157,7 +2210,9 @@
         ]
     ].
     fileName := nil.
-    list removeAll.
+    "/ list removeAll.
+
+    "Modified (comment): / 06-10-2011 / 14:01:30 / cg"
 ! !
 
 !TagsBrowser::TagView methodsFor:'initialize & release'!
@@ -2195,11 +2250,11 @@
 !TagsBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.14 2011-10-06 10:50:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.15 2011-10-06 12:06:07 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.14 2011-10-06 10:50:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.15 2011-10-06 12:06:07 cg Exp $'
 !
 
 version_SVN