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