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