FindFileApplication.st
author Claus Gittinger <cg@exept.de>
Thu, 12 Jan 2012 02:12:35 +0100
changeset 11103 7043dfab86a5
parent 11101 34affbf84319
child 11106 86ac37a9a382
permissions -rw-r--r--
refactored
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     1
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     3
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     4
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     5
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     6
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     8
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
     9
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    10
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    11
"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
321c1729db5b initial checkin
penk
parents:
diff changeset
    13
11096
c9585b9d2697 refactored
Claus Gittinger <cg@exept.de>
parents: 10441
diff changeset
    14
AbstractFileFinderApplicationComponent subclass:#FindFileApplication
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
    15
	instanceVariableNames:'searchDirectories searchDirectoryHolder notSearchForSameContents
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
    16
		namePatternHolder excludedNamePatternHolder ignoreCaseInName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
    17
		ignoreCaseInExcludedName contentsPatternHolder
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
    18
		ignoreCaseInContents notContentsPatternHolder
11096
c9585b9d2697 refactored
Claus Gittinger <cg@exept.de>
parents: 10441
diff changeset
    19
		ignoreCaseInNotContents sameContentsAsHolder useLocate useGrep
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
    20
		rememberInCache searchOnlyInCache searchForSameContents
11096
c9585b9d2697 refactored
Claus Gittinger <cg@exept.de>
parents: 10441
diff changeset
    21
		contentsInfoCache contentsInfoCacheAccessLock
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
    22
		fileSizeOperatorHolder fileSizeHolder enableFileSizeFilter
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
    23
		fileSizeUnitHolder'
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
    24
	classVariableNames:'ContentsInfoCache ContentsInfoCacheAccessLock LastRememberInCache
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
    25
		LastSearchIgnoredCaseInContents LastSearchIgnoredCaseInFilename
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
    26
		SearchStringHistory LastSearchIgnoredCaseInExcludedFilename'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    27
	poolDictionaries:''
321c1729db5b initial checkin
penk
parents:
diff changeset
    28
	category:'Interface-Tools-File'
321c1729db5b initial checkin
penk
parents:
diff changeset
    29
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    30
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    31
!FindFileApplication class methodsFor:'documentation'!
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    32
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    33
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    34
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    35
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    36
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    37
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    38
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    39
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    40
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    41
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    42
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    43
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    44
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    45
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    46
321c1729db5b initial checkin
penk
parents:
diff changeset
    47
!FindFileApplication class methodsFor:'instance creation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    48
321c1729db5b initial checkin
penk
parents:
diff changeset
    49
open
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    50
    ^ self openInDirectory:(Filename currentDirectory)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    51
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    52
    "
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    53
     self open
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    54
    "
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    55
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    56
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    57
openInDirectory:aFilename
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    58
    ^ self openOnFileName:(aFilename asFilename asAbsoluteFilename)
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    59
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    60
    "
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    61
     self openInDirectory:'/etc'
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    62
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    63
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    64
321c1729db5b initial checkin
penk
parents:
diff changeset
    65
openOnFileName:aFileName
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    66
    ^ self openOnFileName:aFileName for:nil
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    67
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    68
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    69
openOnFileName:aFileName for:aTargetApplicationOrNil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    70
321c1729db5b initial checkin
penk
parents:
diff changeset
    71
    | instance builder|
321c1729db5b initial checkin
penk
parents:
diff changeset
    72
321c1729db5b initial checkin
penk
parents:
diff changeset
    73
    builder := super open.
321c1729db5b initial checkin
penk
parents:
diff changeset
    74
    instance := builder application.
3983
dd593a7482fa *** empty log message ***
penk
parents: 3937
diff changeset
    75
    instance item:(DirectoryContentsBrowser itemClass fileName:aFileName).
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    76
    aTargetApplicationOrNil notNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    77
        instance targetApplication:aTargetApplicationOrNil.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    78
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    79
    ^ builder
321c1729db5b initial checkin
penk
parents:
diff changeset
    80
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
    81
321c1729db5b initial checkin
penk
parents:
diff changeset
    82
!FindFileApplication class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    83
321c1729db5b initial checkin
penk
parents:
diff changeset
    84
tabStringFor:aApplicationType
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    85
    "the formatString shown in a tab (language translated)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    86
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    87
    ^ 'Find in %1'
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    88
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    89
    "Modified: / 01-03-2007 / 21:47:54 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    90
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
    91
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    92
!FindFileApplication class methodsFor:'help specs'!
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    93
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    94
flyByHelpSpec
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    95
    "This resource specification was automatically generated
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    96
     by the UIHelpTool of ST/X."
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    97
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    98
    "Do not manually edit this!! If it is corrupted,
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    99
     the UIHelpTool may not be able to read the specification."
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   100
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   101
    "
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   102
     UIHelpTool openOnClass:FindFileApplication    
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   103
    "
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   104
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   105
    <resource: #help>
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   106
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   107
    ^ super flyByHelpSpec addPairsFrom:#(
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   108
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   109
#contentsPattern
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   110
'Search for files containing this. Can be matchPatterns, separated by ";"'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   111
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   112
#namePattern
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   113
'Filename(s) to search for. Can be matchPatterns, separated by ";"'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   114
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   115
#notContentsPattern
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   116
'Search for files NOT containing this. Can be matchPatterns, separated by ";"'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   117
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   118
#searchDirectory
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   119
'Folder, where the search starts'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   120
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   121
#searchRecursive
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   122
'Recursively search in sub-folders'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   123
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   124
#ignoreCase
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   125
'Ignore upper/lowercase differences (be case-insensitive)'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   126
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   127
#sameContents
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   128
'Search for files with same contents as the other file'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   129
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   130
#fileSize
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
   131
'Search for files with a specific size constraint ("~" means: +/- 10%)'
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   132
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   133
)
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
   134
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
   135
    "Modified: / 11-01-2012 / 23:32:42 / cg"
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   136
! !
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   137
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   138
!FindFileApplication class methodsFor:'history'!
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   139
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   140
addToSearchStringHistory:aString
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   141
    self searchStringHistory 
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   142
        remove:aString ifAbsent:[];
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   143
        addFirst:aString.
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   144
    self searchStringHistory size > 25 ifTrue:[
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   145
        self searchStringHistory removeLast
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   146
    ].
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   147
!
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   148
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   149
searchStringHistory
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   150
    SearchStringHistory isNil ifTrue:[
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   151
        SearchStringHistory := OrderedCollection new 
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   152
    ].
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   153
    ^ SearchStringHistory
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   154
! !
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   155
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   156
!FindFileApplication class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   157
321c1729db5b initial checkin
penk
parents:
diff changeset
   158
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   159
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   160
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   161
321c1729db5b initial checkin
penk
parents:
diff changeset
   162
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   163
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   164
321c1729db5b initial checkin
penk
parents:
diff changeset
   165
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   166
     UIPainter new openOnClass:FindFileApplication andSelector:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   167
     FindFileApplication new openInterface:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   168
     FindFileApplication open
321c1729db5b initial checkin
penk
parents:
diff changeset
   169
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   170
321c1729db5b initial checkin
penk
parents:
diff changeset
   171
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
   172
321c1729db5b initial checkin
penk
parents:
diff changeset
   173
    ^ 
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   174
     #(FullSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   175
        name: windowSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   176
        window: 
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   177
       (WindowSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   178
          label: 'File Search'
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   179
          name: 'File Search'
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   180
          min: (Point 377 131)
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   181
          bounds: (Rectangle 0 0 758 512)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   182
        )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   183
        component: 
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   184
       (SpecCollection
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   185
          collection: (
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   186
           (MenuPanelSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   187
              name: 'ToolBar1'
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   188
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   189
              level: 0
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   190
              menu: searchMenu
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   191
              textDefault: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   192
            )
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   193
           (ProgressIndicatorSpec
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   194
              name: 'ProgressIndicator1'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   195
              layout: (LayoutFrame 125 0 11 0 231 0 21 0)
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   196
              visibilityChannel: enableStop
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   197
              backgroundColor: (Color 0.0 66.9993133440146 66.9993133440146)
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   198
              showPercentage: false
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   199
              isActivityIndicator: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   200
            )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   201
           (ViewSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   202
              name: 'Box1'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   203
              layout: (LayoutFrame 0 0.0 32 0 0 1.0 200 0)
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   204
              component: 
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   205
             (SpecCollection
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   206
                collection: (
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   207
                 (LabelSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   208
                    label: 'Directory:'
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   209
                    name: 'DirectoryLabel'
5557
c4f509890024 geometry (for bigger fonts)
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
   210
                    layout: (LayoutFrame 2 0 7 0 154 0 24 0)
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   211
                    activeHelpKey: searchDirectory
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   212
                    translateLabel: true
5557
c4f509890024 geometry (for bigger fonts)
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
   213
                    adjust: right
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   214
                  )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   215
                 (FilenameInputFieldSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   216
                    name: 'DirectoryEntryField'
5603
a20070742d88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
   217
                    layout: (LayoutFrame 156 0 4 0 -315 1 24 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   218
                    activeHelpKey: searchDirectory
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   219
                    model: searchDirectoryHolder
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   220
                    immediateAccept: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   221
                    acceptOnPointerLeave: false
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   222
                  )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   223
                 (LabelSpec
5603
a20070742d88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
   224
                    label: 'Search Files Named:'
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   225
                    name: 'FileNameLabel'
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   226
                    layout: (LayoutFrame 2 0 31 0 154 0 48 0)
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   227
                    activeHelpKey: namePattern
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   228
                    translateLabel: true
5557
c4f509890024 geometry (for bigger fonts)
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
   229
                    adjust: right
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   230
                  )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   231
                 (InputFieldSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   232
                    name: 'FileNameEntryField'
5603
a20070742d88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
   233
                    layout: (LayoutFrame 156 0 28 0 -315 1 48 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   234
                    activeHelpKey: namePattern
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   235
                    tabable: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   236
                    model: namePatternHolder
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   237
                    immediateAccept: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   238
                    acceptOnLeave: false
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   239
                    acceptOnPointerLeave: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   240
                  )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   241
                 (LabelSpec
5557
c4f509890024 geometry (for bigger fonts)
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
   242
                    label: 'Containing:'
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   243
                    name: 'ContentsLabel'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   244
                    layout: (LayoutFrame 2 0 79 0 154 0 96 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   245
                    activeHelpKey: contentsPattern
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   246
                    translateLabel: true
5557
c4f509890024 geometry (for bigger fonts)
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
   247
                    adjust: right
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   248
                  )
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   249
                 (ComboBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   250
                    name: 'ComboBox1'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   251
                    layout: (LayoutFrame 156 0 76 0 -315 1 96 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   252
                    activeHelpKey: contentsPattern
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   253
                    enableChannel: notSearchForSameContents
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   254
                    tabable: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   255
                    model: contentsPatternHolder
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   256
                    immediateAccept: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   257
                    acceptOnPointerLeave: false
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   258
                    comboList: searchStringHistory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   259
                  )
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   260
                 (LabelSpec
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   261
                    label: 'Not Containing:'
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   262
                    name: 'NotContentsLabel'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   263
                    layout: (LayoutFrame 2 0 103 0 154 0 120 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   264
                    activeHelpKey: notContentsPattern
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   265
                    translateLabel: true
5557
c4f509890024 geometry (for bigger fonts)
Claus Gittinger <cg@exept.de>
parents: 5408
diff changeset
   266
                    adjust: right
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   267
                  )
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   268
                 (InputFieldSpec
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   269
                    name: 'NotContentsEntryField'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   270
                    layout: (LayoutFrame 156 0 100 0 -315 1 120 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   271
                    activeHelpKey: notContentsPattern
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   272
                    enableChannel: notSearchForSameContents
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   273
                    tabable: true
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   274
                    model: notContentsPatternHolder
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   275
                    immediateAccept: true
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   276
                    acceptOnPointerLeave: false
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   277
                  )
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   278
                 (LabelSpec
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   279
                    label: 'Same Contents As:'
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   280
                    name: 'SameContentsAsLabel'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   281
                    layout: (LayoutFrame 2 0 127 0 154 0 144 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   282
                    activeHelpKey: sameContents
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   283
                    translateLabel: true
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   284
                    adjust: right
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   285
                  )
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   286
                 (InputFieldSpec
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   287
                    name: 'SameContentsAsEntryField'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   288
                    layout: (LayoutFrame 156 0 124 0 -339 1 144 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   289
                    activeHelpKey: sameContents
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   290
                    enableChannel: searchForSameContents
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   291
                    tabable: true
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   292
                    model: sameContentsAsHolder
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   293
                    immediateAccept: true
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   294
                    acceptOnPointerLeave: false
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   295
                  )
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   296
                 (CheckToggleSpec
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   297
                    name: 'EnableSameContentsCheckToggle'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   298
                    layout: (LayoutOrigin -334 1 128 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   299
                    activeHelpKey: sameContents
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   300
                    model: searchForSameContents
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   301
                    isTriggerOnDown: true
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   302
                    showLamp: false
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   303
                    lampColor: (Color 100.0 100.0 0.0)
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
   304
                  )
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   305
                 (LabelSpec
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   306
                    label: 'File Size:'
6808
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   307
                    name: 'FileSizeLabel'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   308
                    layout: (LayoutFrame 2 0 151 0 154 0 168 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   309
                    activeHelpKey: fileSize
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   310
                    translateLabel: true
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   311
                    adjust: right
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   312
                  )
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   313
                 (PopUpListSpec
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   314
                    label: 'PopUp List'
6808
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   315
                    name: 'FileSizeOperatorPopUpList'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   316
                    layout: (LayoutFrame 157 0 148 0 212 0 168 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   317
                    activeHelpKey: fileSize
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   318
                    tabable: true
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   319
                    model: fileSizeOperatorHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   320
                    enableChannel: enableFileSizeFilterAndNotSearchForSameContents
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   321
                    menu: 
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   322
                   (Array
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   323
                      ' >' ' < '
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   324
                      ' !!= ' ' = '
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   325
                      ' ~ '
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   326
                    )
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   327
                  )
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   328
                 (InputFieldSpec
6808
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   329
                    name: 'FileSizeEntryField'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   330
                    layout: (LayoutFrame 219 0 148 0 -430 1 168 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   331
                    activeHelpKey: fileSize
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   332
                    enableChannel: enableFileSizeFilterAndNotSearchForSameContents
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   333
                    tabable: true
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   334
                    model: fileSizeHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   335
                    type: fileSize
6808
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   336
                    immediateAccept: false
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   337
                    acceptOnLeave: true
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   338
                    acceptOnLostFocus: true
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   339
                    acceptOnPointerLeave: true
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   340
                  )
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   341
                 (CheckToggleSpec
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   342
                    name: 'EnableSizeCheckToggle'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   343
                    layout: (LayoutOrigin -334 1 151 0)
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   344
                    activeHelpKey: fileSize
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   345
                    model: enableFileSizeFilter
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   346
                    enableChannel: notSearchForSameContents
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   347
                    isTriggerOnDown: true
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   348
                    showLamp: false
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   349
                    lampColor: (Color 100.0 100.0 0.0)
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   350
                  )
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   351
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   352
                    label: 'Use ''locate'' Cmd'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   353
                    name: 'UseLocateCheckBox'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   354
                    layout: (LayoutFrame -309 1 5 0 -167 1 28 0)
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   355
                    activeHelpKey: useLocate
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   356
                    visibilityChannel: canUseLocate
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   357
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   358
                    model: useLocate
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   359
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   360
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   361
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   362
                    label: 'Recursive'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   363
                    name: 'RecursiveSearchCheckBox'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   364
                    layout: (LayoutFrame -169 1 5 0 -4 1 28 0)
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   365
                    activeHelpKey: recursiveSearch
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   366
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   367
                    model: searchRecursively
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   368
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   369
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   370
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   371
                    label: 'Directories'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   372
                    name: 'SearchDirectoriesCheckBox'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   373
                    layout: (LayoutFrame -309 1 29 0 -167 1 52 0)
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   374
                    enableChannel: notSearchForSameContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   375
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   376
                    model: searchDirectories
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   377
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   378
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   379
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   380
                    label: 'Ignore Case'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   381
                    name: 'IgnoreCaseInNameCheckBox'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   382
                    layout: (LayoutFrame -169 1 29 0 -4 1 52 0)
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   383
                    activeHelpKey: ignoreCase
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   384
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   385
                    model: ignoreCaseInName
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   386
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   387
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   388
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   389
                    label: 'Use ''grep'' Cmd'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   390
                    name: 'UseGrepCheckBox'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   391
                    layout: (LayoutFrame -309 1 77 0 -167 1 100 0)
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   392
                    visibilityChannel: canUseGrep
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   393
                    enableChannel: notSearchForSameContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   394
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   395
                    model: useGrep
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   396
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   397
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   398
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   399
                    label: 'Ignore Case'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   400
                    name: 'IgnoreCaseInContentsCheckBox'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   401
                    layout: (LayoutFrame -169 1 77 0 -4 1 100 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   402
                    activeHelpKey: ignoreCase
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   403
                    enableChannel: notSearchForSameContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   404
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   405
                    model: ignoreCaseInContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   406
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   407
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   408
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   409
                    label: 'Ignore Case'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   410
                    name: 'IgnoreCaseInNotContentsCheckBox'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   411
                    layout: (LayoutFrame -169 1 101 0 -4 1 124 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   412
                    activeHelpKey: ignoreCase
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   413
                    enableChannel: notSearchForSameContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   414
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   415
                    model: ignoreCaseInNotContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   416
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   417
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   418
                 (CheckBoxSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   419
                    label: 'Cache Info'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   420
                    name: 'RememberInCacheCheckBox'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   421
                    layout: (LayoutFrame -309 1 125 0 -167 1 148 0)
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   422
                    visibilityChannel: canUseGrep
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   423
                    enableChannel: searchForSameContents
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   424
                    tabable: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   425
                    model: rememberInCache
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   426
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   427
                  )
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   428
                 (ActionButtonSpec
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   429
                    label: 'Clear Cache'
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   430
                    name: 'ClearCacheButton'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   431
                    layout: (LayoutFrame -169 1 125 0 -44 1 147 0)
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   432
                    translateLabel: true
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   433
                    model: clearCache
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   434
                  )
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   435
                 (LabelSpec
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   436
                    label: 'But Not Named:'
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   437
                    name: 'Label1'
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   438
                    layout: (LayoutFrame 2 0 55 0 154 0 72 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   439
                    activeHelpKey: namePattern
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   440
                    translateLabel: true
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   441
                    adjust: right
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   442
                  )
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   443
                 (InputFieldSpec
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   444
                    name: 'EntryField1'
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   445
                    layout: (LayoutFrame 156 0 52 0 -315 1 72 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   446
                    activeHelpKey: namePattern
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   447
                    tabable: true
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   448
                    model: excludedNamePatternHolder
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   449
                    immediateAccept: true
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   450
                    acceptOnLeave: false
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   451
                    acceptOnPointerLeave: false
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   452
                  )
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   453
                 (CheckBoxSpec
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   454
                    label: 'Ignore Case'
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   455
                    name: 'CheckBox1'
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   456
                    layout: (LayoutFrame -169 1 53 0 -4 1 76 0)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   457
                    activeHelpKey: ignoreCase
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   458
                    tabable: true
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   459
                    model: ignoreCaseInExcludedName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   460
                    translateLabel: true
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   461
                  )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   462
                 )
321c1729db5b initial checkin
penk
parents:
diff changeset
   463
               
321c1729db5b initial checkin
penk
parents:
diff changeset
   464
              )
321c1729db5b initial checkin
penk
parents:
diff changeset
   465
            )
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   466
           (SequenceViewSpec
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   467
              name: 'List1'
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   468
              layout: (LayoutFrame 0 0.0 210 0 0 1.0 0 1)
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   469
              model: selectionHolder
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   470
              menu: menu
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   471
              hasHorizontalScrollBar: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   472
              hasVerticalScrollBar: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   473
              isMultiSelect: true
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   474
              doubleClickSelector: fileDoubleClick:
6808
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
   475
              valueChangeSelector: fileSelected:
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   476
              useIndex: true
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   477
              sequenceList: shownListHolder
9357
e257439bdea5 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
   478
              properties: 
e257439bdea5 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
   479
             (PropertyListDictionary
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   480
                dragArgument: findFileList
9357
e257439bdea5 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
   481
                startDragSelector: doStartDrag:in:
e257439bdea5 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
   482
                displayObjectSelector: getDisplayObjects:
e257439bdea5 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
   483
                dropObjectSelector: getDropObjects:
e257439bdea5 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
   484
              )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   485
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
   486
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
   487
         
321c1729db5b initial checkin
penk
parents:
diff changeset
   488
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
   489
      )
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   490
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   491
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   492
321c1729db5b initial checkin
penk
parents:
diff changeset
   493
!FindFileApplication class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   494
321c1729db5b initial checkin
penk
parents:
diff changeset
   495
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
   496
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   497
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   498
321c1729db5b initial checkin
penk
parents:
diff changeset
   499
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   500
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   501
321c1729db5b initial checkin
penk
parents:
diff changeset
   502
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   503
     MenuEditor new openOnClass:FindFileApplication andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
   504
     (Menu new fromLiteralArrayEncoding:(FindFileApplication menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
   505
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   506
321c1729db5b initial checkin
penk
parents:
diff changeset
   507
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
   508
321c1729db5b initial checkin
penk
parents:
diff changeset
   509
    ^ 
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   510
     #(Menu
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   511
        (
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   512
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   513
            enabled: hasOneFileSelected
7323
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   514
            label: 'Open in New File Browser'
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   515
            itemValue: openInNewBrowser
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   516
            translateLabel: true
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   517
          )
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   518
         (MenuItem
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   519
            enabled: hasOneFileSelected
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   520
            label: 'Select in Browser'
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   521
            itemValue: selectInBrowser
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   522
            translateLabel: true
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   523
            isVisible: isEmbeddedApplication
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   524
          )
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   525
         (MenuItem
6158
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   526
            label: 'Autoselect in Browser'
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   527
            translateLabel: true
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   528
            indication: autoSelectInBrowserHolder
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   529
          )
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   530
         (MenuItem
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   531
            label: '-'
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   532
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   533
         (MenuItem
8613
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   534
            enabled: hasOneFileSelected
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   535
            label: 'FileIn'
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   536
            itemValue: fileInInBrowser
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   537
            translateLabel: true
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   538
          )
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   539
         (MenuItem
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   540
            label: '-'
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   541
          )
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   542
         (MenuItem
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   543
            enabled: hasSelectionInResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   544
            label: 'Copy Selected Filenames to Clipboard'
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   545
            itemValue: copySelectedFileNamesToClipboard
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   546
            translateLabel: true
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   547
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   548
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   549
            label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   550
          )
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   551
         (MenuItem
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   552
            enabled: hasListEntries
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   553
            label: 'Delete all Files'
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   554
            itemValue: deleteAllFiles
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   555
            translateLabel: true
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   556
          )
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   557
         (MenuItem
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   558
            enabled: hasSelection
5767
2cc71e97ef70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5766
diff changeset
   559
            label: 'Delete Selected Files'
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   560
            itemValue: deleteSelectedFiles
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   561
            translateLabel: true
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   562
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   563
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   564
            label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   565
          )
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   566
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   567
            enabled: hasSelection
5767
2cc71e97ef70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5766
diff changeset
   568
            label: 'Remove Selected from Resultlist'
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   569
            itemValue: removeSelectedFilesFromResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   570
            translateLabel: true
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   571
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   572
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   573
            enabled: hasListEntries
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   574
            label: 'Clear Resultlist'
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   575
            itemValue: clearResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   576
            translateLabel: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   577
          )
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   578
         (MenuItem
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   579
            label: '-'
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   580
          )
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   581
         (MenuItem
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   582
            label: 'Show Matched Files (After SameContents-Search)'
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   583
            itemValue: showMatchedFiles:
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   584
            translateLabel: true
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   585
            isVisible: notShowingMatchedFiles
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   586
            argument: true
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   587
          )
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   588
         (MenuItem
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   589
            label: 'Show Matching Files (After SameContents-Search)'
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   590
            itemValue: showMatchedFiles:
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   591
            translateLabel: true
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   592
            isVisible: showingMatchedFiles
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   593
            argument: false
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   594
          )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   595
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
   596
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   597
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   598
      )
7323
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   599
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   600
    "Modified: / 01-03-2007 / 22:56:59 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   601
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   602
321c1729db5b initial checkin
penk
parents:
diff changeset
   603
searchMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   604
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   605
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   606
321c1729db5b initial checkin
penk
parents:
diff changeset
   607
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   608
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   609
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   610
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   611
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   612
     MenuEditor new openOnClass:FindFileApplication andSelector:#searchMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   613
     (Menu new fromLiteralArrayEncoding:(FindFileApplication searchMenu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
   614
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   615
321c1729db5b initial checkin
penk
parents:
diff changeset
   616
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
   617
321c1729db5b initial checkin
penk
parents:
diff changeset
   618
    ^ 
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   619
     #(Menu
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   620
        (
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   621
         (MenuItem
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   622
            label: 'Search'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   623
            itemValue: doSearch
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   624
            translateLabel: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   625
            isButton: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   626
            labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   627
          )
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   628
         (MenuItem
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   629
            enabled: enableStop
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   630
            label: 'Stop'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   631
            itemValue: stop
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   632
            translateLabel: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   633
            isButton: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   634
            isVisible: enableStop
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   635
            labelImage: (ResourceRetriever XPToolbarIconLibrary stop22x22Icon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   636
          )
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   637
         (MenuItem
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   638
            label: 'Close'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   639
            itemValue: doClose
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   640
            translateLabel: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   641
            isButton: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   642
            startGroup: right
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   643
            isVisible: false
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   644
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   645
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   646
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
   647
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   648
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   649
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   650
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   651
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   652
!FindFileApplication class methodsFor:'startup & release'!
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   653
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   654
releaseContentsInfoCache
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   655
    ContentsInfoCache := ContentsInfoCacheAccessLock := nil.
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   656
! !
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   657
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   658
!FindFileApplication class methodsFor:'tableColumns specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   659
321c1729db5b initial checkin
penk
parents:
diff changeset
   660
searchResultTable
321c1729db5b initial checkin
penk
parents:
diff changeset
   661
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   662
     by the DataSetBuilder of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   663
321c1729db5b initial checkin
penk
parents:
diff changeset
   664
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   665
     the DataSetBuilder may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   666
321c1729db5b initial checkin
penk
parents:
diff changeset
   667
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   668
     DataSetBuilder new openOnClass:FindFileApplication andSelector:#searchResultTable
321c1729db5b initial checkin
penk
parents:
diff changeset
   669
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   670
321c1729db5b initial checkin
penk
parents:
diff changeset
   671
    <resource: #tableColumns>
321c1729db5b initial checkin
penk
parents:
diff changeset
   672
321c1729db5b initial checkin
penk
parents:
diff changeset
   673
    ^#(
6583
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   674
      (DataSetColumnSpec
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   675
         label: 'Filename'
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   676
         id: 'FileName'
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   677
         labelButtonType: Button
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   678
         model: fileName
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   679
         showRowSeparator: false
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   680
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   681
       )
321c1729db5b initial checkin
penk
parents:
diff changeset
   682
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   683
    
321c1729db5b initial checkin
penk
parents:
diff changeset
   684
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   685
321c1729db5b initial checkin
penk
parents:
diff changeset
   686
!FindFileApplication methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   687
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   688
clearCache
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   689
    contentsInfoCache := nil
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   690
!
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   691
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   692
clearResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   693
    self resultList removeAll.
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   694
    self matchedFilesList removeAll.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   695
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   696
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   697
deleteAllFiles
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   698
    |files|
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   699
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   700
    files := self shownList copy.
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   701
    self deleteFiles:files confirm:true.
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   702
    self clearShownList.
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   703
!
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   704
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   705
deleteFiles:colOfFiles confirm:confirm
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   706
    "delete current selected files/directories
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   707
    "
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   708
    |delete result|
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   709
6832
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   710
"/    self windowGroup withWaitCursorDo:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5866
diff changeset
   711
        delete := FileOperation deleteFiles:(colOfFiles asSet) confirm:confirm.
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   712
        result := delete result.
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   713
        result notNil ifTrue:[
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   714
            result ifFalse:[
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   715
                self notify:delete errorString.
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   716
            ] ifTrue:[
5769
c7f4f5fc96e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5768
diff changeset
   717
"/                masterApplication notNil ifTrue:[
c7f4f5fc96e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5768
diff changeset
   718
"/                    masterApplication updateListAfterDelete:colOfFiles.
c7f4f5fc96e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5768
diff changeset
   719
"/                ]
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   720
            ]
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   721
        ].
6832
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   722
"/    ].
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   723
    ^ result.
6832
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   724
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   725
    "Modified: / 25-07-2006 / 09:11:09 / cg"
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   726
!
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   727
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   728
deleteSelectedFiles
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   729
    |sel files result|
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   730
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   731
    sel := self selectionHolder value.
6109
aed06872e73e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6107
diff changeset
   732
    sel isEmptyOrNil ifTrue:[^ self].
aed06872e73e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6107
diff changeset
   733
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   734
    files := sel collect:[:idx | self shownList at:idx].
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   735
    self deleteFiles:files confirm:true.
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   736
    result == true ifTrue:[
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   737
        self removeSelectedFilesFromResultList.
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   738
    ].
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   739
!
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   740
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   741
doSearch
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   742
    |namePatterns excludedNamePatterns contentsPattern notContentsPattern dir fileToCompareAgainst ignoreCaseInName ignoreCaseInExcludedName ignoreCaseInContents|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   743
321c1729db5b initial checkin
penk
parents:
diff changeset
   744
"/    self changeExtentToSeeSearchResult.
321c1729db5b initial checkin
penk
parents:
diff changeset
   745
321c1729db5b initial checkin
penk
parents:
diff changeset
   746
    dir := self searchDirectoryHolder value.
321c1729db5b initial checkin
penk
parents:
diff changeset
   747
    dir isNil ifTrue:[
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   748
        Dialog warn:'Missing directory name'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   749
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   750
    ].
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6183
diff changeset
   751
    dir asFilename exists ifFalse:[
5786
3ae2d45d823f care for whitespace in searchpattern
Claus Gittinger <cg@exept.de>
parents: 5776
diff changeset
   752
        Dialog warn:('No such directory: ''%1''' bindWith:dir asString allBold).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   753
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   754
    ].
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   755
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   756
    LastSearchIgnoredCaseInFilename := ignoreCaseInName := self ignoreCaseInName value.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   757
    LastSearchIgnoredCaseInExcludedFilename := ignoreCaseInExcludedName := self ignoreCaseInExcludedName value.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   758
    LastSearchIgnoredCaseInContents := ignoreCaseInContents := self ignoreCaseInContents value.
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   759
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   760
    self stopSearchTaskOrAbort.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   761
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   762
    namePatterns := self namePatternsFor:(self namePatternHolder value) ignoringCase:ignoreCaseInName.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   763
    excludedNamePatterns := self namePatternsFor:(self excludedNamePatternHolder value) ignoringCase:ignoreCaseInExcludedName.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   764
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   765
    contentsPattern := self contentsPatternHolder value.
321c1729db5b initial checkin
penk
parents:
diff changeset
   766
    contentsPattern size == 0 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   767
        contentsPattern := nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   768
    ] ifFalse:[
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   769
        self class addToSearchStringHistory:contentsPattern.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   770
        ignoreCaseInContents ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   771
            contentsPattern := contentsPattern asLowercase
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   772
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   773
    ].
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   774
    notContentsPattern := self notContentsPatternHolder value.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   775
    notContentsPattern size == 0 ifTrue:[
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   776
        notContentsPattern := nil
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   777
    ] ifFalse:[
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   778
        self ignoreCaseInNotContents value ifTrue:[
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   779
            notContentsPattern := notContentsPattern asLowercase
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   780
        ]
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   781
    ].
5787
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   782
    searchForSameContents value ifTrue:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   783
        fileToCompareAgainst := (self sameContentsAsHolder value ? '') withoutSeparators.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   784
        fileToCompareAgainst isEmpty ifTrue:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   785
            fileToCompareAgainst := nil.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   786
        ] ifFalse:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   787
            fileToCompareAgainst includesMatchCharacters ifFalse:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   788
                fileToCompareAgainst asFilename exists ifFalse:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   789
                    Dialog warn:('No such file: %1' bindWith:fileToCompareAgainst asString allBold).
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   790
                    ^ self.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   791
                ].
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   792
                fileToCompareAgainst asFilename isReadable ifFalse:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   793
                    Dialog warn:('Cannot read: %1' bindWith:fileToCompareAgainst asString allBold).
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   794
                    ^ self.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   795
                ]
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
   796
            ].
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
   797
        ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   798
    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   799
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   800
    self 
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   801
        startSearchTask:[
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   802
            self changeInformationTo:'Find File ' , '- searching ' toTab:true.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   803
            self 
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   804
                doFindFileNamed:namePatterns
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   805
                directories:(self searchDirectories value)
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   806
                ignoreCaseInName:ignoreCaseInName
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   807
                excludeFilesNamed:excludedNamePatterns
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   808
                ignoreCaseInExcludedName:ignoreCaseInExcludedName
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   809
                containingString:contentsPattern
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   810
                ignoreCaseInContents:ignoreCaseInContents
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   811
                notContainingString:notContentsPattern
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   812
                ignoreCaseInNotContents:(self ignoreCaseInNotContents value)
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   813
                sameContentsAsFile:fileToCompareAgainst  
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   814
                sameContentsAs:nil 
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   815
                in:(self searchDirectoryHolder value).
5770
2b3f1705ed84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5769
diff changeset
   816
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   817
        ]
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   818
        name:('FindFile[', self searchDirectoryHolder value asFilename baseName, ']')
5770
2b3f1705ed84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5769
diff changeset
   819
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   820
    "Modified: / 12-01-2012 / 01:54:27 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   821
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   822
7323
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   823
fileInInBrowser
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   824
    |sel entry application|
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   825
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   826
    sel := self selectionHolder value.
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   827
    (sel notEmptyOrNil) ifTrue:[
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   828
        entry := self shownList at:sel first.
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   829
        entry asFilename exists ifFalse:[ ^ self].
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   830
        application := targetApplication ? self masterApplication.
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   831
        application notNil ifTrue:[
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   832
            application fileIn:(entry asFilename).
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   833
        ].
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   834
    ].
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   835
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   836
    "Created: / 20-09-2006 / 14:30:37 / cg"
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   837
!
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   838
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   839
namePatternsFor:namePatternArg ignoringCase:ignoringCase
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   840
    |namePattern|
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   841
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   842
    namePattern := namePatternArg.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   843
    namePattern size == 0 ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   844
        ^ nil
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   845
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   846
    ignoringCase ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   847
        namePattern := namePattern asLowercase
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   848
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   849
    ^ (namePattern asCollectionOfSubstringsSeparatedBy:$;)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   850
        collect:[:each | each withoutSeparators].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   851
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   852
    "Created: / 03-08-2011 / 18:19:20 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   853
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   854
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   855
removeSelectedFilesFromResultList
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   856
    |sel list|
321c1729db5b initial checkin
penk
parents:
diff changeset
   857
321c1729db5b initial checkin
penk
parents:
diff changeset
   858
    sel := self selectionHolder value.
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   859
    list := self shownList.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6442
diff changeset
   860
    (sel notEmptyOrNil) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   861
        sel reverseDo:[: key |
321c1729db5b initial checkin
penk
parents:
diff changeset
   862
            list removeAtIndex:key
321c1729db5b initial checkin
penk
parents:
diff changeset
   863
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
   864
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   865
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   866
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   867
showMatchedFiles:aBoolean
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   868
    aBoolean ifTrue:[
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   869
        self shownListHolder valueHolder:(self matchedFilesList)
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   870
    ] ifFalse:[
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   871
        self shownListHolder valueHolder:(self resultList)
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   872
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   873
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   874
321c1729db5b initial checkin
penk
parents:
diff changeset
   875
!FindFileApplication methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   876
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   877
autoSelectInBrowser
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   878
    ^ self autoSelectInBrowserHolder value.
6158
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   879
!
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   880
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   881
canUseGrep
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   882
    "grep command is much faster, but:
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   883
        - not under MSDOS
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   884
    "
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   885
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   886
    ^ OperatingSystem isUNIXlike and:[ OperatingSystem canExecuteCommand:'egrep' ]
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   887
!
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
   888
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   889
canUseLocate
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   890
    "locate command is much faster, but:
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   891
        - only if searching recursively,
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   892
        - no case ignore
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   893
        - no contents matching
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   894
    "
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   895
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   896
    ^ OperatingSystem isUNIXlike and:[ OperatingSystem canExecuteCommand:'locate' ]
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   897
!
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   898
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   899
contentsPatternHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
   900
321c1729db5b initial checkin
penk
parents:
diff changeset
   901
    contentsPatternHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   902
        contentsPatternHolder := nil asValue.
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   903
        self class searchStringHistory size > 0 ifTrue:[
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   904
            contentsPatternHolder value:(self class searchStringHistory first).    
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   905
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   906
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   907
    ^ contentsPatternHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
   908
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   909
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   910
enableFileSizeFilter
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   911
    enableFileSizeFilter isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   912
        enableFileSizeFilter := false asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   913
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   914
    ^ enableFileSizeFilter.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   915
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   916
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   917
enableFileSizeFilterAndNotSearchForSameContents
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   918
    ^ BlockValue forLogical:self notSearchForSameContents and:self enableFileSizeFilter
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   919
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   920
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   921
excludedNamePatternHolder
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   922
    excludedNamePatternHolder isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   923
        excludedNamePatternHolder := '' asValue.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   924
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   925
    ^ excludedNamePatternHolder.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   926
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   927
    "Created: / 03-08-2011 / 18:03:14 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   928
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   929
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   930
fileSizeHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   931
    fileSizeHolder isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   932
        fileSizeHolder := 0 asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   933
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   934
    ^ fileSizeHolder.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   935
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   936
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   937
fileSizeOperatorHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   938
    fileSizeOperatorHolder isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   939
        fileSizeOperatorHolder := '>' asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   940
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   941
    ^ fileSizeOperatorHolder.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   942
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   943
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   944
fileSizeUnitHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   945
    fileSizeUnitHolder isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   946
        fileSizeUnitHolder := 'b' asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   947
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   948
    ^ fileSizeUnitHolder.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   949
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   950
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   951
ignoreCaseInContents
321c1729db5b initial checkin
penk
parents:
diff changeset
   952
    ignoreCaseInContents isNil ifTrue:[
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   953
        ignoreCaseInContents := (LastSearchIgnoredCaseInContents notNil
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   954
                                    ifTrue:[ LastSearchIgnoredCaseInContents ]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   955
                                    ifFalse:[ TextView lastSearchIgnoredCase ? true]) asValue.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   956
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   957
    ^ ignoreCaseInContents.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   958
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   959
    "Modified: / 03-08-2011 / 18:05:02 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   960
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   961
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   962
ignoreCaseInExcludedName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   963
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   964
    ignoreCaseInExcludedName isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   965
        ignoreCaseInExcludedName := (LastSearchIgnoredCaseInExcludedFilename notNil 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   966
                                        ifTrue:[ LastSearchIgnoredCaseInExcludedFilename ]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   967
                                        ifFalse:[ OperatingSystem caseSensitiveFilenames not]) asValue.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   968
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   969
    ^ ignoreCaseInExcludedName.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   970
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   971
    "Created: / 03-08-2011 / 18:03:38 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   972
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   973
321c1729db5b initial checkin
penk
parents:
diff changeset
   974
ignoreCaseInName
321c1729db5b initial checkin
penk
parents:
diff changeset
   975
    ignoreCaseInName isNil ifTrue:[
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   976
        ignoreCaseInName := (LastSearchIgnoredCaseInFilename notNil
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   977
                                ifTrue:[LastSearchIgnoredCaseInFilename]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   978
                                ifFalse:[ OperatingSystem caseSensitiveFilenames not ]) asValue.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   979
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   980
    ^ ignoreCaseInName.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   981
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   982
    "Modified (format): / 03-08-2011 / 18:05:49 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   983
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   984
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   985
ignoreCaseInNotContents
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   986
    ignoreCaseInNotContents isNil ifTrue:[
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   987
        ignoreCaseInNotContents := (LastSearchIgnoredCaseInContents 
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   988
                                    ? TextView lastSearchIgnoredCase 
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   989
                                    ? true) asValue.
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   990
    ].
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   991
    ^ ignoreCaseInNotContents.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   992
!
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   993
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   994
matchedFilesList
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   995
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   996
    matchedFilesList isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   997
        matchedFilesList := List new.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   998
        matchedFilesList addDependent:self.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   999
    ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1000
    ^ matchedFilesList.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1001
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1002
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1003
namePatternHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1004
321c1729db5b initial checkin
penk
parents:
diff changeset
  1005
    namePatternHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1006
        namePatternHolder := '*' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1007
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1008
    ^ namePatternHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1009
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1010
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1011
notContentsPatternHolder
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1012
    notContentsPatternHolder isNil ifTrue:[
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1013
        notContentsPatternHolder := nil asValue.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1014
    ].
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1015
    ^ notContentsPatternHolder.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1016
!
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1017
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1018
notSearchForSameContents
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1019
    ^ BlockValue forLogicalNot:self searchForSameContents
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1020
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1021
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1022
notShowingMatchedFiles
5865
24bc1718c04f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5864
diff changeset
  1023
    ^ self shownList == self resultList
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1024
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1025
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1026
rememberInCache
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1027
    rememberInCache isNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1028
        rememberInCache := (LastRememberInCache ? false) asValue.
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1029
    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1030
    ^ rememberInCache.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1031
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1032
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1033
sameContentsAsHolder
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1034
    |sel|
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1035
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1036
    sameContentsAsHolder isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1037
        sameContentsAsHolder := ValueHolder new.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1038
        masterApplication notNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1039
            sel := masterApplication currentSelectedFiles.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1040
            sel size > 0 ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1041
                sameContentsAsHolder value:(sel first asFilename pathName).
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1042
            ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1043
        ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1044
    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1045
    ^ sameContentsAsHolder.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1046
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1047
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1048
searchDirectories
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1049
    searchDirectories isNil ifTrue:[
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1050
        searchDirectories := false asValue.
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1051
    ].
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1052
    ^ searchDirectories.
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1053
!
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1054
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1055
searchDirectoryHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1056
321c1729db5b initial checkin
penk
parents:
diff changeset
  1057
    searchDirectoryHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1058
        searchDirectoryHolder := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1059
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1060
    ^ searchDirectoryHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1061
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1062
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1063
searchForSameContents
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1064
    searchForSameContents isNil ifTrue:[
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1065
        searchForSameContents := false asValue.
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1066
    ].
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1067
    ^ searchForSameContents.
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1068
!
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1069
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1070
searchOnlyInCache
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1071
    searchOnlyInCache isNil ifTrue:[
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1072
        searchOnlyInCache := false asValue.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1073
    ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1074
    ^ searchOnlyInCache.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1075
!
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1076
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1077
showingMatchedFiles
5865
24bc1718c04f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5864
diff changeset
  1078
    ^ self shownList == self matchedFilesList
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1079
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1080
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1081
useGrep
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1082
    useGrep isNil ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1083
        useGrep := false asValue.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1084
    ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1085
    ^ useGrep.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1086
!
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1087
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1088
useLocate
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1089
    useLocate isNil ifTrue:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1090
        useLocate := false asValue.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1091
    ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1092
    ^ useLocate.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1093
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1094
321c1729db5b initial checkin
penk
parents:
diff changeset
  1095
!FindFileApplication methodsFor:'private'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1096
321c1729db5b initial checkin
penk
parents:
diff changeset
  1097
changeExtentToSeeSearchResult
321c1729db5b initial checkin
penk
parents:
diff changeset
  1098
    
321c1729db5b initial checkin
penk
parents:
diff changeset
  1099
    | extent window|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1100
321c1729db5b initial checkin
penk
parents:
diff changeset
  1101
    expanded isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1102
        window := self builder window.
9536
ea60487ceeee changed: #changeExtentToSeeSearchResult
Claus Gittinger <cg@exept.de>
parents: 9475
diff changeset
  1103
        window notNil ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1104
            window := window topView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1105
            extent := window extent.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1106
            window extent:((extent x) @ (extent y + 300)).
321c1729db5b initial checkin
penk
parents:
diff changeset
  1107
            expanded := true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1108
            window containerChangedSize.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1109
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1110
    ].
9536
ea60487ceeee changed: #changeExtentToSeeSearchResult
Claus Gittinger <cg@exept.de>
parents: 9475
diff changeset
  1111
ea60487ceeee changed: #changeExtentToSeeSearchResult
Claus Gittinger <cg@exept.de>
parents: 9475
diff changeset
  1112
    "Modified: / 08-08-2010 / 14:42:40 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1113
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1114
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1115
!FindFileApplication methodsFor:'private - searching'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1116
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1117
cachedFileSizeOf:aFilenameString
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1118
    |cache cacheLine fileSize|
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1119
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1120
    cache := self contentsInfoCache.
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1121
    cache isNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1122
        fileSize := aFilenameString asFilename fileSize
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1123
    ] ifFalse:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1124
        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1125
            cacheLine := cache at:aFilenameString ifAbsent:nil.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1126
            cacheLine isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1127
                cache at:aFilenameString put:(cacheLine := Array new:2).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1128
            ] ifFalse:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1129
                fileSize := (cacheLine at:1).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1130
            ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1131
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1132
            fileSize isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1133
                fileSize := aFilenameString asFilename fileSize.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1134
                cacheLine at:1 put:fileSize.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1135
            ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1136
        ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1137
    ].
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1138
    ^ fileSize
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1139
!
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1140
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1141
cachedHashValueOfFile:aFilenameString
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1142
    |cache cacheLine hashValue|
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1143
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1144
    cache := self contentsInfoCache.
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1145
    cache isNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1146
        hashValue := MD5Stream hashValueOfFile:aFilenameString asFilename
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1147
    ] ifFalse:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1148
        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1149
            cacheLine := cache at:aFilenameString ifAbsent:nil.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1150
            cacheLine isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1151
                cache at:aFilenameString put:(Array new:2).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1152
            ] ifFalse:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1153
                hashValue := (cacheLine at:2).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1154
            ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1155
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1156
            hashValue isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1157
                hashValue := MD5Stream hashValueOfFile:aFilenameString asFilename.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1158
                cacheLine at:2 put:hashValue.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1159
            ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1160
        ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1161
    ].
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1162
    ^ hashValue
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1163
!
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1164
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1165
contentsInfoCache
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1166
    contentsInfoCache isNil ifTrue:[
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1167
        ContentsInfoCache isNil ifTrue:[
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1168
            ContentsInfoCache := Dictionary new.    
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1169
            ContentsInfoCacheAccessLock := Semaphore forMutualExclusion.
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1170
        ].
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1171
        contentsInfoCache := ContentsInfoCache
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1172
    ].
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1173
    ^ contentsInfoCache
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1174
!
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1175
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1176
doFindFileNamed:namePatterns directories:searchDirectories ignoreCase:ignCaseInName 
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1177
    containingString:contentsStringArg ignoreCaseInContents:ignCaseInContents 
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1178
    notContainingString:notContentsStringArg ignoreCaseInNotContents:ignCaseInNotContents 
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1179
    sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1180
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1181
    "/ only for backward compatibility...
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1182
    ^ self
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1183
        doFindFileNamed:namePatterns directories:searchDirectories ignoreCaseInName:ignCaseInName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1184
        excludeFilesNamed:'' ignoreCaseInExcludedName:false
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1185
        containingString:contentsStringArg ignoreCaseInContents:ignCaseInContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1186
        notContainingString:notContentsStringArg ignoreCaseInNotContents:ignCaseInNotContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1187
        sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1188
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1189
    "Modified: / 03-08-2011 / 18:16:42 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1190
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1191
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1192
doFindFileNamed:namePatterns directories:searchDirectories ignoreCaseInName:ignCaseInName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1193
    excludeFilesNamed:excludedNamePatterns ignoreCaseInExcludedName:ignoreCaseInExcludedName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1194
    containingString:contentsStringArg ignoreCaseInContents:ignCaseInContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1195
    notContainingString:notContentsStringArg ignoreCaseInNotContents:ignCaseInNotContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1196
    sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1197
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1198
    |dir lines contentsToCompare resultList matchedFilesList inStream
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1199
     doesFileMatch contentsString notContentsString check checkNot 
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1200
     grepCommand nameMatch nameExcludedMatch realNameMatch fileSizesToSearchFor filesToSearchFor fileMD5sToSearchFor 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1201
     setOfFilesToSearchFor remember cache fn dirSearchedRelative|
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1202
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1203
    contentsString := contentsStringArg.
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1204
    (contentsString notNil and:[ ignCaseInContents ]) ifTrue:[ 
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1205
        contentsString := contentsString asLowercase
6183
e6d9cfbfb358 care for empty search-arguments
Michael Beyl <mb@exept.de>
parents: 6158
diff changeset
  1206
    ].
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1207
    notContentsString := notContentsStringArg.
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1208
    (notContentsString notNil and:[ ignCaseInNotContents ]) ifTrue:[ 
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1209
        notContentsString := notContentsString asLowercase    
6183
e6d9cfbfb358 care for empty search-arguments
Michael Beyl <mb@exept.de>
parents: 6158
diff changeset
  1210
    ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1211
    filenameToCompareContentsOrNil notNil ifTrue:[
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1212
        fileSizesToSearchFor := OrderedCollection new.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1213
        filesToSearchFor := OrderedCollection new.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1214
        fileMD5sToSearchFor := OrderedCollection new.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1215
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1216
        filenameToCompareContentsOrNil includesMatchCharacters ifTrue:[
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1217
            dir := filenameToCompareContentsOrNil asFilename.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1218
            [dir pathName includesMatchCharacters] whileTrue:[
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1219
                dir := dir directory
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1220
            ].
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1221
            dir recursiveDirectoryContentsDo:[:relName |
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1222
                |path fn|
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1223
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1224
                fn := dir construct:relName.
5770
2b3f1705ed84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5769
diff changeset
  1225
                (filenameToCompareContentsOrNil match:fn name) ifTrue:[
5847
6ff1fce17ac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5844
diff changeset
  1226
                    fn isDirectory ifFalse:[
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1227
                        fileSizesToSearchFor add:(self cachedFileSizeOf:fn).
5847
6ff1fce17ac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5844
diff changeset
  1228
                        filesToSearchFor add:(fn name).
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1229
                        fileMD5sToSearchFor add:(self cachedHashValueOfFile:fn).
5847
6ff1fce17ac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5844
diff changeset
  1230
                    ]
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1231
                ]
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1232
            ].
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1233
        ] ifFalse:[
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1234
            fn := filenameToCompareContentsOrNil asFilename.
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1235
            fileSizesToSearchFor add:(self cachedFileSizeOf:fn).
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1236
            filesToSearchFor add:(fn pathName).
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1237
            fileMD5sToSearchFor add:(self cachedHashValueOfFile:fn).
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1238
        ].
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1239
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1240
        remember := LastRememberInCache := self rememberInCache value.
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1241
        remember ifTrue:[
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1242
            cache := self contentsInfoCache.
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1243
        ].
5866
d754a2b95e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5865
diff changeset
  1244
        setOfFilesToSearchFor := filesToSearchFor asSet.
d754a2b95e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5865
diff changeset
  1245
    ].    
5791
ee6a05f07dd8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  1246
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1247
    dir := aDirectory asFilename.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1248
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1249
"/    dirSearchedRelative := (dir name) copyFrom:(self searchDirectoryHolder value asString size + 1).
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1250
"/    dirSearchedRelative notEmpty ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1251
"/        self changeInformationTo:('Find File - searching %1' bindWith:dirSearchedRelative) toTab:false.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1252
"/    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1253
        self changeInformationTo:'Find File - searching' toTab:false.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1254
"/    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1255
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1256
    resultList := self resultList.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1257
    matchedFilesList := self matchedFilesList.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1258
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1259
    filenameToCompareContentsOrNil notNil ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1260
        doesFileMatch := 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1261
            [:f |
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1262
                |contentsMatches mustValidateExistance 
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1263
                 fileMD5 fileName fileSize cacheLine idxInList matchedFile|
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1264
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1265
                "/ contents compare ...
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1266
                contentsMatches := false.
5771
ba11ead45024 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1267
                fileName := f name.
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1268
                (setOfFilesToSearchFor includes:fileName) ifFalse:[
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1269
                    mustValidateExistance := false.
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1270
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1271
                    cache notNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1272
                        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1273
                            cacheLine := cache at:fileName ifAbsent:nil.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1274
                            cacheLine notNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1275
                                fileSize := cacheLine at:1.    
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1276
                                fileMD5 := cacheLine at:2.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1277
                                mustValidateExistance := true.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1278
                            ].
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1279
                        ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1280
                    ].
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1281
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1282
                    fileSize isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1283
                        fileSize := f fileSize.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1284
                    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1285
                    remember ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1286
                        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1287
                            cacheLine := cache at:fileName ifAbsentPut:[Array new:2].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1288
                            cacheLine at:1 put:fileSize.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1289
                        ]
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1290
                    ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1291
                    (idxInList := fileSizesToSearchFor indexOf:fileSize) ~~ 0 ifTrue:[
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1292
                        fileMD5 isNil ifTrue:[
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1293
                            OpenError handle:[:ex |
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1294
                                ObjectMemory garbageCollect.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1295
                                fileMD5 := MD5Stream hashValueOfFile:f.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1296
                            ] do:[
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1297
                                fileMD5 := MD5Stream hashValueOfFile:f.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1298
                            ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1299
                            remember ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1300
                                cacheLine at:2 put:fileMD5
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1301
                            ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1302
                        ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1303
                        contentsMatches := (fileMD5 = (fileMD5sToSearchFor at:idxInList)).
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1304
                        contentsMatches ifTrue:[
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1305
                            mustValidateExistance ifTrue:[
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1306
                                fileName asFilename exists ifFalse:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1307
                                    ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1308
                                        cache removeKey:fileName.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1309
                                    ].
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1310
                                    contentsMatches := false.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1311
                                ].
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1312
                            ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1313
                            contentsMatches ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1314
                                matchedFile := filesToSearchFor at:idxInList.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1315
                                matchedFilesList add:matchedFile.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1316
                            ].
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1317
                        ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1318
"/                        contentsToCompare isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1319
"/                            filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1320
"/                                contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1321
"/                            ]
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1322
"/                        ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1323
"/                        contentsToCompare isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1324
"/                            "/ too large - compare block-wise ...
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1325
"/                            contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f).
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1326
"/                        ] ifFalse:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1327
"/                            contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile).
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1328
"/                        ]
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1329
                    ].
5773
6c5f260f3a5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1330
                ] ifTrue:[
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1331
                    f isSymbolicLink ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1332
                        resultList add: (f name , ' is a symbolic link to ' , f pathName).
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1333
                    ]
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1334
                ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1335
                contentsMatches
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1336
            ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1337
    ] ifFalse:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1338
        (contentsString isNil and:[notContentsString isNil]) ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1339
            doesFileMatch := [:f | true].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1340
        ] ifFalse:[
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1341
            (self canUseGrep and:[self useGrep value]) ifTrue:[
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1342
                (ignCaseInContents not and:[ignCaseInNotContents not]) ifTrue:[
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1343
                    contentsString notNil ifTrue:[
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1344
                        notContentsString notNil ifTrue:[
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1345
                            grepCommand := '(grep "',contentsString,'" %1) && (grep -v "',notContentsString,'" %1)'.
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1346
                        ] ifFalse:[
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1347
                            grepCommand := 'grep "' , contentsString , '" %1'.
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1348
                        ].
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1349
                    ] ifFalse:[
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1350
                        grepCommand := 'grep -v "' , notContentsString , '" %1'.
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1351
                    ].
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1352
                    doesFileMatch := [:f | |cmd ret|
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1353
                                            cmd := grepCommand bindWith:f pathName.
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1354
                                            ret := OperatingSystem executeCommand:cmd.
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1355
                                            ret
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1356
                                     ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1357
                ]
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1358
            ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1359
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1360
            doesFileMatch isNil ifTrue:[
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1361
                contentsString notNil ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1362
                    ignCaseInContents ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1363
                        check := [:l | l asLowercase includesString:contentsString]
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1364
                    ] ifFalse:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1365
                        check := [:l | l includesString:contentsString]
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1366
                    ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1367
                ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1368
                notContentsString notNil ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1369
                    ignCaseInNotContents ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1370
                        checkNot := [:l | l asLowercase includesString:notContentsString]
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1371
                    ] ifFalse:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1372
                        checkNot := [:l | l includesString:notContentsString]
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1373
                    ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1374
                ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1375
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1376
                doesFileMatch := 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1377
                    [:f |
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1378
                        |contentsMatches hugeFile bigFile realCheckAction|
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1379
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1380
                        hugeFile := f fileSize > (4024*1024).
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1381
                        bigFile := f fileSize > (512*1024).
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1382
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1383
                        check notNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1384
                            checkNot isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1385
                                realCheckAction := [:text | check value:text]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1386
                            ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1387
                                realCheckAction := [:text | (check value:text) and:[(checkNot value:text) not]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1388
                            ]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1389
                        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1390
                            realCheckAction := [:text | (checkNot value:text) not].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1391
                        ].
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1392
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1393
                        "/ string search ...
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1394
                        contentsMatches := true.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1395
                        (f exists and:[f isReadable]) ifFalse:[
9036
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  1396
                            resultList add: (('*** ' , f pathName , ' skipped - unreadable or bad symbolic link ***') colorizeAllWith:(Color red darkened)).
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1397
                        ] ifTrue:[
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1398
                            hugeFile ifTrue:[
9036
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  1399
                                resultList add: (('*** ' , f pathName , ' skipped - too large ***') colorizeAllWith:(Color red darkened)).
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1400
                            ] ifFalse:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1401
                                Stream lineTooLongErrorSignal handle:[:ex |
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1402
                                    |cont|
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1403
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1404
                                    resultList add: (('*** ' , f pathName , ' skipped - binary/long line ***') colorizeAllWith:(Color red darkened)).
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1405
"/                                    "/ this typically happens, when a binary file is read linewise ...
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1406
"/                                    cont := f readStream binary contentsOfEntireFile asString.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1407
"/                                    contentsMatches := realCheckAction value:cont
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1408
                                ] do:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1409
                                    bigFile ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1410
                                        Stream lineTooLongErrorSignal handle:[:ex |
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1411
                                            resultList add: (('*** ' , f pathName , ' skipped - too large ***') colorizeAllWith:(Color red darkened)).
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1412
                                        ] do:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1413
                                            contentsMatches := false.    
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1414
                                            f readingFileDo:[:stream |
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1415
                                                [contentsMatches or:[stream atEnd]] whileFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1416
                                                    contentsMatches := realCheckAction value:(stream nextLine)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1417
                                                ]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1418
                                            ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1419
                                        ].
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1420
                                    ] ifFalse:[
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1421
                                        lines := f contents ? #().
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1422
                                        contentsMatches := lines contains:realCheckAction
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1423
                                    ]
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1424
                                ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1425
                            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1426
                        ].
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1427
                        contentsMatches
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1428
                    ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1429
            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1430
        ].
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1431
        doesFileMatch := self fileSizeWrapperFor:doesFileMatch.
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1432
    ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1433
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1434
    namePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1435
        nameMatch := [:fn | true]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1436
    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1437
        ignCaseInName ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1438
            nameMatch := [:fn | namePatterns contains:[:aPattern | aPattern match:(fn asLowercase)]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1439
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1440
            nameMatch := [:fn | namePatterns contains:[:aPattern | aPattern match:fn]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1441
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1442
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1443
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1444
    excludedNamePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1445
        nameExcludedMatch := [:fn | true]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1446
    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1447
        ignoreCaseInExcludedName ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1448
            nameExcludedMatch := [:fn | excludedNamePatterns contains:[:aPattern | aPattern match:(fn asLowercase)]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1449
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1450
            nameExcludedMatch := [:fn | excludedNamePatterns contains:[:aPattern | aPattern match:fn]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1451
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1452
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1453
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1454
    "/ combine
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1455
    namePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1456
        excludedNamePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1457
            realNameMatch := [:fn | true]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1458
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1459
            realNameMatch := [:fn | (nameExcludedMatch value:fn) not]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1460
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1461
    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1462
        excludedNamePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1463
            realNameMatch := nameMatch
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1464
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1465
            realNameMatch := [:fn | (nameMatch value:fn) and:[ (nameExcludedMatch value:fn) not ]]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1466
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1467
    ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1468
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1469
    (self canUseLocate 
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1470
    and:[self useLocate value
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1471
    and:[searchDirectories not]])
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1472
    ifTrue:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1473
        [
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1474
            |cmd line f|
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1475
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1476
            cmd := 'locate '.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1477
            ignCaseInName ifTrue:[
5408
64a874a3ef4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  1478
                cmd := cmd , '--ignore-case '
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1479
            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1480
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1481
            cmd := cmd , ((namePatterns collect:[:nm | dir asFilename asAbsoluteFilename constructString:nm])
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1482
                            asStringCollection asStringWith:Character space).
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1483
            inStream := PipeStream readingFrom:cmd inDirectory:dir.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1484
            [inStream atEnd] whileFalse:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1485
                line := inStream nextLine.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1486
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1487
                f := line asFilename.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1488
                (doesFileMatch value:f) ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1489
                    resultList add:line.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1490
                ]
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1491
            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1492
        ] ensure:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1493
            inStream notNil ifTrue:[inStream close].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1494
        ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1495
        ^ self.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1496
    ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1497
    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1498
    bytesToCompareContentsOrNil notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1499
        contentsToCompare := bytesToCompareContentsOrNil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1500
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1501
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1502
    filenameToCompareContentsOrNil notNil ifTrue:[
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1503
        self searchOnlyInCache value ifTrue:[
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1504
            cache notEmptyOrNil ifTrue:[
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1505
                cache keysAndValuesDo:[:fn :info |
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1506
                    |filesSize filesMD5 idxInList|
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1507
                    
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1508
                    filesSize := info at:1.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1509
                    filesSize isNil ifTrue:[
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1510
                        filesSize := fn asFilename fileSize.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1511
                        info at:1 put:filesSize.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1512
                    ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1513
                    (idxInList := fileSizesToSearchFor indexOf:filesSize) ~~ 0 ifTrue:[
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6183
diff changeset
  1514
                        (setOfFilesToSearchFor includes:fn) ifFalse:[
5729
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1515
                            fn asFilename exists ifFalse:[
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1516
                                info at:1 put:nil.    
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1517
                                info at:2 put:nil.    
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1518
                            ] ifTrue:[
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1519
                                filesMD5 := info at:2.
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1520
                                filesMD5 isNil ifTrue:[
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1521
                                    filesMD5 := MD5Stream hashValueOfFile:fn asFilename.
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1522
                                    info at:2 put:filesMD5.
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1523
                                ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1524
                                filesMD5 = (fileMD5sToSearchFor at:idxInList) ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1525
                                    resultList add:fn.
5728
93ac88c7f87d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5727
diff changeset
  1526
                                ]
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1527
                            ]
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1528
                        ]
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1529
                    ]
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1530
                ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1531
            ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1532
            ^ self.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1533
        ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1534
    ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1535
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1536
    self 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1537
        doFindFileNamed:namePatterns 
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1538
        directories:searchDirectories
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1539
        nameMatch:realNameMatch 
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1540
        contentsMatch:doesFileMatch 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1541
        in:dir.
6808
af925359c659 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6633
diff changeset
  1542
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1543
    "Created: / 03-08-2011 / 18:16:02 / cg"
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1544
!
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1545
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1546
doFindFileNamed:namePatterns directories:searchDirectories nameMatch:nameMatch contentsMatch:doesFileMatch in:aDirectory
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1547
    |dir subDirs list directoryContents|
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1548
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1549
    dir := aDirectory asFilename.
5844
11812dd2d7d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5811
diff changeset
  1550
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1551
    self 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1552
        changeInformationTo:('Find File - searching %1' 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1553
                                bindWith:((dir name) copyFrom:(self searchDirectoryHolder value asString size + 1))) 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1554
        toTab:false.
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1555
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1556
    list := self resultList.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1557
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1558
    subDirs := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1559
4638
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  1560
    [
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  1561
        directoryContents := dir directoryContents.
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  1562
    ] on:FileStream openErrorSignal do:[:ex|
9036
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  1563
        list add:((ex pathName , ' -> ' , ex description) colorizeAllWith:Color red darkened).
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1564
        "/        self warn:('Cannot access %1\(%2)'
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1565
        "/                        bindWith:ex parameter printString
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1566
        "/                        with:ex description) withCRs.
4638
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  1567
        ^ self
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  1568
    ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1569
4638
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  1570
    directoryContents sort do:[:fn |
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1571
        |f isDirectory|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1572
321c1729db5b initial checkin
penk
parents:
diff changeset
  1573
        f := dir construct:fn.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1574
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1575
        isDirectory := f isDirectory.
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1576
        isDirectory ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1577
            f isSymbolicLink ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1578
                subDirs add:f
321c1729db5b initial checkin
penk
parents:
diff changeset
  1579
            ]
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1580
        ].
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1581
        (searchDirectories or:[isDirectory not]) ifTrue:[
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1582
            (nameMatch value:fn) ifTrue:[
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1583
                (isDirectory or:[ doesFileMatch value:f ])
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1584
                ifTrue:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1585
                    list add:(f asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1586
                ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1587
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1588
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1589
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1590
321c1729db5b initial checkin
penk
parents:
diff changeset
  1591
    self searchRecursively value ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1592
        subDirs do:[:dir |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1593
            self
321c1729db5b initial checkin
penk
parents:
diff changeset
  1594
                doFindFileNamed:namePatterns 
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1595
                directories:searchDirectories 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1596
                nameMatch:nameMatch 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1597
                contentsMatch:doesFileMatch 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1598
                in:dir
321c1729db5b initial checkin
penk
parents:
diff changeset
  1599
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1600
    ]
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1601
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1602
    "Modified: / 03-08-2011 / 18:36:24 / cg"
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1603
!
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1604
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1605
fileSizeWrapperFor:aFileMatchBlock
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1606
    "possibly wrap the search-match block into a file-size matcher"
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1607
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1608
    |fileSizeToCompare sizeMatch op compare|
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1609
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1610
    self enableFileSizeFilter value ifFalse:[ ^ aFileMatchBlock ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1611
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1612
    fileSizeToCompare := self fileSizeHolder value.
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1613
    op := self fileSizeOperatorHolder value withoutSeparators.
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1614
    op = '~' ifTrue:[
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1615
        compare := [:sz | sz between:(fileSizeToCompare*0.9) and:(fileSizeToCompare*1.1) ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1616
    ] ifFalse:[
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1617
        op := op asSymbol.
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1618
        compare := [:sz | sz perform:op with:fileSizeToCompare ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1619
    ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1620
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1621
    sizeMatch := [:f | 
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1622
                    |sz| 
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1623
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1624
                    sz := f fileSize. 
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1625
                    sz notNil and:[ compare value:sz ]
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1626
                 ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1627
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1628
    ^ [:f | (sizeMatch value:f) and:[ aFileMatchBlock value:f ]]
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1629
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1630
    "Created: / 11-01-2012 / 23:17:02 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1631
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1632
321c1729db5b initial checkin
penk
parents:
diff changeset
  1633
!FindFileApplication methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1634
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  1635
getTabValueString
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  1636
    "the item shown in a tab (not language translated)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1637
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
  1638
    ^ self fileName directory baseName
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  1639
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  1640
    "Created: / 01-03-2007 / 21:39:54 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1641
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1642
321c1729db5b initial checkin
penk
parents:
diff changeset
  1643
!FindFileApplication methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1644
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1645
initialize
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1646
    super initialize.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1647
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1648
    self enableStop value:false.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1649
    self enableSearch value:true.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1650
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1651
    "Created: / 12-01-2012 / 01:38:29 / cg"
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1652
!
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1653
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4798
diff changeset
  1654
item:anItem
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1655
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  1656
    |file newPattern|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1657
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4798
diff changeset
  1658
    super item:anItem.
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  1659
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1660
    file := self fileName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1661
    self searchDirectoryHolder value:(self getDirWithoutFileName:file).
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  1662
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1663
    file isDirectory ifTrue:[
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  1664
        newPattern := '*'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1665
    ] ifFalse:[
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4798
diff changeset
  1666
        newPattern := '*.', anItem suffix.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1667
    ].
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  1668
    self namePatternHolder value:newPattern.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1669
    ^ true.
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1670
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1671
    "Modified: / 12-01-2012 / 01:38:14 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1672
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1673
321c1729db5b initial checkin
penk
parents:
diff changeset
  1674
postOpenWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1675
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1676
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1677
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1678
    findFileView := aBuilder window.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1679
    self windowGroup addPreEventHook:self.
6633
6843fedf7516 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6583
diff changeset
  1680
    super postOpenWith:aBuilder.
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1681
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  1682
    "Modified (format): / 12-01-2012 / 01:40:44 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1683
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1684
321c1729db5b initial checkin
penk
parents:
diff changeset
  1685
release
321c1729db5b initial checkin
penk
parents:
diff changeset
  1686
    self stopSearchTask.
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1687
    contentsInfoCache := nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1688
    ^ super release
321c1729db5b initial checkin
penk
parents:
diff changeset
  1689
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1690
321c1729db5b initial checkin
penk
parents:
diff changeset
  1691
!FindFileApplication class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1692
321c1729db5b initial checkin
penk
parents:
diff changeset
  1693
version
11103
7043dfab86a5 refactored
Claus Gittinger <cg@exept.de>
parents: 11101
diff changeset
  1694
    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.97 2012-01-12 01:12:35 cg Exp $'
9036
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  1695
!
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  1696
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  1697
version_CVS
11103
7043dfab86a5 refactored
Claus Gittinger <cg@exept.de>
parents: 11101
diff changeset
  1698
    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.97 2012-01-12 01:12:35 cg Exp $'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1699
! !