22 allowBuffer allowBrowser searchWhat searchClassProtocolHolder |
22 allowBuffer allowBrowser searchWhat searchClassProtocolHolder |
23 searchInstanceProtocolHolder selectorOrCode listHolder |
23 searchInstanceProtocolHolder selectorOrCode listHolder |
24 matchProcess inputField' |
24 matchProcess inputField' |
25 classVariableNames:'LastCodeSearched LastCodeSearchWasMethod LastGlobalSearched |
25 classVariableNames:'LastCodeSearched LastCodeSearchWasMethod LastGlobalSearched |
26 LastStringSearched LastSearchWasMatch LastSearchWasCaseSensitive |
26 LastStringSearched LastSearchWasMatch LastSearchWasCaseSensitive |
27 LastStringSearchArea LastCodeSearchArea AREA_LISTOFMETHODS' |
27 LastStringSearchArea LastCodeSearchArea AREA_LISTOFMETHODS |
|
28 LastResourceSearched' |
28 poolDictionaries:'' |
29 poolDictionaries:'' |
29 category:'Interface-Browsers-New' |
30 category:'Interface-Browsers-New' |
30 ! |
31 ! |
31 |
32 |
32 !SearchDialog class methodsFor:'documentation'! |
33 !SearchDialog class methodsFor:'documentation'! |
163 addTextEntryWithCaseIgnore:withCaseIgnore withMatch:withMatch |
164 addTextEntryWithCaseIgnore:withCaseIgnore withMatch:withMatch |
164 matchHolder := caseHolder := nil. |
165 matchHolder := caseHolder := nil. |
165 |
166 |
166 searchWhat == #code ifTrue:[ |
167 searchWhat == #code ifTrue:[ |
167 self addTextEntryFieldForCode. |
168 self addTextEntryFieldForCode. |
168 ] ifFalse:[ |
169 ^ self. |
169 self addInputFieldForSelectorOrNameOrString. |
170 ]. |
170 withCaseIgnore ifTrue:[ |
171 |
171 self |
172 self addInputFieldForSelectorOrNameOrString. |
172 addCheckBox:(resources string:'Case Sensitive') |
173 withCaseIgnore ifTrue:[ |
173 on:(caseHolder := (LastSearchWasCaseSensitive ? false) asValue). |
174 self |
174 ]. |
175 addCheckBox:(resources string:'Case Sensitive') |
175 withMatch ifTrue:[ |
176 on:(caseHolder := (LastSearchWasCaseSensitive ? false) asValue). |
176 self |
177 ]. |
177 addCheckBox:(resources string:'Match') |
178 withMatch ifTrue:[ |
178 on:(matchHolder := (LastSearchWasMatch ? true) asValue). |
179 self |
|
180 addCheckBox:(resources string:'Match') |
|
181 on:(matchHolder := (LastSearchWasMatch ? true) asValue). |
179 "/ (isSelector and:[ sel notNil. ]) ifTrue:[ |
182 "/ (isSelector and:[ sel notNil. ]) ifTrue:[ |
180 "/ sel includesMatchCharacters ifTrue:[ |
183 "/ sel includesMatchCharacters ifTrue:[ |
181 "/ matchHolder value:false. |
184 "/ matchHolder value:false. |
182 "/ ]. |
185 "/ ]. |
183 "/ ]. |
186 "/ ]. |
184 ] |
|
185 ] |
187 ] |
|
188 |
|
189 "Modified (format): / 06-07-2011 / 11:56:31 / cg" |
186 ! |
190 ! |
187 |
191 |
188 askThenDo:aBlock |
192 askThenDo:aBlock |
189 |where code sel matchHolderValue caseHolderValue| |
193 |where code sel matchHolderValue caseHolderValue| |
190 |
194 |
291 aBlock value. |
295 aBlock value. |
292 ] |
296 ] |
293 ! |
297 ! |
294 |
298 |
295 setupToAskForMethodSearchTitle:title forBrowser:brwsrArg searchWhat:searchWhatArg |
299 setupToAskForMethodSearchTitle:title forBrowser:brwsrArg searchWhat:searchWhatArg |
296 searchArea:whereDefault withCaseIgnore:withCaseIgnore withMatch:withMatch |
300 searchArea:whereDefault withCaseIgnore:withCaseIgnore withMatch:withMatch |
297 withMethodList:withMethodList allowFind:allowFindArg allowBuffer:allowBufferArg |
301 withMethodList:withMethodList allowFind:allowFindArg allowBuffer:allowBufferArg |
298 allowBrowser:allowBrowserArg withTextEntry:withTextEntryArg |
302 allowBrowser:allowBrowserArg withTextEntry:withTextEntryArg |
299 |
303 |
300 |where ns methodNameSpaces methodPackages hPanel leftVerticalPanel rightVerticalPanel l| |
304 |where ns methodNameSpaces methodPackages hPanel leftVerticalPanel rightVerticalPanel l| |
301 |
305 |
302 allowFind := allowFindArg. |
306 allowFind := allowFindArg. |
303 allowBuffer := allowBufferArg. |
307 allowBuffer := allowBufferArg. |
855 sel := browser globalNameToSearchFor ? LastGlobalSearched. |
860 sel := browser globalNameToSearchFor ? LastGlobalSearched. |
856 ] ifFalse:[ |
861 ] ifFalse:[ |
857 searchWhat == #string ifTrue:[ |
862 searchWhat == #string ifTrue:[ |
858 sel := browser stringToSearchFor ? LastStringSearched. |
863 sel := browser stringToSearchFor ? LastStringSearched. |
859 ] ifFalse:[ |
864 ] ifFalse:[ |
860 sel := browser selectorToSearchFor. |
865 searchWhat == #resource ifTrue:[ |
|
866 sel := browser stringToSearchFor ? LastResourceSearched. |
|
867 ] ifFalse:[ |
|
868 sel := browser selectorToSearchFor. |
|
869 ] |
861 ] |
870 ] |
862 ]. |
871 ]. |
863 ]. |
872 ]. |
|
873 |
864 lastSearchPatterns := browser lastSearchPatterns. |
874 lastSearchPatterns := browser lastSearchPatterns. |
865 sel isEmptyOrNil ifTrue:[ |
875 sel isEmptyOrNil ifTrue:[ |
866 "/ use last searchString |
876 "/ use last searchString |
867 lastSearchPatterns size > 0 ifTrue:[ |
877 lastSearchPatterns size > 0 ifTrue:[ |
868 sel := lastSearchPatterns first. |
878 sel := lastSearchPatterns first. |
882 s := contents withoutSpaces. |
892 s := contents withoutSpaces. |
883 self topView |
893 self topView |
884 withWaitCursorDo:[ |
894 withWaitCursorDo:[ |
885 |best matching| |
895 |best matching| |
886 |
896 |
887 searchWhat == #globalName ifFalse:[ |
897 searchWhat == #resource ifTrue:[ |
888 what := Smalltalk selectorCompletion:s. |
898 what := DoWhatIMeanSupport resourceCompletion:s inEnvironment:Smalltalk match:true ignoreCase:false. |
889 ] ifTrue:[ |
899 ] ifFalse:[ |
890 what := Smalltalk globalNameCompletion:s. |
900 searchWhat == #globalName ifFalse:[ |
|
901 what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:Smalltalk. |
|
902 ] ifTrue:[ |
|
903 what := DoWhatIMeanSupport globalNameCompletion:s inEnvironment:Smalltalk match:true. |
|
904 ]. |
891 ]. |
905 ]. |
892 best := what first. |
906 best := what first. |
893 matching := what second. |
907 matching := what second. |
894 inputField contents:best. |
908 inputField contents:best. |
895 "/ listHolder contents:matching. |
909 "/ listHolder contents:matching. |