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