DirectoryView.st
author Claus Gittinger <cg@exept.de>
Fri, 04 Sep 1998 13:31:11 +0200
changeset 979 2ee26d9ee7c4
parent 878 a00ba144e64f
child 991 9454c462dad4
permissions -rw-r--r--
tuned #readDirectory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
     1
"
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
2137dff405f0 initial checkin
tz
parents:
diff changeset
     4
2137dff405f0 initial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
2137dff405f0 initial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
2137dff405f0 initial checkin
tz
parents:
diff changeset
     7
 inclusion of the above copyright notice. This software may not
2137dff405f0 initial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
2137dff405f0 initial checkin
tz
parents:
diff changeset
     9
 other person. No title to or ownership of the software is
2137dff405f0 initial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
2137dff405f0 initial checkin
tz
parents:
diff changeset
    11
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    12
2137dff405f0 initial checkin
tz
parents:
diff changeset
    13
2137dff405f0 initial checkin
tz
parents:
diff changeset
    14
ApplicationModel subclass:#DirectoryView
2137dff405f0 initial checkin
tz
parents:
diff changeset
    15
	instanceVariableNames:'directory selectedFileFilter readTask monitoring
2137dff405f0 initial checkin
tz
parents:
diff changeset
    16
		monitoringTimeBlock fileDoubleClickAction fileSelectAction
2137dff405f0 initial checkin
tz
parents:
diff changeset
    17
		fileFilterSelectAction fileAttributes'
2137dff405f0 initial checkin
tz
parents:
diff changeset
    18
	classVariableNames:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    19
	poolDictionaries:''
620
03e969ddd336 class category changed
tz
parents: 614
diff changeset
    20
	category:'Interface-Support'
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    21
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    22
2137dff405f0 initial checkin
tz
parents:
diff changeset
    23
Object subclass:#FileRow
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
    24
	instanceVariableNames:'fileName size modified iconKey imageFromFile group owner
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
    25
		permissions baseName'
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    26
	classVariableNames:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    27
	poolDictionaries:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    28
	privateIn:DirectoryView
2137dff405f0 initial checkin
tz
parents:
diff changeset
    29
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    30
2137dff405f0 initial checkin
tz
parents:
diff changeset
    31
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    32
2137dff405f0 initial checkin
tz
parents:
diff changeset
    33
copyright
2137dff405f0 initial checkin
tz
parents:
diff changeset
    34
"
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    35
 COPYRIGHT (c) 1997 by eXept Software AG
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    36
              All Rights Reserved
2137dff405f0 initial checkin
tz
parents:
diff changeset
    37
2137dff405f0 initial checkin
tz
parents:
diff changeset
    38
 This software is furnished under a license and may be used
2137dff405f0 initial checkin
tz
parents:
diff changeset
    39
 only in accordance with the terms of that license and with the
2137dff405f0 initial checkin
tz
parents:
diff changeset
    40
 inclusion of the above copyright notice. This software may not
2137dff405f0 initial checkin
tz
parents:
diff changeset
    41
 be provided or otherwise made available to, or used by, any
2137dff405f0 initial checkin
tz
parents:
diff changeset
    42
 other person. No title to or ownership of the software is
2137dff405f0 initial checkin
tz
parents:
diff changeset
    43
 hereby transferred.
2137dff405f0 initial checkin
tz
parents:
diff changeset
    44
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    45
2137dff405f0 initial checkin
tz
parents:
diff changeset
    46
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    47
2137dff405f0 initial checkin
tz
parents:
diff changeset
    48
documentation
2137dff405f0 initial checkin
tz
parents:
diff changeset
    49
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    50
    documentation to be added.
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    51
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    52
    [author:]
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    53
        Thomas Zwick
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    54
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    55
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
    56
2137dff405f0 initial checkin
tz
parents:
diff changeset
    57
!DirectoryView class methodsFor:'instance creation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    58
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    59
openOnDirectory: aDirectoryString
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    60
    "open a DirectoryView for a aDirectoryString"
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    61
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    62
    ^ (self new directory: aDirectoryString) open
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    63
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    64
    "
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    65
     self openOnDirectory: '/etc'
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    66
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    67
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    68
    "Modified: / 28.1.1998 / 15:44:53 / stefan"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    69
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
    70
2137dff405f0 initial checkin
tz
parents:
diff changeset
    71
!DirectoryView class methodsFor:'interface specs'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    72
823
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    73
windowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    74
    "This resource specification was automatically generated
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    75
     by the UIPainter of ST/X."
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    76
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    77
    "Do not manually edit this!! If it is corrupted,
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    78
     the UIPainter may not be able to read the specification."
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    79
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    80
    "
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    81
     UIPainter new openOnClass:DirectoryView andSelector:#windowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    82
     DirectoryView new openInterface:#windowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    83
     DirectoryView open
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    84
    "
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    85
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    86
    <resource: #canvas>
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    87
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    88
    ^
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    89
     
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    90
       #(#FullSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    91
          #window: 
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    92
           #(#WindowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    93
              #name: 'Directory View'
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    94
              #layout: #(#LayoutFrame 412 0 367 0 811 0 666 0)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    95
              #label: 'Directory View'
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    96
              #min: #(#Point 10 10)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    97
              #max: #(#Point 1152 900)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    98
              #bounds: #(#Rectangle 412 367 812 667)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    99
              #usePreferredExtent: false
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   100
          )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   101
          #component: 
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   102
           #(#SpecCollection
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   103
              #collection: 
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   104
               #(
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   105
                 #(#DataSetSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   106
                    #name: 'filesDataSetView'
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   107
                    #layout: #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   108
                    #model: #selectionOfFile
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   109
                    #hasHorizontalScrollBar: true
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   110
                    #hasVerticalScrollBar: true
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   111
                    #miniScrollerHorizontal: true
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   112
                    #dataList: #listOfFiles
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   113
                    #useIndex: false
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   114
                    #doubleClickSelector: #fileDoubleClicked
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   115
                    #columnHolder: #fileAttributeColumns
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   116
                    #valueChangeSelector: #fileSelected
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   117
                    #verticalSpacing: 1
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   118
                )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   119
                 #(#ComboBoxSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   120
                    #name: 'formatComboBox'
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   121
                    #layout: #(#LayoutFrame 63 0.0 0 0 0 1.0 22 0)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   122
                    #model: #selectionOfFileFilter
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   123
                    #immediateAccept: false
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   124
                    #acceptOnTab: false
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   125
                    #comboList: #listOfFileFilters
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   126
                )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   127
                 #(#LabelSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   128
                    #name: 'filterLabel'
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   129
                    #layout: #(#LayoutFrame 0 0 0 0 62 0 22 0)
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   130
                    #label: 'Filter: '
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   131
                    #adjust: #right
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   132
                )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   133
              )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   134
          )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   135
      )
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   136
! !
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   137
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   138
!DirectoryView class methodsFor:'list specs'!
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   139
820
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   140
tableColumnsForFileAttributes
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   141
    "This resource specification was automatically generated
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   142
     by the DataSetBuilder of ST/X."
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   143
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   144
    "Do not manually edit this!! If it is corrupted,
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   145
     the DataSetBuilder may not be able to read the specification."
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   146
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   147
    "
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   148
     DataSetBuilder new openOnClass:DirectoryView andSelector:#tableColumnsForFileAttributes
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   149
    "
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   150
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   151
    <resource: #tableColumns>
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   152
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   153
820
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   154
    ^ #(
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   155
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   156
           #label: ''
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   157
           #width: 30
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   158
           #height: 22
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   159
           #printSelector: #iconOn:
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   160
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   161
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   162
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   163
           #label: 'File name'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   164
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   165
           #minWidth: 150
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   166
           #model: #baseName
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   167
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   168
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   169
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   170
           #label: 'Size'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   171
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   172
           #width: 70
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   173
           #model: #size
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   174
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   175
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   176
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   177
           #label: 'Modified'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   178
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   179
           #model: #modified
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   180
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   181
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   182
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   183
           #label: 'Permissions'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   184
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   185
           #width: 85
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   186
           #model: #permissions
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   187
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   188
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   189
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   190
           #label: 'Owner'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   191
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   192
           #width: 50
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   193
           #model: #owner
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   194
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   195
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   196
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   197
           #label: 'Group'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   198
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   199
           #width: 50
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   200
           #model: #group
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   201
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   202
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   203
     )
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   204
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   205
2137dff405f0 initial checkin
tz
parents:
diff changeset
   206
!DirectoryView methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   207
2137dff405f0 initial checkin
tz
parents:
diff changeset
   208
directory: aDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   209
2137dff405f0 initial checkin
tz
parents:
diff changeset
   210
    directory := aDirectory asFilename asAbsoluteFilename name
2137dff405f0 initial checkin
tz
parents:
diff changeset
   211
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   212
2137dff405f0 initial checkin
tz
parents:
diff changeset
   213
fileAttributes: anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   214
2137dff405f0 initial checkin
tz
parents:
diff changeset
   215
    fileAttributes := anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   216
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   217
2137dff405f0 initial checkin
tz
parents:
diff changeset
   218
fileDoubleClickAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   219
2137dff405f0 initial checkin
tz
parents:
diff changeset
   220
    fileDoubleClickAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   221
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   222
2137dff405f0 initial checkin
tz
parents:
diff changeset
   223
fileFilterSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   224
2137dff405f0 initial checkin
tz
parents:
diff changeset
   225
    fileFilterSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   226
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   227
2137dff405f0 initial checkin
tz
parents:
diff changeset
   228
fileSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   229
2137dff405f0 initial checkin
tz
parents:
diff changeset
   230
    fileSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   231
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   232
2137dff405f0 initial checkin
tz
parents:
diff changeset
   233
listOfFileFilters: aCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   234
2137dff405f0 initial checkin
tz
parents:
diff changeset
   235
    self listOfFileFilters contents: aCollection.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   236
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   237
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   238
2137dff405f0 initial checkin
tz
parents:
diff changeset
   239
monitoring: aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   240
2137dff405f0 initial checkin
tz
parents:
diff changeset
   241
    aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   242
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   243
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   244
        monitoringTimeBlock := [self readDirectory].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   245
        self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   246
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   247
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   248
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   249
        monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   250
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   251
            Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   252
            monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   253
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   254
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   255
2137dff405f0 initial checkin
tz
parents:
diff changeset
   256
    monitoring := aBoolean.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   257
2137dff405f0 initial checkin
tz
parents:
diff changeset
   258
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   259
2137dff405f0 initial checkin
tz
parents:
diff changeset
   260
!DirectoryView methodsFor:'aspects'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   261
2137dff405f0 initial checkin
tz
parents:
diff changeset
   262
fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   263
2137dff405f0 initial checkin
tz
parents:
diff changeset
   264
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   265
    (holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   266
        |fileAttributeColumns|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   267
        builder aspectAt:#fileAttributeColumns put:(holder := List new).
820
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   268
        fileAttributeColumns := self class tableColumnsForFileAttributes collect: [:i| i decodeAsLiteralArray].
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   269
        holder add: fileAttributeColumns first.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   270
        fileAttributeColumns do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   271
        [:col|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   272
            (fileAttributes includes: col label) ifTrue: [holder add: col]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   273
        ].
591
efb80a288277 labels inseted
tz
parents: 590
diff changeset
   274
        holder do: [:col| col label: ' ', col label]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   275
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   276
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   277
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   278
2137dff405f0 initial checkin
tz
parents:
diff changeset
   279
listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   280
2137dff405f0 initial checkin
tz
parents:
diff changeset
   281
    |holder|          
2137dff405f0 initial checkin
tz
parents:
diff changeset
   282
    (holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   283
        builder aspectAt:#listOfFileFilters put:(holder :=  List with: '*').
2137dff405f0 initial checkin
tz
parents:
diff changeset
   284
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   285
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   286
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   287
2137dff405f0 initial checkin
tz
parents:
diff changeset
   288
listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   289
2137dff405f0 initial checkin
tz
parents:
diff changeset
   290
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   291
    (holder := builder bindingAt:#listOfFiles) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   292
        builder aspectAt:#listOfFiles put:(holder :=  List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   293
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   294
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   295
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   296
2137dff405f0 initial checkin
tz
parents:
diff changeset
   297
selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   298
2137dff405f0 initial checkin
tz
parents:
diff changeset
   299
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   300
    (holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   301
        builder aspectAt:#selectionOfFile put:(holder :=  ValueHolder new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   302
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   303
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   304
2137dff405f0 initial checkin
tz
parents:
diff changeset
   305
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   306
2137dff405f0 initial checkin
tz
parents:
diff changeset
   307
selectionOfFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   308
2137dff405f0 initial checkin
tz
parents:
diff changeset
   309
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   310
    (holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   311
        builder aspectAt:#selectionOfFileFilter put:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   312
        (holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   313
        selectedFileFilter := '*'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   314
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   315
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   316
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   317
2137dff405f0 initial checkin
tz
parents:
diff changeset
   318
!DirectoryView methodsFor:'callbacks'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   319
2137dff405f0 initial checkin
tz
parents:
diff changeset
   320
fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   321
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   322
    (fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   323
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   324
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   325
        fileDoubleClickAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   326
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   327
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   328
            fileDoubleClickAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   329
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   330
        fileDoubleClickAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   331
        ifTrue:
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   332
        [                
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   333
            fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   334
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   335
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   336
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   337
2137dff405f0 initial checkin
tz
parents:
diff changeset
   338
fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   339
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   340
    (fileSelectAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   341
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   342
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   343
        fileSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   344
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   345
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   346
            fileSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   347
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   348
        fileSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   349
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   350
        [
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   351
            fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   352
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   353
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   354
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   355
2137dff405f0 initial checkin
tz
parents:
diff changeset
   356
!DirectoryView methodsFor:'initialization'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   357
2137dff405f0 initial checkin
tz
parents:
diff changeset
   358
initialize
2137dff405f0 initial checkin
tz
parents:
diff changeset
   359
2137dff405f0 initial checkin
tz
parents:
diff changeset
   360
    super initialize.
874
ab93fcd829c5 create builder
Claus Gittinger <cg@exept.de>
parents: 828
diff changeset
   361
    self createBuilder.
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   362
2137dff405f0 initial checkin
tz
parents:
diff changeset
   363
    directory :=  directory ? '.' asFilename asAbsoluteFilename directoryName.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   364
    monitoring := false.
593
17f3d679fa72 better size info
tz
parents: 591
diff changeset
   365
    fileAttributes := #('File name' 'Size' 'Modified').
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   366
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   367
874
ab93fcd829c5 create builder
Claus Gittinger <cg@exept.de>
parents: 828
diff changeset
   368
    "Modified: / 20.6.1998 / 14:46:10 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   369
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   370
2137dff405f0 initial checkin
tz
parents:
diff changeset
   371
!DirectoryView methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   372
2137dff405f0 initial checkin
tz
parents:
diff changeset
   373
readDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   374
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   375
    |allFiles foundFiles filterList dir|    
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   376
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   377
    allFiles := Set new.
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   378
    foundFiles := Set new.
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   379
    filterList := self listOfFileFilters value.
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   380
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   381
    Cursor wait showWhile: 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   382
    [ 
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   383
        (dir := DirectoryContents directoryNamed: directory) notNil ifTrue:[
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   384
"/            dir filesAndBasenamesDo:[:file :name|      
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   385
"/                filterList do:[:filter|
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   386
"/                    ((filter match:name) and:[(foundFiles includes: name) not])
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   387
"/                    ifTrue:[
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   388
"/                        foundFiles add: name
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   389
"/                    ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   390
"/                ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   391
"/            ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   392
            dir filesAndBasenamesDo:[:file :name|      
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   393
                allFiles add: name
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   394
            ].
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   395
            filterList do:[:filter|
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   396
                foundFiles addAll:(allFiles select:[:name | filter match:name]).
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   397
            ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   398
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   399
            foundFiles := foundFiles asOrderedCollection sort.
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   400
            dir := directory asFilename.
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   401
            self listOfFiles contents: (foundFiles collect:[:name| FileRow new fileName:(dir construct:name)])
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   402
        ]
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   403
    ]
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   404
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   405
    "Modified: / 18.5.1998 / 13:02:47 / cg"
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   406
!
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   407
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   408
readMonitoringDirectory
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   409
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   410
    |readBlock|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   411
    readTask notNil ifTrue: [readTask terminate].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   412
    readBlock :=
2137dff405f0 initial checkin
tz
parents:
diff changeset
   413
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   414
        |dir currentFilenames oldListOfFiles|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   415
        dir := directory asFilename.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   416
        currentFilenames := OrderedCollection new.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   417
        (dir isReadable and:[dir isExecutable]) ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   418
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   419
            self listOfFileFilters value do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   420
            [:filter|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   421
                (dir filesMatchingWithoutDotDirs: filter) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   422
                [:aFileName|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   423
                    |file|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   424
                    (file := dir construct: aFileName) isDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   425
                    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   426
                    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   427
                        currentFilenames add: file
2137dff405f0 initial checkin
tz
parents:
diff changeset
   428
                    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   429
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   430
            ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   431
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   432
        oldListOfFiles := self listOfFiles copy.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   433
        (currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet do: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   434
        [:fileName| 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   435
            (oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   436
            ifTrue:                                                                             
2137dff405f0 initial checkin
tz
parents:
diff changeset
   437
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   438
                |nearestFileRow r|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   439
                nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   440
                nearestFileRow = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   441
                ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   442
                ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   443
                monitoring ifTrue: [self selectionOfFile value: r].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   444
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   445
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   446
        self listOfFiles reverseDo:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   447
        [:fileRow|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   448
            (currentFilenames includes: fileRow fileName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   449
            ifFalse: [self listOfFiles remove: fileRow]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   450
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   451
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   452
2137dff405f0 initial checkin
tz
parents:
diff changeset
   453
    monitoring
2137dff405f0 initial checkin
tz
parents:
diff changeset
   454
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   455
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   456
        readTask := readBlock forkAt: Processor userBackgroundPriority.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   457
        Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   458
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   459
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   460
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   461
        Cursor wait showWhile: [readBlock value]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   462
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   463
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   464
2137dff405f0 initial checkin
tz
parents:
diff changeset
   465
!DirectoryView methodsFor:'selection'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   466
2137dff405f0 initial checkin
tz
parents:
diff changeset
   467
selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   468
2137dff405f0 initial checkin
tz
parents:
diff changeset
   469
    ^selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   470
2137dff405f0 initial checkin
tz
parents:
diff changeset
   471
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   472
2137dff405f0 initial checkin
tz
parents:
diff changeset
   473
selectedFileFilter: aString
2137dff405f0 initial checkin
tz
parents:
diff changeset
   474
2137dff405f0 initial checkin
tz
parents:
diff changeset
   475
    aString size = 0 ifTrue: [self listOfFileFilters remove: selectedFileFilter ifAbsent: nil].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   476
    selectedFileFilter := aString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   477
    (self listOfFileFilters includes: selectedFileFilter) not &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   478
    selectedFileFilter notEmpty
2137dff405f0 initial checkin
tz
parents:
diff changeset
   479
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   480
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   481
        self listOfFileFilters addFirst: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   482
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   483
    (self listOfFileFilters includes: selectedFileFilter) &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   484
    fileFilterSelectAction notNil 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   485
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   486
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   487
        fileFilterSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   488
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   489
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   490
            fileFilterSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   491
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   492
        fileFilterSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   493
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   494
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   495
            fileFilterSelectAction value: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   496
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   497
    ].       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   498
    self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   499
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   500
2137dff405f0 initial checkin
tz
parents:
diff changeset
   501
!DirectoryView methodsFor:'startup / release'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   502
2137dff405f0 initial checkin
tz
parents:
diff changeset
   503
closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   504
2137dff405f0 initial checkin
tz
parents:
diff changeset
   505
    self release.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   506
2137dff405f0 initial checkin
tz
parents:
diff changeset
   507
    super closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   508
2137dff405f0 initial checkin
tz
parents:
diff changeset
   509
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   510
2137dff405f0 initial checkin
tz
parents:
diff changeset
   511
release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   512
2137dff405f0 initial checkin
tz
parents:
diff changeset
   513
    monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   514
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   515
        Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   516
        monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   517
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   518
2137dff405f0 initial checkin
tz
parents:
diff changeset
   519
    super release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   520
2137dff405f0 initial checkin
tz
parents:
diff changeset
   521
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   522
2137dff405f0 initial checkin
tz
parents:
diff changeset
   523
!DirectoryView::FileRow class methodsFor:'resources'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   524
2137dff405f0 initial checkin
tz
parents:
diff changeset
   525
HFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   526
2137dff405f0 initial checkin
tz
parents:
diff changeset
   527
    ^self hFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   528
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   529
2137dff405f0 initial checkin
tz
parents:
diff changeset
   530
MakefileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   531
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   532
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   533
    ImageEditor openOnClass:self andSelector:#MakefileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   534
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   535
2137dff405f0 initial checkin
tz
parents:
diff changeset
   536
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   537
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   538
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   539
        constantNamed:#'DirectoryView::FileRow MakefileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   540
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 @@0)IV0/U$0)]&0)UT;)UV4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   541
2137dff405f0 initial checkin
tz
parents:
diff changeset
   542
binaryFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   543
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   544
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   545
    ImageEditor openOnClass:self andSelector:#binaryFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   546
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   547
2137dff405f0 initial checkin
tz
parents:
diff changeset
   548
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   549
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   550
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   551
        constantNamed:#'DirectoryView::FileRow binaryFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   552
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???3 @_7 @W4#&S0&6Q0&6_3&6O5&6@0#&@9 @@0&\@2&6@0&6@0&6@1&6@8&\@0 @@0???0???1'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   553
2137dff405f0 initial checkin
tz
parents:
diff changeset
   554
cFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   555
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   556
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   557
    ImageEditor openOnClass:self andSelector:#cFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   558
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   559
2137dff405f0 initial checkin
tz
parents:
diff changeset
   560
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   561
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   562
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   563
        constantNamed:#'DirectoryView::FileRow cFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   564
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 \@0 "@0  @0  @0&"@;&\@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   565
2137dff405f0 initial checkin
tz
parents:
diff changeset
   566
exeFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   567
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   568
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   569
    ImageEditor openOnClass:self andSelector:#exeFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   570
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   571
2137dff405f0 initial checkin
tz
parents:
diff changeset
   572
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   573
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   574
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   575
        constantNamed:#'DirectoryView::FileRow exeFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   576
        ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU@@@@UUT@@@AEUP@@@DEU@@@@PETEUUUUUPZ**)UUAUUUUATG???4EP_???PUA???=ATG???4EP_???PUA???=ATEUUUTEP@@@@@U@@@@@AUUUUUUUUUUUUUTb'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color red:0.0 green:49.9977 blue:49.9977)); at:4 put:((Color grey:66.9978)); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   577
2137dff405f0 initial checkin
tz
parents:
diff changeset
   578
fileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   579
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   580
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   581
    ImageEditor openOnClass:self andSelector:#fileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   582
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   583
2137dff405f0 initial checkin
tz
parents:
diff changeset
   584
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   585
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   586
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   587
        constantNamed:#'DirectoryView::FileRow fileIcon'
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   588
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 @@0 @@0 @@0 @@0 @@; @@4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   589
2137dff405f0 initial checkin
tz
parents:
diff changeset
   590
hFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   591
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   592
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   593
    ImageEditor openOnClass:self andSelector:#hFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   594
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   595
2137dff405f0 initial checkin
tz
parents:
diff changeset
   596
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   597
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   598
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   599
        constantNamed:#'DirectoryView::FileRow hFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   600
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8  @0  @0 ,@0 2@0 "@0 "@0&"@;&"@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   601
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   602
htmlFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   603
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   604
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   605
    ImageEditor openOnClass:self andSelector:#htmlFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   606
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   607
2137dff405f0 initial checkin
tz
parents:
diff changeset
   608
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   609
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   610
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   611
        constantNamed:#'DirectoryView::FileRow htmlFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   612
        ifAbsentPut:[(Depth4Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'DQDQDQDQDQDQDQ????????DQDQD_???????1@QDQG???L3L3<P@QDQ??L3ADL3D@@QD_?3L0P3L1DQDQG?L3MCP3L1DQDQ?3QCQCMCP??1D_<4P4QDL4O?<QG?L4QDL3MD??DQ?3L3QCL3PO?1D_<3L4QDL4O?<QG?<3QDQCMO??DQ??L4QDP4S??1D_??=D@@S???<QG???????????DQ???????????1DQDQDQDQDQDQDQDQDQDQDQDQDQDP@a') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9977 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9977 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9977); add:(Color red:0.0 green:49.9977 blue:49.9977); add:(Color red:49.9977 green:49.9977 blue:0.0); add:(Color red:49.9977 green:0.0 blue:49.9977); add:(Color grey:49.9977); add:(Color grey:66.9978); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   613
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   614
imageFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   615
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   616
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   617
    ImageEditor openOnClass:self andSelector:#imageFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   618
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   619
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   620
    <resource: #image>
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   621
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   622
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   623
        constantNamed:#'DirectoryView::FileRow imageFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   624
        ifAbsentPut:[(Depth4Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@DQDQDQDQ@@@@@ADQDQDQDPD@@@@QDQDQDQDAD@@@DQDQDQDQ@QD@@ADQDQDQDP@@@@@TQG]4)G50@@@@EDQ7^$+W4QDP@AQD]7R$_WDQD@@SL6Y#$61!!DQ@@D3M&ZS''F0QDP@AL3Y&NS[FDQD@@RH%UR %-QDQ@@D"IUVB"5,QDP@AH"UUJBV5DQD@@QDQDQDQDQDQ@@DQDQDQDQDQDP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9977 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9977 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9977); add:(Color red:0.0 green:49.9977 blue:49.9977); add:(Color red:49.9977 green:49.9977 blue:0.0); add:(Color red:49.9977 green:0.0 blue:49.9977); add:(Color grey:49.9977); add:(Color grey:66.9978); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   625
2137dff405f0 initial checkin
tz
parents:
diff changeset
   626
imgFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   627
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   628
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   629
    ImageEditor openOnClass:self andSelector:#imgFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   630
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   631
2137dff405f0 initial checkin
tz
parents:
diff changeset
   632
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   633
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   634
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   635
        constantNamed:#'DirectoryView::FileRow imgFileIcon'
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   636
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8  @0 @@0!!-F0 **0 **0 **0&**;&*&4 @B0 @N0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   637
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   638
2137dff405f0 initial checkin
tz
parents:
diff changeset
   639
linkedFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   640
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   641
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   642
    ImageEditor openOnClass:self andSelector:#linkedFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   643
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   644
2137dff405f0 initial checkin
tz
parents:
diff changeset
   645
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   646
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   647
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   648
        constantNamed:#'DirectoryView::FileRow linkedFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   649
        ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU@@@@UUT@@@AEUP@@@DEU@@@@PET@@@AUUP@@@AUU@@@@@AT@@@@ EP@@@B U@@@**!!T@@J**EP@B B UB*(@HATJ*@@@EP@@@@@U@@@@@AUUUUUUUUUUUUUTb') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   650
2137dff405f0 initial checkin
tz
parents:
diff changeset
   651
lockedFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   652
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   653
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   654
    ImageEditor openOnClass:self andSelector:#lockedFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   655
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   656
2137dff405f0 initial checkin
tz
parents:
diff changeset
   657
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   658
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   659
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   660
        constantNamed:#'DirectoryView::FileRow lockedFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   661
        ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU(@@@UUT(@@AEUP(@@DEU@(@@PET@(@IUUP@(B!!UU@@((@AT@@*@@EP@B(@@U@@((@AT@J@(@EPB @(@U@(@@(ATJ@@@(ER @@@(U(@@@@)UUUUUUUUUUUUUTb') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   662
2137dff405f0 initial checkin
tz
parents:
diff changeset
   663
protoFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   664
2137dff405f0 initial checkin
tz
parents:
diff changeset
   665
    ^self MakefileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   666
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   667
2137dff405f0 initial checkin
tz
parents:
diff changeset
   668
rcFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   669
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   670
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   671
    ImageEditor openOnClass:self andSelector:#rcFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   672
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   673
2137dff405f0 initial checkin
tz
parents:
diff changeset
   674
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   675
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   676
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   677
        constantNamed:#'DirectoryView::FileRow rcFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   678
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 ) 0 2P0 "@0 "@0&"P;&!! 4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   679
2137dff405f0 initial checkin
tz
parents:
diff changeset
   680
sFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   681
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   682
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   683
    ImageEditor openOnClass:self andSelector:#sFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   684
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   685
2137dff405f0 initial checkin
tz
parents:
diff changeset
   686
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   687
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   688
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   689
        constantNamed:#'DirectoryView::FileRow sFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   690
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 X@0  @0 0@0 X@0&H@;&0@4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   691
2137dff405f0 initial checkin
tz
parents:
diff changeset
   692
stFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   693
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   694
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   695
    ImageEditor openOnClass:self andSelector:#stFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   696
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   697
2137dff405f0 initial checkin
tz
parents:
diff changeset
   698
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   699
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   700
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   701
        constantNamed:#'DirectoryView::FileRow stFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   702
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 A@0 A@0 [00 !!@0 1@0 Y@0&I@;&004 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   703
2137dff405f0 initial checkin
tz
parents:
diff changeset
   704
stcFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   705
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   706
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   707
    ImageEditor openOnClass:self andSelector:#stcFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   708
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   709
2137dff405f0 initial checkin
tz
parents:
diff changeset
   710
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   711
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   712
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   713
        constantNamed:#'DirectoryView::FileRow stcFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   714
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 B@0 B@0 _L0 "R0 2P0 ZP0&JR;&3L4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! !
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   715
2137dff405f0 initial checkin
tz
parents:
diff changeset
   716
!DirectoryView::FileRow methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   717
2137dff405f0 initial checkin
tz
parents:
diff changeset
   718
baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   719
2137dff405f0 initial checkin
tz
parents:
diff changeset
   720
    ^baseName ? (baseName := fileName baseName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   721
2137dff405f0 initial checkin
tz
parents:
diff changeset
   722
2137dff405f0 initial checkin
tz
parents:
diff changeset
   723
2137dff405f0 initial checkin
tz
parents:
diff changeset
   724
2137dff405f0 initial checkin
tz
parents:
diff changeset
   725
2137dff405f0 initial checkin
tz
parents:
diff changeset
   726
2137dff405f0 initial checkin
tz
parents:
diff changeset
   727
2137dff405f0 initial checkin
tz
parents:
diff changeset
   728
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   729
2137dff405f0 initial checkin
tz
parents:
diff changeset
   730
fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   731
2137dff405f0 initial checkin
tz
parents:
diff changeset
   732
    ^fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   733
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   734
2137dff405f0 initial checkin
tz
parents:
diff changeset
   735
fileName: aFileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   736
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   737
    fileName := aFileName
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   738
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   739
2137dff405f0 initial checkin
tz
parents:
diff changeset
   740
group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   741
2137dff405f0 initial checkin
tz
parents:
diff changeset
   742
    ^group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   743
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   744
2137dff405f0 initial checkin
tz
parents:
diff changeset
   745
iconOn:aGC
2137dff405f0 initial checkin
tz
parents:
diff changeset
   746
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   747
    |icon|
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   748
    iconKey isNil 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   749
    ifTrue: 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   750
    [
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   751
        self validateAttributes.
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   752
        (imageFromFile isNil and: [iconKey == #imageFileIcon])
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   753
            ifTrue:  [icon := self retrieveImageFromFileAndRegisterOn: aGC]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   754
    ].
645
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   755
    imageFromFile == true
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   756
        ifFalse: [icon := aGC registerImage: (self class perform: iconKey) key: iconKey]
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   757
        ifTrue:  [icon := aGC registeredImageAt: iconKey].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   758
    ^icon
645
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   759
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   760
    "Modified: / 18.2.1998 / 18:01:52 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   761
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   762
2137dff405f0 initial checkin
tz
parents:
diff changeset
   763
modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   764
2137dff405f0 initial checkin
tz
parents:
diff changeset
   765
    ^modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   766
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   767
2137dff405f0 initial checkin
tz
parents:
diff changeset
   768
owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   769
2137dff405f0 initial checkin
tz
parents:
diff changeset
   770
    ^owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   771
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   772
2137dff405f0 initial checkin
tz
parents:
diff changeset
   773
permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   774
2137dff405f0 initial checkin
tz
parents:
diff changeset
   775
    ^permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   776
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   777
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   778
retrieveImageFromFileAndRegisterOn: aGC
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   779
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   780
    |image|
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   781
    imageFromFile := false.       
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   782
    (image := aGC registeredImageAt: fileName name asSymbol) isNil
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   783
    ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   784
    [            
878
a00ba144e64f checkin from browser
tz
parents: 874
diff changeset
   785
        size < 5000
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   786
        ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   787
        [     
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   788
            Object errorSignal handle: [:ex|]
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   789
            do:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   790
            [   
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   791
                (image := Image fromFile: fileName name) notNil
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   792
                ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   793
                [
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   794
                    image extent y > 22
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   795
                    ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   796
                    [         
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   797
                        image := image magnifiedBy: 22/image extent y
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   798
                    ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   799
                    image := aGC registerImage: image key: fileName name asSymbol.
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   800
                ]
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   801
            ] 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   802
        ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   803
    ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   804
    image notNil ifTrue: [imageFromFile := true. iconKey := fileName name asSymbol].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   805
    ^image
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   806
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   807
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   808
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   809
!
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   810
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   811
size
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   812
    size isNumber ifFalse:[^ size].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   813
    size < 1000        ifTrue: [^ size printString].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   814
    size < (100*1024)  ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   815
    size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   816
    ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb'
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   817
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   818
    "Modified: / 6.2.1998 / 03:38:45 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   819
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   820
2137dff405f0 initial checkin
tz
parents:
diff changeset
   821
!DirectoryView::FileRow methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   822
2137dff405f0 initial checkin
tz
parents:
diff changeset
   823
validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   824
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   825
    |info mode| 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   826
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   827
    permissions := String new:9 withAll:$-.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   828
2137dff405f0 initial checkin
tz
parents:
diff changeset
   829
    (info := fileName info) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   830
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   831
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   832
        iconKey := #lockedFileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   833
        size    := owner := group := '?'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   834
      ^ self
2137dff405f0 initial checkin
tz
parents:
diff changeset
   835
    ].        
2137dff405f0 initial checkin
tz
parents:
diff changeset
   836
    size   := info size.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   837
    modified := info modified printString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   838
    owner  := OperatingSystem getUserNameFromID: info uid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   839
    group  := OperatingSystem getGroupNameFromID: info gid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   840
    mode   := info mode.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   841
2137dff405f0 initial checkin
tz
parents:
diff changeset
   842
    1 to:9 by:3 do:[:i|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   843
        #((0 $x) (1 $w) (2 $r)) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   844
        [:m|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   845
            (mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   846
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   847
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   848
2137dff405f0 initial checkin
tz
parents:
diff changeset
   849
    fileName isReadable
2137dff405f0 initial checkin
tz
parents:
diff changeset
   850
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   851
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   852
        info type == #symbolicLink
2137dff405f0 initial checkin
tz
parents:
diff changeset
   853
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   854
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   855
            ^iconKey := #linkedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   856
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   857
        ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   858
        [       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   859
            ((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol))
2137dff405f0 initial checkin
tz
parents:
diff changeset
   860
            or:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   861
            [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)])
2137dff405f0 initial checkin
tz
parents:
diff changeset
   862
            ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   863
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   864
                iconKey := #fileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   865
                (Image isImageFileSuffix:fileName suffix)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   866
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   867
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   868
                    ^iconKey := #imageFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   869
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   870
                (fileName suffix = 'o') | (fileName suffix = 'so')
2137dff405f0 initial checkin
tz
parents:
diff changeset
   871
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   872
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   873
                    ^iconKey := #binaryFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   874
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   875
2137dff405f0 initial checkin
tz
parents:
diff changeset
   876
                fileName isExecutableProgram
2137dff405f0 initial checkin
tz
parents:
diff changeset
   877
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   878
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   879
                    ^iconKey := #exeFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   880
                ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   881
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   882
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   883
    ] 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   884
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   885
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   886
        ^iconKey := #lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   887
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   888
2137dff405f0 initial checkin
tz
parents:
diff changeset
   889
2137dff405f0 initial checkin
tz
parents:
diff changeset
   890
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   891
2137dff405f0 initial checkin
tz
parents:
diff changeset
   892
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   893
2137dff405f0 initial checkin
tz
parents:
diff changeset
   894
version
2137dff405f0 initial checkin
tz
parents:
diff changeset
   895
    ^ '$Header$'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   896
! !