author | Claus Gittinger <cg@exept.de> |
Thu, 12 Jan 2012 02:57:03 +0100 | |
changeset 11107 | 17342ca15467 |
parent 11102 | 4a79fb29bdd1 |
child 11118 | 6d72314eb4df |
permissions | -rw-r--r-- |
11095 | 1 |
" |
2 |
COPYRIGHT (c) 2002 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 |
" |
|
11087 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
AbstractFileApplicationNoteBookComponent subclass:#AbstractFileFinderApplicationComponent |
|
15 |
instanceVariableNames:'findFileView searchResultTable resultList enableStop enableSearch |
|
16 |
stopSignal accessLock searchTask expanded searchRecursively |
|
17 |
selectionHolder hasListEntries targetApplication matchedFilesList |
|
18 |
shownListHolder autoSelectInBrowserHolder' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'Interface-Tools-File' |
|
22 |
! |
|
23 |
||
11095 | 24 |
!AbstractFileFinderApplicationComponent class methodsFor:'documentation'! |
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! ! |
|
39 |
||
40 |
!AbstractFileFinderApplicationComponent methodsFor:'accessing'! |
|
41 |
||
42 |
accessLock |
|
43 |
^ accessLock |
|
44 |
! |
|
45 |
||
46 |
stopSignal |
|
47 |
||
48 |
stopSignal isNil ifTrue:[ |
|
49 |
stopSignal := Signal new. |
|
50 |
]. |
|
51 |
^ stopSignal |
|
52 |
! |
|
53 |
||
54 |
targetApplication:anApplication |
|
55 |
targetApplication := anApplication. |
|
56 |
||
57 |
"Modified (format): / 11-01-2012 / 22:41:01 / cg" |
|
58 |
! ! |
|
59 |
||
60 |
!AbstractFileFinderApplicationComponent methodsFor:'actions'! |
|
61 |
||
62 |
changeInformationTo:aString |
|
63 |
||
64 |
self changeInformationTo:aString toTab:false |
|
65 |
! |
|
66 |
||
67 |
changeInformationTo:aString toTab:aBoolean |
|
68 |
masterApplication isNil ifTrue:[ |
|
69 |
findFileView label:aString |
|
70 |
] ifFalse:[ |
|
71 |
aBoolean ifTrue:[ |
|
72 |
masterApplication tabStringChangeTo:aString for:self |
|
73 |
] ifFalse:[ |
|
74 |
masterApplication notify:aString. |
|
75 |
]. |
|
76 |
]. |
|
77 |
||
78 |
"Modified: / 03-08-2011 / 17:56:21 / cg" |
|
79 |
! |
|
80 |
||
81 |
clearShownList |
|
82 |
self shownList removeAll. |
|
83 |
! |
|
84 |
||
85 |
copySelectedFileNamesToClipboard |
|
86 |
|sel list stream| |
|
87 |
||
88 |
sel := self selectionHolder value. |
|
89 |
list := self shownList. |
|
90 |
(sel notEmptyOrNil) ifTrue:[ |
|
91 |
stream := WriteStream on:''. |
|
92 |
sel do:[: key | |
|
93 |
stream nextPutAll:(list at:key). |
|
94 |
stream cr. |
|
95 |
]. |
|
96 |
self window setClipboardText:stream contents. |
|
97 |
stream close. |
|
98 |
]. |
|
99 |
! |
|
100 |
||
101 |
openInNewBrowser |
|
102 |
|sel| |
|
103 |
||
104 |
sel := self selectionHolder value. |
|
105 |
(sel notEmptyOrNil) ifTrue:[ |
|
106 |
FileBrowserV2 openOn:(self shownList at:sel first) asFilename |
|
107 |
]. |
|
108 |
! |
|
109 |
||
110 |
selectInBrowser |
|
111 |
|sel entry application| |
|
112 |
||
113 |
sel := self selectionHolder value. |
|
114 |
(sel notEmptyOrNil) ifTrue:[ |
|
115 |
entry := self shownList at:sel first. |
|
116 |
entry asFilename exists ifFalse:[ ^ self]. |
|
117 |
application := targetApplication ? self masterApplication. |
|
118 |
application notNil ifTrue:[ |
|
119 |
application gotoFile:(entry asFilename). |
|
120 |
]. |
|
121 |
]. |
|
122 |
! |
|
123 |
||
11102
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
124 |
startSearchTask:aBlock name:taskName |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
125 |
|thisSearchTask| |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
126 |
|
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
127 |
searchTask := thisSearchTask := |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
128 |
[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
129 |
|message t| |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
130 |
|
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
131 |
[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
132 |
(self stopSignal) catch:[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
133 |
self enableStop value:true. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
134 |
self resultList removeAll. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
135 |
self matchedFilesList removeAll. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
136 |
self notify:'Searching...'. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
137 |
|
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
138 |
"/ self changeInformationTo:'Find File ' , '- searching ' toTab:true. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
139 |
t := Time millisecondsToRun:[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
140 |
aBlock value. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
141 |
]. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
142 |
t > 100 ifTrue:[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
143 |
t := ((t / 1000) asFixedPoint:2) printString , ' s' |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
144 |
] ifFalse:[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
145 |
t := t printString , ' ms' |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
146 |
]. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
147 |
message := 'Found %1 file%2 in %3' bindWith:(resultList size) with:(resultList size == 1 ifTrue:'' ifFalse:'s') with:t. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
148 |
self enableStop value:false. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
149 |
self enableSearch value:true. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
150 |
self changeInformationTo:'Find File ' , '- done.' toTab:true. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
151 |
]. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
152 |
] ensure:[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
153 |
thisSearchTask == searchTask ifTrue:[ |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
154 |
searchTask := nil. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
155 |
self enableStop value:false. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
156 |
self notify:message. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
157 |
]. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
158 |
] |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
159 |
] newProcess. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
160 |
|
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
161 |
searchTask priorityRange:(Processor systemBackgroundPriority to:Processor userSchedulingPriority). |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
162 |
searchTask name:taskName. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
163 |
searchTask resume. |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
164 |
^ searchTask |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
165 |
|
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
166 |
"Created: / 12-01-2012 / 01:52:17 / cg" |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
167 |
! |
4a79fb29bdd1
added: #startSearchTask:name:
Claus Gittinger <cg@exept.de>
parents:
11100
diff
changeset
|
168 |
|
11095 | 169 |
stop |
170 |
searchTask notNil ifTrue:[ |
|
171 |
accessLock critical:[ |
|
172 |
searchTask interruptWith:[stopSignal raiseRequest]. |
|
173 |
] |
|
174 |
]. |
|
175 |
self enableStop value:false. |
|
176 |
self enableSearch value:true. |
|
177 |
self changeInformationTo:'Find File ' , '- search stopped' toTab:true. |
|
178 |
||
179 |
"Modified: / 11-01-2012 / 22:42:07 / cg" |
|
180 |
! |
|
181 |
||
182 |
stopSearchTask |
|
183 |
|task| |
|
184 |
||
185 |
(task := searchTask) notNil ifTrue:[ |
|
186 |
searchTask := nil. |
|
187 |
||
188 |
Object errorSignal handle:[:ex| |
|
189 |
Dialog warn:ex description. |
|
190 |
]do:[ |
|
191 |
task isDead ifFalse:[ |
|
192 |
task terminateWithAllSubprocessesInGroup. |
|
193 |
task waitUntilTerminated. |
|
194 |
] |
|
195 |
] |
|
196 |
]. |
|
197 |
! ! |
|
198 |
||
199 |
!AbstractFileFinderApplicationComponent methodsFor:'aspects'! |
|
200 |
||
201 |
autoSelectInBrowserHolder |
|
202 |
autoSelectInBrowserHolder isNil ifTrue:[ |
|
203 |
autoSelectInBrowserHolder := false asValue. |
|
204 |
]. |
|
205 |
^ autoSelectInBrowserHolder. |
|
206 |
! |
|
207 |
||
208 |
enableSearch |
|
209 |
||
210 |
enableSearch isNil ifTrue:[ |
|
211 |
enableSearch := true asValue. |
|
212 |
]. |
|
213 |
^ enableSearch. |
|
214 |
! |
|
215 |
||
216 |
enableStop |
|
217 |
||
218 |
enableStop isNil ifTrue:[ |
|
219 |
enableStop := true asValue. |
|
220 |
]. |
|
221 |
^ enableStop. |
|
222 |
! |
|
223 |
||
224 |
hasListEntries |
|
225 |
||
226 |
hasListEntries isNil ifTrue:[ |
|
227 |
hasListEntries := false asValue. |
|
228 |
]. |
|
229 |
^ hasListEntries. |
|
230 |
! |
|
231 |
||
11107 | 232 |
matchedFilesList |
233 |
||
234 |
matchedFilesList isNil ifTrue:[ |
|
235 |
matchedFilesList := List new. |
|
236 |
matchedFilesList addDependent:self. |
|
237 |
]. |
|
238 |
^ matchedFilesList. |
|
239 |
! |
|
240 |
||
11095 | 241 |
resultList |
242 |
resultList isNil ifTrue:[ |
|
243 |
resultList := List new. |
|
244 |
resultList addDependent:self. |
|
245 |
]. |
|
246 |
^ resultList. |
|
247 |
! |
|
248 |
||
249 |
searchRecursively |
|
250 |
||
251 |
searchRecursively isNil ifTrue:[ |
|
252 |
searchRecursively := true asValue. |
|
253 |
]. |
|
254 |
^ searchRecursively. |
|
255 |
! |
|
256 |
||
257 |
searchResultTable |
|
258 |
||
259 |
searchResultTable isNil ifTrue:[ |
|
260 |
searchResultTable := self class searchResultTable asValue. |
|
261 |
]. |
|
262 |
^ searchResultTable. |
|
263 |
! |
|
264 |
||
265 |
selectionHolder |
|
266 |
||
267 |
selectionHolder isNil ifTrue:[ |
|
268 |
selectionHolder := ValueHolder new. |
|
269 |
selectionHolder addDependent:self. |
|
270 |
]. |
|
271 |
^ selectionHolder |
|
272 |
! |
|
273 |
||
274 |
shownList |
|
275 |
^ self shownListHolder valueHolder. |
|
276 |
! |
|
277 |
||
278 |
shownListHolder |
|
279 |
shownListHolder isNil ifTrue:[ |
|
280 |
shownListHolder := IndirectValue for:(self resultList). |
|
281 |
shownListHolder addDependent:self. |
|
282 |
]. |
|
283 |
^ shownListHolder. |
|
284 |
! ! |
|
285 |
||
286 |
!AbstractFileFinderApplicationComponent methodsFor:'change & update'! |
|
287 |
||
288 |
update:something with:aParameter from:changedObject |
|
289 |
changedObject == self shownListHolder ifTrue:[ |
|
290 |
self hasListEntries value:(changedObject valueHolder notEmpty). |
|
291 |
^ self |
|
292 |
]. |
|
293 |
changedObject == self selectionHolder ifTrue:[ |
|
294 |
self autoSelectInBrowser ifTrue:[ |
|
295 |
self selectInBrowser. |
|
296 |
]. |
|
297 |
^ self |
|
298 |
]. |
|
299 |
super update:something with:aParameter from:changedObject |
|
300 |
! ! |
|
301 |
||
302 |
!AbstractFileFinderApplicationComponent methodsFor:'drag & drop'! |
|
303 |
||
304 |
getDisplayObjects:anArgument |
|
305 |
"retrieve the objects displayed during a drag" |
|
306 |
||
307 |
| sel string size fnName stream| |
|
308 |
||
309 |
sel := self selectionHolder value. |
|
310 |
size := sel size. |
|
311 |
size == 0 ifTrue:[^ '']. |
|
312 |
||
313 |
stream := WriteStream on:''. |
|
314 |
stream nextPutAll:((resultList at:sel first) asFilename baseName asString). |
|
315 |
size == 1 ifTrue:[ |
|
316 |
fnName := 'ui_menuitem.xpm'. |
|
317 |
] ifFalse:[ |
|
318 |
fnName := 'ui_submenu_open.xpm'. |
|
319 |
stream nextPutAll:' ... '. |
|
320 |
stream nextPutAll:((resultList at:sel last) asFilename baseName asString). |
|
321 |
]. |
|
322 |
string := stream contents. |
|
323 |
||
324 |
^ Array with:(LabelAndIcon |
|
325 |
icon:(Image fromFile:fnName) |
|
326 |
string:(Text string:string emphasis:#bold)) |
|
327 |
! |
|
328 |
||
329 |
getDropObjects:anArgument |
|
330 |
"common code, used in subclasses" |
|
331 |
||
332 |
|sel| |
|
333 |
||
334 |
sel := self selectionHolder value. |
|
335 |
^ sel |
|
336 |
collect:[:idx| |
|
337 |
|el| |
|
338 |
||
339 |
el := resultList at:idx. |
|
340 |
DropObject newFile:(el asFilename) |
|
341 |
]. |
|
342 |
! ! |
|
343 |
||
344 |
!AbstractFileFinderApplicationComponent methodsFor:'event handling'! |
|
345 |
||
346 |
fileDoubleClick:entries |
|
347 |
|file fn app openedAppl contentsPattern| |
|
348 |
||
349 |
file := self shownList at:entries first. |
|
350 |
fn := file asFilename. |
|
351 |
fn exists ifFalse:[ |
|
352 |
Dialog warn:('File %1 does not (no longer ?) exist.' bindWith:file allBold). |
|
353 |
^ self |
|
354 |
]. |
|
355 |
||
356 |
app := targetApplication ? self masterApplication. |
|
357 |
file asFilename isDirectory ifTrue:[ |
|
358 |
app gotoFile:(file asFilename). |
|
359 |
^ self. |
|
360 |
]. |
|
361 |
app notNil ifTrue:[ |
|
362 |
openedAppl := app openApplForFile:file. |
|
363 |
(openedAppl notNil and:[openedAppl isTextEditor]) ifTrue:[ |
|
364 |
contentsPattern := self contentsPatternHolder value. |
|
365 |
(contentsPattern notNil and:[ contentsPattern notEmpty and:[contentsPattern ~= '*']]) ifTrue:[ |
|
366 |
openedAppl searchForPattern:contentsPattern ignoreCase:(self ignoreCaseInContents value). |
|
367 |
] |
|
368 |
]. |
|
369 |
] ifFalse:[ |
|
370 |
self openInNewBrowser. |
|
371 |
] |
|
372 |
! |
|
373 |
||
374 |
fileSelected:entries |
|
375 |
|file fn| |
|
376 |
||
377 |
entries isEmptyOrNil ifTrue:[^ self]. |
|
378 |
||
379 |
file := self shownList at:entries first. |
|
380 |
file isText ifTrue:[^ self]. |
|
381 |
||
382 |
fn := file asFilename. |
|
383 |
fn exists ifFalse:[ |
|
384 |
self notify:('%1 does not (no longer ?) exist or is not accessable.' bindWith:file allBold). |
|
385 |
^ self |
|
386 |
]. |
|
387 |
fn isDirectory ifTrue:[ |
|
388 |
self notify:nil. |
|
389 |
^ self. |
|
390 |
]. |
|
391 |
||
392 |
self notify:('%1: %2.' bindWith:fn baseName allBold with:(UnitConverter fileSizeStringFor:fn fileSize)). |
|
393 |
||
394 |
"Created: / 04-07-2006 / 11:35:38 / cg" |
|
395 |
! |
|
396 |
||
397 |
processEvent:anEvent |
|
398 |
"filter keyboard events. |
|
399 |
Return true, if I have eaten the event" |
|
400 |
||
401 |
|focusView key rawKey| |
|
402 |
||
403 |
anEvent isKeyPressEvent ifTrue:[ |
|
404 |
focusView := anEvent targetView. |
|
405 |
key := anEvent key. |
|
406 |
rawKey := anEvent rawKey. |
|
407 |
||
408 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
409 |
(key == #Return) ifTrue:[ |
|
410 |
(focusView name ~= 'selectionInListView') ifTrue:[ |
|
411 |
self doSearch. |
|
412 |
] ifFalse:[ |
|
413 |
self hasOneFileSelected ifTrue:[ |
|
414 |
self fileDoubleClick:(self selectionHolder value) |
|
415 |
"/ self isEmbeddedApplication ifTrue:[ |
|
416 |
"/ self selectInBrowser. |
|
417 |
"/ ] ifFalse:[ |
|
418 |
"/ self openInNewBrowser. |
|
419 |
"/ ] |
|
420 |
] |
|
421 |
]. |
|
422 |
^ true |
|
423 |
]. |
|
424 |
] |
|
425 |
]. |
|
426 |
^ false |
|
427 |
! ! |
|
428 |
||
429 |
!AbstractFileFinderApplicationComponent methodsFor:'initialization'! |
|
430 |
||
431 |
initialize |
|
432 |
super initialize. |
|
433 |
accessLock := Semaphore forMutualExclusion name:'accessLock'. |
|
11100
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
434 |
|
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
435 |
self enableStop value:false. |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
436 |
self enableSearch value:true. |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
437 |
|
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
438 |
"Modified: / 12-01-2012 / 01:39:27 / cg" |
11095 | 439 |
! ! |
440 |
||
441 |
!AbstractFileFinderApplicationComponent methodsFor:'queries'! |
|
442 |
||
443 |
hasOneFileSelected |
|
444 |
| sel | |
|
445 |
sel := self selectionHolder value. |
|
446 |
^ (sel notNil and:[sel notEmpty and:[sel size = 1]]) |
|
447 |
! |
|
448 |
||
449 |
hasSelectionInResultList |
|
450 |
| sel | |
|
451 |
||
452 |
sel := self selectionHolder value. |
|
453 |
^ sel notEmptyOrNil |
|
454 |
! ! |
|
11087 | 455 |
|
11100
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
456 |
!AbstractFileFinderApplicationComponent methodsFor:'tasks'! |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
457 |
|
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
458 |
stopSearchTaskOrAbort |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
459 |
searchTask isNil ifTrue:[ ^ self ]. |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
460 |
|
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
461 |
(Dialog |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
462 |
confirm:(resources stringWithCRs:'There is already another find-file task running !!') |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
463 |
yesLabel:(resources string:'Stop other Task and Proceed') |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
464 |
noLabel:(resources string:'Cancel')) |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
465 |
ifFalse:[AbortSignal raise]. |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
466 |
self stop. |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
467 |
|
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
468 |
"Created: / 12-01-2012 / 01:48:42 / cg" |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
469 |
! ! |
4782ef32a188
refactored for better reuse in directory-diff
Claus Gittinger <cg@exept.de>
parents:
11095
diff
changeset
|
470 |
|
11087 | 471 |
!AbstractFileFinderApplicationComponent class methodsFor:'documentation'! |
472 |
||
473 |
version |
|
11107 | 474 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileFinderApplicationComponent.st,v 1.5 2012-01-12 01:57:03 cg Exp $' |
11087 | 475 |
! |
476 |
||
477 |
version_CVS |
|
11107 | 478 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileFinderApplicationComponent.st,v 1.5 2012-01-12 01:57:03 cg Exp $' |
11087 | 479 |
! ! |