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