*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 08 Apr 2005 11:32:20 +0200
changeset 6242 53a88bc35aa5
parent 6241 9cc17d183247
child 6243 ec3b7f54d806
*** empty log message ***
Tools_SearchDialog.st
--- a/Tools_SearchDialog.st	Thu Apr 07 11:40:50 2005 +0200
+++ b/Tools_SearchDialog.st	Fri Apr 08 11:32:20 2005 +0200
@@ -51,6 +51,27 @@
 
 !SearchDialog methodsFor:'public'!
 
+addTextEntryWithCaseIgnore:withCaseIgnore withMatch:withMatch 
+    isSelector == #code ifTrue:[
+        self addTextEntryFieldForCode.
+    ] ifFalse:[
+        self addInputFieldForSelectorOrNameOrString.
+        withCaseIgnore ifTrue:[
+            self addCheckBox:(resources string:'Ignore case')
+                on:(caseHolder := (LastSearchWasIgnoringCase ? false) asValue).
+        ].
+        withMatch ifTrue:[
+            self addCheckBox:(resources string:'Match')
+                on:(matchHolder := (LastSearchWasMatch ? true) asValue).
+"/                (isSelector and:[ sel notNil. ]) ifTrue:[ 
+"/                    sel includesMatchCharacters ifTrue:[ 
+"/                        matchHolder value:false.
+"/                    ].
+"/                ].
+        ].
+    ]
+!
+
 askThenDo:aBlock 
     |where code sel matchHolderValue caseHolderValue|
 
@@ -137,9 +158,8 @@
         value:(isMethodHolder value ? false).
 !
 
-setupToAskForMethodSearchTitle:title forBrowser:brwsrArg isSelector:isSelectorArg searchArea:whereDefault withCaseIgnore:withCaseIgnore withMatch:withMatch 
-    withMethodList:withMethodList allowFind:allowFindArg allowBuffer:allowBufferArg allowBrowser:allowBrowserArg withTextEntry:withTextEntryArg 
-    | where ns methodNameSpaces|
+setupToAskForMethodSearchTitle:title forBrowser:brwsrArg isSelector:isSelectorArg searchArea:whereDefault withCaseIgnore:withCaseIgnore withMatch:withMatch withMethodList:withMethodList allowFind:allowFindArg allowBuffer:allowBufferArg allowBrowser:allowBrowserArg withTextEntry:withTextEntryArg 
+    |where ns methodNameSpaces|
 
     allowFind := allowFindArg.
     allowBuffer := allowBufferArg.
@@ -150,45 +170,24 @@
     resources := browser resources.
 
     (self addTextLabel:(resources string:title) withCRs) adjust:#left.
-
     selectedClasses := browser selectedClasses value.
     selectedCategories := browser selectedCategoriesValue.
     selectedMethods := browser selectedMethods value.
     currentClass := browser theSingleSelectedClass.
     currentClassCategory := browser theSingleSelectedCategory.
-    currentClass isNil ifTrue:[ 
-        browser hasMethodSelected ifTrue:[ 
+    currentClass isNil ifTrue:[
+        browser hasMethodSelected ifTrue:[
             currentClass := selectedMethods first mclass.
-            selectedClasses := (selectedMethods collect:[ :each | each mclass ]) 
+            selectedClasses := (selectedMethods collect:[:each | each mclass ]) 
                         asIdentitySet.
-            selectedClasses := selectedClasses select:[ :each | each notNil ].
+            selectedClasses := selectedClasses select:[:each | each notNil ].
         ].
     ].
-    currentClass notNil ifTrue:[ 
+    currentClass notNil ifTrue:[
         currentClass := currentClass theNonMetaclass.
     ].
-
-    withTextEntry ifTrue:[ 
-        isSelector == #code ifTrue:[
-            self addTextEntryFieldForCode.
-        ] ifFalse:[
-            self addInputFieldForSelectorOrNameOrString.
-
-            withCaseIgnore ifTrue:[ 
-                self addCheckBox:(resources string:'Ignore case')
-                    on:(caseHolder := (LastSearchWasIgnoringCase ? false) asValue).
-            ].
-            withMatch ifTrue:[ 
-                self addCheckBox:(resources string:'Match')
-                    on:(matchHolder := (LastSearchWasMatch ? true) asValue).
-
-"/                (isSelector and:[ sel notNil. ]) ifTrue:[ 
-"/                    sel includesMatchCharacters ifTrue:[ 
-"/                        matchHolder value:false.
-"/                    ].
-"/                ].
-            ].
-        ].
+    withTextEntry ifTrue:[
+        self addTextEntryWithCaseIgnore:withCaseIgnore withMatch:withMatch.
     ].
     searchAreas := OrderedCollection new.
     verticalPanel := VerticalPanelView new.
@@ -197,36 +196,35 @@
     self addVerticalSpace.
     (self addTextLabel:(resources string:'Search in:')) adjust:#left.
     whereRadioGroup := RadioButtonGroup new.
-    (selectedCategories size > 0 or:[ selectedClasses size > 0 ]) ifTrue:[ 
+    (selectedCategories size > 0 or:[ selectedClasses size > 0 ]) ifTrue:[
         self addCheckBoxForEverywhere.
-        
         "/        classMethodListView notNil ifTrue:[
         "/            b := CheckBox label:(resources string:'Shown Methods').
         "/            panel add:b. whereChannel add:b value:#currentMethodList.
         "/            areas add:#currentMethodList.
         "/            self makeTabable:b.
         "/        ].
-        browser isMethodListBrowser ifTrue:[ 
+        browser isMethodListBrowser ifTrue:[
             methodNameSpaces := (browser selectedMethods value ? #()) 
-                        collect:[ :eachMethod | eachMethod mclass topNameSpace ].
+                        collect:[:eachMethod | eachMethod mclass topNameSpace ].
         ].
-        methodNameSpaces size == 1 ifTrue:[ 
+        methodNameSpaces size == 1 ifTrue:[
             currentNamespace := methodNameSpaces first.
-        ] ifFalse:[ 
+        ] ifFalse:[
             currentNamespace := browser currentNamespace.
         ].
         (currentNamespace notNil 
             and:[ currentNamespace ~= (browser nameListEntryForALL) ]) 
                 ifTrue:[ self addCheckBoxForCurrentNamespace ]
-                ifFalse:[ 
+                ifFalse:[
                     (currentClass notNil 
                         and:[ (ns := currentClass nameSpace) notNil and:[ ns ~~ Smalltalk ] ]) 
                             ifTrue:[ self addCheckBoxForClassesNamespace:ns ].
                 ].
-        selectedCategories size > 0 ifTrue:[ 
+        selectedCategories size > 0 ifTrue:[
             self addCheckBoxForSelectedClassCategory.
         ].
-        (selectedClasses size > 0 or:[ selectedMethods size > 0 ]) ifTrue:[ 
+        (selectedClasses size > 0 or:[ selectedMethods size > 0 ]) ifTrue:[
             self addCheckBoxForSelectedClass.
             self addCheckBoxForSelectedClassAndSuperclasses.
             self addCheckBoxForSelectedClassAndSubclasses.
@@ -235,39 +233,39 @@
             self addCheckBoxForOwnerAndItsPrivateClasses.
             self addCheckBoxForOwnerAndItsSubclassesAndItsPrivateClasses.
         ].
-    ] ifFalse:[ 
-        browser currentNamespace ~~ Smalltalk ifTrue:[ 
+    ] ifFalse:[
+        browser currentNamespace ~~ Smalltalk ifTrue:[
             self addCheckBoxForEverywhere.
             currentNamespace := browser currentNamespace.
-            currentNamespace ~= (browser nameListEntryForALL) ifTrue:[ 
+            currentNamespace ~= (browser nameListEntryForALL) ifTrue:[
                 self addCheckBoxForCurrentNamespace.
-            ] ifFalse:[ 
+            ] ifFalse:[
                 (currentClass notNil 
                     and:[ (ns := currentClass nameSpace) notNil and:[ ns ~~ Smalltalk ] ]) 
                         ifTrue:[ self addCheckBoxForClassesNamespace:ns ].
             ].
         ].
     ].
-    (withMethodList and:[ browser isMethodListBrowser ]) ifTrue:[ 
-        searchAreas size == 0 ifTrue:[ 
+    (withMethodList and:[ browser isMethodListBrowser ]) ifTrue:[
+        searchAreas size == 0 ifTrue:[
             self addCheckBoxForEverywhere.
         ].
         self addCheckBoxForMethodList.
-        browser selectedMethods value size > 1 ifTrue:[ 
+        browser selectedMethods value size > 1 ifTrue:[
             self addCheckBoxForSelectedMethods.
         ].
     ].
-    searchAreas size == 0 ifTrue:[ 
+    searchAreas size == 0 ifTrue:[
         whereRadioGroup := #everywhere asValue.
         self addDummyCheckBoxForEverywhere.
-    ] ifFalse:[ 
-        whereDefault notNil ifTrue:[ 
-            (searchAreas includes:whereDefault) ifTrue:[ 
+    ] ifFalse:[
+        whereDefault notNil ifTrue:[
+            (searchAreas includes:whereDefault) ifTrue:[
                 where := whereDefault asSymbol.
-            ] ifFalse:[ 
+            ] ifFalse:[
                 where := searchAreas first.
             ].
-        ] ifFalse:[ 
+        ] ifFalse:[
             where := #everywhere.
         ].
         whereRadioGroup value:where.
@@ -277,7 +275,6 @@
     "/ panel has its own idea of indenting
     self addVerticalSpace.
     self addHorizontalLine.
-
     self addButtons.
     self label:(resources string:'Search').
 ! !
@@ -763,5 +760,5 @@
 !SearchDialog class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_SearchDialog.st,v 1.3 2004-05-27 14:29:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools_SearchDialog.st,v 1.4 2005-04-08 09:32:20 cg Exp $'
 ! !