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