FindFileApplication.st
author Claus Gittinger <cg@exept.de>
Wed, 05 Jun 2019 14:16:59 +0200
changeset 18805 f6df57c6dbfb
parent 18709 259745978ab4
child 18877 f8d374955b51
permissions -rw-r--r--
#BUGFIX by cg class: AbstractFileBrowser changed: #currentFileNameHolder endless loop if file not present.
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
15092
1684fd8d6a41 class: FindFileApplication
sr
parents: 14748
diff changeset
    14
"{ NameSpace: Smalltalk }"
1684fd8d6a41 class: FindFileApplication
sr
parents: 14748
diff changeset
    15
11096
c9585b9d2697 refactored
Claus Gittinger <cg@exept.de>
parents: 10441
diff changeset
    16
AbstractFileFinderApplicationComponent subclass:#FindFileApplication
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
    17
	instanceVariableNames:'searchDirectories searchDirectoryHolder notSearchForSameContents
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
    18
		namePatternHolder excludedNamePatternHolder ignoreCaseInName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
    19
		ignoreCaseInExcludedName contentsPatternHolder
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
    20
		ignoreCaseInContents notContentsPatternHolder
11096
c9585b9d2697 refactored
Claus Gittinger <cg@exept.de>
parents: 10441
diff changeset
    21
		ignoreCaseInNotContents sameContentsAsHolder useLocate useGrep
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
    22
		rememberInCache searchOnlyInCache searchForSameContents
11096
c9585b9d2697 refactored
Claus Gittinger <cg@exept.de>
parents: 10441
diff changeset
    23
		contentsInfoCache contentsInfoCacheAccessLock
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
    24
		fileSizeOperatorHolder fileSizeHolder enableFileSizeFilter
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
    25
		fileSizeUnitHolder modificationTimeOperatorHolder
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
    26
		modificationTimeHolder enableModificationTimeFilter
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
    27
		showUnreadableFilesAndDirectoriesHolder
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
    28
		modificationTimeOperatorIndexHolder searchForBinaryContentsHolder'
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
    29
	classVariableNames:'ContentsInfoCache ContentsInfoCacheAccessLock LastRememberInCache
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
    30
		LastSearchIgnoredCaseInContents LastSearchIgnoredCaseInFilename
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
    31
		SearchStringHistory LastSearchIgnoredCaseInExcludedFilename
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
    32
		LastShowUnreadableFilesAndDirectories LastSearchForBinaryContents'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    33
	poolDictionaries:''
321c1729db5b initial checkin
penk
parents:
diff changeset
    34
	category:'Interface-Tools-File'
321c1729db5b initial checkin
penk
parents:
diff changeset
    35
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    36
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    37
!FindFileApplication class methodsFor:'documentation'!
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
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    40
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    41
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    42
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    43
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    44
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    45
 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
    46
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    47
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    48
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    49
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    50
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
    51
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    52
321c1729db5b initial checkin
penk
parents:
diff changeset
    53
!FindFileApplication class methodsFor:'instance creation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    54
321c1729db5b initial checkin
penk
parents:
diff changeset
    55
open
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    56
    ^ self openInDirectory:(Filename currentDirectory)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    57
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    58
    "
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    59
     self open
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
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    63
openInDirectory:aFilename
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    64
    ^ self openOnFileName:(aFilename asFilename asAbsoluteFilename)
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    65
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    66
    "
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    67
     self openInDirectory:'/etc'
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    68
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    69
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    70
321c1729db5b initial checkin
penk
parents:
diff changeset
    71
openOnFileName:aFileName
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    72
    ^ self openOnFileName:aFileName for:nil
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    73
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    74
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    75
openOnFileName:aFileName for:aTargetApplicationOrNil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    76
321c1729db5b initial checkin
penk
parents:
diff changeset
    77
    | instance builder|
321c1729db5b initial checkin
penk
parents:
diff changeset
    78
321c1729db5b initial checkin
penk
parents:
diff changeset
    79
    builder := super open.
321c1729db5b initial checkin
penk
parents:
diff changeset
    80
    instance := builder application.
3983
dd593a7482fa *** empty log message ***
penk
parents: 3937
diff changeset
    81
    instance item:(DirectoryContentsBrowser itemClass fileName:aFileName).
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    82
    aTargetApplicationOrNil notNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    83
        instance targetApplication:aTargetApplicationOrNil.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
    84
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    85
    ^ builder
321c1729db5b initial checkin
penk
parents:
diff changeset
    86
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
    87
321c1729db5b initial checkin
penk
parents:
diff changeset
    88
!FindFileApplication class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
    89
321c1729db5b initial checkin
penk
parents:
diff changeset
    90
tabStringFor:aApplicationType
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    91
    "the formatString shown in a tab (language translated)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    92
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    93
    ^ 'Find in %1'
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    94
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
    95
    "Modified: / 01-03-2007 / 21:47:54 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    96
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
    97
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    98
!FindFileApplication class methodsFor:'help specs'!
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
    99
17894
58b0ce702eb0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17856
diff changeset
   100
helpSpec
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   101
    "This resource specification was automatically generated
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   102
     by the UIHelpTool of ST/X."
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   103
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   104
    "Do not manually edit this!! If it is corrupted,
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   105
     the UIHelpTool may not be able to read the specification."
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   106
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   107
    "
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   108
     UIHelpTool openOnClass:FindFileApplication    
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
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   111
    <resource: #help>
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   112
17894
58b0ce702eb0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17856
diff changeset
   113
    ^ super helpSpec addPairsFrom:#(
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   114
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   115
#contentsPattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   116
'Search for files containing this. Can be matchPatterns, separated by ";".\If search for binary contents is checked, this should be a sequence of hex bytes (i.e. xx xx xx...)'
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   117
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   118
#namePattern
17709
c5dcf0baef9a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17368
diff changeset
   119
'Filename(s) to search for. Can be matchPatterns, separated by ";".\(eg. "*.c ; *.h" searches for C and header files. So does "*.[ch]")'
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   120
11122
Claus Gittinger <cg@exept.de>
parents: 11117
diff changeset
   121
#excludedNamePattern
Claus Gittinger <cg@exept.de>
parents: 11117
diff changeset
   122
'Filename(s) to skip. Can be matchPatterns, separated by ";"'
Claus Gittinger <cg@exept.de>
parents: 11117
diff changeset
   123
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   124
#notContentsPattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   125
'Search for files NOT containing this. Can be matchPatterns, separated by ";".\If search for binary contents is checked, this should be a sequence of hex bytes (i.e. xx xx xx...)'
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   126
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   127
#searchDirectory
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   128
'Folder, where the search starts'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   129
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   130
#searchForBinaryContents
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   131
'Included/Not included patterns are given as a sequence of hex bytes instead of character sequences (eg. xx xx xx...)'
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   132
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   133
#searchRecursive
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   134
'Recursively search in sub-folders'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   135
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   136
#ignoreCase
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   137
'Ignore upper/lowercase differences (be case-insensitive)'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   138
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   139
#sameContents
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   140
'Search for files with same contents as the other file'
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   141
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   142
#fileSize
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
   143
'Search for files with a specific size constraint ("~" means: +/- 10%)'
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   144
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   145
#modificationTime
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   146
'Search for files which are newer or older'
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   147
)
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
   148
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   149
    "Modified: / 12-11-2017 / 17:53:35 / cg"
9408
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   150
! !
173aa5a55022 active help
Claus Gittinger <cg@exept.de>
parents: 9400
diff changeset
   151
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   152
!FindFileApplication class methodsFor:'history'!
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
addToSearchStringHistory:aString
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   155
    self searchStringHistory 
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   156
        remove:aString ifAbsent:[];
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   157
        addFirst:aString.
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   158
    self searchStringHistory size > 25 ifTrue:[
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   159
        self searchStringHistory removeLast
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
!
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   162
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   163
searchStringHistory
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   164
    SearchStringHistory isNil ifTrue:[
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   165
        SearchStringHistory := OrderedCollection new 
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   166
    ].
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   167
    ^ SearchStringHistory
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   168
! !
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   169
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   170
!FindFileApplication class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   171
321c1729db5b initial checkin
penk
parents:
diff changeset
   172
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   173
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   174
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   175
321c1729db5b initial checkin
penk
parents:
diff changeset
   176
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   177
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   178
321c1729db5b initial checkin
penk
parents:
diff changeset
   179
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   180
     UIPainter new openOnClass:FindFileApplication andSelector:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   181
     FindFileApplication new openInterface:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   182
     FindFileApplication open
321c1729db5b initial checkin
penk
parents:
diff changeset
   183
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   184
321c1729db5b initial checkin
penk
parents:
diff changeset
   185
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
   186
321c1729db5b initial checkin
penk
parents:
diff changeset
   187
    ^ 
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   188
    #(FullSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   189
       name: windowSpec
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   190
       uuid: '79f42116-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   191
       window: 
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   192
      (WindowSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   193
         label: 'File Search'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   194
         name: 'File Search'
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   195
         uuid: '79f4341c-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   196
         min: (Point 377 131)
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   197
         bounds: (Rectangle 0 0 759 420)
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   198
       )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   199
       component: 
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   200
      (SpecCollection
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   201
         collection: (
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   202
          (MenuPanelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   203
             name: 'ToolBar1'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   204
             layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   205
             uuid: '79f4376e-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   206
             level: 0
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   207
             menu: searchMenu
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   208
             textDefault: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   209
           )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   210
          (ProgressIndicatorSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   211
             name: 'ProgressIndicator1'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   212
             layout: (LayoutFrame 125 0 11 0 231 0 21 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   213
             uuid: '79f43a48-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   214
             visibilityChannel: enableStop
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   215
             backgroundColor: (Color 0.0 67.0 67.0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   216
             showPercentage: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   217
             isActivityIndicator: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   218
           )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   219
          (ViewSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   220
             name: 'Box1'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   221
             layout: (LayoutFrame 0 0.0 32 0 0 1.0 231 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   222
             uuid: '79f43caa-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   223
             component: 
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   224
            (SpecCollection
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   225
               collection: (
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   226
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   227
                   label: 'Directory:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   228
                   name: 'DirectoryLabel'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   229
                   layout: (LayoutFrame 2 0 7 0 180 0 24 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   230
                   activeHelpKey: searchDirectory
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   231
                   uuid: '79f43e3a-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   232
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   233
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   234
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   235
                (FilenameInputFieldSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   236
                   name: 'DirectoryEntryField'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   237
                   layout: (LayoutFrame 180 0 4 0 -350 1 24 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   238
                   activeHelpKey: searchDirectory
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   239
                   uuid: '79f44056-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   240
                   model: searchDirectoryHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   241
                   immediateAccept: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   242
                   acceptOnPointerLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   243
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   244
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   245
                   label: 'Search Files Named:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   246
                   name: 'FileNameLabel'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   247
                   layout: (LayoutFrame 2 0 31 0 180 0 48 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   248
                   activeHelpKey: namePattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   249
                   uuid: '79f4433a-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   250
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   251
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   252
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   253
                (InputFieldSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   254
                   name: 'FileNameEntryField'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   255
                   layout: (LayoutFrame 180 0 28 0 -350 1 48 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   256
                   activeHelpKey: namePattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   257
                   uuid: '79f444b6-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   258
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   259
                   model: namePatternHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   260
                   immediateAccept: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   261
                   acceptOnLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   262
                   acceptOnPointerLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   263
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   264
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   265
                   label: 'But not Named:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   266
                   name: 'Label1'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   267
                   layout: (LayoutFrame 2 0 55 0 180 0 72 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   268
                   activeHelpKey: excludedNamePattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   269
                   uuid: '79f44704-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   270
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   271
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   272
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   273
                (InputFieldSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   274
                   name: 'EntryField1'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   275
                   layout: (LayoutFrame 180 0 52 0 -350 1 72 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   276
                   activeHelpKey: excludedNamePattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   277
                   uuid: '79f44880-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   278
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   279
                   model: excludedNamePatternHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   280
                   immediateAccept: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   281
                   acceptOnLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   282
                   acceptOnPointerLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   283
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   284
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   285
                   label: 'Containing:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   286
                   name: 'ContentsLabel'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   287
                   layout: (LayoutFrame 2 0 79 0 180 0 96 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   288
                   activeHelpKey: contentsPattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   289
                   uuid: '79f44a88-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   290
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   291
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   292
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   293
                (ComboBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   294
                   name: 'ComboBox1'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   295
                   layout: (LayoutFrame 180 0 76 0 -350 1 96 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   296
                   activeHelpKey: contentsPattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   297
                   uuid: '79f44bfa-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   298
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   299
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   300
                   model: contentsPatternHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   301
                   immediateAccept: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   302
                   acceptOnPointerLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   303
                   comboList: searchStringHistory
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   304
                   useIndex: false
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   305
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   306
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   307
                   label: 'Not Containing:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   308
                   name: 'NotContentsLabel'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   309
                   layout: (LayoutFrame 2 0 103 0 180 0 120 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   310
                   activeHelpKey: notContentsPattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   311
                   uuid: '79f44ea2-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   312
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   313
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   314
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   315
                (InputFieldSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   316
                   name: 'NotContentsEntryField'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   317
                   layout: (LayoutFrame 180 0 100 0 -350 1 120 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   318
                   activeHelpKey: notContentsPattern
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   319
                   uuid: '79f4500a-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   320
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   321
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   322
                   model: notContentsPatternHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   323
                   immediateAccept: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   324
                   acceptOnPointerLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   325
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   326
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   327
                   label: 'Same Contents As:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   328
                   name: 'SameContentsAsLabel'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   329
                   layout: (LayoutFrame 2 0 127 0 180 0 144 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   330
                   activeHelpKey: sameContents
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   331
                   uuid: '79f45208-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   332
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   333
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   334
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   335
                (InputFieldSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   336
                   name: 'SameContentsAsEntryField'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   337
                   layout: (LayoutFrame 180 0 124 0 -367 1 144 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   338
                   activeHelpKey: sameContents
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   339
                   uuid: '79f45370-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   340
                   enableChannel: searchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   341
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   342
                   model: sameContentsAsHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   343
                   immediateAccept: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   344
                   acceptOnPointerLeave: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   345
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   346
                (CheckToggleSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   347
                   name: 'EnableSameContentsCheckToggle'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   348
                   layout: (LayoutOrigin -366 1 128 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   349
                   activeHelpKey: sameContents
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   350
                   uuid: '79f45582-c7c7-11e7-82f7-c42c033b4871'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   351
                   translateLabel: true
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   352
                   model: searchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   353
                   isTriggerOnDown: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   354
                   showLamp: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   355
                   lampColor: (Color 100.0 100.0 0.0)
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   356
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   357
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   358
                   label: 'File Size:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   359
                   name: 'FileSizeLabel'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   360
                   layout: (LayoutFrame 2 0 151 0 180 0 168 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   361
                   activeHelpKey: fileSize
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   362
                   uuid: '79f458c0-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   363
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   364
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   365
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   366
                (PopUpListSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   367
                   label: 'PopUp List'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   368
                   name: 'FileSizeOperatorPopUpList'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   369
                   layout: (LayoutFrame 180 0 148 0 260 0 168 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   370
                   activeHelpKey: fileSize
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   371
                   uuid: '79f45a64-c7c7-11e7-82f7-c42c033b4871'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   372
                   translateLabel: true
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   373
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   374
                   model: fileSizeOperatorHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   375
                   enableChannel: enableFileSizeFilterAndNotSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   376
                   menu: 
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   377
                  (Array
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   378
                     ' >' ' < '
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   379
                     ' !!= ' ' = '
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   380
                     ' ~ '
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   381
                   )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   382
                 )
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   383
                (InputFieldSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   384
                   name: 'FileSizeEntryField'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   385
                   layout: (LayoutFrame 260 0 148 0 -367 1 168 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   386
                   activeHelpKey: fileSize
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   387
                   uuid: '79f45cda-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   388
                   enableChannel: enableFileSizeFilterAndNotSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   389
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   390
                   model: fileSizeHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   391
                   type: fileSize
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   392
                   immediateAccept: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   393
                   acceptOnLeave: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   394
                   acceptOnLostFocus: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   395
                   acceptOnPointerLeave: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   396
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   397
                (CheckToggleSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   398
                   name: 'EnableSizeCheckToggle'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   399
                   layout: (LayoutOrigin -366 1 151 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   400
                   activeHelpKey: fileSize
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   401
                   uuid: '79f45f0a-c7c7-11e7-82f7-c42c033b4871'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   402
                   translateLabel: true
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   403
                   model: enableFileSizeFilter
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   404
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   405
                   isTriggerOnDown: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   406
                   showLamp: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   407
                   lampColor: (Color 100.0 100.0 0.0)
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   408
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   409
                (LabelSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   410
                   label: 'Modified:'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   411
                   name: 'Label2'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   412
                   layout: (LayoutFrame 2 0 175 0 180 0 192 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   413
                   activeHelpKey: modificationTime
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   414
                   uuid: '79f46130-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   415
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   416
                   adjust: right
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   417
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   418
                (PopUpListSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   419
                   label: 'PopUp List'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   420
                   name: 'PopUpList1'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   421
                   layout: (LayoutFrame 180 0 172 0 260 0 192 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   422
                   activeHelpKey: modificationTime
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   423
                   uuid: '79f462b6-c7c7-11e7-82f7-c42c033b4871'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   424
                   translateLabel: true
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   425
                   tabable: true
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   426
                   model: modificationTimeOperatorIndexHolder
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   427
                   enableChannel: enableModificationTimeFilter
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   428
                   menu: modificationTimeOperatorLabelList
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   429
                   useIndex: true
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   430
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   431
                (InputFieldSpec
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   432
                   name: 'ModifiedEntryField'
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   433
                   layout: (LayoutFrame 260 0 172 0 -367 1 192 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   434
                   activeHelpKey: modificationTime
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   435
                   uuid: '79f46478-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   436
                   enableChannel: enableModificationTimeFilter
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   437
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   438
                   model: modificationTimeHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   439
                   type: timestamp
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   440
                   immediateAccept: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   441
                   acceptOnLeave: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   442
                   acceptOnLostFocus: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   443
                   acceptOnPointerLeave: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   444
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   445
                (CheckToggleSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   446
                   name: 'CheckToggle1'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   447
                   layout: (LayoutOrigin -366 1 175 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   448
                   activeHelpKey: modificationTime
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   449
                   uuid: '79f4668a-c7c7-11e7-82f7-c42c033b4871'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   450
                   translateLabel: true
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   451
                   model: enableModificationTimeFilter
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   452
                   isTriggerOnDown: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   453
                   showLamp: false
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   454
                   lampColor: (Color 100.0 100.0 0.0)
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   455
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   456
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   457
                   label: 'Use ''locate'' Cmd'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   458
                   name: 'UseLocateCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   459
                   layout: (LayoutFrame -350 1 5 0 -167 1 28 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   460
                   activeHelpKey: useLocate
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   461
                   uuid: '79f4689c-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   462
                   visibilityChannel: canUseLocate
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   463
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   464
                   model: useLocate
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   465
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   466
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   467
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   468
                   label: 'Recursive'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   469
                   name: 'RecursiveSearchCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   470
                   layout: (LayoutFrame -200 1 5 0 -4 1 28 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   471
                   activeHelpKey: recursiveSearch
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   472
                   uuid: '79f46aa4-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   473
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   474
                   model: searchRecursively
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   475
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   476
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   477
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   478
                   label: 'Directories'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   479
                   name: 'SearchDirectoriesCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   480
                   layout: (LayoutFrame -350 1 29 0 -167 1 52 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   481
                   uuid: '79f46c16-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   482
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   483
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   484
                   model: searchDirectories
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   485
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   486
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   487
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   488
                   label: 'Ignore Case'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   489
                   name: 'IgnoreCaseInNameCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   490
                   layout: (LayoutFrame -200 1 29 0 -4 1 52 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   491
                   activeHelpKey: ignoreCase
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   492
                   uuid: '79f46d7e-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   493
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   494
                   model: ignoreCaseInName
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   495
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   496
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   497
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   498
                   label: 'Ignore Case'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   499
                   name: 'CheckBox1'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   500
                   layout: (LayoutFrame -200 1 53 0 -4 1 76 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   501
                   activeHelpKey: ignoreCase
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   502
                   uuid: '79f46edc-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   503
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   504
                   model: ignoreCaseInExcludedName
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   505
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   506
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   507
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   508
                   label: 'Use ''grep'' Cmd'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   509
                   name: 'UseGrepCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   510
                   layout: (LayoutFrame -350 1 77 0 -167 1 100 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   511
                   uuid: '79f4703a-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   512
                   visibilityChannel: canUseGrep
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   513
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   514
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   515
                   model: useGrep
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   516
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   517
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   518
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   519
                   label: 'Ignore Case'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   520
                   name: 'IgnoreCaseInContentsCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   521
                   layout: (LayoutFrame -200 1 77 0 -4 1 100 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   522
                   activeHelpKey: ignoreCase
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   523
                   uuid: '79f47198-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   524
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   525
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   526
                   model: ignoreCaseInContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   527
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   528
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   529
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   530
                   label: 'Ignore Case'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   531
                   name: 'IgnoreCaseInNotContentsCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   532
                   layout: (LayoutFrame -200 1 101 0 -4 1 124 0)
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   533
                   activeHelpKey: ignoreCase
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   534
                   uuid: '79f472f6-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   535
                   enableChannel: notSearchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   536
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   537
                   model: ignoreCaseInNotContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   538
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   539
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   540
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   541
                   label: 'Cache Info'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   542
                   name: 'RememberInCacheCheckBox'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   543
                   layout: (LayoutFrame -350 1 125 0 -167 1 148 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   544
                   uuid: '79f47454-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   545
                   visibilityChannel: canUseGrep
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   546
                   enableChannel: searchForSameContents
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   547
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   548
                   model: rememberInCache
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   549
                   translateLabel: true
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   550
                   activeHelpKey: rememberInCache
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   551
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   552
                (ActionButtonSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   553
                   label: 'Clear Cache'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   554
                   name: 'ClearCacheButton'
16965
d39ebfdb101d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16826
diff changeset
   555
                   layout: (LayoutFrame -169 1 125 0 -21 1 147 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   556
                   uuid: '79f475b2-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   557
                   translateLabel: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   558
                   model: clearCache
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   559
                   activeHelpKey: clearCache
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   560
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   561
                (CheckBoxSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   562
                   label: 'Show Unreadable Files and Folders'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   563
                   name: 'CheckBox2'
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   564
                   layout: (LayoutFrame -350 1 149 0 0 1 172 0)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   565
                   uuid: '79f477b0-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   566
                   tabable: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   567
                   model: showUnreadableFilesAndDirectoriesHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   568
                   translateLabel: true
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   569
                   activeHelpKey: showUnreadableFilesAndDirectories
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   570
                 )
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   571
                (CheckBoxSpec
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   572
                   label: 'Search for Binary Contents'
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   573
                   name: 'CheckBox3'
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   574
                   layout: (LayoutFrame -350 1 173 0 0 1 196 0)
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   575
                   uuid: '79f47918-c7c7-11e7-82f7-c42c033b4871'
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   576
                   tabable: true
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   577
                   model: searchForBinaryContentsHolder
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   578
                   translateLabel: true
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   579
                   activeHelpKey: searchForBinaryContents
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   580
                 )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   581
                )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   582
              
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   583
             )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   584
           )
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   585
          (SequenceViewSpec
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   586
             name: 'List1'
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   587
             layout: (LayoutFrame 0 0.0 238 0 0 1.0 0 1)
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   588
             uuid: '79f47abc-c7c7-11e7-82f7-c42c033b4871'
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   589
             model: selectionHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   590
             menu: menu
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   591
             hasHorizontalScrollBar: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   592
             hasVerticalScrollBar: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   593
             isMultiSelect: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   594
             doubleClickSelector: fileDoubleClick:
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   595
             valueChangeSelector: fileSelected:
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   596
             useIndex: true
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   597
             sequenceList: shownListHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   598
             properties: 
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   599
            (PropertyListDictionary
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   600
               dropObjectSelector: getDropObjects:
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   601
               displayObjectSelector: getDisplayObjects:
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   602
               startDragSelector: doStartDrag:in:
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   603
               dragArgument: findFileList
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   604
             )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   605
           )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   606
          )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   607
        
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   608
       )
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   609
     )
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
   610
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
   611
    "Modified: / 12-11-2017 / 17:37:30 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   612
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   613
321c1729db5b initial checkin
penk
parents:
diff changeset
   614
!FindFileApplication class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   615
321c1729db5b initial checkin
penk
parents:
diff changeset
   616
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
   617
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   618
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   619
321c1729db5b initial checkin
penk
parents:
diff changeset
   620
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   621
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   622
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   623
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   624
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   625
     MenuEditor new openOnClass:FindFileApplication andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
   626
     (Menu new fromLiteralArrayEncoding:(FindFileApplication menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
   627
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   628
321c1729db5b initial checkin
penk
parents:
diff changeset
   629
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
   630
321c1729db5b initial checkin
penk
parents:
diff changeset
   631
    ^ 
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   632
     #(Menu
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   633
        (
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   634
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   635
            enabled: hasOneFileSelected
7323
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   636
            label: 'Open in New File Browser'
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   637
            itemValue: openInNewBrowser
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   638
          )
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   639
         (MenuItem
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
   640
            enabled: hasOneFileSelected
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   641
            label: 'Select in Browser'
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   642
            itemValue: selectInBrowser
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   643
            isVisible: isEmbeddedApplication
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   644
          )
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   645
         (MenuItem
6158
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   646
            label: 'Autoselect in Browser'
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   647
            indication: autoSelectInBrowserHolder
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   648
          )
823812e0c7ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6154
diff changeset
   649
         (MenuItem
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   650
            label: '-'
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   651
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   652
         (MenuItem
8613
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   653
            enabled: hasOneFileSelected
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   654
            label: 'FileIn'
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   655
            itemValue: fileInInBrowser
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   656
          )
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   657
         (MenuItem
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   658
            label: '-'
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   659
          )
6c82076a9cbf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8330
diff changeset
   660
         (MenuItem
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   661
            enabled: hasSelectionInResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   662
            label: 'Copy Selected Filenames to Clipboard'
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   663
            itemValue: copySelectedFileNamesToClipboard
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   664
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   665
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   666
            label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   667
          )
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   668
         (MenuItem
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   669
            enabled: hasSelection
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   670
            label: 'Delete Selected File(s)...'
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   671
            itemValue: deleteSelectedFiles
12494
dd5b8035d104 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12425
diff changeset
   672
          )
dd5b8035d104 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12425
diff changeset
   673
         (MenuItem
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   674
            enabled: hasListEntries
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   675
            label: 'Delete all Files...'
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   676
            itemValue: deleteAllFiles
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   677
            isVisible: false
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   678
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   679
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   680
            label: '-'
16826
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   681
          )
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   682
         (MenuItem
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   683
            enabled: hasSelection
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   684
            label: 'Touch Selected File(s)...'
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   685
            itemValue: touchSelectedFiles
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   686
          )
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   687
         (MenuItem
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   688
            enabled: hasListEntries
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   689
            label: 'Touch all Files...'
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   690
            itemValue: touchAllFiles
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   691
            isVisible: false
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   692
          )
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   693
         (MenuItem
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
   694
            label: '-'
12778
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   695
            isVisible: cvsMenusAreShown
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   696
          )
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   697
         (MenuItem
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   698
            enabled: hasSelection
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   699
            label: 'Commit Selected File(s) to CVS...'
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   700
            itemValue: commitSelectedFilesToCVS
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   701
            isVisible: cvsMenusAreShown
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   702
          )
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   703
         (MenuItem
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   704
            enabled: hasSelection
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   705
            label: 'Delete Selected File(s) and CVS Container(s)...'
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   706
            itemValue: deleteSelectedFilesAndCVSContainers
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   707
            isVisible: cvsMenusAreShown
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   708
          )
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   709
         (MenuItem
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
   710
            label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   711
          )
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   712
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   713
            enabled: hasSelection
5767
2cc71e97ef70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5766
diff changeset
   714
            label: 'Remove Selected from Resultlist'
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   715
            itemValue: removeSelectedFilesFromResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   716
          )
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   717
         (MenuItem
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   718
            enabled: hasListEntries
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   719
            label: 'Clear Resultlist'
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   720
            itemValue: clearResultList
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   721
          )
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   722
         (MenuItem
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   723
            label: '-'
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   724
          )
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   725
         (MenuItem
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   726
            label: 'Show Matched Files (After SameContents-Search)'
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   727
            itemValue: showMatchedFiles:
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   728
            isVisible: notShowingMatchedFiles
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   729
            argument: true
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   730
          )
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   731
         (MenuItem
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
   732
            label: 'Show Matching Files (After SameContents-Search)'
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   733
            itemValue: showMatchedFiles:
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   734
            isVisible: showingMatchedFiles
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   735
            argument: false
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   736
          )
15214
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   737
         (MenuItem
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   738
            enabled: hasTwoFilesSelected
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   739
            label: 'Compare with Each Other'
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   740
            itemValue: doCompareTwoFiles
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   741
            argument: false
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   742
          )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   743
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
   744
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   745
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   746
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   747
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   748
321c1729db5b initial checkin
penk
parents:
diff changeset
   749
searchMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   750
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   751
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   752
321c1729db5b initial checkin
penk
parents:
diff changeset
   753
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   754
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   755
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   756
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   757
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   758
     MenuEditor new openOnClass:FindFileApplication andSelector:#searchMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   759
     (Menu new fromLiteralArrayEncoding:(FindFileApplication searchMenu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
   760
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   761
321c1729db5b initial checkin
penk
parents:
diff changeset
   762
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
   763
321c1729db5b initial checkin
penk
parents:
diff changeset
   764
    ^ 
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   765
     #(Menu
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   766
        (
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   767
         (MenuItem
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   768
            label: 'Search'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   769
            itemValue: doSearch
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   770
            translateLabel: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   771
            isButton: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   772
            labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   773
          )
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   774
         (MenuItem
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   775
            enabled: enableStop
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   776
            label: 'Stop'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   777
            itemValue: stop
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   778
            translateLabel: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   779
            isButton: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   780
            isVisible: enableStop
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   781
            labelImage: (ResourceRetriever XPToolbarIconLibrary stop22x22Icon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   782
          )
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   783
         (MenuItem
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   784
            label: 'Close'
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   785
            itemValue: doClose
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   786
            translateLabel: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   787
            isButton: true
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   788
            startGroup: right
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   789
            isVisible: false
7574
097a6513da1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7323
diff changeset
   790
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   791
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
   792
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
   793
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   794
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   795
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   796
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   797
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   798
!FindFileApplication class methodsFor:'startup & release'!
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   799
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   800
releaseContentsInfoCache
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   801
    ContentsInfoCache := ContentsInfoCacheAccessLock := nil.
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   802
! !
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   803
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   804
!FindFileApplication class methodsFor:'tableColumns specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   805
321c1729db5b initial checkin
penk
parents:
diff changeset
   806
searchResultTable
321c1729db5b initial checkin
penk
parents:
diff changeset
   807
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   808
     by the DataSetBuilder of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   809
321c1729db5b initial checkin
penk
parents:
diff changeset
   810
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   811
     the DataSetBuilder may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   812
321c1729db5b initial checkin
penk
parents:
diff changeset
   813
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   814
     DataSetBuilder new openOnClass:FindFileApplication andSelector:#searchResultTable
321c1729db5b initial checkin
penk
parents:
diff changeset
   815
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   816
321c1729db5b initial checkin
penk
parents:
diff changeset
   817
    <resource: #tableColumns>
321c1729db5b initial checkin
penk
parents:
diff changeset
   818
321c1729db5b initial checkin
penk
parents:
diff changeset
   819
    ^#(
6583
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   820
      (DataSetColumnSpec
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   821
         label: 'Filename'
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   822
         id: 'FileName'
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   823
         labelButtonType: Button
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   824
         model: fileName
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   825
         showRowSeparator: false
2652ac4ca0ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   826
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   827
       )
321c1729db5b initial checkin
penk
parents:
diff changeset
   828
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   829
    
321c1729db5b initial checkin
penk
parents:
diff changeset
   830
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   831
321c1729db5b initial checkin
penk
parents:
diff changeset
   832
!FindFileApplication methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   833
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   834
clearCache
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
   835
    contentsInfoCache := nil
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   836
!
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
   837
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   838
clearResultList
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   839
    self resultList removeAll.
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   840
    self matchedFilesList removeAll.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   841
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
   842
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   843
deleteAllFiles
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   844
    |files|
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   845
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   846
    files := self shownList copy.
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   847
    self deleteFiles:files confirm:true.
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   848
    self removeFilesFromResultList:files
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   849
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   850
    "Modified: / 29-03-2012 / 10:06:09 / cg"
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   851
!
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   852
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   853
deleteFiles:colOfFiles confirm:confirm
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   854
    "delete current selected files/directories
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   855
    "
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   856
    |delete result|
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   857
6832
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   858
"/    self windowGroup withWaitCursorDo:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5866
diff changeset
   859
        delete := FileOperation deleteFiles:(colOfFiles asSet) confirm:confirm.
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   860
        result := delete result.
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   861
        result notNil ifTrue:[
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   862
            result ifFalse:[
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   863
                self notify:delete errorString.
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   864
            ] ifTrue:[
5769
c7f4f5fc96e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5768
diff changeset
   865
"/                masterApplication notNil ifTrue:[
c7f4f5fc96e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5768
diff changeset
   866
"/                    masterApplication updateListAfterDelete:colOfFiles.
c7f4f5fc96e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5768
diff changeset
   867
"/                ]
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   868
            ]
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   869
        ].
6832
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   870
"/    ].
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   871
    ^ result.
6832
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   872
c69c570a3ec7 wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6822
diff changeset
   873
    "Modified: / 25-07-2006 / 09:11:09 / cg"
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   874
!
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   875
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   876
deleteSelectedFiles
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   877
    |sel files result|
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   878
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   879
    sel := self selectionHolder value.
6109
aed06872e73e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6107
diff changeset
   880
    sel isEmptyOrNil ifTrue:[^ self].
aed06872e73e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6107
diff changeset
   881
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
   882
    files := sel collect:[:idx | self shownList at:idx].
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   883
    self deleteFiles:files confirm:true.
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   884
    result == true ifTrue:[
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   885
        self removeFilesFromResultList:files
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
   886
    ].
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   887
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
   888
    "Modified: / 29-03-2012 / 10:05:39 / cg"
5766
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   889
!
97f7422b1ea6 +deleteFiles
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   890
15214
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   891
doCompareTwoFiles
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   892
    |sel entry1 entry2|
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   893
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   894
    sel := self selectionHolder value.
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   895
    sel size == 2 ifFalse:[^ self].
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   896
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   897
    entry1 := self shownList at:sel first.
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   898
    (entry1 := entry1 asFilename) exists ifFalse:[
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   899
        self warn:'Oops - file is gone: ',entry1 pathName
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   900
    ].
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   901
    entry2 := self shownList at:sel second.
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   902
    (entry2 := entry2 asFilename) exists ifFalse:[
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   903
        self warn:'Oops - file is gone: ',entry2 pathName
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   904
    ].
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   905
    masterApplication openDiffViewOn:entry1 and:entry2
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   906
!
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
   907
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   908
doSearch
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   909
    |namePatterns excludedNamePatterns contentsPattern notContentsPattern 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   910
     dir dirs fn fileToCompareAgainst ignoreCaseInName ignoreCaseInExcludedName 
11423
ba26e541c690 changed: #doSearch
Claus Gittinger <cg@exept.de>
parents: 11122
diff changeset
   911
     ignoreCaseInContents ignoreCaseInNotContents|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   912
321c1729db5b initial checkin
penk
parents:
diff changeset
   913
"/    self changeExtentToSeeSearchResult.
321c1729db5b initial checkin
penk
parents:
diff changeset
   914
321c1729db5b initial checkin
penk
parents:
diff changeset
   915
    dir := self searchDirectoryHolder value.
321c1729db5b initial checkin
penk
parents:
diff changeset
   916
    dir isNil ifTrue:[
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   917
        Dialog warn:(resources string:'Missing directory name').
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   918
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   919
    ].
16608
1edaaaaa88e1 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16574
diff changeset
   920
    dir asString includesMatchCharacters ifTrue:[
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   921
        dirs := Filename filesMatchingGLOB:dir.
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   922
        dirs isEmpty ifTrue:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   923
            Dialog warn:(resources string:'No matching directory: ''%1''' with:dir allBold).
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   924
            ^ self.
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   925
        ].    
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   926
    ] ifFalse:[    
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   927
        dir asFilename exists ifFalse:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   928
            Dialog warn:(resources string:'No such directory: ''%1''' with:dir allBold).
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   929
            ^ self.
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   930
        ].
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   931
        dirs := { dir }
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   932
    ].
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   933
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
   934
    LastShowUnreadableFilesAndDirectories := showUnreadableFilesAndDirectoriesHolder value.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   935
    LastSearchIgnoredCaseInFilename := ignoreCaseInName := self ignoreCaseInName value.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   936
    LastSearchIgnoredCaseInExcludedFilename := ignoreCaseInExcludedName := self ignoreCaseInExcludedName value.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   937
    LastSearchIgnoredCaseInContents := ignoreCaseInContents := self ignoreCaseInContents value.
11423
ba26e541c690 changed: #doSearch
Claus Gittinger <cg@exept.de>
parents: 11122
diff changeset
   938
    ignoreCaseInNotContents := self ignoreCaseInNotContents value.
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
   939
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   940
    self stopSearchTaskOrAbort.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   941
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   942
    namePatterns := self namePatternsFor:(self namePatternHolder value) ignoringCase:ignoreCaseInName.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   943
    excludedNamePatterns := self namePatternsFor:(self excludedNamePatternHolder value) ignoringCase:ignoreCaseInExcludedName.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   944
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   945
    contentsPattern := self contentsPatternHolder value.
321c1729db5b initial checkin
penk
parents:
diff changeset
   946
    contentsPattern size == 0 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   947
        contentsPattern := nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   948
    ] ifFalse:[
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   949
        self class addToSearchStringHistory:contentsPattern.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
   950
        ignoreCaseInContents ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   951
            contentsPattern := contentsPattern asLowercase
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
   952
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   953
    ].
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   954
    notContentsPattern := self notContentsPatternHolder value.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   955
    notContentsPattern size == 0 ifTrue:[
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   956
        notContentsPattern := nil
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   957
    ] ifFalse:[
11423
ba26e541c690 changed: #doSearch
Claus Gittinger <cg@exept.de>
parents: 11122
diff changeset
   958
        ignoreCaseInNotContents ifTrue:[
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   959
            notContentsPattern := notContentsPattern asLowercase
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   960
        ]
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
   961
    ].
5787
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   962
    searchForSameContents value ifTrue:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   963
        fileToCompareAgainst := (self sameContentsAsHolder value ? '') withoutSeparators.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   964
        fileToCompareAgainst isEmpty ifTrue:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   965
            fileToCompareAgainst := nil.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   966
        ] ifFalse:[
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   967
            fileToCompareAgainst includesMatchCharacters ifFalse:[
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   968
                (fn := fileToCompareAgainst asFilename) exists ifFalse:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   969
                    Dialog warn:('No such file: %1' bindWith:fileToCompareAgainst allBold).
5787
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   970
                    ^ self.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   971
                ].
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   972
                fn isReadable ifFalse:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   973
                    Dialog warn:('Cannot read: %1' bindWith:fileToCompareAgainst allBold).
5787
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   974
                    ^ self.
7afc10d73559 search fix
Claus Gittinger <cg@exept.de>
parents: 5786
diff changeset
   975
                ]
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
   976
            ].
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
   977
        ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   978
    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
   979
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   980
    self 
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   981
        startSearchTask:[
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   982
            self changeInformationTo:'Find File ' , '- searching ' toTab:true.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   983
            self 
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   984
                doFindFileNamed:namePatterns
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   985
                directories:(self searchDirectories value)
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   986
                ignoreCaseInName:ignoreCaseInName
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   987
                excludeFilesNamed:excludedNamePatterns
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   988
                ignoreCaseInExcludedName:ignoreCaseInExcludedName
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   989
                containingString:contentsPattern
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   990
                ignoreCaseInContents:ignoreCaseInContents
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   991
                notContainingString:notContentsPattern
11423
ba26e541c690 changed: #doSearch
Claus Gittinger <cg@exept.de>
parents: 11122
diff changeset
   992
                ignoreCaseInNotContents:ignoreCaseInNotContents
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   993
                sameContentsAsFile:fileToCompareAgainst  
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   994
                sameContentsAs:nil 
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   995
                in:dirs.
5770
2b3f1705ed84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5769
diff changeset
   996
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
   997
        ]
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
   998
        name:('FindFile[', dir asFilename baseName, ']')
5770
2b3f1705ed84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5769
diff changeset
   999
11423
ba26e541c690 changed: #doSearch
Claus Gittinger <cg@exept.de>
parents: 11122
diff changeset
  1000
    "Modified: / 16-03-2012 / 09:37:13 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1001
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1002
7323
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1003
fileInInBrowser
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1004
    |sel entry application|
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1005
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1006
    sel := self selectionHolder value.
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1007
    (sel notEmptyOrNil) ifTrue:[
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1008
        entry := self shownList at:sel first.
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1009
        entry asFilename exists ifFalse:[ ^ self].
15214
f00b3fcd0a60 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15105
diff changeset
  1010
7323
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1011
        application := targetApplication ? self masterApplication.
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1012
        application notNil ifTrue:[
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1013
            application fileIn:(entry asFilename).
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1014
        ].
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1015
    ].
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1016
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1017
    "Created: / 20-09-2006 / 14:30:37 / cg"
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1018
!
54d7a46631e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6832
diff changeset
  1019
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1020
namePatternsFor:namePatternArg ignoringCase:ignoringCase
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1021
    |namePattern|
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1022
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1023
    namePattern := namePatternArg.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1024
    namePattern size == 0 ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1025
        ^ nil
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1026
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1027
    ignoringCase ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1028
        namePattern := namePattern asLowercase
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
    ^ (namePattern asCollectionOfSubstringsSeparatedBy:$;)
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1031
        collect:[:each | each withoutSeparators].
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
    "Created: / 03-08-2011 / 18:19:20 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1034
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1035
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1036
removeFilesFromResultList:listOfFiles 
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1037
    |list|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1038
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  1039
    list := self shownList.
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1040
    (listOfFiles notEmptyOrNil) ifTrue:[
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1041
        listOfFiles reverseDo:[: key |
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1042
            list removeAtIndex:key
321c1729db5b initial checkin
penk
parents:
diff changeset
  1043
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1044
    ].
11474
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1045
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1046
    "Created: / 29-03-2012 / 10:04:58 / cg"
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1047
!
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1048
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1049
removeSelectedFilesFromResultList
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1050
    self removeFilesFromResultList:(self selectionHolder value)
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1051
99b9dcfbcc4a added: #removeFilesFromResultList:
Claus Gittinger <cg@exept.de>
parents: 11473
diff changeset
  1052
    "Modified: / 29-03-2012 / 10:05:11 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1053
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1054
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1055
showMatchedFiles:aBoolean
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1056
    aBoolean ifTrue:[
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  1057
        self shownListHolder valueHolder:(self matchedFilesList)
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1058
    ] ifFalse:[
5864
0338587f079e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  1059
        self shownListHolder valueHolder:(self resultList)
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1060
    ].
16826
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1061
!
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1062
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1063
touchAllFiles
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1064
    |files|
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1065
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1066
    files := self shownList copy.
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1067
    self touchFiles:files.
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1068
!
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1069
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1070
touchFiles:colOfFiles
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1071
    "touch current selected files/directories
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1072
    "
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1073
    colOfFiles asSet do:[:each |
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1074
        OperatingSystem executeCommand:('touch %1' bindWith:each asFilename pathName).
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1075
    ].
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1076
!
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1077
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1078
touchSelectedFiles
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1079
    |sel files|
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1080
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1081
    sel := self selectionHolder value.
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1082
    sel isEmptyOrNil ifTrue:[^ self].
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1083
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1084
    files := sel collect:[:idx | self shownList at:idx].
db04dc4aac2d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16810
diff changeset
  1085
    self touchFiles:files.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1086
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1087
12778
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1088
!FindFileApplication methodsFor:'actions-CVS'!
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1089
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1090
commitSelectedFilesToCVS
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1091
    |sel files|
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1092
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1093
    sel := self selectionHolder value.
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1094
    files := sel collect:[:idx | (self shownList at:idx) asFilename ].
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1095
    masterApplication commitFilesToCVS:files
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1096
!
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1097
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1098
deleteSelectedFilesAndCVSContainers
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1099
    |sel files|
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1100
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1101
    sel := self selectionHolder value.
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1102
    files := sel collect:[:idx | (self shownList at:idx) asFilename ].
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1103
    masterApplication removeFilesAndCVSContainers:files
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1104
! !
b7c50fd7cd7a class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12739
diff changeset
  1105
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1106
!FindFileApplication methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1107
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1108
canUseGrep
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1109
    "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
  1110
        - not under MSDOS
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1111
    "
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1112
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1113
    ^ 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
  1114
!
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1115
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1116
canUseLocate
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1117
    "locate command is much faster, but:
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1118
        - only if searching recursively,
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1119
        - no case ignore
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1120
        - no contents matching
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1121
    "
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1122
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1123
    ^ OperatingSystem isUNIXlike and:[ OperatingSystem canExecuteCommand:'locate' ]
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1124
!
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1125
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1126
contentsPatternHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1127
321c1729db5b initial checkin
penk
parents:
diff changeset
  1128
    contentsPatternHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1129
        contentsPatternHolder := nil asValue.
18630
4c8b4840e06b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18457
diff changeset
  1130
        self class searchStringHistory size ~~ 0 ifTrue:[
8330
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
  1131
            contentsPatternHolder value:(self class searchStringHistory first).    
f553e2e0442a search string history
Claus Gittinger <cg@exept.de>
parents: 7691
diff changeset
  1132
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1133
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1134
    ^ contentsPatternHolder.
18630
4c8b4840e06b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18457
diff changeset
  1135
4c8b4840e06b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18457
diff changeset
  1136
    "Modified: / 01-03-2019 / 15:43:39 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1137
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1138
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1139
enableFileSizeFilter
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1140
    enableFileSizeFilter isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1141
        enableFileSizeFilter := false asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1142
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1143
    ^ enableFileSizeFilter.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1144
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1145
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1146
enableFileSizeFilterAndNotSearchForSameContents
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1147
    ^ BlockValue forLogical:self notSearchForSameContents and:self enableFileSizeFilter
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1148
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1149
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1150
enableModificationTimeFilter
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1151
    enableModificationTimeFilter isNil ifTrue:[
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1152
        enableModificationTimeFilter := false asValue.
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1153
    ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1154
    ^ enableModificationTimeFilter.
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1155
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1156
    "Created: / 28-03-2012 / 23:11:58 / cg"
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1157
!
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1158
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1159
excludedNamePatternHolder
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1160
    excludedNamePatternHolder isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1161
        excludedNamePatternHolder := '' asValue.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1162
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1163
    ^ excludedNamePatternHolder.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1164
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1165
    "Created: / 03-08-2011 / 18:03:14 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1166
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1167
6330
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1168
fileSizeHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1169
    fileSizeHolder isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1170
        fileSizeHolder := 0 asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1171
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1172
    ^ fileSizeHolder.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1173
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1174
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1175
fileSizeOperatorHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1176
    fileSizeOperatorHolder isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1177
        fileSizeOperatorHolder := '>' asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1178
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1179
    ^ fileSizeOperatorHolder.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1180
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1181
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1182
fileSizeUnitHolder
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1183
    fileSizeUnitHolder isNil ifTrue:[
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1184
        fileSizeUnitHolder := 'b' asValue.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1185
    ].
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1186
    ^ fileSizeUnitHolder.
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1187
!
24949170ff90 size-search filter added
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  1188
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1189
ignoreCaseInContents
321c1729db5b initial checkin
penk
parents:
diff changeset
  1190
    ignoreCaseInContents isNil ifTrue:[
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1191
        ignoreCaseInContents := (LastSearchIgnoredCaseInContents notNil
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1192
                                    ifTrue:[ LastSearchIgnoredCaseInContents ]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1193
                                    ifFalse:[ TextView lastSearchIgnoredCase ? true]) asValue.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1194
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1195
    ^ ignoreCaseInContents.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1196
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1197
    "Modified: / 03-08-2011 / 18:05:02 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1198
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1199
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1200
ignoreCaseInExcludedName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1201
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1202
    ignoreCaseInExcludedName isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1203
        ignoreCaseInExcludedName := (LastSearchIgnoredCaseInExcludedFilename notNil 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1204
                                        ifTrue:[ LastSearchIgnoredCaseInExcludedFilename ]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1205
                                        ifFalse:[ OperatingSystem caseSensitiveFilenames not]) asValue.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1206
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1207
    ^ ignoreCaseInExcludedName.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1208
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1209
    "Created: / 03-08-2011 / 18:03:38 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1210
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1211
321c1729db5b initial checkin
penk
parents:
diff changeset
  1212
ignoreCaseInName
321c1729db5b initial checkin
penk
parents:
diff changeset
  1213
    ignoreCaseInName isNil ifTrue:[
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1214
        ignoreCaseInName := (LastSearchIgnoredCaseInFilename notNil
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1215
                                ifTrue:[LastSearchIgnoredCaseInFilename]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1216
                                ifFalse:[ OperatingSystem caseSensitiveFilenames not ]) asValue.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1217
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1218
    ^ ignoreCaseInName.
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1219
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1220
    "Modified (format): / 03-08-2011 / 18:05:49 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1221
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1222
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1223
ignoreCaseInNotContents
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1224
    ignoreCaseInNotContents isNil ifTrue:[
6442
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
  1225
        ignoreCaseInNotContents := (LastSearchIgnoredCaseInContents 
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
  1226
                                    ? TextView lastSearchIgnoredCase 
840b9ab17b66 case defaults
Claus Gittinger <cg@exept.de>
parents: 6355
diff changeset
  1227
                                    ? true) asValue.
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1228
    ].
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1229
    ^ ignoreCaseInNotContents.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1230
!
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1231
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1232
modificationTimeHolder
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1233
    modificationTimeHolder isNil ifTrue:[
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1234
        modificationTimeHolder := (Timestamp now subtractDays:1) asValue.
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1235
    ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1236
    ^ modificationTimeHolder.
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1237
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1238
    "Created: / 28-03-2012 / 23:08:25 / cg"
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1239
!
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1240
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1241
modificationTimeOperatorHolder
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1242
    modificationTimeOperatorHolder isNil ifTrue:[
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1243
        modificationTimeOperatorHolder := 'after' asValue.
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1244
        modificationTimeOperatorHolder onChangeSend:#modificationTimeOperatorChanged to:self.
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1245
    ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1246
    ^ modificationTimeOperatorHolder.
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1247
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1248
    "Created: / 28-03-2012 / 23:04:44 / cg"
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1249
!
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1250
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1251
modificationTimeOperatorIndexHolder
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1252
    modificationTimeOperatorIndexHolder isNil ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1253
        modificationTimeOperatorIndexHolder := 1 asValue.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1254
        modificationTimeOperatorIndexHolder onChangeSend:#modificationTimeOperatorChanged to:self.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1255
    ].
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1256
    ^ modificationTimeOperatorIndexHolder.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1257
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1258
    "Created: / 28-03-2012 / 23:04:44 / cg"
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1259
!
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1260
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1261
modificationTimeOperatorLabelList
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1262
    ^ self modificationTimeOperatorSpecList collect:#first
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1263
!
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1264
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1265
modificationTimeOperatorSpecList
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1266
    ^ #(
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1267
        ('before'   #before)
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1268
        ('after'    #after)
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1269
        ('in day'   #inDay)
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1270
        ('in month' #inMonth)
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1271
        ('in year'  #inYear)
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1272
    )
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1273
!
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1274
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1275
modificationTimeOperatorValueList
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1276
    ^ self modificationTimeOperatorSpecList collect:#second
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1277
!
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1278
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1279
namePatternHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1280
321c1729db5b initial checkin
penk
parents:
diff changeset
  1281
    namePatternHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1282
        namePatternHolder := '*' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1283
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1284
    ^ namePatternHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1285
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1286
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1287
notContentsPatternHolder
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1288
    notContentsPatternHolder isNil ifTrue:[
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1289
        notContentsPatternHolder := nil asValue.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1290
    ].
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1291
    ^ notContentsPatternHolder.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1292
!
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1293
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1294
notSearchForSameContents
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1295
    ^ BlockValue forLogicalNot:self searchForSameContents
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1296
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1297
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1298
notShowingMatchedFiles
5865
24bc1718c04f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5864
diff changeset
  1299
    ^ self shownList == self resultList
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1300
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1301
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1302
rememberInCache
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1303
    rememberInCache isNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1304
        rememberInCache := (LastRememberInCache ? false) asValue.
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1305
    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1306
    ^ rememberInCache.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1307
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1308
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1309
sameContentsAsHolder
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1310
    |sel|
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1311
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1312
    sameContentsAsHolder isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1313
        sameContentsAsHolder := ValueHolder new.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1314
        masterApplication notNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1315
            sel := masterApplication currentSelectedFiles.
18630
4c8b4840e06b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18457
diff changeset
  1316
            sel size ~~ 0 ifTrue:[
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1317
                sameContentsAsHolder value:(sel first asFilename pathName).
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1318
            ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1319
        ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1320
    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1321
    ^ sameContentsAsHolder.
18630
4c8b4840e06b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18457
diff changeset
  1322
4c8b4840e06b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18457
diff changeset
  1323
    "Modified: / 01-03-2019 / 15:43:43 / Claus Gittinger"
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1324
!
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1325
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1326
searchDirectories
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1327
    searchDirectories isNil ifTrue:[
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1328
        searchDirectories := false asValue.
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1329
    ].
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1330
    ^ searchDirectories.
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1331
!
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  1332
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1333
searchDirectoryHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1334
321c1729db5b initial checkin
penk
parents:
diff changeset
  1335
    searchDirectoryHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1336
        searchDirectoryHolder := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1337
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1338
    ^ searchDirectoryHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1339
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1340
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1341
searchForBinaryContentsHolder
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1342
    searchForBinaryContentsHolder isNil ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1343
        searchForBinaryContentsHolder := (LastSearchForBinaryContents ? false) asValue.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1344
    ].
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1345
    ^ searchForBinaryContentsHolder.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1346
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1347
    "Created: / 12-11-2017 / 17:35:56 / cg"
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1348
!
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1349
5743
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1350
searchForSameContents
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1351
    searchForSameContents isNil ifTrue:[
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1352
        searchForSameContents := false asValue.
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1353
    ].
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1354
    ^ searchForSameContents.
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1355
!
ab4c777f25f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5730
diff changeset
  1356
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1357
searchOnlyInCache
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1358
    searchOnlyInCache isNil ifTrue:[
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1359
        searchOnlyInCache := false asValue.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1360
    ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1361
    ^ searchOnlyInCache.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1362
!
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1363
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1364
showUnreadableFilesAndDirectoriesHolder
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1365
    showUnreadableFilesAndDirectoriesHolder isNil ifTrue:[
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1366
        showUnreadableFilesAndDirectoriesHolder := (LastShowUnreadableFilesAndDirectories ? false) asValue.
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1367
    ].
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1368
    ^ showUnreadableFilesAndDirectoriesHolder.
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1369
!
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1370
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1371
showingMatchedFiles
5865
24bc1718c04f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5864
diff changeset
  1372
    ^ self shownList == self matchedFilesList
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1373
!
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1374
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1375
useGrep
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1376
    useGrep isNil ifTrue:[
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1377
        useGrep := false asValue.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1378
    ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1379
    ^ useGrep.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1380
!
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1381
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1382
useLocate
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1383
    useLocate isNil ifTrue:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1384
        useLocate := false asValue.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1385
    ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1386
    ^ useLocate.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1387
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1388
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1389
!FindFileApplication methodsFor:'change & update'!
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1390
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1391
modificationTimeOperatorChanged
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1392
    |timeEditField converter realModel idx operator|
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1393
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1394
    timeEditField := (self componentAt:'ModifiedEntryField').
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1395
    converter := timeEditField model.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1396
    realModel := converter model.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1397
    self assert:(self modificationTimeHolder == realModel).
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1398
    idx := self modificationTimeOperatorIndexHolder value.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1399
    operator := self modificationTimeOperatorValueList at:idx.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1400
    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1401
    ((operator == #after) or:[operator = #before]) ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1402
        realModel setValue:(realModel value asTimestamp).    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1403
        converter timeOfClass:Timestamp withFormat:nil orDefault:Timestamp now    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1404
    ] ifFalse:[    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1405
        operator = #inDay ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1406
            realModel setValue:(realModel value asDate).    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1407
            converter timeOfClass:Date withFormat:'%y-%m-%d' orDefault:Date today    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1408
        ] ifFalse:[    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1409
            operator = #inMonth ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1410
                realModel setValue:(realModel value asDate).    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1411
                converter monthAndYear    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1412
            ] ifFalse:[    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1413
                operator = #inYear ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1414
                    realModel setValue:(realModel value asDate).    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1415
                    converter year    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1416
                ] ifFalse:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1417
                    self halt.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1418
                ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1419
            ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1420
        ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1421
    ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1422
    realModel changed.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1423
! !
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  1424
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1425
!FindFileApplication methodsFor:'private'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1426
321c1729db5b initial checkin
penk
parents:
diff changeset
  1427
changeExtentToSeeSearchResult
321c1729db5b initial checkin
penk
parents:
diff changeset
  1428
    
321c1729db5b initial checkin
penk
parents:
diff changeset
  1429
    | extent window|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1430
321c1729db5b initial checkin
penk
parents:
diff changeset
  1431
    expanded isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1432
        window := self builder window.
9536
ea60487ceeee changed: #changeExtentToSeeSearchResult
Claus Gittinger <cg@exept.de>
parents: 9475
diff changeset
  1433
        window notNil ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1434
            window := window topView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1435
            extent := window extent.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1436
            window extent:((extent x) @ (extent y + 300)).
321c1729db5b initial checkin
penk
parents:
diff changeset
  1437
            expanded := true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1438
            window containerChangedSize.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1439
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1440
    ].
9536
ea60487ceeee changed: #changeExtentToSeeSearchResult
Claus Gittinger <cg@exept.de>
parents: 9475
diff changeset
  1441
ea60487ceeee changed: #changeExtentToSeeSearchResult
Claus Gittinger <cg@exept.de>
parents: 9475
diff changeset
  1442
    "Modified: / 08-08-2010 / 14:42:40 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1443
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1444
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1445
!FindFileApplication methodsFor:'private - searching'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1446
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1447
cachedFileSizeOf:aFilenameString
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1448
    |cache cacheLine fileSize|
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1449
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1450
    cache := self contentsInfoCache.
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1451
    cache isNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1452
        fileSize := aFilenameString asFilename fileSize
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1453
    ] ifFalse:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1454
        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1455
            cacheLine := cache at:aFilenameString ifAbsent:nil.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1456
            cacheLine isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1457
                cache at:aFilenameString put:(cacheLine := Array new:2).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1458
            ] ifFalse:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1459
                fileSize := (cacheLine at:1).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1460
            ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1461
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1462
            fileSize isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1463
                fileSize := aFilenameString asFilename fileSize.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1464
                cacheLine at:1 put:fileSize.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1465
            ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1466
        ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1467
    ].
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1468
    ^ fileSize
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1469
!
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1470
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1471
cachedHashValueOfFile:aFilenameString
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1472
    |cache cacheLine hashValue|
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1473
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1474
    cache := self contentsInfoCache.
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1475
    cache isNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1476
        hashValue := MD5Stream hashValueOfFile:aFilenameString asFilename
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1477
    ] ifFalse:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1478
        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1479
            cacheLine := cache at:aFilenameString ifAbsent:nil.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1480
            cacheLine isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1481
                cache at:aFilenameString put:(Array new:2).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1482
            ] ifFalse:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1483
                hashValue := (cacheLine at:2).
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1484
            ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1485
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1486
            hashValue isNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1487
                hashValue := MD5Stream hashValueOfFile:aFilenameString asFilename.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1488
                cacheLine at:2 put:hashValue.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1489
            ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1490
        ].
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1491
    ].
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1492
    ^ hashValue
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1493
!
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1494
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1495
contentsInfoCache
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1496
    contentsInfoCache isNil ifTrue:[
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1497
        ContentsInfoCache isNil ifTrue:[
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1498
            ContentsInfoCache := Dictionary new.    
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1499
            ContentsInfoCacheAccessLock := Semaphore forMutualExclusion.
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1500
        ].
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1501
        contentsInfoCache := ContentsInfoCache
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1502
    ].
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  1503
    ^ contentsInfoCache
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1504
!
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1505
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1506
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
  1507
    containingString:contentsStringArg ignoreCaseInContents:ignCaseInContents 
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1508
    notContainingString:notContentsStringArg ignoreCaseInNotContents:ignCaseInNotContents 
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1509
    sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1510
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1511
    "/ only for backward compatibility...
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1512
    ^ self
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1513
        doFindFileNamed:namePatterns directories:searchDirectories ignoreCaseInName:ignCaseInName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1514
        excludeFilesNamed:'' ignoreCaseInExcludedName:false
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1515
        containingString:contentsStringArg ignoreCaseInContents:ignCaseInContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1516
        notContainingString:notContentsStringArg ignoreCaseInNotContents:ignCaseInNotContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1517
        sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1518
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1519
    "Modified: / 03-08-2011 / 18:16:42 / cg"
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1520
!
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1521
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1522
doFindFileNamed:namePatterns directories:searchDirectories ignoreCaseInName:ignCaseInName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1523
    excludeFilesNamed:excludedNamePatterns ignoreCaseInExcludedName:ignoreCaseInExcludedName
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1524
    containingString:contentsStringArg ignoreCaseInContents:ignCaseInContents 
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1525
    notContainingString:notContentsStringArg ignoreCaseInNotContents:ignCaseInNotContents 
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1526
    sameContentsAsFile:filenameToCompareContentsOrNil 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1527
    sameContentsAs:bytesToCompareContentsOrNil 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1528
    in:aDirectoryOrCollectionOfDirectories
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1529
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1530
    "the main workhorse for searching files.
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1531
     Creates optimized search blocks, depending on how we search,
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1532
     and passes these to the recursive directory walker.
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1533
     (got too big, and may need some splitting/refactoring"
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1534
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1535
    |theSingleDirectory lines contentsToCompare resultList inStream
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1536
     doesFileMatch contentsString notContentsString check checkNot 
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1537
     grepCommand nameMatch nameExcludedMatch realNameMatch 
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1538
     fileSizesToSearchFor filesToSearchFor fileMD5sToSearchFor 
18457
cd5d311f8b73 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18370
diff changeset
  1539
     setOfFilesToSearchFor remember cache fn easyCheck
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1540
     searchForBinaryContents|
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1541
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1542
    searchForBinaryContents := self searchForBinaryContentsHolder value.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1543
    
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1544
    (aDirectoryOrCollectionOfDirectories isFilename
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1545
    or:[aDirectoryOrCollectionOfDirectories isString]) ifTrue:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1546
        theSingleDirectory := aDirectoryOrCollectionOfDirectories asFilename
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1547
    ] ifFalse:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1548
        (aDirectoryOrCollectionOfDirectories size == 1) ifTrue:[
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1549
            theSingleDirectory := aDirectoryOrCollectionOfDirectories first asFilename
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1550
        ].
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1551
    ].
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1552
    
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1553
    "/ dir := aDirectory asFilename.
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1554
    contentsString := contentsStringArg.
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1555
    notContentsString := notContentsStringArg.
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1556
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1557
    searchForBinaryContents ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1558
        contentsString notEmptyOrNil ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1559
            contentsString := (contentsStringArg asCollectionOfWords 
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1560
                                    collect:[:s | Integer readFrom:s radix:16] as:ByteArray) asString.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1561
        ].
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1562
        notContentsString notEmptyOrNil ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1563
            notContentsString := (notContentsStringArg asCollectionOfWords 
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1564
                                    collect:[:s | Integer readFrom:s radix:16] as:ByteArray) asString.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1565
        ].
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1566
    ] ifFalse:[    
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1567
        (contentsString notEmptyOrNil and:[ ignCaseInContents ]) ifTrue:[ 
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1568
            contentsString := contentsString asLowercase
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1569
        ].
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1570
        (notContentsString notEmptyOrNil and:[ ignCaseInNotContents ]) ifTrue:[ 
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1571
            notContentsString := notContentsString asLowercase    
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1572
        ].
6183
e6d9cfbfb358 care for empty search-arguments
Michael Beyl <mb@exept.de>
parents: 6158
diff changeset
  1573
    ].
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1574
    filenameToCompareContentsOrNil notEmptyOrNil ifTrue:[
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1575
        fileSizesToSearchFor := OrderedCollection new.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1576
        filesToSearchFor := OrderedCollection new.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1577
        fileMD5sToSearchFor := OrderedCollection new.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1578
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1579
        filenameToCompareContentsOrNil includesMatchCharacters ifTrue:[
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1580
            |dir|
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1581
            
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1582
            dir := filenameToCompareContentsOrNil asFilename.
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1583
            [dir pathName includesMatchCharacters] whileTrue:[
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1584
                dir := dir directory
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1585
            ].
18457
cd5d311f8b73 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18370
diff changeset
  1586
            dir recursiveDirectoryContentsAsFilenamesDo:[:fn |
5770
2b3f1705ed84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5769
diff changeset
  1587
                (filenameToCompareContentsOrNil match:fn name) ifTrue:[
18457
cd5d311f8b73 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18370
diff changeset
  1588
                    fn isRegularFile ifTrue:[
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1589
                        fileSizesToSearchFor add:(self cachedFileSizeOf:fn).
5847
6ff1fce17ac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5844
diff changeset
  1590
                        filesToSearchFor add:(fn name).
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1591
                        fileMD5sToSearchFor add:(self cachedHashValueOfFile:fn).
5847
6ff1fce17ac4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5844
diff changeset
  1592
                    ]
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1593
                ]
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1594
            ].
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1595
        ] ifFalse:[
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1596
            fn := filenameToCompareContentsOrNil asFilename.
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1597
            fileSizesToSearchFor add:(self cachedFileSizeOf:fn).
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1598
            filesToSearchFor add:(fn pathName).
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1599
            fileMD5sToSearchFor add:(self cachedHashValueOfFile:fn).
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1600
        ].
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1601
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1602
        remember := LastRememberInCache := self rememberInCache value.
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1603
        remember ifTrue:[
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1604
            cache := self contentsInfoCache.
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1605
        ].
5866
d754a2b95e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5865
diff changeset
  1606
        setOfFilesToSearchFor := filesToSearchFor asSet.
d754a2b95e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5865
diff changeset
  1607
    ].    
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1608
    
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1609
"/    dirSearchedRelative := (dir name) copyFrom:(self searchDirectoryHolder value asString size + 1).
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1610
"/    dirSearchedRelative notEmpty ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1611
"/        self changeInformationTo:('Find File - searching %1' bindWith:dirSearchedRelative) toTab:false.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1612
"/    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1613
        self changeInformationTo:'Find File - searching' toTab:false.
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1614
"/    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1615
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1616
    resultList := self resultList.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1617
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1618
    filenameToCompareContentsOrNil notEmptyOrNil ifTrue:[
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1619
        doesFileMatch := 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1620
            [:f |
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1621
                |contentsMatches mustValidateExistance 
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1622
                 fileMD5 fileName fileSize cacheLine idxInList matchedFile|
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1623
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1624
                "/ contents compare ...
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1625
                contentsMatches := false.
5771
ba11ead45024 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1626
                fileName := f name.
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1627
                (setOfFilesToSearchFor includes:fileName) ifFalse:[
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1628
                    mustValidateExistance := false.
5856
68274991f212 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5851
diff changeset
  1629
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1630
                    cache notNil ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1631
                        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1632
                            cacheLine := cache at:fileName ifAbsent:nil.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1633
                            cacheLine notNil ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1634
                                fileSize := cacheLine at:1.    
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1635
                                fileMD5 := cacheLine at:2.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1636
                                mustValidateExistance := true.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1637
                            ].
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1638
                        ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1639
                    ].
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1640
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1641
                    fileSize isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1642
                        fileSize := f fileSize.
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1643
                    ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1644
                    remember ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1645
                        ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1646
                            cacheLine := cache at:fileName ifAbsentPut:[Array new:2].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1647
                            cacheLine at:1 put:fileSize.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1648
                        ]
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1649
                    ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1650
                    (idxInList := fileSizesToSearchFor indexOf:fileSize) ~~ 0 ifTrue:[
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1651
                        fileMD5 isNil ifTrue:[
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1652
                            OpenError handle:[:ex |
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1653
                                ObjectMemory garbageCollect.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1654
                                fileMD5 := MD5Stream hashValueOfFile:f.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1655
                            ] do:[
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1656
                                fileMD5 := MD5Stream hashValueOfFile:f.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1657
                            ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1658
                            remember ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1659
                                cacheLine at:2 put:fileMD5
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1660
                            ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1661
                        ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1662
                        contentsMatches := (fileMD5 = (fileMD5sToSearchFor at:idxInList)).
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1663
                        contentsMatches ifTrue:[
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1664
                            mustValidateExistance ifTrue:[
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1665
                                fileName asFilename exists ifFalse:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1666
                                    ContentsInfoCacheAccessLock critical:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1667
                                        cache removeKey:fileName.
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1668
                                    ].
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1669
                                    contentsMatches := false.
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1670
                                ].
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1671
                            ].
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1672
                            contentsMatches ifTrue:[
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1673
                                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
  1674
                                self matchedFilesList add:matchedFile.
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1675
                            ].
5850
9f217d207505 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5848
diff changeset
  1676
                        ].
5723
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1677
"/                        contentsToCompare isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1678
"/                            filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1679
"/                                contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1680
"/                            ]
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1681
"/                        ].
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1682
"/                        contentsToCompare isNil ifTrue:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1683
"/                            "/ too large - compare block-wise ...
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1684
"/                            contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f).
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1685
"/                        ] ifFalse:[
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1686
"/                            contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile).
dadcb827b659 more search
Claus Gittinger <cg@exept.de>
parents: 5677
diff changeset
  1687
"/                        ]
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1688
                    ].
5773
6c5f260f3a5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1689
                ] ifTrue:[
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1690
                    f isSymbolicLink ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1691
                        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
  1692
                    ]
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1693
                ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1694
                contentsMatches
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1695
            ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1696
    ] ifFalse:[
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1697
        (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
  1698
            doesFileMatch := [:f | true].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1699
        ] ifFalse:[
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1700
            searchForBinaryContents ifFalse:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1701
                (self canUseGrep and:[self useGrep value]) ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1702
                    (ignCaseInContents not and:[ignCaseInNotContents not]) ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1703
                        contentsString notEmptyOrNil ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1704
                            notContentsString notEmptyOrNil ifTrue:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1705
                                grepCommand := '(grep "',contentsString,'" %1) && (grep -v "',notContentsString,'" %1)'.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1706
                            ] ifFalse:[
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1707
                                grepCommand := 'grep "' , contentsString , '" %1'.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1708
                            ].
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1709
                        ] ifFalse:[
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1710
                            grepCommand := 'grep -v "' , notContentsString , '" %1'.
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1711
                        ].
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1712
                        doesFileMatch := [:f | |cmd ret|
18370
04c5fa4abafc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17894
diff changeset
  1713
                                                bytesSearchedCount := bytesSearchedCount + f fileSize.
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1714
                                                cmd := grepCommand bindWith:f pathName.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1715
                                                ret := OperatingSystem executeCommand:cmd.
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1716
                                                ret
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1717
                                         ].
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1718
                    ]
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1719
                ].
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1720
            ].
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1721
            
5601
08ab506e471d egrep search support
Claus Gittinger <cg@exept.de>
parents: 5600
diff changeset
  1722
            doesFileMatch isNil ifTrue:[
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1723
                contentsString notEmptyOrNil ifTrue:[
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1724
                    (searchForBinaryContents not and:[ignCaseInContents]) ifTrue:[
12339
4fb3104f0334 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 11474
diff changeset
  1725
                        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
  1726
                    ] ifFalse:[
12339
4fb3104f0334 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 11474
diff changeset
  1727
                        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
  1728
                    ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1729
                ].
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1730
                notContentsString notEmptyOrNil ifTrue:[
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1731
                    (searchForBinaryContents not and:[ignCaseInNotContents]) ifTrue:[
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1732
                        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
  1733
                    ] ifFalse:[
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1734
                        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
  1735
                    ].
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1736
                ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1737
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1738
                doesFileMatch := 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1739
                    [:f |
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1740
                        |realFile contentsMatches contentsNotMatches sz hugeFile bigFile isBadFile|
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1741
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1742
                        "/ string search ...
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1743
                        contentsMatches := true.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1744
                        (f exists and:[f isReadable]) ifFalse:[
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1745
                            showUnreadableFilesAndDirectoriesHolder value ifTrue:[
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  1746
                                resultList add: (('*** "',f pathName,'" skipped - unreadable or bad symbolic link ***') withColor:(Color darkRed)).
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1747
                            ].
13773
b4eb885ea9f0 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12778
diff changeset
  1748
                            contentsMatches := false.
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1749
                        ] ifTrue:[
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1750
                            isBadFile := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1751
                            realFile := f.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1752
                            f isSymbolicLink ifTrue:[ 
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1753
                                realFile := f linkInfo linkTargetPath asFilename. 
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1754
                                (realFile exists and:[realFile isReadable]) ifFalse:[
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1755
                                    showUnreadableFilesAndDirectoriesHolder value ifTrue:[
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  1756
                                        resultList add: (('*** "',f pathName,'"->"',realFile pathName,'" skipped - unreadable or bad symbolic link destination ***') withColor:(Color darkRed)).
13920
1929484021d8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13773
diff changeset
  1757
                                    ].
13773
b4eb885ea9f0 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12778
diff changeset
  1758
                                    contentsMatches := false.
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1759
                                    isBadFile := true.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1760
                                ].    
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1761
                            ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1762
                            isBadFile ifFalse:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1763
                                realFile isDirectory ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1764
                                    contentsMatches := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1765
                                ] ifFalse:[    
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1766
                                    sz := realFile fileSize.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1767
                                    sz isNil ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1768
                                        contentsMatches := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1769
                                    ] ifFalse:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1770
                                        hugeFile := (sz ? 0) > (4024*1024).
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1771
                                        bigFile := (sz ? 0) > (512*1024).
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1772
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1773
                                        hugeFile ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1774
                                            showUnreadableFilesAndDirectoriesHolder value ifTrue:[
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  1775
                                                resultList add: (('*** ' , f pathName , ' skipped - too large ***') withColor:(Color darkRed)).
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1776
                                            ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1777
                                            contentsMatches := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1778
                                        ] ifFalse:[
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1779
                                            Stream lineTooLongErrorSignal handle:[:ex |
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1780
                                                |cont|
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1781
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1782
            "/                                    "/ this typically happens, when a binary file is read linewise ...
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1783
                                                showUnreadableFilesAndDirectoriesHolder value ifTrue:[
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  1784
                                                    resultList add: (('*** ' , f pathName , ' skipped - binary/long line ***') withColor:(Color darkRed)).
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1785
                                                ].
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1786
                                                contentsMatches := false.
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1787
                                            ] do:[
18370
04c5fa4abafc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17894
diff changeset
  1788
                                                bytesSearchedCount := bytesSearchedCount + sz.
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1789
                                                bigFile ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1790
                                                    Stream lineTooLongErrorSignal handle:[:ex |
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1791
                                                        showUnreadableFilesAndDirectoriesHolder value ifTrue:[
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  1792
                                                            resultList add: (('*** ' , f pathName , ' skipped - too large ***') withColor:(Color darkRed)).
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1793
                                                        ].
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1794
                                                        contentsMatches := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1795
                                                    ] do:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1796
                                                        contentsMatches := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1797
                                                        (check == easyCheck 
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1798
                                                        and:[ realFile size < (128*1024) ]) ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1799
                                                            check notNil ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1800
                                                                contentsMatches := realFile contentsAsString includesString: contentsString caseSensitive:ignCaseInContents not.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1801
                                                                (contentsMatches and:[ checkNot notNil ]) ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1802
                                                                    contentsMatches := (realFile contentsAsString includesString: notContentsString caseSensitive:ignCaseInNotContents not) not.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1803
                                                                ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1804
                                                            ] ifFalse:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1805
                                                                checkNot notNil ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1806
                                                                    contentsMatches := (realFile contentsAsString includesString: notContentsString caseSensitive:ignCaseInNotContents not) not.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1807
                                                                ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1808
                                                            ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1809
                                                        ] ifFalse:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1810
                                                            contentsNotMatches := false.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1811
                                                            realFile readingFileDo:[:stream |
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1812
                                                                [contentsMatches or:[contentsNotMatches or:[stream atEnd]]] whileFalse:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1813
                                                                    |line|
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1814
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1815
                                                                    line := stream nextLine.
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1816
                                                                    check notNil ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1817
                                                                        contentsMatches := check value:line
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1818
                                                                    ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1819
                                                                    checkNot notNil ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1820
                                                                        contentsNotMatches := checkNot value:line
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1821
                                                                    ].
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1822
                                                                ]
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1823
                                                            ].
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1824
                                                        ].
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1825
                                                    ].
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1826
                                                ] ifFalse:[
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1827
                                                    lines := realFile contents ? #().
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1828
                                                    check notNil ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1829
                                                        contentsMatches := lines contains:check
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1830
                                                    ].
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1831
                                                    (contentsMatches and:[ checkNot notNil ]) ifTrue:[
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1832
                                                        contentsMatches := (lines contains:checkNot) not
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1833
                                                    ]
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1834
                                                ]
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1835
                                            ].
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1836
                                        ].    
15105
30559da8faf6 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15092
diff changeset
  1837
                                    ].
5231
d74730347ed8 added option to search for file NOT containing a string
Claus Gittinger <cg@exept.de>
parents: 5224
diff changeset
  1838
                                ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1839
                            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1840
                        ].
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1841
                        contentsMatches
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1842
                    ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1843
            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1844
        ].
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  1845
        doesFileMatch := self fileSizeWrapperFor:doesFileMatch.
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1846
    ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1847
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1848
    doesFileMatch := self modificationTimeWrapperFor:doesFileMatch.
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  1849
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1850
    namePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1851
        nameMatch := [:fn | true]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1852
    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1853
        ignCaseInName ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1854
            nameMatch := [:fn | namePatterns contains:[:aPattern | aPattern match:(fn asLowercase)]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1855
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1856
            nameMatch := [:fn | namePatterns contains:[:aPattern | aPattern match:fn]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1857
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1858
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1859
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1860
    excludedNamePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1861
        nameExcludedMatch := [:fn | true]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1862
    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1863
        ignoreCaseInExcludedName ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1864
            nameExcludedMatch := [:fn | excludedNamePatterns contains:[:aPattern | aPattern match:(fn asLowercase)]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1865
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1866
            nameExcludedMatch := [:fn | excludedNamePatterns contains:[:aPattern | aPattern match:fn]].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1867
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1868
    ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1869
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1870
    "/ combine
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1871
    namePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1872
        excludedNamePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1873
            realNameMatch := [:fn | true]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1874
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1875
            realNameMatch := [:fn | (nameExcludedMatch value:fn) not]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1876
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1877
    ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1878
        excludedNamePatterns isNil ifTrue:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1879
            realNameMatch := nameMatch
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1880
        ] ifFalse:[
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1881
            realNameMatch := [:fn | (nameMatch value:fn) and:[ (nameExcludedMatch value:fn) not ]]
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1882
        ].
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1883
    ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1884
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1885
    (self canUseLocate 
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1886
    and:[self useLocate value
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1887
    and:[searchDirectories not
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1888
    and:[theSingleDirectory notNil]]])
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1889
    ifTrue:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1890
        [
16639
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1891
            |updateInfo cmd line f|
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1892
16639
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1893
            updateInfo :=
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1894
                [
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1895
                    self 
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1896
                        changeInformationTo:('%1 found' bindWith:resultList size) 
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1897
                        toTab:false.
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1898
                ].
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1899
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1900
            self window shown ifTrue:[
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1901
                updateInfo value.
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1902
            ].
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1903
            
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1904
            cmd := 'locate '.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1905
            ignCaseInName ifTrue:[
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1906
                "/ cmd := cmd , '--ignore-case '
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1907
                cmd := cmd , '-i '
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1908
            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1909
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1910
            cmd := cmd , ((namePatterns 
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1911
                            collect:[:nm | '"',nm,'"'])
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  1912
                                asStringCollection asStringWith:Character space).
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1913
            inStream := PipeStream readingFrom:cmd inDirectory:theSingleDirectory.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1914
            [inStream atEnd] whileFalse:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1915
                line := inStream nextLine.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1916
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1917
                f := line asFilename.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1918
                (doesFileMatch value:f) ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1919
                    resultList add:line.
16639
629bf5cdd089 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16608
diff changeset
  1920
                    updateInfo value.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1921
                ]
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1922
            ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1923
        ] ensure:[
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1924
            inStream notNil ifTrue:[inStream close].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1925
        ].
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1926
        ^ self.
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  1927
    ].
12339
4fb3104f0334 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 11474
diff changeset
  1928
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1929
    bytesToCompareContentsOrNil notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1930
        contentsToCompare := bytesToCompareContentsOrNil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1931
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1932
12385
d2206a9da1c9 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12339
diff changeset
  1933
    filenameToCompareContentsOrNil notEmptyOrNil ifTrue:[
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1934
        self searchOnlyInCache value ifTrue:[
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1935
            cache notEmptyOrNil ifTrue:[
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1936
                cache keysAndValuesDo:[:fn :info |
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1937
                    |filesSize filesMD5 idxInList|
12339
4fb3104f0334 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 11474
diff changeset
  1938
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1939
                    filesSize := info at:1.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1940
                    filesSize isNil ifTrue:[
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1941
                        filesSize := fn asFilename fileSize.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1942
                        info at:1 put:filesSize.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1943
                    ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1944
                    (idxInList := fileSizesToSearchFor indexOf:filesSize) ~~ 0 ifTrue:[
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6183
diff changeset
  1945
                        (setOfFilesToSearchFor includes:fn) ifFalse:[
5729
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1946
                            fn asFilename exists ifFalse:[
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1947
                                info at:1 put:nil.    
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1948
                                info at:2 put:nil.    
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1949
                            ] ifTrue:[
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1950
                                filesMD5 := info at:2.
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1951
                                filesMD5 isNil ifTrue:[
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1952
                                    filesMD5 := MD5Stream hashValueOfFile:fn asFilename.
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1953
                                    info at:2 put:filesMD5.
752d89ffb83e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1954
                                ].
5768
18f6e4033412 multisearch
Claus Gittinger <cg@exept.de>
parents: 5767
diff changeset
  1955
                                filesMD5 = (fileMD5sToSearchFor at:idxInList) ifTrue:[
5859
c85f10082d25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  1956
                                    resultList add:fn.
5728
93ac88c7f87d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5727
diff changeset
  1957
                                ]
5727
2e272a545f8d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  1958
                            ]
5726
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1959
                        ]
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1960
                    ]
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1961
                ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1962
            ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1963
            ^ self.
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1964
        ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1965
    ].
464df1753187 fast cache search added
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1966
18370
04c5fa4abafc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17894
diff changeset
  1967
    filesSearchedCount := bytesSearchedCount := 0.
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1968
16574
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1969
    aDirectoryOrCollectionOfDirectories do:[:eachDir |
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1970
        self 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1971
            doFindFileNamed:namePatterns 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1972
            directories:searchDirectories
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1973
            nameMatch:realNameMatch 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1974
            contentsMatch:doesFileMatch 
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1975
            in:eachDir.
635deee55b29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16511
diff changeset
  1976
    ]
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1977
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  1978
    "Created: / 03-08-2011 / 18:16:02 / cg"
17751
79bd35bda2d9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17709
diff changeset
  1979
    "Modified: / 12-11-2017 / 17:50:01 / cg"
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  1980
    "Modified: / 13-03-2019 / 21:20:12 / Claus Gittinger"
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1981
!
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1982
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1983
doFindFileNamed:namePatterns directories:searchDirectories nameMatch:nameMatch contentsMatch:doesFileMatch in:aDirectory
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1984
    "the recursive walker. Searches for files matching namematch-block,
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1985
     and contents matching doesFileMatch-block"
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1986
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1987
    |dir subDirs list directoryContents updateInfo|
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1988
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  1989
    dir := aDirectory asFilename.
5844
11812dd2d7d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5811
diff changeset
  1990
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1991
    updateInfo :=
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1992
        [
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1993
            self 
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1994
                changeInformationTo:('%1 found - searching %2' 
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1995
                                        bindWith:resultList size
18709
259745978ab4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18675
diff changeset
  1996
                                        with:(((dir name) copyFrom:(self searchDirectoryHolder value asString size + 1))
259745978ab4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18675
diff changeset
  1997
                                                    contractTo:80)) 
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1998
                toTab:false.
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  1999
        ].
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  2000
14748
e6132b5f9f68 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 14064
diff changeset
  2001
    self window shown ifTrue:[
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  2002
        updateInfo value.
14748
e6132b5f9f68 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 14064
diff changeset
  2003
    ].
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2004
    list := self resultList.
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2005
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2006
    subDirs := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2007
4638
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  2008
    [
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  2009
        directoryContents := dir directoryContents.
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  2010
    ] on:FileStream openErrorSignal do:[:ex|
15660
252c9daa66e0 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15217
diff changeset
  2011
        self showUnreadableFilesAndDirectoriesHolder value ifTrue:[
18675
f7d7084c61cc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18630
diff changeset
  2012
            list add:((ex pathName , ' -> ' , ex description) withColor:Color darkRed).
15660
252c9daa66e0 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15217
diff changeset
  2013
        ].
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2014
        "/        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
  2015
        "/                        bindWith:ex parameter printString
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2016
        "/                        with:ex description) withCRs.
4638
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  2017
        ^ self
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  2018
    ].
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  2019
4638
79734f7bdfc4 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4518
diff changeset
  2020
    directoryContents sort do:[:fn |
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  2021
        |f isDirectory|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2022
321c1729db5b initial checkin
penk
parents:
diff changeset
  2023
        f := dir construct:fn.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  2024
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  2025
        isDirectory := f isDirectory.
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  2026
        isDirectory ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2027
            f isSymbolicLink ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2028
                subDirs add:f
321c1729db5b initial checkin
penk
parents:
diff changeset
  2029
            ]
4518
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  2030
        ].
85b13890d7b1 allow to search for directories
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  2031
        (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
  2032
            (nameMatch value:fn) ifTrue:[
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  2033
                filesSearchedCount := (filesSearchedCount ? 0) + 1.
18370
04c5fa4abafc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17894
diff changeset
  2034
                (isDirectory or:[ doesFileMatch value:f ]) ifTrue:[
15217
d815d45f3c53 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15214
diff changeset
  2035
                    updateInfo value.
5176
b76af7e92feb option to use locate for faster search
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  2036
                    list add:(f asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2037
                ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2038
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2039
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2040
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2041
321c1729db5b initial checkin
penk
parents:
diff changeset
  2042
    self searchRecursively value ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2043
        subDirs do:[:dir |
321c1729db5b initial checkin
penk
parents:
diff changeset
  2044
            self
321c1729db5b initial checkin
penk
parents:
diff changeset
  2045
                doFindFileNamed:namePatterns 
5600
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2046
                directories:searchDirectories 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2047
                nameMatch:nameMatch 
4e7bca968c09 findFile code cleanup (and speedup by factor of 2)
Claus Gittinger <cg@exept.de>
parents: 5557
diff changeset
  2048
                contentsMatch:doesFileMatch 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2049
                in:dir
321c1729db5b initial checkin
penk
parents:
diff changeset
  2050
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2051
    ]
10441
3238040023bb class definition
Claus Gittinger <cg@exept.de>
parents: 9536
diff changeset
  2052
15660
252c9daa66e0 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 15217
diff changeset
  2053
    "Modified: / 22-05-2015 / 11:42:17 / cg"
18709
259745978ab4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18675
diff changeset
  2054
    "Modified: / 23-03-2019 / 12:27:35 / Claus Gittinger"
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2055
!
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2056
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2057
fileSizeWrapperFor:aFileMatchBlock
17856
3cfbcdbab1ad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17855
diff changeset
  2058
    "possibly wrap the search-match block into a file-size matcher block"
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2059
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2060
    |fileSizeToCompare sizeMatch op compare|
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2061
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2062
    self enableFileSizeFilter value ifFalse:[ ^ aFileMatchBlock ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2063
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2064
    fileSizeToCompare := self fileSizeHolder value.
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2065
    op := self fileSizeOperatorHolder value withoutSeparators.
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2066
    op = '~' ifTrue:[
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2067
        compare := [:sz | sz between:(fileSizeToCompare*0.9) and:(fileSizeToCompare*1.1) ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2068
    ] ifFalse:[
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2069
        op := op asSymbol.
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2070
        compare := [:sz | sz perform:op with:fileSizeToCompare ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2071
    ].
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2072
17855
9122cdf37cfd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17751
diff changeset
  2073
    sizeMatch := [:f | compare value:(f fileSize ? 0) ].
11097
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2074
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2075
    ^ [:f | (sizeMatch value:f) and:[ aFileMatchBlock value:f ]]
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2076
0319362db871 refactored
Claus Gittinger <cg@exept.de>
parents: 11096
diff changeset
  2077
    "Created: / 11-01-2012 / 23:17:02 / cg"
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2078
!
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2079
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2080
modificationTimeWrapperFor:aFileMatchBlock
17856
3cfbcdbab1ad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17855
diff changeset
  2081
    "possibly wrap the search-match block into a modification time matcher block"
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2082
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2083
    |timeToCompare timeMatch idx op compare|
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2084
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2085
    self enableModificationTimeFilter value ifFalse:[ ^ aFileMatchBlock ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2086
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2087
    timeToCompare := self modificationTimeHolder value.
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2088
    idx := self modificationTimeOperatorIndexHolder value.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2089
    op := self modificationTimeOperatorValueList at:idx.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2090
    op = #after ifTrue:[
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2091
        compare := [:t | t > timeToCompare ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2092
    ] ifFalse:[
16810
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2093
        op = #before ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2094
            compare := [:t | t < timeToCompare ].
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2095
        ] ifFalse:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2096
            op = #inDay ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2097
                timeToCompare := timeToCompare asDate.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2098
                compare := [:t | t asDate = timeToCompare ].
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2099
            ] ifFalse:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2100
                op = #inMonth ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2101
                    timeToCompare := timeToCompare asDate.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2102
                    compare := [:t | t month = timeToCompare month
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2103
                                     and:[t year = timeToCompare year] ].
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2104
                ] ifFalse:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2105
                    op = #inYear ifTrue:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2106
                        timeToCompare := timeToCompare asDate.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2107
                        compare := [:t | t year = timeToCompare year ].
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2108
                    ] ifFalse:[
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2109
                        self halt.
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2110
                    ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2111
                ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2112
            ].    
dee205471698 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 16639
diff changeset
  2113
        ].
11473
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2114
    ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2115
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2116
    timeMatch := [:f | 
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2117
                    |t| 
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2118
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2119
                    t := f modificationTime. 
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2120
                    t notNil and:[ compare value:t ]
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2121
                 ].
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2122
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2123
    ^ [:f | (timeMatch value:f) and:[ aFileMatchBlock value:f ]]
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2124
2d838f1ab6e3 class definition
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
  2125
    "Created: / 28-03-2012 / 23:18:32 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2126
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2127
321c1729db5b initial checkin
penk
parents:
diff changeset
  2128
!FindFileApplication methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2129
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  2130
getTabValueString
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  2131
    "the item shown in a tab (not language translated)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2132
7691
6ff02cb42c55 code cleanup
Claus Gittinger <cg@exept.de>
parents: 7688
diff changeset
  2133
    ^ self fileName directory baseName
7688
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  2134
9f592c9a86db code cleanup
Claus Gittinger <cg@exept.de>
parents: 7574
diff changeset
  2135
    "Created: / 01-03-2007 / 21:39:54 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2136
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2137
321c1729db5b initial checkin
penk
parents:
diff changeset
  2138
!FindFileApplication methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2139
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2140
initialize
17368
2065f601f1ea #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16965
diff changeset
  2141
    <modifier: #super> "must be called if redefined"
2065f601f1ea #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16965
diff changeset
  2142
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2143
    super initialize.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2144
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2145
    self enableStop value:false.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2146
    self enableSearch value:true.
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2147
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2148
    "Created: / 12-01-2012 / 01:38:29 / cg"
17368
2065f601f1ea #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16965
diff changeset
  2149
    "Modified: / 08-02-2017 / 00:27:53 / cg"
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2150
!
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2151
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4798
diff changeset
  2152
item:anItem
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2153
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  2154
    |file newPattern|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2155
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4798
diff changeset
  2156
    super item:anItem.
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  2157
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2158
    file := self fileName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2159
    self searchDirectoryHolder value:(self getDirWithoutFileName:file).
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  2160
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2161
    file isDirectory ifTrue:[
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  2162
        newPattern := '*'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2163
    ] ifFalse:[
12739
5dfe43fb5704 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12494
diff changeset
  2164
        anItem suffix isEmptyOrNil ifTrue:[
5dfe43fb5704 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12494
diff changeset
  2165
            newPattern := '*'.
5dfe43fb5704 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12494
diff changeset
  2166
        ] ifFalse:[
5dfe43fb5704 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12494
diff changeset
  2167
            newPattern := '*.', anItem suffix.
5dfe43fb5704 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 12494
diff changeset
  2168
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2169
    ].
4797
6e16a84c6bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4638
diff changeset
  2170
    self namePatternHolder value:newPattern.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2171
    ^ true.
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2172
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2173
    "Modified: / 12-01-2012 / 01:38:14 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2174
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2175
321c1729db5b initial checkin
penk
parents:
diff changeset
  2176
postOpenWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  2177
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2178
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2179
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2180
    findFileView := aBuilder window.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2181
    self windowGroup addPreEventHook:self.
6633
6843fedf7516 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6583
diff changeset
  2182
    super postOpenWith:aBuilder.
11101
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2183
34affbf84319 refactored
Claus Gittinger <cg@exept.de>
parents: 11097
diff changeset
  2184
    "Modified (format): / 12-01-2012 / 01:40:44 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2185
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2186
321c1729db5b initial checkin
penk
parents:
diff changeset
  2187
release
321c1729db5b initial checkin
penk
parents:
diff changeset
  2188
    self stopSearchTask.
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  2189
    contentsInfoCache := nil.
14064
7aa0a1075ee8 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 13920
diff changeset
  2190
    super release
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2191
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2192
321c1729db5b initial checkin
penk
parents:
diff changeset
  2193
!FindFileApplication class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2194
321c1729db5b initial checkin
penk
parents:
diff changeset
  2195
version
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  2196
    ^ '$Header$'
9036
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  2197
!
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  2198
9242245f6689 no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents: 8613
diff changeset
  2199
version_CVS
16186
aa2cd75d6b8d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15660
diff changeset
  2200
    ^ '$Header$'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2201
! !
12339
4fb3104f0334 class: FindFileApplication
Claus Gittinger <cg@exept.de>
parents: 11474
diff changeset
  2202