author | Claus Gittinger <cg@exept.de> |
Wed, 29 Feb 2012 19:50:58 +0100 | |
changeset 11295 | 92ce4ff0f0f9 |
parent 11272 | 1f7423bcbe3d |
child 11632 | b8ee8fa3700d |
permissions | -rw-r--r-- |
5591 | 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 |
" |
|
5592 | 12 |
"{ Package: 'stx:libtool' }" |
5591 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
DialogBox subclass:#SearchDialog |
|
17 |
instanceVariableNames:'openHow classes methods selectedClasses selectedCategories |
|
7042 | 18 |
selectedMethods selectedPackages currentClass currentNamespace |
19 |
currentClassCategory currentPackage browser whereRadioGroup |
|
8782 | 20 |
currentPanel searchAreas caseHolder matchHolder isMethodHolder |
7042 | 21 |
codeField selectorHolder defaultOpenHow withTextEntry allowFind |
9311 | 22 |
allowBuffer allowBrowser searchWhat searchClassProtocolHolder |
10444 | 23 |
searchInstanceProtocolHolder selectorOrCode selectionList |
24 |
listHolder matchProcess inputField' |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
25 |
classVariableNames:'LastCodeSearched LastCodeSearchWasMethod LastGlobalSearched |
9001
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
26 |
LastStringSearched LastSearchWasMatch LastSearchWasCaseSensitive |
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
27 |
LastStringSearchArea LastCodeSearchArea AREA_LISTOFMETHODS |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
28 |
LastResourceSearched' |
5591 | 29 |
poolDictionaries:'' |
30 |
category:'Interface-Browsers-New' |
|
31 |
! |
|
32 |
||
33 |
!SearchDialog class methodsFor:'documentation'! |
|
34 |
||
35 |
copyright |
|
36 |
" |
|
37 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
38 |
All Rights Reserved |
|
39 |
||
40 |
This software is furnished under a license and may be used |
|
41 |
only in accordance with the terms of that license and with the |
|
42 |
inclusion of the above copyright notice. This software may not |
|
43 |
be provided or otherwise made available to, or used by, any |
|
44 |
other person. No title to or ownership of the software is |
|
45 |
hereby transferred. |
|
46 |
" |
|
47 |
! ! |
|
48 |
||
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
49 |
!SearchDialog class methodsFor:'initialization'! |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
50 |
|
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
51 |
initialize |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
52 |
AREA_LISTOFMETHODS := #listOfMethods |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
53 |
|
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
54 |
"Created: / 19-11-2010 / 12:00:18 / cg" |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
55 |
! ! |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
56 |
|
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
57 |
!SearchDialog class methodsFor:'constants'! |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
58 |
|
9642 | 59 |
constantForListOfMethodsArea |
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
60 |
^ AREA_LISTOFMETHODS |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
61 |
|
9642 | 62 |
"Created: / 19-11-2010 / 12:11:50 / cg" |
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
63 |
! ! |
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
64 |
|
6381
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
65 |
!SearchDialog class methodsFor:'queries'! |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
66 |
|
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
67 |
lastCodeSearchArea |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
68 |
^ LastCodeSearchArea |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
69 |
! |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
70 |
|
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
71 |
lastStringSearchArea |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
72 |
^ LastStringSearchArea |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
73 |
! ! |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
74 |
|
6685 | 75 |
!SearchDialog methodsFor:'accessing-entered values'! |
76 |
||
77 |
classesToSearch |
|
78 |
^ classes. |
|
79 |
! |
|
80 |
||
81 |
codeToSearch |
|
82 |
^ selectorOrCode. |
|
83 |
! |
|
84 |
||
85 |
matchMethods |
|
86 |
^ isMethodHolder value ? false. |
|
87 |
! |
|
88 |
||
89 |
methodsToSearch |
|
90 |
^ methods. |
|
91 |
! |
|
92 |
||
93 |
openHow |
|
94 |
^ openHow. |
|
95 |
! |
|
96 |
||
97 |
searchIgnoringCase |
|
9001
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
98 |
^ self searchIsCaseSensitive not |
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
99 |
! |
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
100 |
|
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
101 |
searchIsCaseSensitive |
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
102 |
^ (caseHolder value ? false) |
6685 | 103 |
! |
104 |
||
105 |
searchWithMatch |
|
106 |
^ matchHolder value ? false. |
|
107 |
! |
|
108 |
||
109 |
selectorToSearch |
|
110 |
^ selectorOrCode. |
|
111 |
! ! |
|
112 |
||
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
113 |
!SearchDialog methodsFor:'obsolete'! |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
114 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
115 |
addCheckBoxForClassMethodSearch |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
116 |
|b| |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
117 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
118 |
b := CheckBox label:(resources string:'Class Protocol'). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
119 |
b model:(self searchClassProtocolHolder). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
120 |
currentPanel add:b. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
121 |
^ b. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
122 |
! |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
123 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
124 |
addCheckBoxForInstanceMethodSearch |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
125 |
|b| |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
126 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
127 |
b := CheckBox label:(resources string:'Instance Protocol'). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
128 |
b model:(self searchInstanceProtocolHolder). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
129 |
currentPanel add:b. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
130 |
^ b. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
131 |
! ! |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
132 |
|
5591 | 133 |
!SearchDialog methodsFor:'private'! |
134 |
||
6685 | 135 |
searchClassProtocolHolder |
136 |
searchClassProtocolHolder isNil ifTrue:[ |
|
137 |
searchClassProtocolHolder := true asValue |
|
138 |
]. |
|
139 |
^ searchClassProtocolHolder |
|
140 |
! |
|
141 |
||
142 |
searchInstanceProtocolHolder |
|
143 |
searchInstanceProtocolHolder isNil ifTrue:[ |
|
144 |
searchInstanceProtocolHolder := true asValue |
|
145 |
]. |
|
146 |
^ searchInstanceProtocolHolder |
|
147 |
! |
|
148 |
||
5591 | 149 |
showHelpOnCodePatterns |
150 |
HTMLDocumentView openFullOnHelpFile:'Browser/RBSearchPatterns.html' |
|
9315 | 151 |
! |
152 |
||
153 |
updateListOfMatchingSelectorsFor:s |
|
154 |
|p| |
|
155 |
||
156 |
(p := matchProcess) notNil ifTrue:[ |
|
157 |
p terminate. |
|
158 |
]. |
|
159 |
listHolder isNil ifTrue:[^ self]. |
|
160 |
||
161 |
matchProcess := |
|
162 |
[ |
|
163 |
|what matching| |
|
164 |
||
165 |
[ |
|
166 |
searchWhat == #globalName ifFalse:[ |
|
9600
301631add7e9
changed: #updateListOfMatchingSelectorsFor:
Claus Gittinger <cg@exept.de>
parents:
9519
diff
changeset
|
167 |
what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:Smalltalk match:(matchHolder value) ignoreCase:(caseHolder value not) |
9315 | 168 |
] ifTrue:[ |
169 |
what := DoWhatIMeanSupport globalNameCompletion:s inEnvironment:Smalltalk match:(matchHolder value). |
|
170 |
]. |
|
171 |
"/ best := what first. |
|
172 |
matching := what second. |
|
173 |
self sensor pushAction:[ listHolder contents:matching ]. |
|
174 |
] ensure:[ |
|
175 |
matchProcess := nil. |
|
176 |
]. |
|
177 |
] fork. |
|
9600
301631add7e9
changed: #updateListOfMatchingSelectorsFor:
Claus Gittinger <cg@exept.de>
parents:
9519
diff
changeset
|
178 |
|
301631add7e9
changed: #updateListOfMatchingSelectorsFor:
Claus Gittinger <cg@exept.de>
parents:
9519
diff
changeset
|
179 |
"Modified: / 26-10-2010 / 20:33:05 / cg" |
5591 | 180 |
! ! |
181 |
||
182 |
!SearchDialog methodsFor:'public'! |
|
183 |
||
6242 | 184 |
addTextEntryWithCaseIgnore:withCaseIgnore withMatch:withMatch |
9366
58c82c246a2f
changed: #addTextEntryWithCaseIgnore:withMatch:
Claus Gittinger <cg@exept.de>
parents:
9365
diff
changeset
|
185 |
matchHolder := caseHolder := nil. |
58c82c246a2f
changed: #addTextEntryWithCaseIgnore:withMatch:
Claus Gittinger <cg@exept.de>
parents:
9365
diff
changeset
|
186 |
|
9311 | 187 |
searchWhat == #code ifTrue:[ |
6242 | 188 |
self addTextEntryFieldForCode. |
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
189 |
^ self. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
190 |
]. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
191 |
|
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
192 |
self addInputFieldForSelectorOrNameOrString. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
193 |
withCaseIgnore ifTrue:[ |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
194 |
self |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
195 |
addCheckBox:(resources string:'Case Sensitive') |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
196 |
on:(caseHolder := (LastSearchWasCaseSensitive ? false) asValue). |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
197 |
]. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
198 |
withMatch ifTrue:[ |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
199 |
self |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
200 |
addCheckBox:(resources string:'Match') |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
201 |
on:(matchHolder := (LastSearchWasMatch ? true) asValue). |
6242 | 202 |
"/ (isSelector and:[ sel notNil. ]) ifTrue:[ |
203 |
"/ sel includesMatchCharacters ifTrue:[ |
|
204 |
"/ matchHolder value:false. |
|
205 |
"/ ]. |
|
206 |
"/ ]. |
|
207 |
] |
|
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
208 |
|
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
209 |
"Modified (format): / 06-07-2011 / 11:56:31 / cg" |
6242 | 210 |
! |
211 |
||
5591 | 212 |
askThenDo:aBlock |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
213 |
|where code sel matchHolderValue caseHolderValue| |
5591 | 214 |
|
215 |
self open. |
|
9406 | 216 |
self beScreenDialog. "raise it above all windows" |
5591 | 217 |
self accepted ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
218 |
^ self. |
5591 | 219 |
]. |
220 |
||
221 |
openHow isNil ifTrue:[ |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
222 |
openHow := defaultOpenHow. |
5591 | 223 |
]. |
224 |
where := whereRadioGroup value. |
|
225 |
withTextEntry ifTrue:[ |
|
9311 | 226 |
searchWhat == #code ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
227 |
code := codeField contentsAsString. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
228 |
LastCodeSearched := code. |
6381
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
229 |
LastCodeSearchArea := where. |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
230 |
] ifFalse:[ |
10469 | 231 |
(selectionList notNil and:[selectionList hasSelection]) ifTrue:[ |
10444 | 232 |
sel := selectionList selectionValue. |
233 |
] ifFalse:[ |
|
234 |
sel := selectorHolder value. |
|
235 |
]. |
|
8304
3e556502d05e
changed #askThenDo: check selection for isEmptyOrNil (not only isEmpty)
ca
parents:
8282
diff
changeset
|
236 |
sel isEmptyOrNil ifTrue:[ |
9311 | 237 |
browser warn:((searchWhat == #selector) |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
238 |
ifTrue:[ 'No selector entered for search'. ] |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
239 |
ifFalse:[ 'Nothing entered for search'. ]). |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
240 |
^ self. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
241 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
242 |
sel := sel string. |
6667 | 243 |
|
11272 | 244 |
(browser ? SystemBrowser) rememberSearchPattern:sel. |
9311 | 245 |
searchWhat == #globalName ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
246 |
LastGlobalSearched := sel. |
6381
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
247 |
] ifFalse:[ |
9311 | 248 |
searchWhat == #string ifTrue:[ |
8123 | 249 |
LastStringSearched := sel. |
6381
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
250 |
LastStringSearchArea := where. |
6667 | 251 |
] ifFalse:[ |
6700 | 252 |
(sel startsWith:'#''') ifTrue:[ |
253 |
sel := sel copyFrom:3. |
|
254 |
(sel endsWith:$') ifTrue:[ |
|
255 |
sel := sel copyWithoutLast:1. |
|
6667 | 256 |
]. |
257 |
]. |
|
6381
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
258 |
] |
f8696b036204
remember last search areas for string and code search
Claus Gittinger <cg@exept.de>
parents:
6379
diff
changeset
|
259 |
] |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
260 |
]. |
5591 | 261 |
]. |
262 |
where isNil ifTrue:[ |
|
11272 | 263 |
(browser ? Dialog) warn:'No class(es) for search'. |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
264 |
^ self. |
5591 | 265 |
]. |
9336
fe62308cf539
comment/format in: #askThenDo:
Claus Gittinger <cg@exept.de>
parents:
9331
diff
changeset
|
266 |
self getClassesAndMethodsFor:where. |
5591 | 267 |
|
268 |
(#(#classesWithPrivateClasses #classHierarchiesWithPrivateClasses #ownersWithPrivateClasses #ownersHierarchiesWithPrivateClasses) |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
269 |
includes:where) |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
270 |
ifTrue:[ |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
271 |
|toSearch| |
5591 | 272 |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
273 |
toSearch := IdentitySet withAll:classes. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
274 |
classes := IdentitySet withAll:toSearch. |
9336
fe62308cf539
comment/format in: #askThenDo:
Claus Gittinger <cg@exept.de>
parents:
9331
diff
changeset
|
275 |
[ toSearch notEmpty ] whileTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
276 |
|cls| |
5591 | 277 |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
278 |
cls := toSearch removeFirst. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
279 |
classes addAll:cls allPrivateClasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
280 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
281 |
]. |
5591 | 282 |
|
283 |
classes size == 0 ifTrue:[ |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
284 |
classes := nil. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
285 |
methods size == 0 ifTrue:[ |
11272 | 286 |
(browser ? Dialog) warn:'No class(es) given for search.'. |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
287 |
^ self. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
288 |
]. |
5591 | 289 |
] ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
290 |
classes := classes asOrderedCollection. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
291 |
methods size ~~ 0 ifTrue:[ |
11272 | 292 |
(browser ? Dialog) warn:'oops'. |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
293 |
methods := nil. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
294 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
295 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
296 |
|
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
297 |
matchHolderValue := matchHolder value. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
298 |
matchHolderValue notNil ifTrue:[ |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
299 |
LastSearchWasMatch := matchHolderValue |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
300 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
301 |
caseHolderValue := caseHolder value. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
302 |
caseHolderValue notNil ifTrue:[ |
9001
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
303 |
LastSearchWasCaseSensitive := caseHolderValue |
5591 | 304 |
]. |
305 |
||
6685 | 306 |
selectorOrCode := sel ? code. |
307 |
||
308 |
aBlock numArgs == 7 ifTrue:[ |
|
309 |
"/ old style |
|
310 |
aBlock |
|
311 |
value:classes |
|
312 |
value:(sel ? code) |
|
9001
22e3a719e91a
inverted the check-box meaning: \"Ignore case\" vs. \"Case Sensitive\"
Claus Gittinger <cg@exept.de>
parents:
8833
diff
changeset
|
313 |
value:(self searchIgnoringCase) |
6685 | 314 |
value:openHow |
315 |
value:(matchHolderValue ? false) |
|
316 |
value:methods |
|
317 |
value:(isMethodHolder value ? false). |
|
318 |
] ifFalse:[ |
|
319 |
aBlock value. |
|
320 |
] |
|
10469 | 321 |
|
11272 | 322 |
"Modified: / 14-02-2012 / 14:12:49 / cg" |
5591 | 323 |
! |
324 |
||
9365
c27204a9244b
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9336
diff
changeset
|
325 |
setupToAskForMethodSearchTitle:title forBrowser:brwsrArg searchWhat:searchWhatArg |
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
326 |
searchArea:whereDefault withCaseIgnore:withCaseIgnore withMatch:withMatch |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
327 |
withMethodList:withMethodList allowFind:allowFindArg allowBuffer:allowBufferArg |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
328 |
allowBrowser:allowBrowserArg withTextEntry:withTextEntryArg |
9365
c27204a9244b
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9336
diff
changeset
|
329 |
|
10444 | 330 |
|where ns methodNameSpaces methodPackages hPanel leftVerticalPanel rightVerticalPanel| |
5591 | 331 |
|
332 |
allowFind := allowFindArg. |
|
333 |
allowBuffer := allowBufferArg. |
|
334 |
allowBrowser := allowBrowserArg. |
|
9311 | 335 |
searchWhat := searchWhatArg. |
336 |
||
5591 | 337 |
withTextEntry := withTextEntryArg. |
11272 | 338 |
|
339 |
(browser := brwsrArg) isNil ifTrue:[ |
|
340 |
resources := NewSystemBrowser classResources. |
|
341 |
] ifFalse:[ |
|
342 |
resources := browser resources. |
|
343 |
selectedClasses := browser selectedClasses value. |
|
344 |
selectedCategories := browser selectedCategoriesValue. |
|
345 |
selectedCategories := selectedCategories reject:[:cat | NavigatorModel isPseudoCategory:cat]. |
|
346 |
selectedMethods := browser selectedMethods value. |
|
347 |
currentClass := browser theSingleSelectedClass. |
|
348 |
currentClassCategory := browser theSingleSelectedCategory. |
|
349 |
currentPackage := browser theSingleSelectedProject. |
|
350 |
currentClass isNil ifTrue:[ |
|
351 |
browser hasMethodSelected ifTrue:[ |
|
352 |
currentClass := selectedMethods first mclass. |
|
353 |
"/ selectedClasses := (selectedMethods collect:[:each | each mclass ]) asIdentitySet. |
|
354 |
"/ selectedClasses := selectedClasses select:[:each | each notNil ]. |
|
355 |
]. |
|
356 |
]. |
|
357 |
]. |
|
5591 | 358 |
|
6351 | 359 |
(self addTextLabel:(resources stringWithCRs:title)) adjust:#left. |
6685 | 360 |
|
6242 | 361 |
currentClass notNil ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
362 |
currentClass := currentClass theNonMetaclass. |
5591 | 363 |
]. |
6242 | 364 |
withTextEntry ifTrue:[ |
365 |
self addTextEntryWithCaseIgnore:withCaseIgnore withMatch:withMatch. |
|
5591 | 366 |
]. |
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
367 |
|
5591 | 368 |
searchAreas := OrderedCollection new. |
6685 | 369 |
|
5591 | 370 |
self addHorizontalLine. |
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
371 |
"/ self addVerticalSpace. |
6685 | 372 |
|
373 |
hPanel := HorizontalPanelView "SimpleView" new. |
|
374 |
hPanel verticalLayout:#top. |
|
375 |
hPanel horizontalLayout:#left. |
|
376 |
||
8782 | 377 |
leftVerticalPanel := currentPanel := VerticalPanelView new. |
6685 | 378 |
leftVerticalPanel verticalLayout:#topSpace. |
379 |
leftVerticalPanel horizontalLayout:#fitSpace. |
|
380 |
||
5591 | 381 |
(self addTextLabel:(resources string:'Search in:')) adjust:#left. |
382 |
whereRadioGroup := RadioButtonGroup new. |
|
7042 | 383 |
|
6242 | 384 |
(selectedCategories size > 0 or:[ selectedClasses size > 0 ]) ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
385 |
self addCheckBoxForEverywhere. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
386 |
"/ classMethodListView notNil ifTrue:[ |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
387 |
"/ b := CheckBox label:(resources string:'Shown Methods'). |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
388 |
"/ panel add:b. whereChannel add:b value:#currentMethodList. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
389 |
"/ areas add:#currentMethodList. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
390 |
"/ self makeTabable:b. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
391 |
"/ ]. |
6242 | 392 |
browser isMethodListBrowser ifTrue:[ |
7374 | 393 |
methods := browser selectedMethods value ? #(). |
394 |
methodNameSpaces := methods |
|
395 |
select:[:eachMethod | eachMethod mclass notNil] |
|
396 |
thenCollect:[:eachMethod | eachMethod mclass topNameSpace ]. |
|
397 |
methodPackages := methods |
|
7042 | 398 |
collect:[:eachMethod | eachMethod package ]. |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
399 |
]. |
6242 | 400 |
methodNameSpaces size == 1 ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
401 |
currentNamespace := methodNameSpaces first. |
6242 | 402 |
] ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
403 |
currentNamespace := browser currentNamespace. |
6379 | 404 |
selectedClasses size == 0 ifTrue:[ |
405 |
|classesInAllSelectedCategories nameSpacesOfAllClassesInAllSelectedCategories| |
|
406 |
classesInAllSelectedCategories := Smalltalk allClasses select:[:cls | selectedCategories includes:cls category]. |
|
407 |
nameSpacesOfAllClassesInAllSelectedCategories := classesInAllSelectedCategories collect:[:eachClass | eachClass topNameSpace]. |
|
408 |
nameSpacesOfAllClassesInAllSelectedCategories size == 1 ifTrue:[ |
|
409 |
currentNamespace := nameSpacesOfAllClassesInAllSelectedCategories first. |
|
410 |
]. |
|
411 |
]. |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
412 |
]. |
7042 | 413 |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
414 |
(currentNamespace notNil |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
415 |
and:[ currentNamespace ~= (browser nameListEntryForALL) ]) |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
416 |
ifTrue:[ self addCheckBoxForCurrentNamespace ] |
6242 | 417 |
ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
418 |
(currentClass notNil |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
419 |
and:[ (ns := currentClass nameSpace) notNil and:[ ns ~~ Smalltalk ] ]) |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
420 |
ifTrue:[ self addCheckBoxForClassesNamespace:ns ]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
421 |
]. |
7042 | 422 |
|
423 |
methodPackages size == 1 ifTrue:[ |
|
424 |
currentPackage := methodPackages first. |
|
425 |
] ifFalse:[ |
|
426 |
currentPackage := browser currentProject. |
|
7384 | 427 |
"/ selectedClasses size == 0 ifTrue:[ |
428 |
"/ |classesInAllSelectedCategories packagesOfAllClassesInAllSelectedCategories| |
|
429 |
"/ classesInAllSelectedCategories := Smalltalk allClasses select:[:cls | selectedCategories includes:cls category]. |
|
430 |
"/ packagesOfAllClassesInAllSelectedCategories := classesInAllSelectedCategories collect:[:eachClass | eachClass package]. |
|
431 |
"/ packagesOfAllClassesInAllSelectedCategories size == 1 ifTrue:[ |
|
432 |
"/ currentPackage := packagesOfAllClassesInAllSelectedCategories first. |
|
433 |
"/ ]. |
|
434 |
"/ ]. |
|
7042 | 435 |
]. |
436 |
||
437 |
(currentPackage notNil |
|
438 |
and:[ currentPackage ~= (browser nameListEntryForALL) ]) |
|
439 |
ifTrue:[ self addCheckBoxForCurrentPackage ] |
|
440 |
ifFalse:[ |
|
441 |
(currentClass notNil) ifTrue:[ |
|
442 |
self addCheckBoxForClassesPackage:(currentClass package) |
|
443 |
]. |
|
444 |
]. |
|
445 |
||
6242 | 446 |
selectedCategories size > 0 ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
447 |
self addCheckBoxForSelectedClassCategory. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
448 |
]. |
6242 | 449 |
(selectedClasses size > 0 or:[ selectedMethods size > 0 ]) ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
450 |
self addCheckBoxForSelectedClass. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
451 |
self addCheckBoxForSelectedClassAndSuperclasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
452 |
self addCheckBoxForSelectedClassAndSubclasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
453 |
self addCheckBoxForSelectedClassAndPrivateClasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
454 |
self addCheckBoxForSelectedClassAndSubclassesAndPrivateClasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
455 |
self addCheckBoxForOwnerAndItsPrivateClasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
456 |
self addCheckBoxForOwnerAndItsSubclassesAndItsPrivateClasses. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
457 |
]. |
6242 | 458 |
] ifFalse:[ |
11272 | 459 |
(browser notNil and:[browser currentNamespace ~~ Smalltalk]) ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
460 |
self addCheckBoxForEverywhere. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
461 |
currentNamespace := browser currentNamespace. |
6242 | 462 |
currentNamespace ~= (browser nameListEntryForALL) ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
463 |
self addCheckBoxForCurrentNamespace. |
6242 | 464 |
] ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
465 |
(currentClass notNil |
6685 | 466 |
and:[ (ns := currentClass nameSpace) notNil |
467 |
and:[ ns ~~ Smalltalk ] ]) |
|
468 |
ifTrue:[ |
|
469 |
self addCheckBoxForClassesNamespace:ns |
|
470 |
]. |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
471 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
472 |
]. |
5591 | 473 |
]. |
8083
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
474 |
searchAreas size == 0 ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
475 |
self addCheckBoxForEverywhere. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
476 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
477 |
self addCheckBoxForChangedClassesList. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
478 |
|
11272 | 479 |
withMethodList ifTrue:[ |
480 |
browser isMethodListBrowser ifTrue:[ |
|
481 |
searchAreas size == 0 ifTrue:[ |
|
482 |
self addCheckBoxForEverywhere. |
|
483 |
]. |
|
484 |
self addCheckBoxForMethodList. |
|
485 |
browser selectedMethods value size > 1 ifTrue:[ |
|
486 |
self addCheckBoxForSelectedMethods. |
|
487 |
]. |
|
488 |
self addCheckBoxForSelectedMethodClasses. |
|
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
489 |
self addCheckBoxForSelectedMethodPackages. |
11272 | 490 |
] ifFalse:[ |
491 |
searchAreas size == 0 ifTrue:[ |
|
492 |
self addCheckBoxForEverywhere. |
|
493 |
]. |
|
494 |
self addCheckBoxForChangedMethodList. |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
495 |
]. |
5591 | 496 |
]. |
7042 | 497 |
|
6242 | 498 |
searchAreas size == 0 ifTrue:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
499 |
whereRadioGroup := #everywhere asValue. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
500 |
self addDummyCheckBoxForEverywhere. |
6242 | 501 |
] ifFalse:[ |
502 |
whereDefault notNil ifTrue:[ |
|
503 |
(searchAreas includes:whereDefault) ifTrue:[ |
|
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
504 |
where := whereDefault asSymbol. |
6242 | 505 |
] ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
506 |
where := searchAreas first. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
507 |
]. |
6242 | 508 |
] ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
509 |
where := #everywhere. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
510 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
511 |
whereRadioGroup value:where. |
5591 | 512 |
]. |
6685 | 513 |
|
514 |
hPanel add:leftVerticalPanel. |
|
515 |
||
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
516 |
false ifTrue:[ |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
517 |
"/ noone liked the right panel... |
8782 | 518 |
rightVerticalPanel := currentPanel := VerticalPanelView new. |
6685 | 519 |
rightVerticalPanel verticalLayout:#topSpace. |
520 |
rightVerticalPanel horizontalLayout:#fitSpace. |
|
521 |
||
522 |
self addCheckBoxForClassMethodSearch. |
|
523 |
self addCheckBoxForInstanceMethodSearch. |
|
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
524 |
"/ rightVerticalPanel origin:0.75@0.0 corner:1.0@1.0. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
525 |
hPanel |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
526 |
preferredExtent:(leftVerticalPanel preferredWidth + rightVerticalPanel preferredWidth) |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
527 |
@ |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
528 |
(leftVerticalPanel preferredHeight max:rightVerticalPanel preferredHeight). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
529 |
hPanel add:rightVerticalPanel. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
530 |
] ifFalse:[ |
6685 | 531 |
|
532 |
"/ rightVerticalPanel origin:0.75@0.0 corner:1.0@1.0. |
|
533 |
hPanel |
|
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
534 |
preferredExtent:(leftVerticalPanel preferredWidth) @ (leftVerticalPanel preferredHeight). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
535 |
]. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
536 |
|
6685 | 537 |
self addComponent:hPanel indent:0. |
538 |
||
5591 | 539 |
"/ panel has its own idea of indenting |
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
540 |
"/ self addVerticalSpace. |
9311 | 541 |
searchWhat == #selector ifTrue:[ |
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
542 |
"/ not yet implemented |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
543 |
"/ self addHorizontalLine. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
544 |
"/ self addCheckBoxesForClassAndMetaSearch. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
545 |
|
10444 | 546 |
selectionList := self addFilteredListOfMatchingSelectors. |
547 |
self stickAtBottomWithVariableHeight:selectionList. |
|
9315 | 548 |
matchHolder notNil ifTrue:[ |
549 |
matchHolder onChangeEvaluate:[ self updateListOfMatchingSelectorsFor:inputField contents ] |
|
550 |
]. |
|
9331
f5f593eca2dd
changed: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9327
diff
changeset
|
551 |
inputField notNil ifTrue:[ self updateListOfMatchingSelectorsFor:inputField contents ]. |
9311 | 552 |
] ifFalse:[ |
553 |
self addHorizontalLine. |
|
554 |
]. |
|
5591 | 555 |
self addButtons. |
6685 | 556 |
|
5591 | 557 |
self label:(resources string:'Search'). |
7374 | 558 |
|
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
559 |
"Modified: / 29-02-2012 / 19:48:17 / cg" |
5591 | 560 |
! ! |
561 |
||
562 |
!SearchDialog methodsFor:'setup'! |
|
563 |
||
564 |
addCheckBox:b forSearchArea:area |
|
8782 | 565 |
currentPanel add:b. |
5591 | 566 |
whereRadioGroup add:b value:area. |
567 |
searchAreas add:area. |
|
568 |
self makeTabable:b. |
|
569 |
! |
|
570 |
||
8083
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
571 |
addCheckBoxForChangedClassesList |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
572 |
|b| |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
573 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
574 |
b := CheckBox label:(resources string:'Changed Classes'). |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
575 |
self addCheckBox:b forSearchArea:#listOfChangedClasses. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
576 |
ChangeSet current changedClasses isEmpty ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
577 |
b disable |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
578 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
579 |
^ b. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
580 |
! |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
581 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
582 |
addCheckBoxForChangedMethodList |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
583 |
|b| |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
584 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
585 |
b := CheckBox label:(resources string:'Changed Methods'). |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
586 |
self addCheckBox:b forSearchArea:#listOfChangedMethods. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
587 |
ChangeSet current changeSelectors isEmpty ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
588 |
b disable |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
589 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
590 |
^ b. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
591 |
! |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
592 |
|
5591 | 593 |
addCheckBoxForClassesNamespace:ns |
594 |
|b| |
|
595 |
||
596 |
b := CheckBox |
|
8124 | 597 |
label:(resources string:'Classes'' nameSpace ("%1")' with:ns name). |
5591 | 598 |
self addCheckBox:b forSearchArea:#currentClassesNameSpace. |
599 |
^ b. |
|
600 |
! |
|
601 |
||
7333 | 602 |
addCheckBoxForClassesPackage:pkg |
603 |
|b| |
|
604 |
||
605 |
b := CheckBox |
|
8124 | 606 |
label:(resources string:'Classes'' package ("%1")' with:pkg). |
7333 | 607 |
self addCheckBox:b forSearchArea:#currentClassesPackage. |
608 |
^ b. |
|
609 |
||
610 |
"Created: / 21-09-2006 / 17:39:55 / cg" |
|
611 |
! |
|
612 |
||
5591 | 613 |
addCheckBoxForCurrentNamespace |
614 |
|b| |
|
615 |
||
7384 | 616 |
b := CheckBox |
8124 | 617 |
label:(resources string:'Current nameSpace ("%1")' with:currentNamespace name). |
5591 | 618 |
self addCheckBox:b forSearchArea:#currentNameSpace. |
619 |
^ b. |
|
7384 | 620 |
|
621 |
"Modified: / 10-10-2006 / 15:28:47 / cg" |
|
5591 | 622 |
! |
623 |
||
7042 | 624 |
addCheckBoxForCurrentPackage |
625 |
|b| |
|
626 |
||
7384 | 627 |
b := CheckBox |
8124 | 628 |
label:(resources string:'Current package ("%1")' with:currentPackage). |
7042 | 629 |
self addCheckBox:b forSearchArea:#currentPackage. |
630 |
^ b. |
|
7384 | 631 |
|
632 |
"Modified: / 10-10-2006 / 15:28:51 / cg" |
|
7042 | 633 |
! |
634 |
||
635 |
addCheckBoxForCurrentPackage:pkg |
|
636 |
|b| |
|
637 |
||
638 |
b := CheckBox |
|
8124 | 639 |
label:(resources string:'Classes'' package ("%1")' with:pkg). |
7042 | 640 |
self addCheckBox:b forSearchArea:#currentClassesPackage. |
641 |
^ b. |
|
7384 | 642 |
|
643 |
"Modified: / 10-10-2006 / 15:29:06 / cg" |
|
7042 | 644 |
! |
645 |
||
5591 | 646 |
addCheckBoxForEverywhere |
647 |
|b| |
|
648 |
||
649 |
b := CheckBox label:(resources string:'Everywhere'). |
|
650 |
self addCheckBox:b forSearchArea:#everywhere. |
|
651 |
^ b. |
|
652 |
! |
|
653 |
||
654 |
addCheckBoxForMethodList |
|
655 |
|b| |
|
656 |
||
657 |
b := CheckBox label:(resources string:'Methodlist'). |
|
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
658 |
self addCheckBox:b forSearchArea:AREA_LISTOFMETHODS. |
5591 | 659 |
^ b. |
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
660 |
|
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
661 |
"Modified: / 19-11-2010 / 12:00:52 / cg" |
5591 | 662 |
! |
663 |
||
664 |
addCheckBoxForOwnerAndItsPrivateClasses |
|
8124 | 665 |
|b lbl arg| |
5591 | 666 |
|
667 |
(currentClass notNil and:[ currentClass isPrivate. ]) ifTrue:[ |
|
8124 | 668 |
lbl := 'Owner (%1) & all its private classes'. |
669 |
arg := currentClass owningClass name. |
|
5591 | 670 |
] ifFalse:[ |
8124 | 671 |
lbl := 'Owners & all their private classes'. |
5591 | 672 |
]. |
8124 | 673 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 674 |
self addCheckBox:b forSearchArea:#ownersWithPrivateClasses. |
675 |
(selectedClasses contains:[ :cls | cls isPrivate. ]) ifFalse:[ |
|
8124 | 676 |
b disable. |
5591 | 677 |
]. |
678 |
^ b. |
|
679 |
! |
|
680 |
||
681 |
addCheckBoxForOwnerAndItsSubclassesAndItsPrivateClasses |
|
8124 | 682 |
|b lbl arg| |
5591 | 683 |
|
684 |
(currentClass notNil and:[ currentClass isPrivate. ]) ifTrue:[ |
|
8124 | 685 |
lbl := 'Owner (%1) & its subclasses & all its private classes'. |
686 |
arg := currentClass owningClass name. |
|
5591 | 687 |
] ifFalse:[ |
8124 | 688 |
lbl := 'Owners & their subclasses & all their private classes'. |
5591 | 689 |
]. |
8124 | 690 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 691 |
self addCheckBox:b forSearchArea:#ownersHierarchiesWithPrivateClasses. |
692 |
(selectedClasses contains:[ :cls | cls isPrivate. ]) ifFalse:[ |
|
8124 | 693 |
b disable. |
5591 | 694 |
]. |
695 |
^ b. |
|
696 |
! |
|
697 |
||
698 |
addCheckBoxForSelectedClass |
|
8124 | 699 |
|b lbl arg| |
5591 | 700 |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
701 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
702 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
703 |
or:[ selectedClasses size > 1] ]) ifTrue:[ |
8124 | 704 |
selectedClasses size == 1 ifTrue:[ |
705 |
lbl := 'Selected class ("%1")'. |
|
706 |
arg := selectedClasses first theNonMetaclass name. |
|
707 |
] ifFalse:[ |
|
708 |
lbl := 'Selected classes (%1)'. |
|
709 |
arg := selectedClasses size. |
|
710 |
]. |
|
5591 | 711 |
] ifFalse:[ |
8124 | 712 |
lbl := 'Class ("%1")'. |
713 |
arg := currentClass name. |
|
5591 | 714 |
]. |
8124 | 715 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 716 |
self addCheckBox:b forSearchArea:#classes. |
717 |
^ b. |
|
718 |
! |
|
719 |
||
720 |
addCheckBoxForSelectedClassAndPrivateClasses |
|
721 |
|b lbl| |
|
722 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
723 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
724 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
725 |
or:[ selectedClasses size > 1] ]) ifTrue:[ |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
726 |
lbl := 'Selected classes & all private classes'. |
5591 | 727 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
728 |
lbl := 'Class & private classes'. |
5591 | 729 |
]. |
730 |
b := CheckBox label:(resources string:lbl). |
|
731 |
self addCheckBox:b forSearchArea:#classesWithPrivateClasses. |
|
732 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
733 |
contains:[ :cls | cls theNonMetaclass privateClasses size > 0. ]) |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
734 |
ifFalse:[ b disable. ]. |
5591 | 735 |
^ b. |
736 |
! |
|
737 |
||
738 |
addCheckBoxForSelectedClassAndSubclasses |
|
739 |
|b lbl| |
|
740 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
741 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
742 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
743 |
or:[ selectedClasses size > 1] ]) ifTrue:[ |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
744 |
lbl := 'Selected classes & all subclasses'. |
5591 | 745 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
746 |
lbl := 'Class & subclasses'. |
5591 | 747 |
]. |
748 |
b := CheckBox label:(resources string:lbl). |
|
749 |
self addCheckBox:b forSearchArea:#classHierarchies. |
|
750 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
751 |
contains:[ :cls | cls theNonMetaclass subclasses size > 0. ]) |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
752 |
ifFalse:[ b disable. ]. |
5591 | 753 |
^ b. |
754 |
! |
|
755 |
||
756 |
addCheckBoxForSelectedClassAndSubclassesAndPrivateClasses |
|
757 |
|b lbl| |
|
758 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
759 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
760 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
761 |
or:[ selectedClasses size > 1] ]) ifTrue:[ |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
762 |
lbl := 'Selected classes & all subclasses & all private classes'. |
5591 | 763 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
764 |
lbl := 'Class & subclasses & all private classes'. |
5591 | 765 |
]. |
766 |
b := CheckBox label:(resources string:lbl). |
|
767 |
self addCheckBox:b forSearchArea:#classHierarchiesWithPrivateClasses. |
|
768 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
769 |
contains:[ :cls | cls theNonMetaclass privateClasses size > 0. ]) |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
770 |
ifFalse:[ b disable. ]. |
5591 | 771 |
^ b. |
772 |
! |
|
773 |
||
774 |
addCheckBoxForSelectedClassAndSuperclasses |
|
775 |
|b lbl| |
|
776 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
777 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
778 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
779 |
or:[ selectedClasses size > 1] ]) ifTrue:[ |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
780 |
lbl := 'Selected classes & all superclasses'. |
5591 | 781 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
782 |
lbl := 'Class & superclasses'. |
5591 | 783 |
]. |
784 |
b := CheckBox label:(resources string:lbl). |
|
785 |
self addCheckBox:b forSearchArea:#classesAndSuperclasses. |
|
786 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
787 |
contains:[ :cls | cls theNonMetaclass superclass notNil. ]) |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
788 |
ifFalse:[ b disable. ]. |
5591 | 789 |
^ b. |
790 |
! |
|
791 |
||
792 |
addCheckBoxForSelectedClassCategory |
|
8124 | 793 |
|b lbl arg| |
5591 | 794 |
|
795 |
currentClassCategory notNil ifTrue:[ |
|
8124 | 796 |
lbl := 'Class category ("%1")'. |
797 |
arg := currentClassCategory. |
|
5591 | 798 |
] ifFalse:[ |
8124 | 799 |
lbl := 'Selected classes categories (%1)'. |
800 |
arg := selectedCategories size. |
|
5591 | 801 |
]. |
8124 | 802 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 803 |
self addCheckBox:b forSearchArea:#classCategories. |
804 |
^ b. |
|
805 |
! |
|
806 |
||
8566 | 807 |
addCheckBoxForSelectedMethodClasses |
808 |
|b classes| |
|
809 |
||
9619
23273d2df296
changed: #addCheckBoxForSelectedMethodClasses
Claus Gittinger <cg@exept.de>
parents:
9600
diff
changeset
|
810 |
classes := ((browser selectedMethods value ? #()) |
23273d2df296
changed: #addCheckBoxForSelectedMethodClasses
Claus Gittinger <cg@exept.de>
parents:
9600
diff
changeset
|
811 |
select:[:m | m mclass notNil] |
23273d2df296
changed: #addCheckBoxForSelectedMethodClasses
Claus Gittinger <cg@exept.de>
parents:
9600
diff
changeset
|
812 |
thenCollect:[:m | m mclass theNonMetaclass]) asSet. |
8566 | 813 |
classes size == 1 ifTrue:[ |
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
814 |
b := CheckBox label:(resources string:'Selected method''s class ("%1")' |
8566 | 815 |
with:classes first name). |
816 |
] ifFalse:[ |
|
9271
4fc80f22048c
changed: #addCheckBoxForSelectedMethodClasses
Claus Gittinger <cg@exept.de>
parents:
9245
diff
changeset
|
817 |
b := CheckBox label:(resources string:'Selected methods'' classes (%1)' |
8566 | 818 |
with:classes size). |
819 |
]. |
|
820 |
self addCheckBox:b forSearchArea:#listOfSelectedMethodClasses. |
|
821 |
^ b. |
|
9619
23273d2df296
changed: #addCheckBoxForSelectedMethodClasses
Claus Gittinger <cg@exept.de>
parents:
9600
diff
changeset
|
822 |
|
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
823 |
"Modified: / 29-02-2012 / 19:42:33 / cg" |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
824 |
! |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
825 |
|
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
826 |
addCheckBoxForSelectedMethodPackages |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
827 |
|b packages| |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
828 |
|
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
829 |
packages := ((browser selectedMethods value ? #()) |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
830 |
collect:[:m | m package]) asSet. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
831 |
|
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
832 |
packages size == 1 ifTrue:[ |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
833 |
b := CheckBox label:(resources string:'Selected method''s package ("%1")' |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
834 |
with:packages first). |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
835 |
] ifFalse:[ |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
836 |
b := CheckBox label:(resources string:'Selected methods'' packages (%1)' |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
837 |
with:packages size). |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
838 |
]. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
839 |
self addCheckBox:b forSearchArea:#listOfSelectedMethodPackages. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
840 |
^ b. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
841 |
|
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
842 |
"Created: / 29-02-2012 / 19:42:26 / cg" |
8566 | 843 |
! |
844 |
||
5591 | 845 |
addCheckBoxForSelectedMethods |
846 |
|b| |
|
847 |
||
848 |
b := CheckBox label:(resources string:'Selected methods (%1)' |
|
849 |
with:browser selectedMethods value size). |
|
850 |
self addCheckBox:b forSearchArea:#listOfSelectedMethods. |
|
851 |
^ b. |
|
852 |
! |
|
853 |
||
7042 | 854 |
addCheckBoxForSelectedPackage |
8124 | 855 |
|b lbl arg| |
7042 | 856 |
|
857 |
currentClassCategory notNil ifTrue:[ |
|
8124 | 858 |
lbl := 'Class category ("%1")'. |
859 |
arg := currentClassCategory. |
|
7042 | 860 |
] ifFalse:[ |
8124 | 861 |
lbl := 'Selected classes categories (%1)'. |
862 |
arg := selectedCategories size. |
|
7042 | 863 |
]. |
8124 | 864 |
b := CheckBox label:(resources string:lbl with:arg). |
7042 | 865 |
self addCheckBox:b forSearchArea:#classCategories. |
866 |
^ b. |
|
867 |
! |
|
868 |
||
10962
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
869 |
addCheckBoxesForClassAndMetaSearch |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
870 |
|y b1 b2| |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
871 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
872 |
y := self yPosition. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
873 |
b1 := self addCheckBox:(resources string:'Instance Protocol') on:(self searchInstanceProtocolHolder). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
874 |
"/ b1 width:0.5. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
875 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
876 |
"/ self yPosition:y. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
877 |
b2 := self addCheckBox:(resources string:'Class Protocol') on:(self searchClassProtocolHolder). |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
878 |
"/ b2 left:0.5; width:0.5. |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
879 |
|
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
880 |
"Created: / 06-12-2011 / 11:24:11 / cg" |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
881 |
! |
3111d4444e1a
added: #addCheckBoxesForClassAndMetaSearch
Claus Gittinger <cg@exept.de>
parents:
10751
diff
changeset
|
882 |
|
5591 | 883 |
addDummyCheckBoxForEverywhere |
884 |
|b| |
|
885 |
||
886 |
b := CheckBox label:(resources string:'Everywhere'). |
|
887 |
b turnOn. |
|
888 |
b disable. |
|
6685 | 889 |
|
8782 | 890 |
currentPanel add:b. |
5591 | 891 |
! |
892 |
||
9309 | 893 |
addFilteredListOfMatchingSelectors |
894 |
|l| |
|
895 |
||
896 |
listHolder := List new. |
|
897 |
||
898 |
l := HVScrollableView for:SelectionInListView. |
|
899 |
l listHolder:listHolder. |
|
900 |
self addComponent:l. |
|
901 |
l doubleClickAction:[ |
|
902 |
selectorHolder value:(l selectionValue). |
|
903 |
matchHolder value:false. |
|
904 |
caseHolder value:false. |
|
905 |
self doAccept. |
|
906 |
self okPressed. |
|
907 |
]. |
|
908 |
^ l. |
|
909 |
! |
|
910 |
||
5591 | 911 |
addInputFieldForSelectorOrNameOrString |
9315 | 912 |
|sel lastSearchPatterns| |
5591 | 913 |
|
11272 | 914 |
browser notNil ifTrue:[ |
915 |
searchWhat == #selector ifTrue:[ |
|
916 |
sel := browser selectorToSearchFor. |
|
8123 | 917 |
] ifFalse:[ |
11272 | 918 |
searchWhat == #globalName ifTrue:[ |
919 |
sel := browser globalNameToSearchFor ? LastGlobalSearched. |
|
920 |
] ifFalse:[ |
|
921 |
searchWhat == #string ifTrue:[ |
|
922 |
sel := browser stringToSearchFor ? LastStringSearched. |
|
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
923 |
] ifFalse:[ |
11272 | 924 |
searchWhat == #resource ifTrue:[ |
925 |
sel := browser stringToSearchFor ? LastResourceSearched. |
|
926 |
] ifFalse:[ |
|
927 |
sel := browser selectorToSearchFor. |
|
928 |
] |
|
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
929 |
] |
11272 | 930 |
]. |
8123 | 931 |
]. |
5591 | 932 |
]. |
11272 | 933 |
lastSearchPatterns := (browser ? SystemBrowser) lastSearchPatterns. |
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
934 |
|
8123 | 935 |
sel isEmptyOrNil ifTrue:[ |
936 |
"/ use last searchString |
|
937 |
lastSearchPatterns size > 0 ifTrue:[ |
|
938 |
sel := lastSearchPatterns first. |
|
939 |
]. |
|
5591 | 940 |
]. |
9645
8ff383213d07
comment/format in: #addCheckBoxForSelectedPackage
Claus Gittinger <cg@exept.de>
parents:
9644
diff
changeset
|
941 |
selectorHolder := (sel ? '') withoutSeparators asValue. |
5591 | 942 |
|
943 |
inputField := self addComboBoxOn:selectorHolder tabable:true. |
|
9309 | 944 |
inputField list:lastSearchPatterns. |
9245
1f903a58f92c
changed: #addInputFieldForSelectorOrNameOrString
Claus Gittinger <cg@exept.de>
parents:
9001
diff
changeset
|
945 |
inputField selectAllInitially. |
9309 | 946 |
inputField immediateAccept:true. |
9506
757e644f44f6
changed: #addInputFieldForSelectorOrNameOrString
Stefan Vogel <sv@exept.de>
parents:
9424
diff
changeset
|
947 |
inputField takeFocus. |
5591 | 948 |
inputField |
8123 | 949 |
entryCompletionBlock:[ :contents | |
950 |
|s what| |
|
5591 | 951 |
|
8123 | 952 |
s := contents withoutSpaces. |
953 |
self topView |
|
9309 | 954 |
withWaitCursorDo:[ |
955 |
|best matching| |
|
956 |
||
10189
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
957 |
searchWhat == #resource ifTrue:[ |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
958 |
what := DoWhatIMeanSupport resourceCompletion:s inEnvironment:Smalltalk match:true ignoreCase:false. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
959 |
] ifFalse:[ |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
960 |
searchWhat == #globalName ifFalse:[ |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
961 |
what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:Smalltalk. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
962 |
] ifTrue:[ |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
963 |
what := DoWhatIMeanSupport globalNameCompletion:s inEnvironment:Smalltalk match:true. |
0be2c38f087a
comment/format in: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry:
Claus Gittinger <cg@exept.de>
parents:
9645
diff
changeset
|
964 |
]. |
8123 | 965 |
]. |
9309 | 966 |
best := what first. |
967 |
matching := what second. |
|
968 |
inputField contents:best. |
|
969 |
"/ listHolder contents:matching. |
|
970 |
matching size ~~ 1 ifTrue:[ |
|
11272 | 971 |
(browser ? self) window beep. |
8123 | 972 |
]. |
973 |
]. |
|
974 |
]. |
|
9309 | 975 |
|
976 |
selectorHolder onChangeEvaluate:[ self updateListOfMatchingSelectorsFor:inputField contents ]. |
|
9644
d417581c978b
changed: #addInputFieldForSelectorOrNameOrString
Claus Gittinger <cg@exept.de>
parents:
9642
diff
changeset
|
977 |
|
11272 | 978 |
"Modified: / 14-02-2012 / 14:13:52 / cg" |
5591 | 979 |
! |
980 |
||
981 |
addTextEntryFieldForCode |
|
9423 | 982 |
|initial box panel patternInfoBox infoLabel helpButton errMessageField checkCodeAction |
7170 | 983 |
metaBox b| |
5591 | 984 |
|
985 |
box := View new. |
|
6443 | 986 |
box extent:(600 @ 200). |
5591 | 987 |
|
6608 | 988 |
panel := VariableHorizontalPanel in:box. |
989 |
panel origin:0.0@0.0 corner:(1.0@1.0). |
|
5591 | 990 |
|
6608 | 991 |
codeField := CodeView in:panel. |
7748 | 992 |
codeField canTab:true. |
6608 | 993 |
"/ codeField origin:0.0@0.0 corner:(0.75@1.0). |
994 |
||
9423 | 995 |
patternInfoBox := View in:panel. |
996 |
||
997 |
infoLabel := Label in:patternInfoBox. |
|
998 |
infoLabel geometryLayout:(LayoutFrame bottomInset:30). |
|
999 |
||
8786
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1000 |
infoLabel font:(codeField font asSize:(codeField font size - 2)). |
6608 | 1001 |
infoLabel adjust:#left. |
8786
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1002 |
infoLabel label:(self helpTextForMetaPatterns). |
5591 | 1003 |
|
6608 | 1004 |
panel relativeCorners:#(0.6 1.0). |
9423 | 1005 |
panel showHandle:true. |
6608 | 1006 |
|
9423 | 1007 |
helpButton := Button label:(resources string:'Pattern Help') in:patternInfoBox. |
6608 | 1008 |
helpButton layout:((AlignmentOrigin fractionalFromPoint:0.5@1.0) |
6443 | 1009 |
leftOffset:2 |
8165
d7d59fbdcd2b
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8124
diff
changeset
|
1010 |
topOffset:helpButton preferredHeight negated; |
6608 | 1011 |
leftAlignmentFraction:0.5 topAlignmentFraction:0). |
5591 | 1012 |
helpButton topInset:0.75@1.0. |
1013 |
helpButton action:[self showHelpOnCodePatterns]. |
|
1014 |
||
6608 | 1015 |
|
5591 | 1016 |
self addComponent:box tabable:true. |
7170 | 1017 |
|
1018 |
metaBox := HorizontalPanelView new. |
|
1019 |
metaBox horizontalLayout:#leftMax. |
|
9519
e02cc8f995ec
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
9506
diff
changeset
|
1020 |
b := Button label:'+Lit' action:[ codeField pasteOrReplace:'`#n' ] in:metaBox. |
8833
fa0f28ab2b85
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
8786
diff
changeset
|
1021 |
b helpKey:#matchAnyLiteral. |
9519
e02cc8f995ec
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
9506
diff
changeset
|
1022 |
b := Button label:'+Var' action:[ codeField pasteOrReplace:'`v' ] in:metaBox. |
8833
fa0f28ab2b85
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
8786
diff
changeset
|
1023 |
b helpKey:#matchAnyVariable. |
9519
e02cc8f995ec
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
9506
diff
changeset
|
1024 |
b := Button label:'+Expr' action:[ codeField pasteOrReplace:'`@e' ] in:metaBox. |
8833
fa0f28ab2b85
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
8786
diff
changeset
|
1025 |
b helpKey:#matchAnyExpression. |
9519
e02cc8f995ec
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
9506
diff
changeset
|
1026 |
b := Button label:'+Msg' action:[ codeField pasteOrReplace:'`@m:' ] in:metaBox. |
8833
fa0f28ab2b85
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
8786
diff
changeset
|
1027 |
b helpKey:#matchAnyMessage. |
9519
e02cc8f995ec
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
9506
diff
changeset
|
1028 |
b := Button label:'+Node' action:[ codeField pasteOrReplace:'`{:node | node isLiteral and:[node value isSymbol] }' ] in:metaBox. |
9424
ea700a8c978a
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
9423
diff
changeset
|
1029 |
b helpKey:#matchAnyNode. |
10377
0024b64778eb
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
10189
diff
changeset
|
1030 |
b := Button label:'+Stats' action:[ codeField pasteOrReplace:'`.@stats' ] in:metaBox. |
0024b64778eb
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
10189
diff
changeset
|
1031 |
b helpKey:#matchAnyStats. |
7170 | 1032 |
self addComponent:metaBox. |
1033 |
||
5591 | 1034 |
errMessageField := (self addTextLabel:'') adjust:#left. |
1035 |
errMessageField level:-1. |
|
1036 |
self addCheckBox:(resources string:'Method') on:self isMethodHolder. |
|
1037 |
||
1038 |
checkCodeAction := [ self checkCodeIn:codeField notifying:errMessageField. ]. |
|
1039 |
||
1040 |
codeField modifiedChannel onChangeEvaluate:checkCodeAction. |
|
8282
9b4068f2dd30
method-code search fixed: correctly pass the isMethod argument
Claus Gittinger <cg@exept.de>
parents:
8269
diff
changeset
|
1041 |
self isMethodHolder onChangeEvaluate:checkCodeAction. |
5591 | 1042 |
|
1043 |
initial := browser selectionInCodeView. |
|
1044 |
initial isEmptyOrNil ifTrue:[ |
|
6443 | 1045 |
initial := LastCodeSearched ? '' |
5591 | 1046 |
]. |
1047 |
codeField contents:initial. |
|
1048 |
checkCodeAction value. |
|
7748 | 1049 |
|
10377
0024b64778eb
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
10189
diff
changeset
|
1050 |
"Modified: / 23-07-2011 / 10:35:14 / cg" |
5591 | 1051 |
! |
1052 |
||
1053 |
checkCodeIn:codeField notifying:errMessageField |
|
1054 |
|codeString tree errAction| |
|
1055 |
||
1056 |
codeString := codeField contents asString string. |
|
1057 |
errAction := [:str :pos | |
|
6608 | 1058 |
|line col badLine| |
5591 | 1059 |
|
6608 | 1060 |
line := codeField lineOfCharacterPosition:pos. |
1061 |
col := (codeField colOfCharacterPosition:pos) max:1. |
|
5591 | 1062 |
|
8282
9b4068f2dd30
method-code search fixed: correctly pass the isMethod argument
Claus Gittinger <cg@exept.de>
parents:
8269
diff
changeset
|
1063 |
badLine := (codeField listAt:line) ? ''. |
9b4068f2dd30
method-code search fixed: correctly pass the isMethod argument
Claus Gittinger <cg@exept.de>
parents:
8269
diff
changeset
|
1064 |
col <= badLine size size ifTrue:[ |
6608 | 1065 |
codeField |
1066 |
listAt:line |
|
1067 |
put:(badLine asText |
|
1068 |
emphasisAt:col |
|
1069 |
put:(UserPreferences current unknownIdentifierEmphasis)). |
|
1070 |
"/ codeField selectFromCharacterPosition:pos to:pos. |
|
1071 |
]. |
|
1072 |
errMessageField label:('line: ',line printString,' ',str). |
|
1073 |
errMessageField backgroundColor:Color red. |
|
1074 |
codeField requestFocus. |
|
1075 |
nil. |
|
1076 |
]. |
|
5591 | 1077 |
|
1078 |
isMethodHolder value ifTrue:[ |
|
6608 | 1079 |
tree := RBParser parseRewriteMethod:codeString onError: errAction. |
5591 | 1080 |
] ifFalse:[ |
6608 | 1081 |
tree := RBParser parseRewriteExpression:codeString onError: errAction. |
5591 | 1082 |
]. |
6608 | 1083 |
tree notNil ifTrue:[ |
1084 |
errMessageField backgroundColor:View defaultViewBackgroundColor. |
|
1085 |
errMessageField label:nil |
|
1086 |
]. |
|
5591 | 1087 |
codeField modifiedChannel setValue:false. |
1088 |
! |
|
1089 |
||
1090 |
getClassesAndMethodsFor:where |
|
1091 |
where == #everywhere ifTrue:[ |
|
7042 | 1092 |
classes := Smalltalk allClasses. |
7378 | 1093 |
methods := nil. |
7042 | 1094 |
^ self. |
5591 | 1095 |
]. |
1096 |
where == #currentNameSpace ifTrue:[ |
|
7042 | 1097 |
classes := currentNamespace allClassesWithAllPrivateClasses. |
7378 | 1098 |
methods := nil. |
7042 | 1099 |
^ self. |
5591 | 1100 |
]. |
1101 |
where == #currentClassesNameSpace ifTrue:[ |
|
7042 | 1102 |
currentClass isPrivate ifTrue:[ |
1103 |
classes := currentClass topOwningClass nameSpace |
|
1104 |
allClassesWithAllPrivateClasses. |
|
1105 |
] ifFalse:[ |
|
1106 |
classes := currentClass nameSpace allClassesWithAllPrivateClasses. |
|
1107 |
]. |
|
7378 | 1108 |
methods := nil. |
7042 | 1109 |
^ self. |
1110 |
]. |
|
1111 |
where == #currentPackage ifTrue:[ |
|
1112 |
classes := Smalltalk allClassesInPackage:currentPackage. |
|
7378 | 1113 |
methods := nil. |
7042 | 1114 |
^ self. |
1115 |
]. |
|
1116 |
where == #currentClassesPackage ifTrue:[ |
|
1117 |
classes := Smalltalk allClassesInPackage:currentClass package. |
|
7378 | 1118 |
methods := nil. |
7042 | 1119 |
^ self. |
5591 | 1120 |
]. |
1121 |
where == #classCategories ifTrue:[ |
|
7042 | 1122 |
classes := Smalltalk allClasses |
1123 |
select:[ :cls | selectedCategories includes:cls category. ]. |
|
1124 |
classes := classes collect:[ :each | each theNonMetaclass. ]. |
|
7378 | 1125 |
methods := nil. |
7042 | 1126 |
^ self. |
5591 | 1127 |
]. |
1128 |
(where == #classes or:[ where == #classesWithPrivateClasses. ]) ifTrue:[ |
|
7042 | 1129 |
classes := selectedClasses collect:[ :each | each theNonMetaclass. ]. |
7378 | 1130 |
methods := nil. |
7042 | 1131 |
^ self. |
5591 | 1132 |
]. |
7378 | 1133 |
(where == #classHierarchies or:[ where == #classHierarchiesWithPrivateClasses. ]) |
1134 |
ifTrue:[ |
|
1135 |
classes := IdentitySet new. |
|
1136 |
selectedClasses do:[ :cls | |
|
1137 |
classes addAll:cls theNonMetaclass withAllSubclasses. |
|
1138 |
]. |
|
1139 |
methods := nil. |
|
1140 |
^ self. |
|
1141 |
]. |
|
5591 | 1142 |
where == #ownersWithPrivateClasses ifTrue:[ |
7042 | 1143 |
classes := IdentitySet new. |
1144 |
selectedClasses do:[ :cls | |
|
1145 |
|c| |
|
5591 | 1146 |
|
7042 | 1147 |
c := cls theNonMetaclass. |
1148 |
classes add:(c owningClass ? c). |
|
1149 |
]. |
|
7378 | 1150 |
methods := nil. |
7042 | 1151 |
^ self. |
5591 | 1152 |
]. |
1153 |
where == #ownersHierarchiesWithPrivateClasses ifTrue:[ |
|
7042 | 1154 |
classes := IdentitySet new. |
1155 |
selectedClasses do:[ :cls | |
|
1156 |
|c| |
|
5591 | 1157 |
|
7042 | 1158 |
c := cls theNonMetaclass. |
1159 |
classes addAll:(c owningClass ? c) withAllSubclasses. |
|
1160 |
]. |
|
7378 | 1161 |
methods := nil. |
7042 | 1162 |
^ self. |
5591 | 1163 |
]. |
1164 |
(where == #classesAndSuperclasses) ifTrue:[ |
|
7042 | 1165 |
classes := IdentitySet new. |
1166 |
selectedClasses do:[ :cls | |
|
1167 |
classes addAll:cls theNonMetaclass withAllSuperclasses. |
|
1168 |
]. |
|
7378 | 1169 |
methods := nil. |
7042 | 1170 |
^ self. |
5591 | 1171 |
]. |
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
1172 |
(where == AREA_LISTOFMETHODS) ifTrue:[ |
7042 | 1173 |
classes := nil. |
1174 |
methods := browser methodListApp methodList value. |
|
1175 |
^ self. |
|
5591 | 1176 |
]. |
1177 |
(where == #listOfSelectedMethods) ifTrue:[ |
|
7042 | 1178 |
classes := nil. |
10751 | 1179 |
methods := browser selectedMethods value ? #(). |
7042 | 1180 |
^ self. |
5591 | 1181 |
]. |
8566 | 1182 |
(where == #listOfSelectedMethodClasses) ifTrue:[ |
10751 | 1183 |
classes := ((browser selectedMethods value ? #()) collect:[:m | m mclass theNonMetaclass]) asSet asOrderedCollection. |
8566 | 1184 |
methods := nil. |
1185 |
^ self. |
|
1186 |
]. |
|
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1187 |
(where == #listOfSelectedMethodPackages) ifTrue:[ |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1188 |
classes := (((browser selectedMethods value ? #()) collect:[:m | m package]) asSet |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1189 |
collectAll:[:p | Smalltalk allClassesInPackage:p ]) asOrderedCollection. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1190 |
methods := nil. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1191 |
^ self. |
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1192 |
]. |
8083
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1193 |
(where == #listOfChangedClasses) ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1194 |
classes := ChangeSet current changedClasses. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1195 |
methods := nil. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1196 |
^ self. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1197 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1198 |
(where == #listOfChangedMethods) ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1199 |
classes := nil. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1200 |
methods := Set new. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1201 |
ChangeSet current do:[:chg | |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1202 |
|mthd| |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1203 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1204 |
chg notNil ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1205 |
chg isMethodChange ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1206 |
mthd := chg changeMethod. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1207 |
mthd notNil ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1208 |
methods add:mthd |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1209 |
] |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1210 |
] |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1211 |
] |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1212 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1213 |
methods := methods asOrderedCollection. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1214 |
^ self. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1215 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1216 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1217 |
self halt:'inumplemented search'. |
7378 | 1218 |
|
10751 | 1219 |
"Modified: / 05-10-2011 / 15:48:20 / az" |
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1220 |
"Modified: / 29-02-2012 / 19:47:42 / cg" |
5591 | 1221 |
! |
1222 |
||
8786
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1223 |
helpTextForMetaPatterns |
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1224 |
^ 'MetaPatterns: |
9423 | 1225 |
' , '`' allBold , ' = meta |
1226 |
' , '@' allBold , ' = list/any |
|
1227 |
' , '.' allBold , ' = statement |
|
1228 |
' , '`' allBold , ' = recurse |
|
8786
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1229 |
|
9423 | 1230 |
' , '`#n' allBold , ' any lit |
10557
5c24429dbb65
changed: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
10469
diff
changeset
|
1231 |
' , '`v' allBold , ' any var (`V => global) |
9423 | 1232 |
' , '`@e' allBold , ' any expr |
10557
5c24429dbb65
changed: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
10469
diff
changeset
|
1233 |
' , '`@m:' allBold , ' any message (`m => unary) |
9423 | 1234 |
' , '`{:n|...}' allBold , ' node pattern |
10557
5c24429dbb65
changed: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
10469
diff
changeset
|
1235 |
' , '`''a.*''' allBold , ' regex on string const |
8786
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1236 |
'. |
9423 | 1237 |
|
10557
5c24429dbb65
changed: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
10469
diff
changeset
|
1238 |
"Modified: / 08-08-2011 / 20:33:03 / cg" |
8786
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1239 |
! |
caa3e9c06b2d
added: #helpTextForMetaPatterns
Claus Gittinger <cg@exept.de>
parents:
8782
diff
changeset
|
1240 |
|
5591 | 1241 |
isMethodHolder |
1242 |
isMethodHolder isNil ifTrue:[isMethodHolder := (LastCodeSearchWasMethod ? false) asValue]. |
|
1243 |
^ isMethodHolder |
|
1244 |
! ! |
|
1245 |
||
1246 |
!SearchDialog methodsFor:'setup-buttons'! |
|
1247 |
||
1248 |
addBrowseButton |
|
1249 |
|b| |
|
1250 |
||
1251 |
b := Button label:(resources string:'Browse'). |
|
1252 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
1253 |
self addButton:b before:nil. |
|
1254 |
] ifFalse:[ |
|
1255 |
self addButton:b after:nil. |
|
1256 |
]. |
|
1257 |
b |
|
1258 |
action:[ |
|
1259 |
openHow := #newBrowser. |
|
1260 |
self doAccept. |
|
1261 |
self okPressed. |
|
1262 |
]. |
|
1263 |
^ b. |
|
1264 |
! |
|
1265 |
||
1266 |
addBufferButton |
|
1267 |
|b| |
|
1268 |
||
1269 |
b := Button label:(resources string:'Add Buffer'). |
|
1270 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
1271 |
self addButton:b before:nil. |
|
1272 |
] ifFalse:[ |
|
1273 |
self addButton:b after:nil. |
|
1274 |
]. |
|
1275 |
b |
|
1276 |
action:[ |
|
1277 |
openHow := #newBuffer. |
|
1278 |
self doAccept. |
|
1279 |
self okPressed. |
|
1280 |
]. |
|
1281 |
^ b. |
|
1282 |
! |
|
1283 |
||
1284 |
addButtons |
|
6685 | 1285 |
"add find/newBrowser/newBuffer buttons" |
1286 |
||
5591 | 1287 |
|prevButton| |
1288 |
||
1289 |
allowFind ifTrue:[ |
|
6685 | 1290 |
defaultOpenHow := #showHere. |
1291 |
prevButton := self addFindButton. |
|
5591 | 1292 |
]. |
1293 |
allowBrowser ifTrue:[ |
|
6685 | 1294 |
defaultOpenHow := #newBrowser. |
1295 |
prevButton := self addBrowseButton. |
|
5591 | 1296 |
]. |
1297 |
allowBuffer ifTrue:[ |
|
6685 | 1298 |
defaultOpenHow := #newBuffer. |
1299 |
prevButton := self addBufferButton. |
|
5591 | 1300 |
]. |
1301 |
prevButton notNil ifTrue:[ |
|
6685 | 1302 |
prevButton isReturnButton:true. |
5591 | 1303 |
]. |
1304 |
self addAbortButton. |
|
1305 |
! |
|
1306 |
||
1307 |
addFindButton |
|
1308 |
|b| |
|
1309 |
||
1310 |
b := Button label:(resources string:'Find'). |
|
1311 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
1312 |
self addButton:b before:nil. |
|
1313 |
] ifFalse:[ |
|
1314 |
self addButton:b after:nil. |
|
1315 |
]. |
|
1316 |
b |
|
1317 |
action:[ |
|
1318 |
openHow := #showHere. |
|
1319 |
self doAccept. |
|
1320 |
self okPressed. |
|
1321 |
]. |
|
1322 |
^ b. |
|
1323 |
! ! |
|
1324 |
||
1325 |
!SearchDialog class methodsFor:'documentation'! |
|
1326 |
||
8833
fa0f28ab2b85
changed: #addTextEntryFieldForCode
Claus Gittinger <cg@exept.de>
parents:
8786
diff
changeset
|
1327 |
version_CVS |
11295
92ce4ff0f0f9
added: #addCheckBoxForSelectedMethodPackages
Claus Gittinger <cg@exept.de>
parents:
11272
diff
changeset
|
1328 |
^ '$Header: /cvs/stx/stx/libtool/Tools_SearchDialog.st,v 1.69 2012-02-29 18:50:58 cg Exp $' |
5591 | 1329 |
! ! |
9640
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
1330 |
|
68bba6744726
default for text-search in method -list
Claus Gittinger <cg@exept.de>
parents:
9619
diff
changeset
|
1331 |
SearchDialog initialize! |