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