DirectoryView.st
author tz
Thu, 29 Jan 1998 19:57:15 +0100
changeset 527 6dc446339dc2
parent 516 d336effde882
child 590 c2f5cd223be2
permissions -rw-r--r--
dialog styles revised
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
     1
"
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
2137dff405f0 initial checkin
tz
parents:
diff changeset
     4
2137dff405f0 initial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
2137dff405f0 initial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
2137dff405f0 initial checkin
tz
parents:
diff changeset
     7
 inclusion of the above copyright notice. This software may not
2137dff405f0 initial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
2137dff405f0 initial checkin
tz
parents:
diff changeset
     9
 other person. No title to or ownership of the software is
2137dff405f0 initial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
2137dff405f0 initial checkin
tz
parents:
diff changeset
    11
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    12
2137dff405f0 initial checkin
tz
parents:
diff changeset
    13
2137dff405f0 initial checkin
tz
parents:
diff changeset
    14
ApplicationModel subclass:#DirectoryView
2137dff405f0 initial checkin
tz
parents:
diff changeset
    15
	instanceVariableNames:'directory selectedFileFilter readTask monitoring
2137dff405f0 initial checkin
tz
parents:
diff changeset
    16
		monitoringTimeBlock fileDoubleClickAction fileSelectAction
2137dff405f0 initial checkin
tz
parents:
diff changeset
    17
		fileFilterSelectAction fileAttributes'
2137dff405f0 initial checkin
tz
parents:
diff changeset
    18
	classVariableNames:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    19
	poolDictionaries:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    20
	category:'Interface-Advanced-Tools'
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
2137dff405f0 initial checkin
tz
parents:
diff changeset
    24
	instanceVariableNames:'fileName size modified iconKey group owner permissions baseName'
2137dff405f0 initial checkin
tz
parents:
diff changeset
    25
	classVariableNames:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    26
	poolDictionaries:''
2137dff405f0 initial checkin
tz
parents:
diff changeset
    27
	privateIn:DirectoryView
2137dff405f0 initial checkin
tz
parents:
diff changeset
    28
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    29
2137dff405f0 initial checkin
tz
parents:
diff changeset
    30
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    31
2137dff405f0 initial checkin
tz
parents:
diff changeset
    32
copyright
2137dff405f0 initial checkin
tz
parents:
diff changeset
    33
"
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    34
 COPYRIGHT (c) 1997 by eXept Software AG
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    35
              All Rights Reserved
2137dff405f0 initial checkin
tz
parents:
diff changeset
    36
2137dff405f0 initial checkin
tz
parents:
diff changeset
    37
 This software is furnished under a license and may be used
2137dff405f0 initial checkin
tz
parents:
diff changeset
    38
 only in accordance with the terms of that license and with the
2137dff405f0 initial checkin
tz
parents:
diff changeset
    39
 inclusion of the above copyright notice. This software may not
2137dff405f0 initial checkin
tz
parents:
diff changeset
    40
 be provided or otherwise made available to, or used by, any
2137dff405f0 initial checkin
tz
parents:
diff changeset
    41
 other person. No title to or ownership of the software is
2137dff405f0 initial checkin
tz
parents:
diff changeset
    42
 hereby transferred.
2137dff405f0 initial checkin
tz
parents:
diff changeset
    43
"
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
documentation
2137dff405f0 initial checkin
tz
parents:
diff changeset
    48
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    49
    documentation to be added.
502
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    50
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    51
    [author:]
624dc714fd69 copyright changed
tz
parents: 474
diff changeset
    52
        Thomas Zwick
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    53
"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    54
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    55
2137dff405f0 initial checkin
tz
parents:
diff changeset
    56
history
2137dff405f0 initial checkin
tz
parents:
diff changeset
    57
    "Created: / 10.1.1998 / 10:59:49 / tz"
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
2137dff405f0 initial checkin
tz
parents:
diff changeset
    76
windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    77
    "this window spec was automatically generated by the ST/X UIPainter"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    78
2137dff405f0 initial checkin
tz
parents:
diff changeset
    79
    "do not manually edit this - the painter/builder may not be able to
2137dff405f0 initial checkin
tz
parents:
diff changeset
    80
     handle the specification if its corrupted."
2137dff405f0 initial checkin
tz
parents:
diff changeset
    81
2137dff405f0 initial checkin
tz
parents:
diff changeset
    82
    "
2137dff405f0 initial checkin
tz
parents:
diff changeset
    83
     UIPainter new openOnClass:DirectoryView andSelector:#windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    84
     DirectoryView new openInterface:#windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    85
    "
2137dff405f0 initial checkin
tz
parents:
diff changeset
    86
    "DirectoryView open"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    87
2137dff405f0 initial checkin
tz
parents:
diff changeset
    88
    <resource: #canvas>
2137dff405f0 initial checkin
tz
parents:
diff changeset
    89
2137dff405f0 initial checkin
tz
parents:
diff changeset
    90
    ^
2137dff405f0 initial checkin
tz
parents:
diff changeset
    91
     
2137dff405f0 initial checkin
tz
parents:
diff changeset
    92
       #(#FullSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    93
          #'window:' 
2137dff405f0 initial checkin
tz
parents:
diff changeset
    94
           #(#WindowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    95
              #'name:' 'Directory View'
2137dff405f0 initial checkin
tz
parents:
diff changeset
    96
              #'layout:' #(#LayoutFrame 194 0 152 0 593 0 451 0)
2137dff405f0 initial checkin
tz
parents:
diff changeset
    97
              #'label:' 'Directory View'
2137dff405f0 initial checkin
tz
parents:
diff changeset
    98
              #'min:' #(#Point 10 10)
2137dff405f0 initial checkin
tz
parents:
diff changeset
    99
              #'max:' #(#Point 1152 900)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   100
              #'bounds:' #(#Rectangle 194 152 594 452)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   101
              #'usePreferredExtent:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   102
          )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   103
          #'component:' 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   104
           #(#SpecCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   105
              #'collection:' 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   106
               #(
2137dff405f0 initial checkin
tz
parents:
diff changeset
   107
                 #(#DataSetSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   108
                    #'name:' 'filesDataSetView'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   109
                    #'layout:' #(#LayoutFrame 0 0.0 22 0.0 0 1.0 0 1.0)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   110
                    #'model:' #selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   111
                    #'hasHorizontalScrollBar:' true
2137dff405f0 initial checkin
tz
parents:
diff changeset
   112
                    #'hasVerticalScrollBar:' true
2137dff405f0 initial checkin
tz
parents:
diff changeset
   113
                    #'miniScrollerHorizontal:' true
2137dff405f0 initial checkin
tz
parents:
diff changeset
   114
                    #'dataList:' #listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   115
                    #'useIndex:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   116
                    #'doubleClickSelector:' #fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   117
                    #'columnHolder:' #fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   118
                    #'valueChangeSelector:' #fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   119
                    #'verticalSpacing:' 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   120
                )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   121
                 #(#ComboBoxSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   122
                    #'name:' 'formatComboBox'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   123
                    #'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 22 0)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   124
                    #'model:' #selectionOfFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   125
                    #'immediateAccept:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   126
                    #'acceptOnTab:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   127
                    #'comboList:' #listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   128
                )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   129
              )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   130
          )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   131
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   132
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   133
2137dff405f0 initial checkin
tz
parents:
diff changeset
   134
windowSpecOfFileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   135
2137dff405f0 initial checkin
tz
parents:
diff changeset
   136
    ^
2137dff405f0 initial checkin
tz
parents:
diff changeset
   137
     #(
2137dff405f0 initial checkin
tz
parents:
diff changeset
   138
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   139
          #'label:' ''
2137dff405f0 initial checkin
tz
parents:
diff changeset
   140
          #'width:' 30
2137dff405f0 initial checkin
tz
parents:
diff changeset
   141
          #'height:' 22
2137dff405f0 initial checkin
tz
parents:
diff changeset
   142
          #'printSelector:' #'iconOn:'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   143
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   144
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   145
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   146
          #'label:' 'File name'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   147
          #'minWidth:' 100
2137dff405f0 initial checkin
tz
parents:
diff changeset
   148
          #'model:' #baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   149
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   150
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   151
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   152
          #'label:' 'Size'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   153
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   154
          #'model:' #size
2137dff405f0 initial checkin
tz
parents:
diff changeset
   155
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   156
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   157
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   158
          #'label:' 'Modified'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   159
          #'model:' #modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   160
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   161
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   162
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   163
          #'label:' 'Permissions'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   164
          #'width:' 85
2137dff405f0 initial checkin
tz
parents:
diff changeset
   165
          #'model:' #permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   166
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   167
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   168
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   169
          #'label:' 'Owner'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   170
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   171
          #'model:' #owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   172
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   173
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   174
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   175
          #'label:' 'Group'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   176
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   177
          #'model:' #group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   178
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   179
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   180
    )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   181
2137dff405f0 initial checkin
tz
parents:
diff changeset
   182
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   183
2137dff405f0 initial checkin
tz
parents:
diff changeset
   184
!DirectoryView methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   185
2137dff405f0 initial checkin
tz
parents:
diff changeset
   186
directory: aDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   187
2137dff405f0 initial checkin
tz
parents:
diff changeset
   188
    directory := aDirectory asFilename asAbsoluteFilename name
2137dff405f0 initial checkin
tz
parents:
diff changeset
   189
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   190
2137dff405f0 initial checkin
tz
parents:
diff changeset
   191
fileAttributes: anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   192
2137dff405f0 initial checkin
tz
parents:
diff changeset
   193
    fileAttributes := anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   194
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   195
2137dff405f0 initial checkin
tz
parents:
diff changeset
   196
fileDoubleClickAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   197
2137dff405f0 initial checkin
tz
parents:
diff changeset
   198
    fileDoubleClickAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   199
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   200
2137dff405f0 initial checkin
tz
parents:
diff changeset
   201
fileFilterSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   202
2137dff405f0 initial checkin
tz
parents:
diff changeset
   203
    fileFilterSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   204
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   205
2137dff405f0 initial checkin
tz
parents:
diff changeset
   206
fileSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   207
2137dff405f0 initial checkin
tz
parents:
diff changeset
   208
    fileSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   209
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   210
2137dff405f0 initial checkin
tz
parents:
diff changeset
   211
listOfFileFilters: aCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   212
2137dff405f0 initial checkin
tz
parents:
diff changeset
   213
    self listOfFileFilters contents: aCollection.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   214
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   215
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   216
2137dff405f0 initial checkin
tz
parents:
diff changeset
   217
monitoring: aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   218
2137dff405f0 initial checkin
tz
parents:
diff changeset
   219
    aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   220
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   221
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   222
        monitoringTimeBlock := [self readDirectory].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   223
        self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   224
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   225
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   226
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   227
        monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   228
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   229
            Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   230
            monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   231
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   232
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   233
2137dff405f0 initial checkin
tz
parents:
diff changeset
   234
    monitoring := aBoolean.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   235
2137dff405f0 initial checkin
tz
parents:
diff changeset
   236
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   237
2137dff405f0 initial checkin
tz
parents:
diff changeset
   238
!DirectoryView methodsFor:'aspects'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   239
2137dff405f0 initial checkin
tz
parents:
diff changeset
   240
fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   241
2137dff405f0 initial checkin
tz
parents:
diff changeset
   242
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   243
    (holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   244
        |fileAttributeColumns|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   245
        builder aspectAt:#fileAttributeColumns put:(holder := List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   246
        fileAttributeColumns := self class windowSpecOfFileAttributeColumns collect: [:i| i decodeAsLiteralArray].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   247
        holder add: fileAttributeColumns first.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   248
        fileAttributeColumns do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   249
        [:col|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   250
            (fileAttributes includes: col label) ifTrue: [holder add: col]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   251
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   252
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   253
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   254
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   255
2137dff405f0 initial checkin
tz
parents:
diff changeset
   256
listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   257
2137dff405f0 initial checkin
tz
parents:
diff changeset
   258
    |holder|          
2137dff405f0 initial checkin
tz
parents:
diff changeset
   259
    (holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   260
        builder aspectAt:#listOfFileFilters put:(holder :=  List with: '*').
2137dff405f0 initial checkin
tz
parents:
diff changeset
   261
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   262
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   263
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   264
2137dff405f0 initial checkin
tz
parents:
diff changeset
   265
listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   266
2137dff405f0 initial checkin
tz
parents:
diff changeset
   267
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   268
    (holder := builder bindingAt:#listOfFiles) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   269
        builder aspectAt:#listOfFiles put:(holder :=  List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   270
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   271
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   272
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   273
2137dff405f0 initial checkin
tz
parents:
diff changeset
   274
selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   275
2137dff405f0 initial checkin
tz
parents:
diff changeset
   276
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   277
    (holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   278
        builder aspectAt:#selectionOfFile put:(holder :=  ValueHolder new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   279
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   280
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   281
2137dff405f0 initial checkin
tz
parents:
diff changeset
   282
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   283
2137dff405f0 initial checkin
tz
parents:
diff changeset
   284
selectionOfFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   285
2137dff405f0 initial checkin
tz
parents:
diff changeset
   286
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   287
    (holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   288
        builder aspectAt:#selectionOfFileFilter put:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   289
        (holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   290
        selectedFileFilter := '*'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   291
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   292
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   293
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   294
2137dff405f0 initial checkin
tz
parents:
diff changeset
   295
!DirectoryView methodsFor:'callbacks'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   296
2137dff405f0 initial checkin
tz
parents:
diff changeset
   297
fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   298
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   299
    (fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   300
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   301
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   302
        fileDoubleClickAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   303
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   304
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   305
            fileDoubleClickAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   306
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   307
        fileDoubleClickAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   308
        ifTrue:
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   309
        [                
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   310
            fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   311
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   312
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   313
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   314
2137dff405f0 initial checkin
tz
parents:
diff changeset
   315
fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   316
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   317
    (fileSelectAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   318
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   319
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   320
        fileSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   321
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   322
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   323
            fileSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   324
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   325
        fileSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   326
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   327
        [
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   328
            fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   329
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   330
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   331
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   332
2137dff405f0 initial checkin
tz
parents:
diff changeset
   333
!DirectoryView methodsFor:'initialization'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   334
2137dff405f0 initial checkin
tz
parents:
diff changeset
   335
initialize
2137dff405f0 initial checkin
tz
parents:
diff changeset
   336
2137dff405f0 initial checkin
tz
parents:
diff changeset
   337
    super initialize.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   338
2137dff405f0 initial checkin
tz
parents:
diff changeset
   339
    directory :=  directory ? '.' asFilename asAbsoluteFilename directoryName.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   340
    monitoring := false.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   341
    fileAttributes := #('File name' 'Size').
2137dff405f0 initial checkin
tz
parents:
diff changeset
   342
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   343
2137dff405f0 initial checkin
tz
parents:
diff changeset
   344
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   345
2137dff405f0 initial checkin
tz
parents:
diff changeset
   346
!DirectoryView methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   347
2137dff405f0 initial checkin
tz
parents:
diff changeset
   348
readDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   349
2137dff405f0 initial checkin
tz
parents:
diff changeset
   350
    |readBlock|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   351
    readTask notNil ifTrue: [readTask terminate].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   352
    readBlock :=
2137dff405f0 initial checkin
tz
parents:
diff changeset
   353
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   354
        |dir currentFilenames oldListOfFiles|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   355
        dir := directory asFilename.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   356
        currentFilenames := OrderedCollection new.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   357
        (dir isReadable and:[dir isExecutable]) ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   358
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   359
            self listOfFileFilters value do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   360
            [:filter|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   361
                (dir filesMatchingWithoutDotDirs: filter) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   362
                [:aFileName|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   363
                    |file|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   364
                    (file := dir construct: aFileName) isDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   365
                    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   366
                    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   367
                        currentFilenames add: file
2137dff405f0 initial checkin
tz
parents:
diff changeset
   368
                    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   369
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   370
            ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   371
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   372
        oldListOfFiles := self listOfFiles copy.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   373
        (currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet do: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   374
        [:fileName| 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   375
            (oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   376
            ifTrue:                                                                             
2137dff405f0 initial checkin
tz
parents:
diff changeset
   377
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   378
                |nearestFileRow r|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   379
                nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   380
                nearestFileRow = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   381
                ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   382
                ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   383
                monitoring ifTrue: [self selectionOfFile value: r].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   384
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   385
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   386
        self listOfFiles reverseDo:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   387
        [:fileRow|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   388
            (currentFilenames includes: fileRow fileName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   389
            ifFalse: [self listOfFiles remove: fileRow]
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
    monitoring
2137dff405f0 initial checkin
tz
parents:
diff changeset
   394
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   395
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   396
        readTask := readBlock forkAt: Processor userBackgroundPriority.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   397
        Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   398
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   399
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   400
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   401
        Cursor wait showWhile: [readBlock value]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   402
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   403
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   404
2137dff405f0 initial checkin
tz
parents:
diff changeset
   405
!DirectoryView methodsFor:'selection'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   406
2137dff405f0 initial checkin
tz
parents:
diff changeset
   407
selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   408
2137dff405f0 initial checkin
tz
parents:
diff changeset
   409
    ^selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   410
2137dff405f0 initial checkin
tz
parents:
diff changeset
   411
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   412
2137dff405f0 initial checkin
tz
parents:
diff changeset
   413
selectedFileFilter: aString
2137dff405f0 initial checkin
tz
parents:
diff changeset
   414
2137dff405f0 initial checkin
tz
parents:
diff changeset
   415
    aString size = 0 ifTrue: [self listOfFileFilters remove: selectedFileFilter ifAbsent: nil].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   416
    selectedFileFilter := aString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   417
    (self listOfFileFilters includes: selectedFileFilter) not &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   418
    selectedFileFilter notEmpty
2137dff405f0 initial checkin
tz
parents:
diff changeset
   419
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   420
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   421
        self listOfFileFilters addFirst: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   422
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   423
    (self listOfFileFilters includes: selectedFileFilter) &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   424
    fileFilterSelectAction notNil 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   425
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   426
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   427
        fileFilterSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   428
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   429
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   430
            fileFilterSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   431
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   432
        fileFilterSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   433
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   434
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   435
            fileFilterSelectAction value: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   436
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   437
    ].       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   438
    self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   439
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   440
2137dff405f0 initial checkin
tz
parents:
diff changeset
   441
!DirectoryView methodsFor:'startup / release'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   442
2137dff405f0 initial checkin
tz
parents:
diff changeset
   443
closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   444
2137dff405f0 initial checkin
tz
parents:
diff changeset
   445
    self release.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   446
2137dff405f0 initial checkin
tz
parents:
diff changeset
   447
    super closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   448
2137dff405f0 initial checkin
tz
parents:
diff changeset
   449
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   450
2137dff405f0 initial checkin
tz
parents:
diff changeset
   451
release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   452
2137dff405f0 initial checkin
tz
parents:
diff changeset
   453
    monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   454
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   455
        Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   456
        monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   457
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   458
2137dff405f0 initial checkin
tz
parents:
diff changeset
   459
    super release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   460
2137dff405f0 initial checkin
tz
parents:
diff changeset
   461
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   462
2137dff405f0 initial checkin
tz
parents:
diff changeset
   463
!DirectoryView::FileRow class methodsFor:'resources'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   464
2137dff405f0 initial checkin
tz
parents:
diff changeset
   465
HFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   466
2137dff405f0 initial checkin
tz
parents:
diff changeset
   467
    ^self hFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   468
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   469
2137dff405f0 initial checkin
tz
parents:
diff changeset
   470
MakefileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   471
    "ImageEditor openOnClass:self andSelector:#MakefileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   472
2137dff405f0 initial checkin
tz
parents:
diff changeset
   473
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   474
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 0 48 128 0 48 128 0 48 164 149 176 189 89 48 165 217 176 165 85 59 165 85 180 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   475
2137dff405f0 initial checkin
tz
parents:
diff changeset
   476
binaryFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   477
    "ImageEditor openOnClass:self andSelector:#binaryFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   478
2137dff405f0 initial checkin
tz
parents:
diff changeset
   479
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   480
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 243 128 7 247 128 5 244 142 100 240 155 100 112 155 103 243 155 99 245 155 96 48 142 96 57 128 0 48 153 192 50 155 96 48 155 96 48 155 96 49 155 96 56 153 192 48 128 0 48 255 255 240 255 255 241]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   481
2137dff405f0 initial checkin
tz
parents:
diff changeset
   482
cFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   483
    "ImageEditor openOnClass:self andSelector:#cFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   484
2137dff405f0 initial checkin
tz
parents:
diff changeset
   485
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   486
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 0 48 128 0 48 129 192 48 130 32 48 130 0 48 130 0 48 154 32 59 153 192 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   487
2137dff405f0 initial checkin
tz
parents:
diff changeset
   488
exeFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   489
    "ImageEditor openOnClass:self andSelector:#exefileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   490
2137dff405f0 initial checkin
tz
parents:
diff changeset
   491
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   492
    ^(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[85 85 85 85 85 64 0 0 21 85 64 0 0 17 85 64 0 0 16 85 64 0 0 16 21 65 85 85 85 85 65 170 170 165 85 65 85 85 85 5 65 255 255 253 5 65 255 255 253 5 65 255 255 253 5 65 255 255 253 5 65 255 255 253 5 65 255 255 253 5 65 85 85 85 5 64 0 0 0 5 64 0 0 0 5 85 85 85 85 85 85 85 85 85 85]) ; colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color red:0.0 green:49.9992 blue:49.9992)); at:4 put:((Color grey:66.9993)); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself
2137dff405f0 initial checkin
tz
parents:
diff changeset
   493
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   494
2137dff405f0 initial checkin
tz
parents:
diff changeset
   495
fileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   496
    "ImageEditor openOnClass:self andSelector:#fileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   497
2137dff405f0 initial checkin
tz
parents:
diff changeset
   498
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   499
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 0 48 128 0 48 128 0 48 128 0 48 128 0 48 128 0 48 128 0 59 128 0 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   500
2137dff405f0 initial checkin
tz
parents:
diff changeset
   501
hFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   502
    "ImageEditor openOnClass:self andSelector:#hFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   503
2137dff405f0 initial checkin
tz
parents:
diff changeset
   504
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   505
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 130 0 48 130 0 48 130 192 48 131 32 48 130 32 48 130 32 48 154 32 59 154 32 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   506
2137dff405f0 initial checkin
tz
parents:
diff changeset
   507
imageFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   508
    "ImageEditor openOnClass:self andSelector:#imageFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   509
2137dff405f0 initial checkin
tz
parents:
diff changeset
   510
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   511
    ^(Depth4Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 16 0 0 0 1 17 17 17 17 17 16 16 0 0 1 17 17 17 17 17 16 17 0 0 1 17 17 17 17 17 16 17 16 0 1 17 17 17 17 17 16 0 0 0 1 68 71 119 74 71 215 0 0 0 1 68 71 119 164 173 125 17 17 0 1 68 71 119 74 71 215 17 17 0 1 51 54 102 57 54 198 17 17 0 1 51 54 102 147 156 108 17 17 0 1 51 54 102 57 54 198 17 17 0 1 34 37 85 40 37 181 17 17 0 1 34 37 85 130 139 91 17 17 0 1 34 37 85 40 37 181 17 17 0 1 17 17 17 17 17 17 17 17 0 1 17 17 17 17 17 17 17 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]) ; 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.9992 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9992 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9992); add:(Color red:0.0 green:49.9992 blue:49.9992); add:(Color red:49.9992 green:49.9992 blue:0.0); add:(Color red:49.9992 green:0.0 blue:49.9992); add:(Color grey:49.9992); add:(Color grey:66.9993); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   512
2137dff405f0 initial checkin
tz
parents:
diff changeset
   513
imgFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   514
    "ImageEditor openOnClass:self andSelector:#imgFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   515
2137dff405f0 initial checkin
tz
parents:
diff changeset
   516
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   517
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 130 0 48 128 0 48 134 209 176 130 170 176 130 170 176 130 170 176 154 170 187 154 169 180 128 0 176 128 3 176 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   518
2137dff405f0 initial checkin
tz
parents:
diff changeset
   519
linkedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   520
    "ImageEditor openOnClass:self andSelector:#linkedFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   521
2137dff405f0 initial checkin
tz
parents:
diff changeset
   522
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   523
    ^(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[85 85 85 85 85 64 0 0 21 85 64 0 0 17 85 64 0 0 16 85 64 0 0 16 21 64 0 0 21 85 64 0 0 5 85 64 0 0 0 5 64 0 0 8 5 64 0 0 10 5 64 0 10 170 133 64 0 42 170 133 64 0 160 10 5 66 170 128 8 5 66 170 0 0 5 64 0 0 0 5 64 0 0 0 5 85 85 85 85 85 85 85 85 85 85]) ; 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:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   524
2137dff405f0 initial checkin
tz
parents:
diff changeset
   525
lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   526
    "ImageEditor openOnClass:self andSelector:#lockedFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   527
2137dff405f0 initial checkin
tz
parents:
diff changeset
   528
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   529
    ^(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[85 85 85 85 85 104 0 0 21 85 74 0 0 17 85 66 128 0 16 85 64 160 0 16 21 64 40 0 149 85 64 10 2 133 85 64 2 138 0 5 64 0 168 0 5 64 0 168 0 5 64 2 138 0 5 64 10 2 128 5 64 40 0 160 5 64 160 0 40 5 66 128 0 10 5 74 0 0 2 133 104 0 0 0 165 85 85 85 85 85 85 85 85 85 85]) ; 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:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   530
2137dff405f0 initial checkin
tz
parents:
diff changeset
   531
protoFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   532
2137dff405f0 initial checkin
tz
parents:
diff changeset
   533
    ^self MakefileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   534
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   535
2137dff405f0 initial checkin
tz
parents:
diff changeset
   536
rcFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   537
    "ImageEditor openOnClass:self andSelector:#rcFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   538
2137dff405f0 initial checkin
tz
parents:
diff changeset
   539
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   540
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 0 48 128 0 48 130 152 48 131 36 48 130 32 48 130 32 48 154 36 59 154 24 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   541
2137dff405f0 initial checkin
tz
parents:
diff changeset
   542
sFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   543
    "ImageEditor openOnClass:self andSelector:#sFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   544
2137dff405f0 initial checkin
tz
parents:
diff changeset
   545
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   546
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 0 48 128 0 48 129 128 48 130 0 48 131 0 48 129 128 48 152 128 59 155 0 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   547
2137dff405f0 initial checkin
tz
parents:
diff changeset
   548
stFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   549
    "ImageEditor openOnClass:self andSelector:#stFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   550
2137dff405f0 initial checkin
tz
parents:
diff changeset
   551
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   552
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 16 48 128 16 48 129 188 48 130 16 48 131 16 48 129 144 48 152 144 59 155 12 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   553
2137dff405f0 initial checkin
tz
parents:
diff changeset
   554
stcFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   555
    "ImageEditor openOnClass:self andSelector:#stcFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   556
2137dff405f0 initial checkin
tz
parents:
diff changeset
   557
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   558
    ^(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 255 249 128 7 240 128 5 242 128 4 240 128 4 112 128 7 240 128 3 248 128 32 48 128 32 48 129 243 48 130 36 176 131 36 48 129 164 48 152 164 187 155 51 52 128 0 48 128 0 48 255 255 240 255 255 240]) ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[255 252 0 255 254 0 255 255 0 255 255 128 255 255 192 255 255 224 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 255 255 240 127 255 240]) ; yourself); yourself! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   559
2137dff405f0 initial checkin
tz
parents:
diff changeset
   560
!DirectoryView::FileRow methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   561
2137dff405f0 initial checkin
tz
parents:
diff changeset
   562
baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   563
2137dff405f0 initial checkin
tz
parents:
diff changeset
   564
    ^baseName ? (baseName := fileName baseName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   565
2137dff405f0 initial checkin
tz
parents:
diff changeset
   566
2137dff405f0 initial checkin
tz
parents:
diff changeset
   567
2137dff405f0 initial checkin
tz
parents:
diff changeset
   568
2137dff405f0 initial checkin
tz
parents:
diff changeset
   569
2137dff405f0 initial checkin
tz
parents:
diff changeset
   570
2137dff405f0 initial checkin
tz
parents:
diff changeset
   571
2137dff405f0 initial checkin
tz
parents:
diff changeset
   572
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   573
2137dff405f0 initial checkin
tz
parents:
diff changeset
   574
fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   575
2137dff405f0 initial checkin
tz
parents:
diff changeset
   576
    ^fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   577
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   578
2137dff405f0 initial checkin
tz
parents:
diff changeset
   579
fileName: aFileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   580
2137dff405f0 initial checkin
tz
parents:
diff changeset
   581
    fileName := aFileName.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   582
    self validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   583
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   584
2137dff405f0 initial checkin
tz
parents:
diff changeset
   585
group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   586
2137dff405f0 initial checkin
tz
parents:
diff changeset
   587
    ^group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   588
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   589
2137dff405f0 initial checkin
tz
parents:
diff changeset
   590
iconOn:aGC
2137dff405f0 initial checkin
tz
parents:
diff changeset
   591
2137dff405f0 initial checkin
tz
parents:
diff changeset
   592
    (aGC registeredImageAt:iconKey) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   593
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   594
    [
474
7b19423c8b79 max read image size reduced
tz
parents: 473
diff changeset
   595
        ((iconKey == #imageFileIcon) and: [size < 5000])
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   596
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   597
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   598
            Object errorSignal handle: [:ex|]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   599
            do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   600
            [   
2137dff405f0 initial checkin
tz
parents:
diff changeset
   601
                |image|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   602
                (image := Image fromFile: fileName name) notNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   603
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   604
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   605
                    image extent y > 22
2137dff405f0 initial checkin
tz
parents:
diff changeset
   606
                    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   607
                    [         
2137dff405f0 initial checkin
tz
parents:
diff changeset
   608
                        image := image magnifiedBy: 22/image extent y
2137dff405f0 initial checkin
tz
parents:
diff changeset
   609
                    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   610
                    (aGC registeredImageAt: (iconKey := fileName name asSymbol)) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   611
                    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   612
                    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   613
                        aGC registerImage: image key: iconKey
2137dff405f0 initial checkin
tz
parents:
diff changeset
   614
                    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   615
                ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   616
            ] 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   617
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   618
        ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   619
        [  
2137dff405f0 initial checkin
tz
parents:
diff changeset
   620
            aGC registerImage: (self class perform: iconKey) key: iconKey
2137dff405f0 initial checkin
tz
parents:
diff changeset
   621
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   622
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   623
    ^aGC registeredImageAt: iconKey
2137dff405f0 initial checkin
tz
parents:
diff changeset
   624
2137dff405f0 initial checkin
tz
parents:
diff changeset
   625
2137dff405f0 initial checkin
tz
parents:
diff changeset
   626
2137dff405f0 initial checkin
tz
parents:
diff changeset
   627
2137dff405f0 initial checkin
tz
parents:
diff changeset
   628
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   629
2137dff405f0 initial checkin
tz
parents:
diff changeset
   630
modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   631
2137dff405f0 initial checkin
tz
parents:
diff changeset
   632
    ^modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   633
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   634
2137dff405f0 initial checkin
tz
parents:
diff changeset
   635
owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   636
2137dff405f0 initial checkin
tz
parents:
diff changeset
   637
    ^owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   638
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   639
2137dff405f0 initial checkin
tz
parents:
diff changeset
   640
permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   641
2137dff405f0 initial checkin
tz
parents:
diff changeset
   642
    ^permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   643
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   644
2137dff405f0 initial checkin
tz
parents:
diff changeset
   645
size
2137dff405f0 initial checkin
tz
parents:
diff changeset
   646
2137dff405f0 initial checkin
tz
parents:
diff changeset
   647
    ^size
2137dff405f0 initial checkin
tz
parents:
diff changeset
   648
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   649
2137dff405f0 initial checkin
tz
parents:
diff changeset
   650
!DirectoryView::FileRow methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   651
2137dff405f0 initial checkin
tz
parents:
diff changeset
   652
validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   653
2137dff405f0 initial checkin
tz
parents:
diff changeset
   654
    |info mode|    
2137dff405f0 initial checkin
tz
parents:
diff changeset
   655
    permissions := String new:9 withAll:$-.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   656
2137dff405f0 initial checkin
tz
parents:
diff changeset
   657
    (info := fileName info) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   658
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   659
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   660
        iconKey := #lockedFileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   661
        size    := owner := group := '?'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   662
      ^ self
2137dff405f0 initial checkin
tz
parents:
diff changeset
   663
    ].        
2137dff405f0 initial checkin
tz
parents:
diff changeset
   664
    size   := info size.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   665
    modified := info modified printString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   666
    owner  := OperatingSystem getUserNameFromID: info uid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   667
    group  := OperatingSystem getGroupNameFromID: info gid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   668
    mode   := info mode.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   669
2137dff405f0 initial checkin
tz
parents:
diff changeset
   670
    1 to:9 by:3 do:[:i|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   671
        #((0 $x) (1 $w) (2 $r)) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   672
        [:m|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   673
            (mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   674
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   675
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   676
2137dff405f0 initial checkin
tz
parents:
diff changeset
   677
    fileName isReadable
2137dff405f0 initial checkin
tz
parents:
diff changeset
   678
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   679
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   680
        info type == #symbolicLink
2137dff405f0 initial checkin
tz
parents:
diff changeset
   681
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   682
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   683
            ^iconKey := #linkedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   684
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   685
        ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   686
        [       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   687
            ((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol))
2137dff405f0 initial checkin
tz
parents:
diff changeset
   688
            or:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   689
            [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)])
2137dff405f0 initial checkin
tz
parents:
diff changeset
   690
            ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   691
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   692
                iconKey := #fileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   693
                (Image isImageFileSuffix:fileName suffix)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   694
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   695
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   696
                    ^iconKey := #imageFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   697
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   698
                (fileName suffix = 'o') | (fileName suffix = 'so')
2137dff405f0 initial checkin
tz
parents:
diff changeset
   699
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   700
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   701
                    ^iconKey := #binaryFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   702
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   703
2137dff405f0 initial checkin
tz
parents:
diff changeset
   704
                fileName isExecutableProgram
2137dff405f0 initial checkin
tz
parents:
diff changeset
   705
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   706
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   707
                    ^iconKey := #exeFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   708
                ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   709
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   710
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   711
    ] 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   712
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   713
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   714
        ^iconKey := #lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   715
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   716
2137dff405f0 initial checkin
tz
parents:
diff changeset
   717
2137dff405f0 initial checkin
tz
parents:
diff changeset
   718
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   719
2137dff405f0 initial checkin
tz
parents:
diff changeset
   720
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   721
2137dff405f0 initial checkin
tz
parents:
diff changeset
   722
version
2137dff405f0 initial checkin
tz
parents:
diff changeset
   723
    ^ '$Header$'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   724
! !