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