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