DirectoryView.st
author Stefan Vogel <sv@exept.de>
Thu, 23 Jan 2014 17:12:00 +0100
changeset 3067 4fc07457aef3
parent 3044 482172c551b3
child 3298 d388699ae421
permissions -rw-r--r--
AbortSignal -> AbortOperationRequest
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
"
1385
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
    12
"{ Package: 'stx:libtool2' }"
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
    13
424
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:''
2101
11e04dde2975 category change
Claus Gittinger <cg@exept.de>
parents: 1627
diff changeset
    20
	category:'Interface-Dialogs'
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'
1385
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
    26
	classVariableNames:'MaxImageFileSize'
424
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
"
2351
ac44cbdf95c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
    50
    this is somewhat outdated. However, it is still used by the image editor and
ac44cbdf95c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
    51
    some other resource editors.
ac44cbdf95c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
    52
    It has the advantage of showing the file-contents...
ac44cbdf95c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2101
diff changeset
    53
    ...but the disabdvantage of having an ugly layout and user interface.
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    54
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    55
    [author:]
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    56
        Thomas Zwick
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    57
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    58
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
    59
2137dff405f0 initial checkin
tz
parents:
diff changeset
    60
!DirectoryView class methodsFor:'instance creation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    61
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    62
openOnDirectory: aDirectoryString
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    63
    "open a DirectoryView for a aDirectoryString"
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 new directory: aDirectoryString) open
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    66
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    67
    "
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    68
     self openOnDirectory: '/etc'
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    69
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    70
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    71
    "Modified: / 28.1.1998 / 15:44:53 / stefan"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    72
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
    73
2137dff405f0 initial checkin
tz
parents:
diff changeset
    74
!DirectoryView class methodsFor:'interface specs'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    75
823
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    76
windowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    77
    "This resource specification was automatically generated
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    78
     by the UIPainter of ST/X."
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    79
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    80
    "Do not manually edit this!! If it is corrupted,
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    81
     the UIPainter may not be able to read the specification."
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    82
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    83
    "
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    84
     UIPainter new openOnClass:DirectoryView andSelector:#windowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    85
     DirectoryView new openInterface:#windowSpec
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    86
     DirectoryView open
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    87
    "
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    88
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    89
    <resource: #canvas>
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
    90
1346
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    91
    ^ 
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    92
     #(#FullSpec
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    93
        #name: #windowSpec
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    94
        #window: 
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    95
       #(#WindowSpec
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    96
          #label: 'Directory View'
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    97
          #name: 'Directory View'
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    98
          #min: #(#Point 10 10)
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    99
          #max: #(#Point 1152 900)
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   100
          #bounds: #(#Rectangle 13 23 413 323)
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   101
        )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   102
        #component: 
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   103
       #(#SpecCollection
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   104
          #collection: #(
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   105
           #(#DataSetSpec
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   106
              #name: 'filesDataSetView'
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   107
              #layout: #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   108
              #model: #selectionOfFile
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   109
              #menu: #fileListMenu
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   110
              #hasHorizontalScrollBar: true
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   111
              #hasVerticalScrollBar: true
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   112
              #miniScrollerHorizontal: true
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   113
              #dataList: #listOfFiles
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   114
              #useIndex: false
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   115
              #has3Dsepartors: false
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   116
              #doubleClickSelector: #fileDoubleClicked
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   117
              #columnHolder: #fileAttributeColumns
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   118
              #valueChangeSelector: #fileSelected
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   119
              #verticalSpacing: 1
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   120
            )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   121
           #(#ComboBoxSpec
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   122
              #name: 'formatComboBox'
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   123
              #layout: #(#LayoutFrame 63 0.0 0 0 0 1.0 22 0)
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   124
              #model: #selectionOfFileFilter
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   125
              #immediateAccept: false
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   126
              #acceptOnTab: false
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   127
              #acceptOnPointerLeave: false
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   128
              #comboList: #listOfFileFilters
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   129
            )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   130
           #(#LabelSpec
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   131
              #label: 'Filter: '
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   132
              #name: 'filterLabel'
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   133
              #layout: #(#LayoutFrame 0 0 0 0 62 0 22 0)
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   134
              #adjust: #right
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   135
            )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   136
           )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   137
         
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   138
        )
823
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   139
      )
1346
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   140
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   141
    "Modified: / 11.2.2000 / 00:11:43 / cg"
823
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   142
! !
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   143
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   144
!DirectoryView class methodsFor:'list specs'!
47e7d348e01a *** empty log message ***
tz
parents: 820
diff changeset
   145
820
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   146
tableColumnsForFileAttributes
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   147
    "This resource specification was automatically generated
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   148
     by the DataSetBuilder of ST/X."
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   149
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   150
    "Do not manually edit this!! If it is corrupted,
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   151
     the DataSetBuilder may not be able to read the specification."
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   152
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   153
    "
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   154
     DataSetBuilder new openOnClass:DirectoryView andSelector:#tableColumnsForFileAttributes
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   155
    "
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   156
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   157
    <resource: #tableColumns>
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   158
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   159
820
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   160
    ^ #(
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   161
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   162
           #label: ''
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   163
           #width: 30
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   164
           #height: 22
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   165
           #printSelector: #iconOn:
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   166
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   167
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   168
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   169
           #label: 'File name'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   170
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   171
           #minWidth: 150
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   172
           #model: #baseName
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   173
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   174
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   175
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   176
           #label: 'Size'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   177
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   178
           #width: 70
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   179
           #model: #size
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   180
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   181
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   182
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   183
           #label: 'Modified'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   184
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   185
           #model: #modified
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   186
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   187
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   188
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   189
           #label: 'Permissions'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   190
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   191
           #width: 85
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   192
           #model: #permissions
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   193
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   194
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   195
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   196
           #label: 'Owner'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   197
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   198
           #width: 50
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   199
           #model: #owner
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   200
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   201
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   202
        #(#DataSetColumnSpec
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   203
           #label: 'Group'
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   204
           #labelAlignment: #left
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   205
           #width: 50
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   206
           #model: #group
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   207
           #canSelect: false
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   208
       )
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   209
     )
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   210
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   211
1346
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   212
!DirectoryView class methodsFor:'menu specs'!
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   213
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   214
fileListMenu
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   215
    "This resource specification was automatically generated
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   216
     by the MenuEditor of ST/X."
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   217
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   218
    "Do not manually edit this!! If it is corrupted,
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   219
     the MenuEditor may not be able to read the specification."
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   220
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   221
    "
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   222
     MenuEditor new openOnClass:DirectoryView andSelector:#fileListMenu
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   223
     (Menu new fromLiteralArrayEncoding:(DirectoryView fileListMenu)) startUp
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   224
    "
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   225
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   226
    <resource: #menu>
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   227
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   228
    ^ 
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   229
     #(#Menu
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   230
        #(
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   231
         #(#MenuItem
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   232
            #label: 'Update'
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   233
            #translateLabel: true
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   234
            #value: #updateFileList
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   235
          )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   236
         )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   237
        nil
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   238
        nil
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   239
      )
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   240
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   241
    "Created: / 11.2.2000 / 00:11:39 / cg"
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   242
! !
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   243
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   244
!DirectoryView methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   245
2137dff405f0 initial checkin
tz
parents:
diff changeset
   246
directory: aDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   247
2137dff405f0 initial checkin
tz
parents:
diff changeset
   248
    directory := aDirectory asFilename asAbsoluteFilename name
2137dff405f0 initial checkin
tz
parents:
diff changeset
   249
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   250
2137dff405f0 initial checkin
tz
parents:
diff changeset
   251
fileAttributes: anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   252
2137dff405f0 initial checkin
tz
parents:
diff changeset
   253
    fileAttributes := anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   254
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   255
2137dff405f0 initial checkin
tz
parents:
diff changeset
   256
fileDoubleClickAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   257
2137dff405f0 initial checkin
tz
parents:
diff changeset
   258
    fileDoubleClickAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   259
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   260
2137dff405f0 initial checkin
tz
parents:
diff changeset
   261
fileFilterSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   262
2137dff405f0 initial checkin
tz
parents:
diff changeset
   263
    fileFilterSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   264
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   265
2137dff405f0 initial checkin
tz
parents:
diff changeset
   266
fileSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   267
2137dff405f0 initial checkin
tz
parents:
diff changeset
   268
    fileSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   269
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   270
2137dff405f0 initial checkin
tz
parents:
diff changeset
   271
listOfFileFilters: aCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   272
2137dff405f0 initial checkin
tz
parents:
diff changeset
   273
    self listOfFileFilters contents: aCollection.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   274
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   275
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   276
2137dff405f0 initial checkin
tz
parents:
diff changeset
   277
monitoring: aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   278
2137dff405f0 initial checkin
tz
parents:
diff changeset
   279
    aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   280
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   281
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   282
        monitoringTimeBlock := [self readDirectory].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   283
        self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   284
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   285
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   286
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   287
        monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   288
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   289
            Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   290
            monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   291
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   292
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   293
2137dff405f0 initial checkin
tz
parents:
diff changeset
   294
    monitoring := aBoolean.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   295
2137dff405f0 initial checkin
tz
parents:
diff changeset
   296
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   297
2137dff405f0 initial checkin
tz
parents:
diff changeset
   298
!DirectoryView methodsFor:'aspects'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   299
2137dff405f0 initial checkin
tz
parents:
diff changeset
   300
fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   301
2137dff405f0 initial checkin
tz
parents:
diff changeset
   302
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   303
    (holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   304
        |fileAttributeColumns|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   305
        builder aspectAt:#fileAttributeColumns put:(holder := List new).
820
e967a1359d77 table columns formatted
tz
parents: 652
diff changeset
   306
        fileAttributeColumns := self class tableColumnsForFileAttributes collect: [:i| i decodeAsLiteralArray].
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   307
        holder add: fileAttributeColumns first.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   308
        fileAttributeColumns do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   309
        [:col|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   310
            (fileAttributes includes: col label) ifTrue: [holder add: col]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   311
        ].
591
efb80a288277 labels inseted
tz
parents: 590
diff changeset
   312
        holder do: [:col| col label: ' ', col label]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   313
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   314
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   315
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   316
2137dff405f0 initial checkin
tz
parents:
diff changeset
   317
listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   318
2137dff405f0 initial checkin
tz
parents:
diff changeset
   319
    |holder|          
2137dff405f0 initial checkin
tz
parents:
diff changeset
   320
    (holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   321
        builder aspectAt:#listOfFileFilters put:(holder :=  List with: '*').
2137dff405f0 initial checkin
tz
parents:
diff changeset
   322
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   323
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   324
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   325
2137dff405f0 initial checkin
tz
parents:
diff changeset
   326
listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   327
2137dff405f0 initial checkin
tz
parents:
diff changeset
   328
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   329
    (holder := builder bindingAt:#listOfFiles) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   330
        builder aspectAt:#listOfFiles put:(holder :=  List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   331
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   332
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   333
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   334
2137dff405f0 initial checkin
tz
parents:
diff changeset
   335
selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   336
2137dff405f0 initial checkin
tz
parents:
diff changeset
   337
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   338
    (holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   339
        builder aspectAt:#selectionOfFile put:(holder :=  ValueHolder new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   340
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   341
    ^ holder
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
selectionOfFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   346
2137dff405f0 initial checkin
tz
parents:
diff changeset
   347
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   348
    (holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   349
        builder aspectAt:#selectionOfFileFilter put:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   350
        (holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   351
        selectedFileFilter := '*'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   352
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   353
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   354
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   355
2137dff405f0 initial checkin
tz
parents:
diff changeset
   356
!DirectoryView methodsFor:'callbacks'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   357
2137dff405f0 initial checkin
tz
parents:
diff changeset
   358
fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   359
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   360
    (fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   361
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   362
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   363
        fileDoubleClickAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   364
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   365
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   366
            fileDoubleClickAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   367
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   368
        fileDoubleClickAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   369
        ifTrue:
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   370
        [                
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   371
            fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   372
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   373
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   374
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   375
2137dff405f0 initial checkin
tz
parents:
diff changeset
   376
fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   377
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   378
    (fileSelectAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   379
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   380
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   381
        fileSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   382
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   383
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   384
            fileSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   385
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   386
        fileSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   387
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   388
        [
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   389
            fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   390
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   391
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   392
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   393
2137dff405f0 initial checkin
tz
parents:
diff changeset
   394
!DirectoryView methodsFor:'initialization'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   395
2137dff405f0 initial checkin
tz
parents:
diff changeset
   396
initialize
2137dff405f0 initial checkin
tz
parents:
diff changeset
   397
2137dff405f0 initial checkin
tz
parents:
diff changeset
   398
    super initialize.
874
ab93fcd829c5 create builder
Claus Gittinger <cg@exept.de>
parents: 828
diff changeset
   399
    self createBuilder.
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   400
3044
482172c551b3 class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
   401
    directory :=  (directory ? '.') asFilename asAbsoluteFilename directoryName.
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   402
    monitoring := false.
593
17f3d679fa72 better size info
tz
parents: 591
diff changeset
   403
    fileAttributes := #('File name' 'Size' 'Modified').
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   404
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   405
874
ab93fcd829c5 create builder
Claus Gittinger <cg@exept.de>
parents: 828
diff changeset
   406
    "Modified: / 20.6.1998 / 14:46:10 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   407
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   408
2878
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   409
!DirectoryView methodsFor:'initialize-release'!
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   410
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   411
release
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   412
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   413
    monitoring ifTrue:
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   414
    [
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   415
        Processor removeTimedBlock:monitoringTimeBlock.
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   416
        monitoringTimeBlock := nil
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   417
    ].
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   418
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   419
    super release
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   420
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   421
! !
241be37ce37b category of: #release
Claus Gittinger <cg@exept.de>
parents: 2439
diff changeset
   422
1346
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   423
!DirectoryView methodsFor:'menu actions'!
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   424
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   425
updateFileList
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   426
    DirectoryContents flushCache.
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   427
    self readDirectory
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   428
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   429
    "Created: / 11.2.2000 / 00:12:46 / cg"
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   430
    "Modified: / 11.2.2000 / 00:14:32 / cg"
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   431
! !
0793db434b21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   432
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   433
!DirectoryView methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   434
2137dff405f0 initial checkin
tz
parents:
diff changeset
   435
readDirectory
2439
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   436
    |allDirectories allFiles foundFiles filterList dir newContents|    
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   437
2439
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   438
    allFiles := OrderedCollection new.
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   439
    allDirectories := OrderedCollection new.
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   440
    foundFiles := OrderedCollection new.
991
9454c462dad4 fixed file filter (must use selected filter; not all filters)
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   441
    "/ filterList := self listOfFileFilters value.
9454c462dad4 fixed file filter (must use selected filter; not all filters)
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   442
    filterList := self selectedFileFilter asCollectionOfSubstringsSeparatedBy:$;.
9454c462dad4 fixed file filter (must use selected filter; not all filters)
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   443
    filterList := filterList collect:[:pattern | pattern withoutSeparators].
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   444
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   445
    self withCursor:Cursor read do:[ 
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   446
        (dir := DirectoryContents directoryNamed: directory) notNil ifTrue:[
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   447
"/            dir filesAndBasenamesDo:[:file :name|      
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   448
"/                filterList do:[:filter|
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   449
"/                    ((filter match:name) and:[(foundFiles includes: name) not])
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   450
"/                    ifTrue:[
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   451
"/                        foundFiles add: name
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   452
"/                    ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   453
"/                ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   454
"/            ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   455
            dir filesAndBasenamesDo:[:file :name|      
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   456
                allFiles add: name
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   457
            ].
2439
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   458
            dir directoriesAndBasenamesDo:[:file :name|      
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   459
                allDirectories add: name
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   460
            ].
991
9454c462dad4 fixed file filter (must use selected filter; not all filters)
Claus Gittinger <cg@exept.de>
parents: 979
diff changeset
   461
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   462
            Filename isCaseSensitive ifFalse:[
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   463
                filterList do:[:filter|
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   464
                    |lcFilter|
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   465
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   466
                    lcFilter := filter asLowercase.
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   467
                    foundFiles
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   468
                        addAll:(allFiles 
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   469
                                    select:[:name | lcFilter match:name asLowercase]
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   470
                                ).
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   471
                ]
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   472
            ] ifTrue:[
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   473
                filterList do:[:filter|
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   474
                    foundFiles
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   475
                        addAll:(allFiles 
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   476
                                    select:[:name | filter match:name]
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   477
                                ).
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   478
                ]
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   479
            ].
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   480
2439
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   481
            foundFiles sort.
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   482
            allDirectories sort.
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   483
979
2ee26d9ee7c4 tuned #readDirectory
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   484
            dir := directory asFilename.
2439
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   485
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   486
            newContents := OrderedCollection new.
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   487
            newContents addAll:(allDirectories collect:[:name| FileRow new fileName:(dir construct:name)]).
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   488
            newContents addAll:(foundFiles collect:[:name| FileRow new fileName:(dir construct:name)]).
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   489
9f6c2575f2b1 fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2351
diff changeset
   490
            self listOfFiles contents:newContents
828
12090f74be53 care for non-existing directory
Claus Gittinger <cg@exept.de>
parents: 823
diff changeset
   491
        ]
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   492
    ]
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   493
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   494
    "Modified: / 23.9.1998 / 17:00:42 / cg"
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   495
!
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   496
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   497
readMonitoringDirectory
3018
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   498
    |readBlock|
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   499
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   500
    readTask notNil ifTrue: [readTask terminate].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   501
    readBlock :=
2137dff405f0 initial checkin
tz
parents:
diff changeset
   502
        [
3018
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   503
            |dir currentFilenames oldListOfFiles|
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   504
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   505
            dir := directory asFilename.
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   506
            currentFilenames := OrderedCollection new.
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   507
            (dir isReadable and:[dir isExecutable]) ifTrue: [
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   508
                self listOfFileFilters value do:
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   509
                [:filter|
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   510
                    (dir filesMatchingWithoutDotDirs: filter) do: [:aFileName|
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   511
                        |file|
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   512
                        (file := dir construct: aFileName) isDirectory ifFalse: [
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   513
                            currentFilenames add: file
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   514
                        ]
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   515
                    ].
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   516
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   517
            ].
3018
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   518
            oldListOfFiles := self listOfFiles copy.
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   519
            (currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet 
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   520
                do: [:fileName| 
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   521
                    (oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   522
                    ifTrue: [
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   523
                        |nearestFileRow r|
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   524
                        nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil).
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   525
                        nearestFileRow = 0
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   526
                            ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)]
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   527
                            ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow].
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   528
                        monitoring ifTrue: [self selectionOfFile value: r].
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   529
                    ]
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   530
                ].
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   531
            self listOfFiles 
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   532
                reverseDo: [:fileRow|
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   533
                    (currentFilenames includes: fileRow fileName)
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   534
                    ifFalse: [self listOfFiles remove: fileRow]
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   535
                ]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   536
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   537
3018
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   538
    monitoring ifTrue: [
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   539
        readTask := readBlock forkAt: Processor userBackgroundPriority.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   540
        Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1
3018
31dc0e6c143e class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 2999
diff changeset
   541
    ] ifFalse: [
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   542
        Cursor wait showWhile: [readBlock value]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   543
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   544
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   545
2137dff405f0 initial checkin
tz
parents:
diff changeset
   546
!DirectoryView methodsFor:'selection'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   547
2137dff405f0 initial checkin
tz
parents:
diff changeset
   548
selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   549
2137dff405f0 initial checkin
tz
parents:
diff changeset
   550
    ^selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   551
2137dff405f0 initial checkin
tz
parents:
diff changeset
   552
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   553
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   554
selectedFileFilter:aString
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   555
    "change the file filter"
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   556
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   557
    |listOfFileFilters nArgs|
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   558
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   559
    aString = selectedFileFilter ifTrue:[^ self].
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   560
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   561
    listOfFileFilters := self listOfFileFilters.
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   562
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   563
    "/ what is this for ?
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   564
    aString size == 0 ifTrue: [
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   565
        listOfFileFilters remove: selectedFileFilter ifAbsent: nil
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   566
    ].
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   567
    selectedFileFilter := aString.
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   568
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   569
    ((listOfFileFilters includes: selectedFileFilter) not
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   570
    and:[selectedFileFilter notEmpty])
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   571
    ifTrue: [
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   572
        listOfFileFilters addFirst: selectedFileFilter
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   573
    ].
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   574
    ((listOfFileFilters includes: selectedFileFilter)
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   575
    and:[fileFilterSelectAction notNil]) 
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   576
    ifTrue: [
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   577
        (nArgs := fileFilterSelectAction numArgs) == 0
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   578
        ifTrue: [
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   579
            fileFilterSelectAction value
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   580
        ] ifFalse:[
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   581
            nArgs == 1 ifTrue:[
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   582
                fileFilterSelectAction value: selectedFileFilter
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   583
            ] ifFalse:[
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   584
                self error:'bad numArgs of fileFilter action block'
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   585
            ]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   586
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   587
    ].       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   588
    self readDirectory.
999
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   589
3dc1bc073981 fixed filter for caseless fileSystems (win32)
Claus Gittinger <cg@exept.de>
parents: 991
diff changeset
   590
    "Modified: / 23.9.1998 / 16:53:05 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   591
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   592
3035
5a1ce9362a65 class: DirectoryView
Claus Gittinger <cg@exept.de>
parents: 3018
diff changeset
   593
!DirectoryView methodsFor:'startup & release'!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   594
2137dff405f0 initial checkin
tz
parents:
diff changeset
   595
closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   596
2137dff405f0 initial checkin
tz
parents:
diff changeset
   597
    self release.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   598
2137dff405f0 initial checkin
tz
parents:
diff changeset
   599
    super closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   600
2137dff405f0 initial checkin
tz
parents:
diff changeset
   601
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   602
2137dff405f0 initial checkin
tz
parents:
diff changeset
   603
!DirectoryView::FileRow class methodsFor:'resources'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   604
2137dff405f0 initial checkin
tz
parents:
diff changeset
   605
HFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   606
2137dff405f0 initial checkin
tz
parents:
diff changeset
   607
    ^self hFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   608
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   609
2137dff405f0 initial checkin
tz
parents:
diff changeset
   610
MakefileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   611
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   612
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   613
    ImageEditor openOnClass:self andSelector:#MakefileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   614
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   615
2137dff405f0 initial checkin
tz
parents:
diff changeset
   616
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   617
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   618
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   619
        constantNamed:#'DirectoryView::FileRow MakefileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   620
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   621
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   622
2137dff405f0 initial checkin
tz
parents:
diff changeset
   623
binaryFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   624
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   625
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   626
    ImageEditor openOnClass:self andSelector:#binaryFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   627
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   628
2137dff405f0 initial checkin
tz
parents:
diff changeset
   629
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   630
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   631
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   632
        constantNamed:#'DirectoryView::FileRow binaryFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   633
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   634
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   635
2137dff405f0 initial checkin
tz
parents:
diff changeset
   636
cFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   637
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   638
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   639
    ImageEditor openOnClass:self andSelector:#cFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   640
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   641
2137dff405f0 initial checkin
tz
parents:
diff changeset
   642
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   643
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   644
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   645
        constantNamed:#'DirectoryView::FileRow cFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   646
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   647
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   648
2137dff405f0 initial checkin
tz
parents:
diff changeset
   649
exeFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   650
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   651
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   652
    ImageEditor openOnClass:self andSelector:#exeFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   653
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   654
2137dff405f0 initial checkin
tz
parents:
diff changeset
   655
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   656
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   657
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   658
        constantNamed:#'DirectoryView::FileRow exeFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   659
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   660
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   661
2137dff405f0 initial checkin
tz
parents:
diff changeset
   662
fileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   663
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   664
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   665
    ImageEditor openOnClass:self andSelector:#fileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   666
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   667
2137dff405f0 initial checkin
tz
parents:
diff changeset
   668
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   669
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   670
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   671
        constantNamed:#'DirectoryView::FileRow fileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   672
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   673
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   674
2137dff405f0 initial checkin
tz
parents:
diff changeset
   675
hFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   676
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   677
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   678
    ImageEditor openOnClass:self andSelector:#hFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   679
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   680
2137dff405f0 initial checkin
tz
parents:
diff changeset
   681
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   682
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   683
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   684
        constantNamed:#'DirectoryView::FileRow hFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   685
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   686
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   687
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   688
htmlFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   689
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   690
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   691
    ImageEditor openOnClass:self andSelector:#htmlFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   692
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   693
2137dff405f0 initial checkin
tz
parents:
diff changeset
   694
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   695
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   696
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   697
        constantNamed:#'DirectoryView::FileRow htmlFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   698
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   699
!
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   700
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   701
imageFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   702
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   703
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   704
    ImageEditor openOnClass:self andSelector:#imageFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   705
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   706
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   707
    <resource: #image>
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   708
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   709
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   710
        constantNamed:#'DirectoryView::FileRow imageFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   711
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   712
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   713
2137dff405f0 initial checkin
tz
parents:
diff changeset
   714
imgFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   715
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   716
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   717
    ImageEditor openOnClass:self andSelector:#imgFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   718
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   719
2137dff405f0 initial checkin
tz
parents:
diff changeset
   720
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   721
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   722
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   723
        constantNamed:#'DirectoryView::FileRow imgFileIcon'
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   724
        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
   725
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   726
2137dff405f0 initial checkin
tz
parents:
diff changeset
   727
linkedFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   728
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   729
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   730
    ImageEditor openOnClass:self andSelector:#linkedFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   731
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   732
2137dff405f0 initial checkin
tz
parents:
diff changeset
   733
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   734
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   735
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   736
        constantNamed:#'DirectoryView::FileRow linkedFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   737
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   738
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   739
2137dff405f0 initial checkin
tz
parents:
diff changeset
   740
lockedFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   741
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   742
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   743
    ImageEditor openOnClass:self andSelector:#lockedFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   744
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   745
2137dff405f0 initial checkin
tz
parents:
diff changeset
   746
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   747
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   748
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   749
        constantNamed:#'DirectoryView::FileRow lockedFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   750
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   751
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   752
2137dff405f0 initial checkin
tz
parents:
diff changeset
   753
protoFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   754
2137dff405f0 initial checkin
tz
parents:
diff changeset
   755
    ^self MakefileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   756
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   757
2137dff405f0 initial checkin
tz
parents:
diff changeset
   758
rcFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   759
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   760
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   761
    ImageEditor openOnClass:self andSelector:#rcFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   762
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   763
2137dff405f0 initial checkin
tz
parents:
diff changeset
   764
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   765
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   766
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   767
        constantNamed:#'DirectoryView::FileRow rcFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   768
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   769
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   770
2137dff405f0 initial checkin
tz
parents:
diff changeset
   771
sFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   772
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   773
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   774
    ImageEditor openOnClass:self andSelector:#sFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   775
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   776
2137dff405f0 initial checkin
tz
parents:
diff changeset
   777
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   778
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   779
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   780
        constantNamed:#'DirectoryView::FileRow sFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   781
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   782
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   783
2137dff405f0 initial checkin
tz
parents:
diff changeset
   784
stFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   785
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   786
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   787
    ImageEditor openOnClass:self andSelector:#stFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   788
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   789
2137dff405f0 initial checkin
tz
parents:
diff changeset
   790
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   791
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   792
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   793
        constantNamed:#'DirectoryView::FileRow stFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   794
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   795
!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   796
2137dff405f0 initial checkin
tz
parents:
diff changeset
   797
stcFileIcon
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   798
    "Generated by the Image Editor"
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   799
    "
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   800
    ImageEditor openOnClass:self andSelector:#stcFileIcon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   801
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   802
2137dff405f0 initial checkin
tz
parents:
diff changeset
   803
    <resource: #image>
644
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   804
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   805
    ^Icon
3a1a1cae7428 image format updated
tz
parents: 638
diff changeset
   806
        constantNamed:#'DirectoryView::FileRow stcFileIcon'
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   807
        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]
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   808
! !
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   809
2137dff405f0 initial checkin
tz
parents:
diff changeset
   810
!DirectoryView::FileRow methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   811
2137dff405f0 initial checkin
tz
parents:
diff changeset
   812
baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   813
2137dff405f0 initial checkin
tz
parents:
diff changeset
   814
    ^baseName ? (baseName := fileName baseName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   815
2137dff405f0 initial checkin
tz
parents:
diff changeset
   816
2137dff405f0 initial checkin
tz
parents:
diff changeset
   817
2137dff405f0 initial checkin
tz
parents:
diff changeset
   818
2137dff405f0 initial checkin
tz
parents:
diff changeset
   819
2137dff405f0 initial checkin
tz
parents:
diff changeset
   820
2137dff405f0 initial checkin
tz
parents:
diff changeset
   821
2137dff405f0 initial checkin
tz
parents:
diff changeset
   822
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   823
2137dff405f0 initial checkin
tz
parents:
diff changeset
   824
fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   825
2137dff405f0 initial checkin
tz
parents:
diff changeset
   826
    ^fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   827
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   828
2137dff405f0 initial checkin
tz
parents:
diff changeset
   829
fileName: aFileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   830
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   831
    fileName := aFileName
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   832
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   833
2137dff405f0 initial checkin
tz
parents:
diff changeset
   834
group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   835
2137dff405f0 initial checkin
tz
parents:
diff changeset
   836
    ^group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   837
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   838
2137dff405f0 initial checkin
tz
parents:
diff changeset
   839
iconOn:aGC
2137dff405f0 initial checkin
tz
parents:
diff changeset
   840
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   841
    |icon|
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   842
    iconKey isNil 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   843
    ifTrue: 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   844
    [
614
41cd940faa45 faster dir reading
tz
parents: 607
diff changeset
   845
        self validateAttributes.
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   846
        (imageFromFile isNil and: [iconKey == #imageFileIcon])
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   847
            ifTrue:  [icon := self retrieveImageFromFileAndRegisterOn: aGC]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   848
    ].
645
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   849
    imageFromFile == true
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   850
        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
   851
        ifTrue:  [icon := aGC registeredImageAt: iconKey].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   852
    ^icon
645
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   853
9f422fbbd801 care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   854
    "Modified: / 18.2.1998 / 18:01:52 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   855
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   856
2137dff405f0 initial checkin
tz
parents:
diff changeset
   857
modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   858
2137dff405f0 initial checkin
tz
parents:
diff changeset
   859
    ^modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   860
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   861
2137dff405f0 initial checkin
tz
parents:
diff changeset
   862
owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   863
2137dff405f0 initial checkin
tz
parents:
diff changeset
   864
    ^owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   865
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   866
2137dff405f0 initial checkin
tz
parents:
diff changeset
   867
permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   868
2137dff405f0 initial checkin
tz
parents:
diff changeset
   869
    ^permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   870
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   871
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   872
retrieveImageFromFileAndRegisterOn: aGC
1385
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   873
    "retrieve a bitmap image - but only if it is smaller than some limit (currently 20k)"
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   874
1385
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   875
    |image maxImageFileSize|
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   876
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   877
    maxImageFileSize := MaxImageFileSize ? 20000.
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   878
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   879
    imageFromFile := false.       
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   880
    (image := aGC registeredImageAt: fileName name asSymbol) isNil
1385
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   881
    ifTrue:[            
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   882
        size < maxImageFileSize ifTrue:[     
2999
a173c8753a07 exception access
Claus Gittinger <cg@exept.de>
parents: 2938
diff changeset
   883
            Error handle: [:ex|]
1385
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   884
            do:[   
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   885
                (image := Image fromFile: fileName name) notNil ifTrue:[
cbe7e7763105 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
   886
                    image extent y > 22 ifTrue:[         
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   887
                        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
   888
                    ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   889
                    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
   890
                ]
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   891
            ] 
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   892
        ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   893
    ].
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   894
    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
   895
    ^image
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   896
!
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   897
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   898
size
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   899
    size isNumber ifFalse:[^ size].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   900
    size < 1000        ifTrue: [^ size printString].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   901
    size < (100*1024)  ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   902
    size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   903
    ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb'
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   904
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   905
    "Modified: / 6.2.1998 / 03:38:45 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   906
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   907
2137dff405f0 initial checkin
tz
parents:
diff changeset
   908
!DirectoryView::FileRow methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   909
2137dff405f0 initial checkin
tz
parents:
diff changeset
   910
validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   911
2938
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   912
    |info mode suffix| 
638
a82372d61cf8 avoid rereading of file images + multiple listings of same filter matching files
tz
parents: 620
diff changeset
   913
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   914
    permissions := String new:9 withAll:$-.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   915
2938
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   916
    (info := fileName info) isNil ifTrue:[
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   917
        iconKey := #lockedFileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   918
        size    := owner := group := '?'.
2938
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   919
        ^ self
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   920
    ].        
2137dff405f0 initial checkin
tz
parents:
diff changeset
   921
    size   := info size.
1627
e14aa2449e97 change modified to modificationTime
penk
parents: 1385
diff changeset
   922
    modified := info modificationTime printString.
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   923
    owner  := OperatingSystem getUserNameFromID: info uid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   924
    group  := OperatingSystem getGroupNameFromID: info gid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   925
    mode   := info mode.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   926
2137dff405f0 initial checkin
tz
parents:
diff changeset
   927
    1 to:9 by:3 do:[:i|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   928
        #((0 $x) (1 $w) (2 $r)) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   929
        [:m|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   930
            (mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   931
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   932
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   933
2938
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   934
    fileName isReadable ifFalse:[
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   935
        ^iconKey := #lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   936
    ].
2938
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   937
    info type == #symbolicLink ifTrue:[
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   938
        ^ iconKey := #linkedFileIcon
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   939
    ].
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   940
    suffix := fileName suffix.
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   941
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   942
    ((DirectoryView::FileRow class implements: (iconKey := (suffix, 'FileIcon') asSymbol))
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   943
        or: [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)]
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   944
    ) ifFalse:[
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   945
        iconKey := #fileIcon.
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   946
        ((suffix = 'o') or:[suffix = 'so']) ifTrue: [
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   947
            ^iconKey := #binaryFileIcon
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   948
        ].
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   949
        (Image isImageFileSuffix:suffix) ifTrue: [
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   950
            ^iconKey := #imageFileIcon
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   951
        ].
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   952
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   953
        fileName isExecutableProgram ifTrue:[
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   954
            ^iconKey := #exeFileIcon
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   955
        ]
8e9207531826 | replaced by or:
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   956
    ]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   957
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   958
2137dff405f0 initial checkin
tz
parents:
diff changeset
   959
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   960
2137dff405f0 initial checkin
tz
parents:
diff changeset
   961
version
2137dff405f0 initial checkin
tz
parents:
diff changeset
   962
    ^ '$Header$'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   963
! !
2999
a173c8753a07 exception access
Claus Gittinger <cg@exept.de>
parents: 2938
diff changeset
   964