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