DirectoryView.st
author ca
Wed, 22 Apr 1998 15:58:26 +0200
changeset 803 19e0367ee9d6
parent 652 75644c11d619
child 820 e967a1359d77
permissions -rw-r--r--
change label from: HTML Browser to HTML View
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
2137dff405f0 initial checkin
tz
parents:
diff changeset
    73
windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    74
    "this window spec was automatically generated by the ST/X UIPainter"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    75
2137dff405f0 initial checkin
tz
parents:
diff changeset
    76
    "do not manually edit this - the painter/builder may not be able to
2137dff405f0 initial checkin
tz
parents:
diff changeset
    77
     handle the specification if its corrupted."
2137dff405f0 initial checkin
tz
parents:
diff changeset
    78
2137dff405f0 initial checkin
tz
parents:
diff changeset
    79
    "
2137dff405f0 initial checkin
tz
parents:
diff changeset
    80
     UIPainter new openOnClass:DirectoryView andSelector:#windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    81
     DirectoryView new openInterface:#windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    82
    "
2137dff405f0 initial checkin
tz
parents:
diff changeset
    83
    "DirectoryView open"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    84
2137dff405f0 initial checkin
tz
parents:
diff changeset
    85
    <resource: #canvas>
2137dff405f0 initial checkin
tz
parents:
diff changeset
    86
2137dff405f0 initial checkin
tz
parents:
diff changeset
    87
    ^
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    88
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    89
       #(#FullSpec
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    90
          #window: 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    91
           #(#WindowSpec
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    92
              #name: 'Directory View'
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    93
              #layout: #(#LayoutFrame 34 0 350 0 433 0 649 0)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    94
              #label: 'Directory View'
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    95
              #min: #(#Point 10 10)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    96
              #max: #(#Point 1152 900)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    97
              #bounds: #(#Rectangle 34 350 434 650)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
    98
              #usePreferredExtent: false
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    99
          )
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   100
          #component: 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   101
           #(#SpecCollection
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   102
              #collection: 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   103
               #(
2137dff405f0 initial checkin
tz
parents:
diff changeset
   104
                 #(#DataSetSpec
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   105
                    #name: 'filesDataSetView'
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   106
                    #layout: #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   107
                    #model: #selectionOfFile
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   108
                    #hasHorizontalScrollBar: true
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   109
                    #hasVerticalScrollBar: true
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   110
                    #miniScrollerHorizontal: true
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   111
                    #dataList: #listOfFiles
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   112
                    #useIndex: false
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   113
                    #doubleClickSelector: #fileDoubleClicked
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   114
                    #columnHolder: #fileAttributeColumns
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   115
                    #valueChangeSelector: #fileSelected
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   116
                    #verticalSpacing: 1
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   117
                )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   118
                 #(#ComboBoxSpec
652
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   119
                    #name: 'formatComboBox'
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   120
                    #layout: #(#LayoutFrame 63 0.0 0 0 0 1.0 22 0)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   121
                    #model: #selectionOfFileFilter
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   122
                    #immediateAccept: false
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   123
                    #acceptOnTab: false
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   124
                    #comboList: #listOfFileFilters
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   125
                )
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   126
                 #(#LabelSpec
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   127
                    #name: 'label1'
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   128
                    #layout: #(#LayoutFrame 0 0 0 0 62 0 22 0)
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   129
                    #label: 'Filter: '
75644c11d619 label 'Filter:' added to avoid using as file name input field
tz
parents: 645
diff changeset
   130
                    #adjust: #right
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   131
                )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   132
              )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   133
          )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   134
      )
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   135
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   136
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   137
2137dff405f0 initial checkin
tz
parents:
diff changeset
   138
windowSpecOfFileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   139
2137dff405f0 initial checkin
tz
parents:
diff changeset
   140
    ^
2137dff405f0 initial checkin
tz
parents:
diff changeset
   141
     #(
2137dff405f0 initial checkin
tz
parents:
diff changeset
   142
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   143
          #'label:' ''
2137dff405f0 initial checkin
tz
parents:
diff changeset
   144
          #'width:' 30
2137dff405f0 initial checkin
tz
parents:
diff changeset
   145
          #'height:' 22
2137dff405f0 initial checkin
tz
parents:
diff changeset
   146
          #'printSelector:' #'iconOn:'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   147
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   148
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   149
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   150
          #'label:' 'File name'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   151
          #'labelAlignment:' #left
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   152
          #'minWidth:' 150
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   153
          #'model:' #baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   154
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   155
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   156
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   157
          #'label:' 'Size'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   158
          #'labelAlignment:' #left
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   159
          #'width:' 70
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   160
          #'model:' #size
2137dff405f0 initial checkin
tz
parents:
diff changeset
   161
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   162
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   163
       #(#DataSetColumnSpec
593
17f3d679fa72 better size info
tz
parents: 591
diff changeset
   164
          #'label:' 'Modified'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   165
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   166
          #'model:' #modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   167
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   168
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   169
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   170
          #'label:' 'Permissions'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   171
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   172
          #'width:' 85
2137dff405f0 initial checkin
tz
parents:
diff changeset
   173
          #'model:' #permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   174
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   175
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   176
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   177
          #'label:' 'Owner'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   178
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   179
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   180
          #'model:' #owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   181
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   182
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   183
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   184
          #'label:' 'Group'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   185
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   186
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   187
          #'model:' #group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   188
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   189
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   190
    )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   191
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   192
    "Modified: / 6.2.1998 / 03:40:16 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   193
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   194
2137dff405f0 initial checkin
tz
parents:
diff changeset
   195
!DirectoryView methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   196
2137dff405f0 initial checkin
tz
parents:
diff changeset
   197
directory: aDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   198
2137dff405f0 initial checkin
tz
parents:
diff changeset
   199
    directory := aDirectory asFilename asAbsoluteFilename name
2137dff405f0 initial checkin
tz
parents:
diff changeset
   200
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   201
2137dff405f0 initial checkin
tz
parents:
diff changeset
   202
fileAttributes: anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   203
2137dff405f0 initial checkin
tz
parents:
diff changeset
   204
    fileAttributes := anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   205
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   206
2137dff405f0 initial checkin
tz
parents:
diff changeset
   207
fileDoubleClickAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   208
2137dff405f0 initial checkin
tz
parents:
diff changeset
   209
    fileDoubleClickAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   210
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   211
2137dff405f0 initial checkin
tz
parents:
diff changeset
   212
fileFilterSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   213
2137dff405f0 initial checkin
tz
parents:
diff changeset
   214
    fileFilterSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   215
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   216
2137dff405f0 initial checkin
tz
parents:
diff changeset
   217
fileSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   218
2137dff405f0 initial checkin
tz
parents:
diff changeset
   219
    fileSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   220
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   221
2137dff405f0 initial checkin
tz
parents:
diff changeset
   222
listOfFileFilters: aCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   223
2137dff405f0 initial checkin
tz
parents:
diff changeset
   224
    self listOfFileFilters contents: aCollection.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   225
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   226
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   227
2137dff405f0 initial checkin
tz
parents:
diff changeset
   228
monitoring: aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   229
2137dff405f0 initial checkin
tz
parents:
diff changeset
   230
    aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   231
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   232
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   233
        monitoringTimeBlock := [self readDirectory].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   234
        self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   235
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   236
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   237
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   238
        monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   239
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   240
            Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   241
            monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   242
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   243
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   244
2137dff405f0 initial checkin
tz
parents:
diff changeset
   245
    monitoring := aBoolean.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   246
2137dff405f0 initial checkin
tz
parents:
diff changeset
   247
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   248
2137dff405f0 initial checkin
tz
parents:
diff changeset
   249
!DirectoryView methodsFor:'aspects'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   250
2137dff405f0 initial checkin
tz
parents:
diff changeset
   251
fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   252
2137dff405f0 initial checkin
tz
parents:
diff changeset
   253
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   254
    (holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   255
        |fileAttributeColumns|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   256
        builder aspectAt:#fileAttributeColumns put:(holder := List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   257
        fileAttributeColumns := self class windowSpecOfFileAttributeColumns collect: [:i| i decodeAsLiteralArray].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   258
        holder add: fileAttributeColumns first.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   259
        fileAttributeColumns do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   260
        [:col|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   261
            (fileAttributes includes: col label) ifTrue: [holder add: col]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   262
        ].
591
efb80a288277 labels inseted
tz
parents: 590
diff changeset
   263
        holder do: [:col| col label: ' ', col label]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   264
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   265
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   266
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   267
2137dff405f0 initial checkin
tz
parents:
diff changeset
   268
listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   269
2137dff405f0 initial checkin
tz
parents:
diff changeset
   270
    |holder|          
2137dff405f0 initial checkin
tz
parents:
diff changeset
   271
    (holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   272
        builder aspectAt:#listOfFileFilters put:(holder :=  List with: '*').
2137dff405f0 initial checkin
tz
parents:
diff changeset
   273
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   274
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   275
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   276
2137dff405f0 initial checkin
tz
parents:
diff changeset
   277
listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   278
2137dff405f0 initial checkin
tz
parents:
diff changeset
   279
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   280
    (holder := builder bindingAt:#listOfFiles) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   281
        builder aspectAt:#listOfFiles put:(holder :=  List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   282
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   283
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   284
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   285
2137dff405f0 initial checkin
tz
parents:
diff changeset
   286
selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   287
2137dff405f0 initial checkin
tz
parents:
diff changeset
   288
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   289
    (holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   290
        builder aspectAt:#selectionOfFile put:(holder :=  ValueHolder new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   291
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   292
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   293
2137dff405f0 initial checkin
tz
parents:
diff changeset
   294
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   295
2137dff405f0 initial checkin
tz
parents:
diff changeset
   296
selectionOfFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   297
2137dff405f0 initial checkin
tz
parents:
diff changeset
   298
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   299
    (holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   300
        builder aspectAt:#selectionOfFileFilter put:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   301
        (holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   302
        selectedFileFilter := '*'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   303
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   304
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   305
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   306
2137dff405f0 initial checkin
tz
parents:
diff changeset
   307
!DirectoryView methodsFor:'callbacks'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   308
2137dff405f0 initial checkin
tz
parents:
diff changeset
   309
fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   310
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   311
    (fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   312
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   313
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   314
        fileDoubleClickAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   315
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   316
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   317
            fileDoubleClickAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   318
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   319
        fileDoubleClickAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   320
        ifTrue:
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   321
        [                
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   322
            fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   323
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   324
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   325
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   326
2137dff405f0 initial checkin
tz
parents:
diff changeset
   327
fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   328
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   329
    (fileSelectAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   330
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   331
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   332
        fileSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   333
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   334
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   335
            fileSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   336
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   337
        fileSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   338
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   339
        [
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   340
            fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   341
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   342
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   343
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   344
2137dff405f0 initial checkin
tz
parents:
diff changeset
   345
!DirectoryView methodsFor:'initialization'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   346
2137dff405f0 initial checkin
tz
parents:
diff changeset
   347
initialize
2137dff405f0 initial checkin
tz
parents:
diff changeset
   348
2137dff405f0 initial checkin
tz
parents:
diff changeset
   349
    super initialize.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   350
2137dff405f0 initial checkin
tz
parents:
diff changeset
   351
    directory :=  directory ? '.' asFilename asAbsoluteFilename directoryName.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   352
    monitoring := false.
593
17f3d679fa72 better size info
tz
parents: 591
diff changeset
   353
    fileAttributes := #('File name' 'Size' 'Modified').
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   354
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   355
2137dff405f0 initial checkin
tz
parents:
diff changeset
   356
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   357
2137dff405f0 initial checkin
tz
parents:
diff changeset
   358
!DirectoryView methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   359
2137dff405f0 initial checkin
tz
parents:
diff changeset
   360
readDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   361
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   362
    |foundFiles list|    
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   363
    foundFiles := OrderedCollection new.
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   364
    list := self listOfFileFilters value.
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   365
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   366
    Cursor wait showWhile: 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   367
    [ 
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   368
        (DirectoryContents directoryNamed: directory) filesAndBasenamesDo: 
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   369
        [:file :name|      
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   370
            list do:
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   371
            [:filter|
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   372
                ((filter match: name) and: [(foundFiles includes: file) not])
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   373
                ifTrue:
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   374
                [
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   375
                    foundFiles add: file
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   376
                ].
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   377
            ].
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   378
        ].
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   379
        self listOfFiles contents: (foundFiles collect: [:file| FileRow new fileName: file])
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   380
    ]
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   381
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   382
!
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   383
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   384
readMonitoringDirectory
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   385
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   386
    |readBlock|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   387
    readTask notNil ifTrue: [readTask terminate].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   388
    readBlock :=
2137dff405f0 initial checkin
tz
parents:
diff changeset
   389
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   390
        |dir currentFilenames oldListOfFiles|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   391
        dir := directory asFilename.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   392
        currentFilenames := OrderedCollection new.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   393
        (dir isReadable and:[dir isExecutable]) ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   394
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   395
            self listOfFileFilters value do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   396
            [:filter|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   397
                (dir filesMatchingWithoutDotDirs: filter) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   398
                [:aFileName|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   399
                    |file|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   400
                    (file := dir construct: aFileName) isDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   401
                    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   402
                    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   403
                        currentFilenames add: file
2137dff405f0 initial checkin
tz
parents:
diff changeset
   404
                    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   405
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   406
            ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   407
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   408
        oldListOfFiles := self listOfFiles copy.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   409
        (currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet do: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   410
        [:fileName| 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   411
            (oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   412
            ifTrue:                                                                             
2137dff405f0 initial checkin
tz
parents:
diff changeset
   413
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   414
                |nearestFileRow r|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   415
                nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   416
                nearestFileRow = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   417
                ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   418
                ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   419
                monitoring ifTrue: [self selectionOfFile value: r].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   420
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   421
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   422
        self listOfFiles reverseDo:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   423
        [:fileRow|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   424
            (currentFilenames includes: fileRow fileName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   425
            ifFalse: [self listOfFiles remove: fileRow]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   426
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   427
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   428
2137dff405f0 initial checkin
tz
parents:
diff changeset
   429
    monitoring
2137dff405f0 initial checkin
tz
parents:
diff changeset
   430
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   431
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   432
        readTask := readBlock forkAt: Processor userBackgroundPriority.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   433
        Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   434
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   435
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   436
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   437
        Cursor wait showWhile: [readBlock value]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   438
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   439
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   440
2137dff405f0 initial checkin
tz
parents:
diff changeset
   441
!DirectoryView methodsFor:'selection'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   442
2137dff405f0 initial checkin
tz
parents:
diff changeset
   443
selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   444
2137dff405f0 initial checkin
tz
parents:
diff changeset
   445
    ^selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   446
2137dff405f0 initial checkin
tz
parents:
diff changeset
   447
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   448
2137dff405f0 initial checkin
tz
parents:
diff changeset
   449
selectedFileFilter: aString
2137dff405f0 initial checkin
tz
parents:
diff changeset
   450
2137dff405f0 initial checkin
tz
parents:
diff changeset
   451
    aString size = 0 ifTrue: [self listOfFileFilters remove: selectedFileFilter ifAbsent: nil].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   452
    selectedFileFilter := aString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   453
    (self listOfFileFilters includes: selectedFileFilter) not &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   454
    selectedFileFilter notEmpty
2137dff405f0 initial checkin
tz
parents:
diff changeset
   455
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   456
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   457
        self listOfFileFilters addFirst: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   458
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   459
    (self listOfFileFilters includes: selectedFileFilter) &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   460
    fileFilterSelectAction notNil 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   461
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   462
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   463
        fileFilterSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   464
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   465
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   466
            fileFilterSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   467
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   468
        fileFilterSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   469
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   470
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   471
            fileFilterSelectAction value: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   472
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   473
    ].       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   474
    self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   475
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   476
2137dff405f0 initial checkin
tz
parents:
diff changeset
   477
!DirectoryView methodsFor:'startup / release'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   478
2137dff405f0 initial checkin
tz
parents:
diff changeset
   479
closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   480
2137dff405f0 initial checkin
tz
parents:
diff changeset
   481
    self release.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   482
2137dff405f0 initial checkin
tz
parents:
diff changeset
   483
    super closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   484
2137dff405f0 initial checkin
tz
parents:
diff changeset
   485
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   486
2137dff405f0 initial checkin
tz
parents:
diff changeset
   487
release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   488
2137dff405f0 initial checkin
tz
parents:
diff changeset
   489
    monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   490
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   491
        Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   492
        monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   493
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   494
2137dff405f0 initial checkin
tz
parents:
diff changeset
   495
    super release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   496
2137dff405f0 initial checkin
tz
parents:
diff changeset
   497
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   498
2137dff405f0 initial checkin
tz
parents:
diff changeset
   499
!DirectoryView::FileRow class methodsFor:'resources'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   500
2137dff405f0 initial checkin
tz
parents:
diff changeset
   501
HFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   502
2137dff405f0 initial checkin
tz
parents:
diff changeset
   503
    ^self hFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   504
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   505
2137dff405f0 initial checkin
tz
parents:
diff changeset
   506
MakefileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   507
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   508
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   509
    ImageEditor openOnClass:self andSelector:#MakefileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   510
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   511
2137dff405f0 initial checkin
tz
parents:
diff changeset
   512
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   513
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   514
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   515
        constantNamed:#'DirectoryView::FileRow MakefileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   516
        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
   517
2137dff405f0 initial checkin
tz
parents:
diff changeset
   518
binaryFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   519
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   520
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   521
    ImageEditor openOnClass:self andSelector:#binaryFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   522
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   523
2137dff405f0 initial checkin
tz
parents:
diff changeset
   524
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   525
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   526
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   527
        constantNamed:#'DirectoryView::FileRow binaryFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   528
        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
   529
2137dff405f0 initial checkin
tz
parents:
diff changeset
   530
cFileIcon
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:#cFileIcon
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 cFileIcon'
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 "@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
   541
2137dff405f0 initial checkin
tz
parents:
diff changeset
   542
exeFileIcon
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:#exeFileIcon
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 exeFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   552
        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
   553
2137dff405f0 initial checkin
tz
parents:
diff changeset
   554
fileIcon
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:#fileIcon
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 fileIcon'
644
3a1a1cae7428 image format updated
tz
parents: 638
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
hFileIcon
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:#hFileIcon
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 hFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   576
        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
   577
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   578
htmlFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   579
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   580
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   581
    ImageEditor openOnClass:self andSelector:#htmlFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   582
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   583
2137dff405f0 initial checkin
tz
parents:
diff changeset
   584
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   585
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   586
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   587
        constantNamed:#'DirectoryView::FileRow htmlFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   588
        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
   589
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   590
imageFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   591
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   592
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   593
    ImageEditor openOnClass:self andSelector:#imageFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   594
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   595
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   596
    <resource: #image>
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   597
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   598
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   599
        constantNamed:#'DirectoryView::FileRow imageFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   600
        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
   601
2137dff405f0 initial checkin
tz
parents:
diff changeset
   602
imgFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   603
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   604
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   605
    ImageEditor openOnClass:self andSelector:#imgFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   606
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   607
2137dff405f0 initial checkin
tz
parents:
diff changeset
   608
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   609
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   610
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   611
        constantNamed:#'DirectoryView::FileRow imgFileIcon'
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   612
        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
   613
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   614
2137dff405f0 initial checkin
tz
parents:
diff changeset
   615
linkedFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   616
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   617
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   618
    ImageEditor openOnClass:self andSelector:#linkedFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   619
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   620
2137dff405f0 initial checkin
tz
parents:
diff changeset
   621
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   622
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   623
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   624
        constantNamed:#'DirectoryView::FileRow linkedFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   625
        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
   626
2137dff405f0 initial checkin
tz
parents:
diff changeset
   627
lockedFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   628
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   629
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   630
    ImageEditor openOnClass:self andSelector:#lockedFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   631
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   632
2137dff405f0 initial checkin
tz
parents:
diff changeset
   633
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   634
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   635
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   636
        constantNamed:#'DirectoryView::FileRow lockedFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   637
        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
   638
2137dff405f0 initial checkin
tz
parents:
diff changeset
   639
protoFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   640
2137dff405f0 initial checkin
tz
parents:
diff changeset
   641
    ^self MakefileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   642
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   643
2137dff405f0 initial checkin
tz
parents:
diff changeset
   644
rcFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   645
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   646
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   647
    ImageEditor openOnClass:self andSelector:#rcFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   648
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   649
2137dff405f0 initial checkin
tz
parents:
diff changeset
   650
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   651
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   652
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   653
        constantNamed:#'DirectoryView::FileRow rcFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   654
        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
   655
2137dff405f0 initial checkin
tz
parents:
diff changeset
   656
sFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   657
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   658
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   659
    ImageEditor openOnClass:self andSelector:#sFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   660
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   661
2137dff405f0 initial checkin
tz
parents:
diff changeset
   662
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   663
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   664
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   665
        constantNamed:#'DirectoryView::FileRow sFileIcon'
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   666
        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
   667
2137dff405f0 initial checkin
tz
parents:
diff changeset
   668
stFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   669
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   670
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   671
    ImageEditor openOnClass:self andSelector:#stFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   672
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   673
2137dff405f0 initial checkin
tz
parents:
diff changeset
   674
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   675
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   676
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   677
        constantNamed:#'DirectoryView::FileRow stFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
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 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
   679
2137dff405f0 initial checkin
tz
parents:
diff changeset
   680
stcFileIcon
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:#stcFileIcon
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 stcFileIcon'
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 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
   691
2137dff405f0 initial checkin
tz
parents:
diff changeset
   692
!DirectoryView::FileRow methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   693
2137dff405f0 initial checkin
tz
parents:
diff changeset
   694
baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   695
2137dff405f0 initial checkin
tz
parents:
diff changeset
   696
    ^baseName ? (baseName := fileName baseName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   697
2137dff405f0 initial checkin
tz
parents:
diff changeset
   698
2137dff405f0 initial checkin
tz
parents:
diff changeset
   699
2137dff405f0 initial checkin
tz
parents:
diff changeset
   700
2137dff405f0 initial checkin
tz
parents:
diff changeset
   701
2137dff405f0 initial checkin
tz
parents:
diff changeset
   702
2137dff405f0 initial checkin
tz
parents:
diff changeset
   703
2137dff405f0 initial checkin
tz
parents:
diff changeset
   704
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   705
2137dff405f0 initial checkin
tz
parents:
diff changeset
   706
fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   707
2137dff405f0 initial checkin
tz
parents:
diff changeset
   708
    ^fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   709
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   710
2137dff405f0 initial checkin
tz
parents:
diff changeset
   711
fileName: aFileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   712
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   713
    fileName := aFileName
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   714
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   715
2137dff405f0 initial checkin
tz
parents:
diff changeset
   716
group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   717
2137dff405f0 initial checkin
tz
parents:
diff changeset
   718
    ^group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   719
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   720
2137dff405f0 initial checkin
tz
parents:
diff changeset
   721
iconOn:aGC
2137dff405f0 initial checkin
tz
parents:
diff changeset
   722
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   723
    |icon|
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   724
    iconKey isNil 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   725
    ifTrue: 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   726
    [
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   727
        self validateAttributes.
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   728
        (imageFromFile isNil and: [iconKey == #imageFileIcon])
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   729
            ifTrue:  [icon := self retrieveImageFromFileAndRegisterOn: aGC]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   730
    ].
645
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   731
    imageFromFile == true
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   732
        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
   733
        ifTrue:  [icon := aGC registeredImageAt: iconKey].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   734
    ^icon
645
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   735
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   736
    "Modified: / 18.2.1998 / 18:01:52 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   737
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   738
2137dff405f0 initial checkin
tz
parents:
diff changeset
   739
modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   740
2137dff405f0 initial checkin
tz
parents:
diff changeset
   741
    ^modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   742
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   743
2137dff405f0 initial checkin
tz
parents:
diff changeset
   744
owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   745
2137dff405f0 initial checkin
tz
parents:
diff changeset
   746
    ^owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   747
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   748
2137dff405f0 initial checkin
tz
parents:
diff changeset
   749
permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   750
2137dff405f0 initial checkin
tz
parents:
diff changeset
   751
    ^permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   752
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   753
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   754
retrieveImageFromFileAndRegisterOn: aGC
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   755
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   756
    |image|
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   757
    imageFromFile := false.       
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   758
    (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
   759
    ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   760
    [            
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   761
        size < 5000
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   762
        ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   763
        [     
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   764
            Object errorSignal handle: [:ex|]
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   765
            do:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   766
            [   
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   767
                (image := Image fromFile: fileName name) notNil
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   768
                ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   769
                [
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   770
                    image extent y > 22
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   771
                    ifTrue:
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   772
                    [         
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   773
                        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
   774
                    ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   775
                    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
   776
                ]
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   777
            ] 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   778
        ].
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 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
   781
    ^image
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   782
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   783
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   784
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   785
!
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   786
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   787
size
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   788
    size isNumber ifFalse:[^ size].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   789
    size < 1000        ifTrue: [^ size printString].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   790
    size < (100*1024)  ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   791
    size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   792
    ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb'
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   793
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   794
    "Modified: / 6.2.1998 / 03:38:45 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   795
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   796
2137dff405f0 initial checkin
tz
parents:
diff changeset
   797
!DirectoryView::FileRow methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   798
2137dff405f0 initial checkin
tz
parents:
diff changeset
   799
validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   800
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   801
    |info mode| 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   802
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   803
    permissions := String new:9 withAll:$-.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   804
2137dff405f0 initial checkin
tz
parents:
diff changeset
   805
    (info := fileName info) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   806
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   807
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   808
        iconKey := #lockedFileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   809
        size    := owner := group := '?'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   810
      ^ self
2137dff405f0 initial checkin
tz
parents:
diff changeset
   811
    ].        
2137dff405f0 initial checkin
tz
parents:
diff changeset
   812
    size   := info size.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   813
    modified := info modified printString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   814
    owner  := OperatingSystem getUserNameFromID: info uid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   815
    group  := OperatingSystem getGroupNameFromID: info gid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   816
    mode   := info mode.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   817
2137dff405f0 initial checkin
tz
parents:
diff changeset
   818
    1 to:9 by:3 do:[:i|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   819
        #((0 $x) (1 $w) (2 $r)) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   820
        [:m|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   821
            (mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   822
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   823
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   824
2137dff405f0 initial checkin
tz
parents:
diff changeset
   825
    fileName isReadable
2137dff405f0 initial checkin
tz
parents:
diff changeset
   826
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   827
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   828
        info type == #symbolicLink
2137dff405f0 initial checkin
tz
parents:
diff changeset
   829
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   830
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   831
            ^iconKey := #linkedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   832
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   833
        ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   834
        [       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   835
            ((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol))
2137dff405f0 initial checkin
tz
parents:
diff changeset
   836
            or:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   837
            [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)])
2137dff405f0 initial checkin
tz
parents:
diff changeset
   838
            ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   839
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   840
                iconKey := #fileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   841
                (Image isImageFileSuffix:fileName suffix)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   842
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   843
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   844
                    ^iconKey := #imageFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   845
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   846
                (fileName suffix = 'o') | (fileName suffix = 'so')
2137dff405f0 initial checkin
tz
parents:
diff changeset
   847
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   848
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   849
                    ^iconKey := #binaryFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   850
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   851
2137dff405f0 initial checkin
tz
parents:
diff changeset
   852
                fileName isExecutableProgram
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 := #exeFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   856
                ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   857
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   858
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   859
    ] 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   860
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   861
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   862
        ^iconKey := #lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   863
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   864
2137dff405f0 initial checkin
tz
parents:
diff changeset
   865
2137dff405f0 initial checkin
tz
parents:
diff changeset
   866
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   867
2137dff405f0 initial checkin
tz
parents:
diff changeset
   868
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   869
2137dff405f0 initial checkin
tz
parents:
diff changeset
   870
version
2137dff405f0 initial checkin
tz
parents:
diff changeset
   871
    ^ '$Header$'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   872
! !