15 |
15 |
16 AbstractFileApplicationNoteBookComponent subclass:#AbstractFileFinderApplicationComponent |
16 AbstractFileApplicationNoteBookComponent subclass:#AbstractFileFinderApplicationComponent |
17 instanceVariableNames:'findFileView searchResultTable resultList enableStop enableSearch |
17 instanceVariableNames:'findFileView searchResultTable resultList enableStop enableSearch |
18 stopSignal accessLock searchTask expanded searchRecursively |
18 stopSignal accessLock searchTask expanded searchRecursively |
19 selectionHolder hasListEntries targetApplication matchedFilesList |
19 selectionHolder hasListEntries targetApplication matchedFilesList |
20 shownListHolder autoSelectInBrowserHolder' |
20 shownListHolder autoSelectInBrowserHolder filesSearchedCount' |
21 classVariableNames:'' |
21 classVariableNames:'' |
22 poolDictionaries:'' |
22 poolDictionaries:'' |
23 category:'Interface-Tools-File' |
23 category:'Interface-Tools-File' |
24 ! |
24 ! |
25 |
25 |
126 startSearchTask:aBlock name:taskName |
126 startSearchTask:aBlock name:taskName |
127 |thisSearchTask| |
127 |thisSearchTask| |
128 |
128 |
129 searchTask := thisSearchTask := |
129 searchTask := thisSearchTask := |
130 [ |
130 [ |
131 |message t| |
131 |message time| |
132 |
132 |
133 [ |
133 [ |
134 (self stopSignal) catch:[ |
134 (self stopSignal) catch:[ |
135 self enableStop value:true. |
135 self enableStop value:true. |
136 self resultList removeAll. |
136 self resultList removeAll. |
137 self matchedFilesList removeAll. |
137 self matchedFilesList removeAll. |
138 self notify:'Searching...'. |
138 self notify:'Searching...'. |
139 |
139 filesSearchedCount := 0. |
140 "/ self changeInformationTo:'Find File ' , '- searching ' toTab:true. |
140 |
141 t := Time millisecondsToRun:[ |
141 "/ self changeInformationTo:'Find File ' , '- searching ' toTab:true. |
|
142 time := Time millisecondsToRun:[ |
142 aBlock value. |
143 aBlock value. |
143 ]. |
144 ]. |
144 t > 100 ifTrue:[ |
145 time > 100 ifTrue:[ |
145 t := ((t / 1000) asFixedPoint:2) printString , ' s' |
146 time := ((time / 1000) asFixedPoint:2) printString , ' s' |
146 ] ifFalse:[ |
147 ] ifFalse:[ |
147 t := t printString , ' ms' |
148 time := time printString , ' ms' |
148 ]. |
149 ]. |
149 message := 'Found %1 file%2 in %3.' bindWith:(resultList size) with:(resultList size == 1 ifTrue:'' ifFalse:'s') with:t. |
150 message := resources |
|
151 string:'Found %1 file%2 in %3 (%4 files visited).' |
|
152 with:(resultList size) |
|
153 with:(resultList size == 1 ifTrue:'' ifFalse:'s') |
|
154 with:time |
|
155 with:filesSearchedCount. |
150 self enableStop value:false. |
156 self enableStop value:false. |
151 self enableSearch value:true. |
157 self enableSearch value:true. |
152 self changeInformationTo:'Find File ' , '- done.' toTab:true. |
158 self changeInformationTo:'Find File ' , '- done.' toTab:true. |
153 ]. |
159 ]. |
154 ] ensure:[ |
160 ] ensure:[ |
477 ! ! |
483 ! ! |
478 |
484 |
479 !AbstractFileFinderApplicationComponent class methodsFor:'documentation'! |
485 !AbstractFileFinderApplicationComponent class methodsFor:'documentation'! |
480 |
486 |
481 version |
487 version |
482 ^ '$Header: /cvs/stx/stx/libtool/AbstractFileFinderApplicationComponent.st,v 1.12 2015-02-07 13:27:25 cg Exp $' |
488 ^ '$Header: /cvs/stx/stx/libtool/AbstractFileFinderApplicationComponent.st,v 1.13 2015-02-07 14:21:50 cg Exp $' |
483 ! |
489 ! |
484 |
490 |
485 version_CVS |
491 version_CVS |
486 ^ '$Header: /cvs/stx/stx/libtool/AbstractFileFinderApplicationComponent.st,v 1.12 2015-02-07 13:27:25 cg Exp $' |
492 ^ '$Header: /cvs/stx/stx/libtool/AbstractFileFinderApplicationComponent.st,v 1.13 2015-02-07 14:21:50 cg Exp $' |
487 ! ! |
493 ! ! |
488 |
494 |