author | Claus Gittinger <cg@exept.de> |
Fri, 06 Mar 2009 16:01:27 +0100 | |
changeset 8566 | 159df00766af |
parent 8304 | 3e556502d05e |
child 8569 | 41fb489a3cf3 |
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 |
]. |
8566 | 393 |
self addCheckBoxForSelectedMethodClasses. |
8083
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
394 |
] ifFalse:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
395 |
searchAreas size == 0 ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
396 |
self addCheckBoxForEverywhere. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
397 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
398 |
self addCheckBoxForChangedMethodList. |
5591 | 399 |
]. |
7042 | 400 |
|
6242 | 401 |
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
|
402 |
whereRadioGroup := #everywhere asValue. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
403 |
self addDummyCheckBoxForEverywhere. |
6242 | 404 |
] ifFalse:[ |
405 |
whereDefault notNil ifTrue:[ |
|
406 |
(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
|
407 |
where := whereDefault asSymbol. |
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 |
where := searchAreas first. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
410 |
]. |
6242 | 411 |
] ifFalse:[ |
5886
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
412 |
where := #everywhere. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
413 |
]. |
a212a4614597
remember last match- and last case-flag setting as default
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
414 |
whereRadioGroup value:where. |
5591 | 415 |
]. |
6685 | 416 |
|
417 |
hPanel add:leftVerticalPanel. |
|
418 |
||
419 |
rightVerticalPanel := verticalPanel := VerticalPanelView new. |
|
420 |
rightVerticalPanel verticalLayout:#topSpace. |
|
421 |
rightVerticalPanel horizontalLayout:#fitSpace. |
|
422 |
||
423 |
false ifTrue:[ |
|
424 |
self addCheckBoxForClassMethodSearch. |
|
425 |
self addCheckBoxForInstanceMethodSearch. |
|
426 |
]. |
|
427 |
||
428 |
"/ rightVerticalPanel origin:0.75@0.0 corner:1.0@1.0. |
|
429 |
hPanel |
|
8165
d7d59fbdcd2b
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8124
diff
changeset
|
430 |
preferredExtent:(leftVerticalPanel preferredHeight + rightVerticalPanel preferredHeight) |
6685 | 431 |
@ |
8165
d7d59fbdcd2b
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8124
diff
changeset
|
432 |
(leftVerticalPanel preferredHeight max:rightVerticalPanel preferredHeight). |
6685 | 433 |
hPanel add:rightVerticalPanel. |
434 |
self addComponent:hPanel indent:0. |
|
435 |
||
5591 | 436 |
"/ panel has its own idea of indenting |
437 |
self addVerticalSpace. |
|
438 |
self addHorizontalLine. |
|
439 |
self addButtons. |
|
6685 | 440 |
|
5591 | 441 |
self label:(resources string:'Search'). |
7374 | 442 |
|
7384 | 443 |
"Modified: / 10-10-2006 / 15:30:52 / cg" |
5591 | 444 |
! ! |
445 |
||
446 |
!SearchDialog methodsFor:'setup'! |
|
447 |
||
448 |
addCheckBox:b forSearchArea:area |
|
449 |
verticalPanel add:b. |
|
450 |
whereRadioGroup add:b value:area. |
|
451 |
searchAreas add:area. |
|
452 |
self makeTabable:b. |
|
453 |
! |
|
454 |
||
8083
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
455 |
addCheckBoxForChangedClassesList |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
456 |
|b| |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
457 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
458 |
b := CheckBox label:(resources string:'Changed Classes'). |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
459 |
self addCheckBox:b forSearchArea:#listOfChangedClasses. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
460 |
ChangeSet current changedClasses isEmpty ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
461 |
b disable |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
462 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
463 |
^ b. |
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 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
466 |
addCheckBoxForChangedMethodList |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
467 |
|b| |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
468 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
469 |
b := CheckBox label:(resources string:'Changed Methods'). |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
470 |
self addCheckBox:b forSearchArea:#listOfChangedMethods. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
471 |
ChangeSet current changeSelectors isEmpty ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
472 |
b disable |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
473 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
474 |
^ b. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
475 |
! |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
476 |
|
6685 | 477 |
addCheckBoxForClassMethodSearch |
478 |
|b| |
|
479 |
||
480 |
b := CheckBox label:(resources string:'Class Protocol'). |
|
481 |
b model:(self searchClassProtocolHolder). |
|
482 |
verticalPanel add:b. |
|
483 |
^ b. |
|
484 |
! |
|
485 |
||
5591 | 486 |
addCheckBoxForClassesNamespace:ns |
487 |
|b| |
|
488 |
||
489 |
b := CheckBox |
|
8124 | 490 |
label:(resources string:'Classes'' nameSpace ("%1")' with:ns name). |
5591 | 491 |
self addCheckBox:b forSearchArea:#currentClassesNameSpace. |
492 |
^ b. |
|
493 |
! |
|
494 |
||
7333 | 495 |
addCheckBoxForClassesPackage:pkg |
496 |
|b| |
|
497 |
||
498 |
b := CheckBox |
|
8124 | 499 |
label:(resources string:'Classes'' package ("%1")' with:pkg). |
7333 | 500 |
self addCheckBox:b forSearchArea:#currentClassesPackage. |
501 |
^ b. |
|
502 |
||
503 |
"Created: / 21-09-2006 / 17:39:55 / cg" |
|
504 |
! |
|
505 |
||
5591 | 506 |
addCheckBoxForCurrentNamespace |
507 |
|b| |
|
508 |
||
7384 | 509 |
b := CheckBox |
8124 | 510 |
label:(resources string:'Current nameSpace ("%1")' with:currentNamespace name). |
5591 | 511 |
self addCheckBox:b forSearchArea:#currentNameSpace. |
512 |
^ b. |
|
7384 | 513 |
|
514 |
"Modified: / 10-10-2006 / 15:28:47 / cg" |
|
5591 | 515 |
! |
516 |
||
7042 | 517 |
addCheckBoxForCurrentPackage |
518 |
|b| |
|
519 |
||
7384 | 520 |
b := CheckBox |
8124 | 521 |
label:(resources string:'Current package ("%1")' with:currentPackage). |
7042 | 522 |
self addCheckBox:b forSearchArea:#currentPackage. |
523 |
^ b. |
|
7384 | 524 |
|
525 |
"Modified: / 10-10-2006 / 15:28:51 / cg" |
|
7042 | 526 |
! |
527 |
||
528 |
addCheckBoxForCurrentPackage:pkg |
|
529 |
|b| |
|
530 |
||
531 |
b := CheckBox |
|
8124 | 532 |
label:(resources string:'Classes'' package ("%1")' with:pkg). |
7042 | 533 |
self addCheckBox:b forSearchArea:#currentClassesPackage. |
534 |
^ b. |
|
7384 | 535 |
|
536 |
"Modified: / 10-10-2006 / 15:29:06 / cg" |
|
7042 | 537 |
! |
538 |
||
5591 | 539 |
addCheckBoxForEverywhere |
540 |
|b| |
|
541 |
||
542 |
b := CheckBox label:(resources string:'Everywhere'). |
|
543 |
self addCheckBox:b forSearchArea:#everywhere. |
|
544 |
^ b. |
|
545 |
! |
|
546 |
||
6685 | 547 |
addCheckBoxForInstanceMethodSearch |
548 |
|b| |
|
549 |
||
550 |
b := CheckBox label:(resources string:'Instance Protocol'). |
|
551 |
b model:(self searchInstanceProtocolHolder). |
|
552 |
verticalPanel add:b. |
|
553 |
^ b. |
|
554 |
! |
|
555 |
||
5591 | 556 |
addCheckBoxForMethodList |
557 |
|b| |
|
558 |
||
559 |
b := CheckBox label:(resources string:'Methodlist'). |
|
560 |
self addCheckBox:b forSearchArea:#listOfMethods. |
|
561 |
^ b. |
|
562 |
! |
|
563 |
||
564 |
addCheckBoxForOwnerAndItsPrivateClasses |
|
8124 | 565 |
|b lbl arg| |
5591 | 566 |
|
567 |
(currentClass notNil and:[ currentClass isPrivate. ]) ifTrue:[ |
|
8124 | 568 |
lbl := 'Owner (%1) & all its private classes'. |
569 |
arg := currentClass owningClass name. |
|
5591 | 570 |
] ifFalse:[ |
8124 | 571 |
lbl := 'Owners & all their private classes'. |
5591 | 572 |
]. |
8124 | 573 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 574 |
self addCheckBox:b forSearchArea:#ownersWithPrivateClasses. |
575 |
(selectedClasses contains:[ :cls | cls isPrivate. ]) ifFalse:[ |
|
8124 | 576 |
b disable. |
5591 | 577 |
]. |
578 |
^ b. |
|
579 |
! |
|
580 |
||
581 |
addCheckBoxForOwnerAndItsSubclassesAndItsPrivateClasses |
|
8124 | 582 |
|b lbl arg| |
5591 | 583 |
|
584 |
(currentClass notNil and:[ currentClass isPrivate. ]) ifTrue:[ |
|
8124 | 585 |
lbl := 'Owner (%1) & its subclasses & all its private classes'. |
586 |
arg := currentClass owningClass name. |
|
5591 | 587 |
] ifFalse:[ |
8124 | 588 |
lbl := 'Owners & their subclasses & all their private classes'. |
5591 | 589 |
]. |
8124 | 590 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 591 |
self addCheckBox:b forSearchArea:#ownersHierarchiesWithPrivateClasses. |
592 |
(selectedClasses contains:[ :cls | cls isPrivate. ]) ifFalse:[ |
|
8124 | 593 |
b disable. |
5591 | 594 |
]. |
595 |
^ b. |
|
596 |
! |
|
597 |
||
598 |
addCheckBoxForSelectedClass |
|
8124 | 599 |
|b lbl arg| |
5591 | 600 |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
601 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
602 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
603 |
or:[ selectedClasses size > 1] ]) ifTrue:[ |
8124 | 604 |
selectedClasses size == 1 ifTrue:[ |
605 |
lbl := 'Selected class ("%1")'. |
|
606 |
arg := selectedClasses first theNonMetaclass name. |
|
607 |
] ifFalse:[ |
|
608 |
lbl := 'Selected classes (%1)'. |
|
609 |
arg := selectedClasses size. |
|
610 |
]. |
|
5591 | 611 |
] ifFalse:[ |
8124 | 612 |
lbl := 'Class ("%1")'. |
613 |
arg := currentClass name. |
|
5591 | 614 |
]. |
8124 | 615 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 616 |
self addCheckBox:b forSearchArea:#classes. |
617 |
^ b. |
|
618 |
! |
|
619 |
||
620 |
addCheckBoxForSelectedClassAndPrivateClasses |
|
621 |
|b lbl| |
|
622 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
623 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
624 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
625 |
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
|
626 |
lbl := 'Selected classes & all private classes'. |
5591 | 627 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
628 |
lbl := 'Class & private classes'. |
5591 | 629 |
]. |
630 |
b := CheckBox label:(resources string:lbl). |
|
631 |
self addCheckBox:b forSearchArea:#classesWithPrivateClasses. |
|
632 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
633 |
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
|
634 |
ifFalse:[ b disable. ]. |
5591 | 635 |
^ b. |
636 |
! |
|
637 |
||
638 |
addCheckBoxForSelectedClassAndSubclasses |
|
639 |
|b lbl| |
|
640 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
641 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
642 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
643 |
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
|
644 |
lbl := 'Selected classes & all subclasses'. |
5591 | 645 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
646 |
lbl := 'Class & subclasses'. |
5591 | 647 |
]. |
648 |
b := CheckBox label:(resources string:lbl). |
|
649 |
self addCheckBox:b forSearchArea:#classHierarchies. |
|
650 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
651 |
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
|
652 |
ifFalse:[ b disable. ]. |
5591 | 653 |
^ b. |
654 |
! |
|
655 |
||
656 |
addCheckBoxForSelectedClassAndSubclassesAndPrivateClasses |
|
657 |
|b lbl| |
|
658 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
659 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
660 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
661 |
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
|
662 |
lbl := 'Selected classes & all subclasses & all private classes'. |
5591 | 663 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
664 |
lbl := 'Class & subclasses & all private classes'. |
5591 | 665 |
]. |
666 |
b := CheckBox label:(resources string:lbl). |
|
667 |
self addCheckBox:b forSearchArea:#classHierarchiesWithPrivateClasses. |
|
668 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
669 |
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
|
670 |
ifFalse:[ b disable. ]. |
5591 | 671 |
^ b. |
672 |
! |
|
673 |
||
674 |
addCheckBoxForSelectedClassAndSuperclasses |
|
675 |
|b lbl| |
|
676 |
||
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
677 |
(browser isMethodListBrowser |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
678 |
or:[ currentClass isNil |
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
679 |
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
|
680 |
lbl := 'Selected classes & all superclasses'. |
5591 | 681 |
] ifFalse:[ |
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
682 |
lbl := 'Class & superclasses'. |
5591 | 683 |
]. |
684 |
b := CheckBox label:(resources string:lbl). |
|
685 |
self addCheckBox:b forSearchArea:#classesAndSuperclasses. |
|
686 |
(selectedClasses |
|
8269
eb414f5f7bf1
multiple seleted class search also when an inheritance classList is shown
Claus Gittinger <cg@exept.de>
parents:
8165
diff
changeset
|
687 |
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
|
688 |
ifFalse:[ b disable. ]. |
5591 | 689 |
^ b. |
690 |
! |
|
691 |
||
692 |
addCheckBoxForSelectedClassCategory |
|
8124 | 693 |
|b lbl arg| |
5591 | 694 |
|
695 |
currentClassCategory notNil ifTrue:[ |
|
8124 | 696 |
lbl := 'Class category ("%1")'. |
697 |
arg := currentClassCategory. |
|
5591 | 698 |
] ifFalse:[ |
8124 | 699 |
lbl := 'Selected classes categories (%1)'. |
700 |
arg := selectedCategories size. |
|
5591 | 701 |
]. |
8124 | 702 |
b := CheckBox label:(resources string:lbl with:arg). |
5591 | 703 |
self addCheckBox:b forSearchArea:#classCategories. |
704 |
^ b. |
|
705 |
! |
|
706 |
||
8566 | 707 |
addCheckBoxForSelectedMethodClasses |
708 |
|b classes| |
|
709 |
||
710 |
classes := (browser selectedMethods value collect:[:m | m mclass theNonMetaclass]) asSet. |
|
711 |
classes size == 1 ifTrue:[ |
|
712 |
b := CheckBox label:(resources string:'Selected method class (%1)' |
|
713 |
with:classes first name). |
|
714 |
] ifFalse:[ |
|
715 |
b := CheckBox label:(resources string:'Selected method classes (%1)' |
|
716 |
with:classes size). |
|
717 |
]. |
|
718 |
self addCheckBox:b forSearchArea:#listOfSelectedMethodClasses. |
|
719 |
^ b. |
|
720 |
! |
|
721 |
||
5591 | 722 |
addCheckBoxForSelectedMethods |
723 |
|b| |
|
724 |
||
725 |
b := CheckBox label:(resources string:'Selected methods (%1)' |
|
726 |
with:browser selectedMethods value size). |
|
727 |
self addCheckBox:b forSearchArea:#listOfSelectedMethods. |
|
728 |
^ b. |
|
729 |
! |
|
730 |
||
7042 | 731 |
addCheckBoxForSelectedPackage |
8124 | 732 |
|b lbl arg| |
7042 | 733 |
|
734 |
currentClassCategory notNil ifTrue:[ |
|
8124 | 735 |
lbl := 'Class category ("%1")'. |
736 |
arg := currentClassCategory. |
|
7042 | 737 |
] ifFalse:[ |
8124 | 738 |
lbl := 'Selected classes categories (%1)'. |
739 |
arg := selectedCategories size. |
|
7042 | 740 |
]. |
8124 | 741 |
b := CheckBox label:(resources string:lbl with:arg). |
7042 | 742 |
self addCheckBox:b forSearchArea:#classCategories. |
743 |
^ b. |
|
744 |
! |
|
745 |
||
5591 | 746 |
addDummyCheckBoxForEverywhere |
747 |
|b| |
|
748 |
||
749 |
b := CheckBox label:(resources string:'Everywhere'). |
|
750 |
b turnOn. |
|
751 |
b disable. |
|
6685 | 752 |
|
5591 | 753 |
verticalPanel add:b. |
754 |
! |
|
755 |
||
756 |
addInputFieldForSelectorOrNameOrString |
|
757 |
|sel inputField lastSearchPatterns| |
|
758 |
||
759 |
isSelector == true ifTrue:[ |
|
8123 | 760 |
sel := browser selectorToSearchFor. |
5591 | 761 |
] ifFalse:[ |
8123 | 762 |
isSelector == #globalName ifTrue:[ |
763 |
sel := browser globalNameToSearchFor ? LastGlobalSearched. |
|
764 |
] ifFalse:[ |
|
765 |
isSelector == #string ifTrue:[ |
|
766 |
sel := browser stringToSearchFor ? LastStringSearched. |
|
767 |
] ifFalse:[ |
|
768 |
sel := browser selectorToSearchFor. |
|
769 |
] |
|
770 |
]. |
|
5591 | 771 |
]. |
8123 | 772 |
sel isEmptyOrNil ifTrue:[ |
773 |
"/ use last searchString |
|
774 |
lastSearchPatterns := browser lastSearchPatterns. |
|
775 |
lastSearchPatterns size > 0 ifTrue:[ |
|
776 |
sel := lastSearchPatterns first. |
|
777 |
]. |
|
5591 | 778 |
]. |
779 |
selectorHolder := sel asValue. |
|
780 |
||
781 |
inputField := self addComboBoxOn:selectorHolder tabable:true. |
|
782 |
inputField list:lastSearchPatterns . |
|
783 |
inputField selectAll. |
|
784 |
inputField |
|
8123 | 785 |
entryCompletionBlock:[ :contents | |
786 |
|s what| |
|
5591 | 787 |
|
8123 | 788 |
s := contents withoutSpaces. |
789 |
self topView |
|
790 |
withWaitCursorDo:[ |
|
791 |
isSelector == #globalName ifFalse:[ |
|
792 |
what := Smalltalk selectorCompletion:s. |
|
793 |
] ifTrue:[ |
|
794 |
what := Smalltalk globalNameCompletion:s. |
|
795 |
]. |
|
796 |
inputField contents:what first. |
|
797 |
(what at:2) size ~~ 1 ifTrue:[ |
|
798 |
browser window beep. |
|
799 |
]. |
|
800 |
]. |
|
801 |
]. |
|
5591 | 802 |
! |
803 |
||
804 |
addTextEntryFieldForCode |
|
7170 | 805 |
|initial box panel infoLabel helpButton errMessageField checkCodeAction |
806 |
metaBox b| |
|
5591 | 807 |
|
808 |
box := View new. |
|
6443 | 809 |
box extent:(600 @ 200). |
5591 | 810 |
|
6608 | 811 |
panel := VariableHorizontalPanel in:box. |
812 |
panel origin:0.0@0.0 corner:(1.0@1.0). |
|
5591 | 813 |
|
6608 | 814 |
codeField := CodeView in:panel. |
7748 | 815 |
codeField canTab:true. |
6608 | 816 |
"/ codeField origin:0.0@0.0 corner:(0.75@1.0). |
817 |
||
818 |
infoLabel := Label in:panel. |
|
819 |
"/ infoLabel origin:0.75@0.0 corner:(1.0@1.0). |
|
5591 | 820 |
infoLabel font:(codeField font). |
6608 | 821 |
infoLabel adjust:#left. |
5591 | 822 |
infoLabel label:'MetaPatterns: |
823 |
||
824 |
' , '`' allBold , ' = meta |
|
825 |
||
826 |
' , '@' allBold , ' = list/any |
|
827 |
' , '.' allBold , ' = statement |
|
828 |
' , '`' allBold , ' = recurse |
|
829 |
||
830 |
' , '`#n' allBold , ' any lit |
|
831 |
' , '`v' allBold , ' any var |
|
832 |
' , '`@e' allBold , ' any expr |
|
833 |
'. |
|
834 |
||
6608 | 835 |
panel relativeCorners:#(0.6 1.0). |
836 |
||
837 |
helpButton := Button label:(resources string:'Pattern Help') in:infoLabel. |
|
838 |
helpButton layout:((AlignmentOrigin fractionalFromPoint:0.5@1.0) |
|
6443 | 839 |
leftOffset:2 |
8165
d7d59fbdcd2b
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8124
diff
changeset
|
840 |
topOffset:helpButton preferredHeight negated; |
6608 | 841 |
leftAlignmentFraction:0.5 topAlignmentFraction:0). |
5591 | 842 |
helpButton topInset:0.75@1.0. |
843 |
helpButton action:[self showHelpOnCodePatterns]. |
|
844 |
||
6608 | 845 |
|
5591 | 846 |
self addComponent:box tabable:true. |
7170 | 847 |
|
848 |
metaBox := HorizontalPanelView new. |
|
849 |
metaBox horizontalLayout:#leftMax. |
|
850 |
b := Button label:'Lit' action:[ codeField paste:'`#n' ] in:metaBox. |
|
851 |
b := Button label:'Var' action:[ codeField paste:'`v' ] in:metaBox. |
|
852 |
b := Button label:'Expr' action:[ codeField paste:'`@e' ] in:metaBox. |
|
853 |
self addComponent:metaBox. |
|
854 |
||
5591 | 855 |
errMessageField := (self addTextLabel:'') adjust:#left. |
856 |
errMessageField level:-1. |
|
857 |
self addCheckBox:(resources string:'Method') on:self isMethodHolder. |
|
858 |
||
859 |
checkCodeAction := [ self checkCodeIn:codeField notifying:errMessageField. ]. |
|
860 |
||
861 |
codeField modifiedChannel onChangeEvaluate:checkCodeAction. |
|
8282
9b4068f2dd30
method-code search fixed: correctly pass the isMethod argument
Claus Gittinger <cg@exept.de>
parents:
8269
diff
changeset
|
862 |
self isMethodHolder onChangeEvaluate:checkCodeAction. |
5591 | 863 |
|
864 |
initial := browser selectionInCodeView. |
|
865 |
initial isEmptyOrNil ifTrue:[ |
|
6443 | 866 |
initial := LastCodeSearched ? '' |
5591 | 867 |
]. |
868 |
codeField contents:initial. |
|
869 |
checkCodeAction value. |
|
7748 | 870 |
|
871 |
"Modified: / 15-03-2007 / 16:27:11 / cg" |
|
5591 | 872 |
! |
873 |
||
874 |
checkCodeIn:codeField notifying:errMessageField |
|
875 |
|codeString tree errAction| |
|
876 |
||
877 |
codeString := codeField contents asString string. |
|
878 |
errAction := [:str :pos | |
|
6608 | 879 |
|line col badLine| |
5591 | 880 |
|
6608 | 881 |
line := codeField lineOfCharacterPosition:pos. |
882 |
col := (codeField colOfCharacterPosition:pos) max:1. |
|
5591 | 883 |
|
8282
9b4068f2dd30
method-code search fixed: correctly pass the isMethod argument
Claus Gittinger <cg@exept.de>
parents:
8269
diff
changeset
|
884 |
badLine := (codeField listAt:line) ? ''. |
9b4068f2dd30
method-code search fixed: correctly pass the isMethod argument
Claus Gittinger <cg@exept.de>
parents:
8269
diff
changeset
|
885 |
col <= badLine size size ifTrue:[ |
6608 | 886 |
codeField |
887 |
listAt:line |
|
888 |
put:(badLine asText |
|
889 |
emphasisAt:col |
|
890 |
put:(UserPreferences current unknownIdentifierEmphasis)). |
|
891 |
"/ codeField selectFromCharacterPosition:pos to:pos. |
|
892 |
]. |
|
893 |
errMessageField label:('line: ',line printString,' ',str). |
|
894 |
errMessageField backgroundColor:Color red. |
|
895 |
codeField requestFocus. |
|
896 |
nil. |
|
897 |
]. |
|
5591 | 898 |
|
899 |
isMethodHolder value ifTrue:[ |
|
6608 | 900 |
tree := RBParser parseRewriteMethod:codeString onError: errAction. |
5591 | 901 |
] ifFalse:[ |
6608 | 902 |
tree := RBParser parseRewriteExpression:codeString onError: errAction. |
5591 | 903 |
]. |
6608 | 904 |
tree notNil ifTrue:[ |
905 |
errMessageField backgroundColor:View defaultViewBackgroundColor. |
|
906 |
errMessageField label:nil |
|
907 |
]. |
|
5591 | 908 |
codeField modifiedChannel setValue:false. |
909 |
! |
|
910 |
||
911 |
getClassesAndMethodsFor:where |
|
912 |
where == #everywhere ifTrue:[ |
|
7042 | 913 |
classes := Smalltalk allClasses. |
7378 | 914 |
methods := nil. |
7042 | 915 |
^ self. |
5591 | 916 |
]. |
917 |
where == #currentNameSpace ifTrue:[ |
|
7042 | 918 |
classes := currentNamespace allClassesWithAllPrivateClasses. |
7378 | 919 |
methods := nil. |
7042 | 920 |
^ self. |
5591 | 921 |
]. |
922 |
where == #currentClassesNameSpace ifTrue:[ |
|
7042 | 923 |
currentClass isPrivate ifTrue:[ |
924 |
classes := currentClass topOwningClass nameSpace |
|
925 |
allClassesWithAllPrivateClasses. |
|
926 |
] ifFalse:[ |
|
927 |
classes := currentClass nameSpace allClassesWithAllPrivateClasses. |
|
928 |
]. |
|
7378 | 929 |
methods := nil. |
7042 | 930 |
^ self. |
931 |
]. |
|
932 |
where == #currentPackage ifTrue:[ |
|
933 |
classes := Smalltalk allClassesInPackage:currentPackage. |
|
7378 | 934 |
methods := nil. |
7042 | 935 |
^ self. |
936 |
]. |
|
937 |
where == #currentClassesPackage ifTrue:[ |
|
938 |
classes := Smalltalk allClassesInPackage:currentClass package. |
|
7378 | 939 |
methods := nil. |
7042 | 940 |
^ self. |
5591 | 941 |
]. |
942 |
where == #classCategories ifTrue:[ |
|
7042 | 943 |
classes := Smalltalk allClasses |
944 |
select:[ :cls | selectedCategories includes:cls category. ]. |
|
945 |
classes := classes collect:[ :each | each theNonMetaclass. ]. |
|
7378 | 946 |
methods := nil. |
7042 | 947 |
^ self. |
5591 | 948 |
]. |
949 |
(where == #classes or:[ where == #classesWithPrivateClasses. ]) ifTrue:[ |
|
7042 | 950 |
classes := selectedClasses collect:[ :each | each theNonMetaclass. ]. |
7378 | 951 |
methods := nil. |
7042 | 952 |
^ self. |
5591 | 953 |
]. |
7378 | 954 |
(where == #classHierarchies or:[ where == #classHierarchiesWithPrivateClasses. ]) |
955 |
ifTrue:[ |
|
956 |
classes := IdentitySet new. |
|
957 |
selectedClasses do:[ :cls | |
|
958 |
classes addAll:cls theNonMetaclass withAllSubclasses. |
|
959 |
]. |
|
960 |
methods := nil. |
|
961 |
^ self. |
|
962 |
]. |
|
5591 | 963 |
where == #ownersWithPrivateClasses ifTrue:[ |
7042 | 964 |
classes := IdentitySet new. |
965 |
selectedClasses do:[ :cls | |
|
966 |
|c| |
|
5591 | 967 |
|
7042 | 968 |
c := cls theNonMetaclass. |
969 |
classes add:(c owningClass ? c). |
|
970 |
]. |
|
7378 | 971 |
methods := nil. |
7042 | 972 |
^ self. |
5591 | 973 |
]. |
974 |
where == #ownersHierarchiesWithPrivateClasses ifTrue:[ |
|
7042 | 975 |
classes := IdentitySet new. |
976 |
selectedClasses do:[ :cls | |
|
977 |
|c| |
|
5591 | 978 |
|
7042 | 979 |
c := cls theNonMetaclass. |
980 |
classes addAll:(c owningClass ? c) withAllSubclasses. |
|
981 |
]. |
|
7378 | 982 |
methods := nil. |
7042 | 983 |
^ self. |
5591 | 984 |
]. |
985 |
(where == #classesAndSuperclasses) ifTrue:[ |
|
7042 | 986 |
classes := IdentitySet new. |
987 |
selectedClasses do:[ :cls | |
|
988 |
classes addAll:cls theNonMetaclass withAllSuperclasses. |
|
989 |
]. |
|
7378 | 990 |
methods := nil. |
7042 | 991 |
^ self. |
5591 | 992 |
]. |
993 |
(where == #listOfMethods) ifTrue:[ |
|
7042 | 994 |
classes := nil. |
995 |
methods := browser methodListApp methodList value. |
|
996 |
^ self. |
|
5591 | 997 |
]. |
998 |
(where == #listOfSelectedMethods) ifTrue:[ |
|
7042 | 999 |
classes := nil. |
1000 |
methods := browser selectedMethods value. |
|
1001 |
^ self. |
|
5591 | 1002 |
]. |
8566 | 1003 |
(where == #listOfSelectedMethodClasses) ifTrue:[ |
1004 |
classes := (browser selectedMethods value collect:[:m | m mclass theNonMetaclass]) asSet asOrderedCollection. |
|
1005 |
methods := nil. |
|
1006 |
^ self. |
|
1007 |
]. |
|
8083
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1008 |
(where == #listOfChangedClasses) ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1009 |
classes := ChangeSet current changedClasses. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1010 |
methods := nil. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1011 |
^ self. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1012 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1013 |
(where == #listOfChangedMethods) ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1014 |
classes := nil. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1015 |
methods := Set new. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1016 |
ChangeSet current do:[:chg | |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1017 |
|mthd| |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1018 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1019 |
chg notNil ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1020 |
chg isMethodChange ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1021 |
mthd := chg changeMethod. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1022 |
mthd notNil ifTrue:[ |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1023 |
methods add:mthd |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1024 |
] |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1025 |
] |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1026 |
] |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1027 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1028 |
methods := methods asOrderedCollection. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1029 |
^ self. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1030 |
]. |
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1031 |
|
53aba2c722ad
+search in changed methods & changed classes
Claus Gittinger <cg@exept.de>
parents:
8067
diff
changeset
|
1032 |
self halt:'inumplemented search'. |
7378 | 1033 |
|
1034 |
"Modified: / 09-10-2006 / 12:34:40 / cg" |
|
5591 | 1035 |
! |
1036 |
||
1037 |
isMethodHolder |
|
1038 |
isMethodHolder isNil ifTrue:[isMethodHolder := (LastCodeSearchWasMethod ? false) asValue]. |
|
1039 |
^ isMethodHolder |
|
1040 |
! ! |
|
1041 |
||
1042 |
!SearchDialog methodsFor:'setup-buttons'! |
|
1043 |
||
1044 |
addBrowseButton |
|
1045 |
|b| |
|
1046 |
||
1047 |
b := Button label:(resources string:'Browse'). |
|
1048 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
1049 |
self addButton:b before:nil. |
|
1050 |
] ifFalse:[ |
|
1051 |
self addButton:b after:nil. |
|
1052 |
]. |
|
1053 |
b |
|
1054 |
action:[ |
|
1055 |
openHow := #newBrowser. |
|
1056 |
self doAccept. |
|
1057 |
self okPressed. |
|
1058 |
]. |
|
1059 |
^ b. |
|
1060 |
! |
|
1061 |
||
1062 |
addBufferButton |
|
1063 |
|b| |
|
1064 |
||
1065 |
b := Button label:(resources string:'Add Buffer'). |
|
1066 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
1067 |
self addButton:b before:nil. |
|
1068 |
] ifFalse:[ |
|
1069 |
self addButton:b after:nil. |
|
1070 |
]. |
|
1071 |
b |
|
1072 |
action:[ |
|
1073 |
openHow := #newBuffer. |
|
1074 |
self doAccept. |
|
1075 |
self okPressed. |
|
1076 |
]. |
|
1077 |
^ b. |
|
1078 |
! |
|
1079 |
||
1080 |
addButtons |
|
6685 | 1081 |
"add find/newBrowser/newBuffer buttons" |
1082 |
||
5591 | 1083 |
|prevButton| |
1084 |
||
1085 |
allowFind ifTrue:[ |
|
6685 | 1086 |
defaultOpenHow := #showHere. |
1087 |
prevButton := self addFindButton. |
|
5591 | 1088 |
]. |
1089 |
allowBrowser ifTrue:[ |
|
6685 | 1090 |
defaultOpenHow := #newBrowser. |
1091 |
prevButton := self addBrowseButton. |
|
5591 | 1092 |
]. |
1093 |
allowBuffer ifTrue:[ |
|
6685 | 1094 |
defaultOpenHow := #newBuffer. |
1095 |
prevButton := self addBufferButton. |
|
5591 | 1096 |
]. |
1097 |
prevButton notNil ifTrue:[ |
|
6685 | 1098 |
prevButton isReturnButton:true. |
5591 | 1099 |
]. |
1100 |
self addAbortButton. |
|
1101 |
! |
|
1102 |
||
1103 |
addFindButton |
|
1104 |
|b| |
|
1105 |
||
1106 |
b := Button label:(resources string:'Find'). |
|
1107 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
1108 |
self addButton:b before:nil. |
|
1109 |
] ifFalse:[ |
|
1110 |
self addButton:b after:nil. |
|
1111 |
]. |
|
1112 |
b |
|
1113 |
action:[ |
|
1114 |
openHow := #showHere. |
|
1115 |
self doAccept. |
|
1116 |
self okPressed. |
|
1117 |
]. |
|
1118 |
^ b. |
|
1119 |
! ! |
|
1120 |
||
1121 |
!SearchDialog class methodsFor:'documentation'! |
|
1122 |
||
1123 |
version |
|
8566 | 1124 |
^ '$Header: /cvs/stx/stx/libtool/Tools_SearchDialog.st,v 1.32 2009-03-06 15:01:27 cg Exp $' |
5591 | 1125 |
! ! |