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