DirectoryView.st
author Claus Gittinger <cg@exept.de>
Fri, 06 Feb 1998 03:46:07 +0100
changeset 608 8610ea5b501d
parent 607 8b6cd53f93b8
child 614 41cd940faa45
permissions -rw-r--r--
geometry
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
!DirectoryView class methodsFor:'instance creation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    57
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    58
openOnDirectory: aDirectoryString
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    59
    "open a DirectoryView for a aDirectoryString"
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    60
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    61
    ^ (self new directory: aDirectoryString) open
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    62
516
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    63
    "
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    64
     self openOnDirectory: '/etc'
d336effde882 Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
    65
    "
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
    "Modified: / 28.1.1998 / 15:44:53 / stefan"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    68
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
    69
2137dff405f0 initial checkin
tz
parents:
diff changeset
    70
!DirectoryView class methodsFor:'interface specs'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
    71
2137dff405f0 initial checkin
tz
parents:
diff changeset
    72
windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    73
    "this window spec was automatically generated by the ST/X UIPainter"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    74
2137dff405f0 initial checkin
tz
parents:
diff changeset
    75
    "do not manually edit this - the painter/builder may not be able to
2137dff405f0 initial checkin
tz
parents:
diff changeset
    76
     handle the specification if its corrupted."
2137dff405f0 initial checkin
tz
parents:
diff changeset
    77
2137dff405f0 initial checkin
tz
parents:
diff changeset
    78
    "
2137dff405f0 initial checkin
tz
parents:
diff changeset
    79
     UIPainter new openOnClass:DirectoryView andSelector:#windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    80
     DirectoryView new openInterface:#windowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    81
    "
2137dff405f0 initial checkin
tz
parents:
diff changeset
    82
    "DirectoryView open"
2137dff405f0 initial checkin
tz
parents:
diff changeset
    83
2137dff405f0 initial checkin
tz
parents:
diff changeset
    84
    <resource: #canvas>
2137dff405f0 initial checkin
tz
parents:
diff changeset
    85
2137dff405f0 initial checkin
tz
parents:
diff changeset
    86
    ^
2137dff405f0 initial checkin
tz
parents:
diff changeset
    87
     
2137dff405f0 initial checkin
tz
parents:
diff changeset
    88
       #(#FullSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    89
          #'window:' 
2137dff405f0 initial checkin
tz
parents:
diff changeset
    90
           #(#WindowSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
    91
              #'name:' 'Directory View'
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    92
              #'layout:' #(#LayoutFrame 64 0 703 0 463 0 1002 0)
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    93
              #'label:' 'Directory View'
2137dff405f0 initial checkin
tz
parents:
diff changeset
    94
              #'min:' #(#Point 10 10)
2137dff405f0 initial checkin
tz
parents:
diff changeset
    95
              #'max:' #(#Point 1152 900)
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
    96
              #'bounds:' #(#Rectangle 64 703 464 1003)
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
    97
              #'usePreferredExtent:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
    98
          )
2137dff405f0 initial checkin
tz
parents:
diff changeset
    99
          #'component:' 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   100
           #(#SpecCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   101
              #'collection:' 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   102
               #(
2137dff405f0 initial checkin
tz
parents:
diff changeset
   103
                 #(#DataSetSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   104
                    #'name:' 'filesDataSetView'
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   105
                    #'layout:' #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   106
                    #'model:' #selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   107
                    #'hasHorizontalScrollBar:' true
2137dff405f0 initial checkin
tz
parents:
diff changeset
   108
                    #'hasVerticalScrollBar:' true
2137dff405f0 initial checkin
tz
parents:
diff changeset
   109
                    #'miniScrollerHorizontal:' true
2137dff405f0 initial checkin
tz
parents:
diff changeset
   110
                    #'dataList:' #listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   111
                    #'useIndex:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   112
                    #'doubleClickSelector:' #fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   113
                    #'columnHolder:' #fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   114
                    #'valueChangeSelector:' #fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   115
                    #'verticalSpacing:' 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   116
                )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   117
                 #(#ComboBoxSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   118
                    #'name:' 'formatComboBox'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   119
                    #'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 22 0)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   120
                    #'model:' #selectionOfFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   121
                    #'immediateAccept:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   122
                    #'acceptOnTab:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   123
                    #'comboList:' #listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   124
                )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   125
              )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   126
          )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   127
      )
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   128
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   129
    "Modified: / 6.2.1998 / 03:42:15 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   130
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   131
2137dff405f0 initial checkin
tz
parents:
diff changeset
   132
windowSpecOfFileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   133
2137dff405f0 initial checkin
tz
parents:
diff changeset
   134
    ^
2137dff405f0 initial checkin
tz
parents:
diff changeset
   135
     #(
2137dff405f0 initial checkin
tz
parents:
diff changeset
   136
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   137
          #'label:' ''
2137dff405f0 initial checkin
tz
parents:
diff changeset
   138
          #'width:' 30
2137dff405f0 initial checkin
tz
parents:
diff changeset
   139
          #'height:' 22
2137dff405f0 initial checkin
tz
parents:
diff changeset
   140
          #'printSelector:' #'iconOn:'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   141
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   142
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   143
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   144
          #'label:' 'File name'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   145
          #'labelAlignment:' #left
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   146
          #'minWidth:' 150
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   147
          #'model:' #baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   148
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   149
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   150
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   151
          #'label:' 'Size'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   152
          #'labelAlignment:' #left
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   153
          #'width:' 70
424
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
593
17f3d679fa72 better size info
tz
parents: 591
diff changeset
   158
          #'label:' 'Modified'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   159
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   160
          #'model:' #modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   161
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   162
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   163
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   164
          #'label:' 'Permissions'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   165
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   166
          #'width:' 85
2137dff405f0 initial checkin
tz
parents:
diff changeset
   167
          #'model:' #permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   168
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   169
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   170
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   171
          #'label:' 'Owner'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   172
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   173
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   174
          #'model:' #owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   175
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   176
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   177
       #(#DataSetColumnSpec
2137dff405f0 initial checkin
tz
parents:
diff changeset
   178
          #'label:' 'Group'
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   179
          #'labelAlignment:' #left
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   180
          #'width:' 50
2137dff405f0 initial checkin
tz
parents:
diff changeset
   181
          #'model:' #group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   182
          #'canSelect:' false
2137dff405f0 initial checkin
tz
parents:
diff changeset
   183
      )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   184
    )
2137dff405f0 initial checkin
tz
parents:
diff changeset
   185
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   186
    "Modified: / 6.2.1998 / 03:40:16 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   187
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   188
2137dff405f0 initial checkin
tz
parents:
diff changeset
   189
!DirectoryView methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   190
2137dff405f0 initial checkin
tz
parents:
diff changeset
   191
directory: aDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   192
2137dff405f0 initial checkin
tz
parents:
diff changeset
   193
    directory := aDirectory asFilename asAbsoluteFilename name
2137dff405f0 initial checkin
tz
parents:
diff changeset
   194
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   195
2137dff405f0 initial checkin
tz
parents:
diff changeset
   196
fileAttributes: anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   197
2137dff405f0 initial checkin
tz
parents:
diff changeset
   198
    fileAttributes := anArray
2137dff405f0 initial checkin
tz
parents:
diff changeset
   199
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   200
2137dff405f0 initial checkin
tz
parents:
diff changeset
   201
fileDoubleClickAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   202
2137dff405f0 initial checkin
tz
parents:
diff changeset
   203
    fileDoubleClickAction := 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
fileFilterSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   207
2137dff405f0 initial checkin
tz
parents:
diff changeset
   208
    fileFilterSelectAction := 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
fileSelectAction: anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   212
2137dff405f0 initial checkin
tz
parents:
diff changeset
   213
    fileSelectAction := anActionBlock
2137dff405f0 initial checkin
tz
parents:
diff changeset
   214
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   215
2137dff405f0 initial checkin
tz
parents:
diff changeset
   216
listOfFileFilters: aCollection
2137dff405f0 initial checkin
tz
parents:
diff changeset
   217
2137dff405f0 initial checkin
tz
parents:
diff changeset
   218
    self listOfFileFilters contents: aCollection.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   219
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   220
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   221
2137dff405f0 initial checkin
tz
parents:
diff changeset
   222
monitoring: aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   223
2137dff405f0 initial checkin
tz
parents:
diff changeset
   224
    aBoolean
2137dff405f0 initial checkin
tz
parents:
diff changeset
   225
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   226
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   227
        monitoringTimeBlock := [self readDirectory].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   228
        self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   229
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   230
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   231
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   232
        monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   233
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   234
            Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   235
            monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   236
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   237
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   238
2137dff405f0 initial checkin
tz
parents:
diff changeset
   239
    monitoring := aBoolean.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   240
2137dff405f0 initial checkin
tz
parents:
diff changeset
   241
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   242
2137dff405f0 initial checkin
tz
parents:
diff changeset
   243
!DirectoryView methodsFor:'aspects'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   244
2137dff405f0 initial checkin
tz
parents:
diff changeset
   245
fileAttributeColumns
2137dff405f0 initial checkin
tz
parents:
diff changeset
   246
2137dff405f0 initial checkin
tz
parents:
diff changeset
   247
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   248
    (holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   249
        |fileAttributeColumns|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   250
        builder aspectAt:#fileAttributeColumns put:(holder := List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   251
        fileAttributeColumns := self class windowSpecOfFileAttributeColumns collect: [:i| i decodeAsLiteralArray].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   252
        holder add: fileAttributeColumns first.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   253
        fileAttributeColumns do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   254
        [:col|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   255
            (fileAttributes includes: col label) ifTrue: [holder add: col]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   256
        ].
591
efb80a288277 labels inseted
tz
parents: 590
diff changeset
   257
        holder do: [:col| col label: ' ', col label]
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   258
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   259
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   260
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   261
2137dff405f0 initial checkin
tz
parents:
diff changeset
   262
listOfFileFilters
2137dff405f0 initial checkin
tz
parents:
diff changeset
   263
2137dff405f0 initial checkin
tz
parents:
diff changeset
   264
    |holder|          
2137dff405f0 initial checkin
tz
parents:
diff changeset
   265
    (holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   266
        builder aspectAt:#listOfFileFilters put:(holder :=  List with: '*').
2137dff405f0 initial checkin
tz
parents:
diff changeset
   267
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   268
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   269
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   270
2137dff405f0 initial checkin
tz
parents:
diff changeset
   271
listOfFiles
2137dff405f0 initial checkin
tz
parents:
diff changeset
   272
2137dff405f0 initial checkin
tz
parents:
diff changeset
   273
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   274
    (holder := builder bindingAt:#listOfFiles) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   275
        builder aspectAt:#listOfFiles put:(holder :=  List new).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   276
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   277
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   278
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   279
2137dff405f0 initial checkin
tz
parents:
diff changeset
   280
selectionOfFile
2137dff405f0 initial checkin
tz
parents:
diff changeset
   281
2137dff405f0 initial checkin
tz
parents:
diff changeset
   282
    |holder|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   283
    (holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   284
        builder aspectAt:#selectionOfFile put:(holder :=  ValueHolder new).
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
2137dff405f0 initial checkin
tz
parents:
diff changeset
   288
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   289
2137dff405f0 initial checkin
tz
parents:
diff changeset
   290
selectionOfFileFilter
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
    (holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[
2137dff405f0 initial checkin
tz
parents:
diff changeset
   294
        builder aspectAt:#selectionOfFileFilter put:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   295
        (holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   296
        selectedFileFilter := '*'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   297
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   298
    ^ holder
2137dff405f0 initial checkin
tz
parents:
diff changeset
   299
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   300
2137dff405f0 initial checkin
tz
parents:
diff changeset
   301
!DirectoryView methodsFor:'callbacks'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   302
2137dff405f0 initial checkin
tz
parents:
diff changeset
   303
fileDoubleClicked
2137dff405f0 initial checkin
tz
parents:
diff changeset
   304
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   305
    (fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   306
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   307
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   308
        fileDoubleClickAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   309
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   310
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   311
            fileDoubleClickAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   312
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   313
        fileDoubleClickAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   314
        ifTrue:
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   315
        [                
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   316
            fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   317
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   318
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   319
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   320
2137dff405f0 initial checkin
tz
parents:
diff changeset
   321
fileSelected
2137dff405f0 initial checkin
tz
parents:
diff changeset
   322
      
473
396ab247a5af be sure that file is selected
tz
parents: 451
diff changeset
   323
    (fileSelectAction notNil and: [self selectionOfFile value notNil]) 
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   324
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   325
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   326
        fileSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   327
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   328
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   329
            fileSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   330
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   331
        fileSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   332
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   333
        [
451
a8da4f1924a4 evaluate actions with complete path
tz
parents: 424
diff changeset
   334
            fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   335
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   336
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   337
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   338
2137dff405f0 initial checkin
tz
parents:
diff changeset
   339
!DirectoryView methodsFor:'initialization'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   340
2137dff405f0 initial checkin
tz
parents:
diff changeset
   341
initialize
2137dff405f0 initial checkin
tz
parents:
diff changeset
   342
2137dff405f0 initial checkin
tz
parents:
diff changeset
   343
    super initialize.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   344
2137dff405f0 initial checkin
tz
parents:
diff changeset
   345
    directory :=  directory ? '.' asFilename asAbsoluteFilename directoryName.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   346
    monitoring := false.
593
17f3d679fa72 better size info
tz
parents: 591
diff changeset
   347
    fileAttributes := #('File name' 'Size' 'Modified').
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   348
    self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   349
2137dff405f0 initial checkin
tz
parents:
diff changeset
   350
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   351
2137dff405f0 initial checkin
tz
parents:
diff changeset
   352
!DirectoryView methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   353
2137dff405f0 initial checkin
tz
parents:
diff changeset
   354
readDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   355
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   356
    |foundFiles| 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   357
    foundFiles := OrderedCollection new.
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   358
    Cursor wait showWhile: 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   359
    [ 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   360
        (DirectoryContents directoryNamed: directory) filesDo: 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   361
        [:file| 
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   362
            self listOfFileFilters value do:
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   363
            [:filter|
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   364
                (file name includesMatchString: filter)
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   365
                ifTrue:
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   366
                [
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   367
                    foundFiles add: (FileRow new fileName: file)
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   368
                ].
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   369
            ].
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   370
        ].
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   371
        self listOfFiles contents: foundFiles
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   372
    ]
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   373
!
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   374
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   375
readMonitoringDirectory
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   376
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   377
    |readBlock|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   378
    readTask notNil ifTrue: [readTask terminate].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   379
    readBlock :=
2137dff405f0 initial checkin
tz
parents:
diff changeset
   380
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   381
        |dir currentFilenames oldListOfFiles|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   382
        dir := directory asFilename.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   383
        currentFilenames := OrderedCollection new.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   384
        (dir isReadable and:[dir isExecutable]) ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   385
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   386
            self listOfFileFilters value do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   387
            [:filter|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   388
                (dir filesMatchingWithoutDotDirs: filter) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   389
                [:aFileName|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   390
                    |file|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   391
                    (file := dir construct: aFileName) isDirectory
2137dff405f0 initial checkin
tz
parents:
diff changeset
   392
                    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   393
                    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   394
                        currentFilenames add: file
2137dff405f0 initial checkin
tz
parents:
diff changeset
   395
                    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   396
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   397
            ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   398
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   399
        oldListOfFiles := self listOfFiles copy.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   400
        (currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet do: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   401
        [:fileName| 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   402
            (oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   403
            ifTrue:                                                                             
2137dff405f0 initial checkin
tz
parents:
diff changeset
   404
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   405
                |nearestFileRow r|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   406
                nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil).
2137dff405f0 initial checkin
tz
parents:
diff changeset
   407
                nearestFileRow = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   408
                ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   409
                ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   410
                monitoring ifTrue: [self selectionOfFile value: r].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   411
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   412
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   413
        self listOfFiles reverseDo:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   414
        [:fileRow|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   415
            (currentFilenames includes: fileRow fileName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   416
            ifFalse: [self listOfFiles remove: fileRow]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   417
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   418
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   419
2137dff405f0 initial checkin
tz
parents:
diff changeset
   420
    monitoring
2137dff405f0 initial checkin
tz
parents:
diff changeset
   421
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   422
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   423
        readTask := readBlock forkAt: Processor userBackgroundPriority.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   424
        Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   425
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   426
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   427
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   428
        Cursor wait showWhile: [readBlock value]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   429
    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   430
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   431
2137dff405f0 initial checkin
tz
parents:
diff changeset
   432
!DirectoryView methodsFor:'selection'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   433
2137dff405f0 initial checkin
tz
parents:
diff changeset
   434
selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   435
2137dff405f0 initial checkin
tz
parents:
diff changeset
   436
    ^selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   437
2137dff405f0 initial checkin
tz
parents:
diff changeset
   438
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   439
2137dff405f0 initial checkin
tz
parents:
diff changeset
   440
selectedFileFilter: aString
2137dff405f0 initial checkin
tz
parents:
diff changeset
   441
2137dff405f0 initial checkin
tz
parents:
diff changeset
   442
    aString size = 0 ifTrue: [self listOfFileFilters remove: selectedFileFilter ifAbsent: nil].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   443
    selectedFileFilter := aString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   444
    (self listOfFileFilters includes: selectedFileFilter) not &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   445
    selectedFileFilter notEmpty
2137dff405f0 initial checkin
tz
parents:
diff changeset
   446
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   447
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   448
        self listOfFileFilters addFirst: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   449
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   450
    (self listOfFileFilters includes: selectedFileFilter) &
2137dff405f0 initial checkin
tz
parents:
diff changeset
   451
    fileFilterSelectAction notNil 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   452
    ifTrue: 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   453
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   454
        fileFilterSelectAction numArgs = 0
2137dff405f0 initial checkin
tz
parents:
diff changeset
   455
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   456
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   457
            fileFilterSelectAction value
2137dff405f0 initial checkin
tz
parents:
diff changeset
   458
        ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   459
        fileFilterSelectAction numArgs = 1
2137dff405f0 initial checkin
tz
parents:
diff changeset
   460
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   461
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   462
            fileFilterSelectAction value: selectedFileFilter
2137dff405f0 initial checkin
tz
parents:
diff changeset
   463
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   464
    ].       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   465
    self readDirectory.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   466
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   467
2137dff405f0 initial checkin
tz
parents:
diff changeset
   468
!DirectoryView methodsFor:'startup / release'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   469
2137dff405f0 initial checkin
tz
parents:
diff changeset
   470
closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   471
2137dff405f0 initial checkin
tz
parents:
diff changeset
   472
    self release.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   473
2137dff405f0 initial checkin
tz
parents:
diff changeset
   474
    super closeRequest
2137dff405f0 initial checkin
tz
parents:
diff changeset
   475
2137dff405f0 initial checkin
tz
parents:
diff changeset
   476
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   477
2137dff405f0 initial checkin
tz
parents:
diff changeset
   478
release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   479
2137dff405f0 initial checkin
tz
parents:
diff changeset
   480
    monitoring ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   481
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   482
        Processor removeTimedBlock:monitoringTimeBlock.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   483
        monitoringTimeBlock := nil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   484
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   485
2137dff405f0 initial checkin
tz
parents:
diff changeset
   486
    super release
2137dff405f0 initial checkin
tz
parents:
diff changeset
   487
2137dff405f0 initial checkin
tz
parents:
diff changeset
   488
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   489
2137dff405f0 initial checkin
tz
parents:
diff changeset
   490
!DirectoryView::FileRow class methodsFor:'resources'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   491
2137dff405f0 initial checkin
tz
parents:
diff changeset
   492
HFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   493
2137dff405f0 initial checkin
tz
parents:
diff changeset
   494
    ^self hFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   495
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   496
2137dff405f0 initial checkin
tz
parents:
diff changeset
   497
MakefileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   498
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   499
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   500
    ImageEditor openOnClass:self andSelector:#MakefileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   501
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   502
2137dff405f0 initial checkin
tz
parents:
diff changeset
   503
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   504
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   505
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   506
        constantNamed:#'DirectoryView::FileRow MakefileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   507
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 @@0)IV0/U$0)]&0)UT;)UV4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   508
2137dff405f0 initial checkin
tz
parents:
diff changeset
   509
binaryFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   510
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   511
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   512
    ImageEditor openOnClass:self andSelector:#binaryFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   513
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   514
2137dff405f0 initial checkin
tz
parents:
diff changeset
   515
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   516
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   517
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   518
        constantNamed:#'DirectoryView::FileRow binaryFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   519
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???3 @_7 @W4#&S0&6Q0&6_3&6O5&6@0#&@9 @@0&\@2&6@0&6@0&6@1&6@8&\@0 @@0???0???1'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   520
2137dff405f0 initial checkin
tz
parents:
diff changeset
   521
cFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   522
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   523
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   524
    ImageEditor openOnClass:self andSelector:#cFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   525
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   526
2137dff405f0 initial checkin
tz
parents:
diff changeset
   527
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   528
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   529
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   530
        constantNamed:#'DirectoryView::FileRow cFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   531
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 \@0 "@0  @0  @0&"@;&\@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   532
2137dff405f0 initial checkin
tz
parents:
diff changeset
   533
exeFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   534
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   535
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   536
    ImageEditor openOnClass:self andSelector:#exeFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   537
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   538
2137dff405f0 initial checkin
tz
parents:
diff changeset
   539
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   540
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   541
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   542
        constantNamed:#'DirectoryView::FileRow exeFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   543
        ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU@@@@UUT@@@AEUP@@@DEU@@@@PETEUUUUUPZ**)UUAUUUUATG???4EP_???PUA???=ATG???4EP_???PUA???=ATEUUUTEP@@@@@U@@@@@AUUUUUUUUUUUUUTb'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color red:0.0 green:49.9977 blue:49.9977)); at:4 put:((Color grey:66.9978)); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   544
2137dff405f0 initial checkin
tz
parents:
diff changeset
   545
fileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   546
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   547
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   548
    ImageEditor openOnClass:self andSelector:#fileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   549
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   550
2137dff405f0 initial checkin
tz
parents:
diff changeset
   551
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   552
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   553
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   554
        constantNamed:#'DirectoryView::FileRow fileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   555
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 @@0 @@0 @@0 @@0 @@; @@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   556
2137dff405f0 initial checkin
tz
parents:
diff changeset
   557
hFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   558
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   559
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   560
    ImageEditor openOnClass:self andSelector:#hFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   561
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   562
2137dff405f0 initial checkin
tz
parents:
diff changeset
   563
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   564
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   565
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   566
        constantNamed:#'DirectoryView::FileRow hFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   567
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8  @0  @0 ,@0 2@0 "@0 "@0&"@;&"@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   568
2137dff405f0 initial checkin
tz
parents:
diff changeset
   569
imageFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   570
    "ImageEditor openOnClass:self andSelector:#imageFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   571
2137dff405f0 initial checkin
tz
parents:
diff changeset
   572
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   573
    ^(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
   574
2137dff405f0 initial checkin
tz
parents:
diff changeset
   575
imgFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   576
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   577
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   578
    ImageEditor openOnClass:self andSelector:#imgFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   579
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   580
2137dff405f0 initial checkin
tz
parents:
diff changeset
   581
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   582
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   583
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   584
        constantNamed:#'DirectoryView::FileRow imgFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   585
        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]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   586
2137dff405f0 initial checkin
tz
parents:
diff changeset
   587
linkedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   588
    "ImageEditor openOnClass:self andSelector:#linkedFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   589
2137dff405f0 initial checkin
tz
parents:
diff changeset
   590
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   591
    ^(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
   592
2137dff405f0 initial checkin
tz
parents:
diff changeset
   593
lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   594
    "ImageEditor openOnClass:self andSelector:#lockedFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   595
2137dff405f0 initial checkin
tz
parents:
diff changeset
   596
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   597
    ^(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
   598
2137dff405f0 initial checkin
tz
parents:
diff changeset
   599
protoFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   600
2137dff405f0 initial checkin
tz
parents:
diff changeset
   601
    ^self MakefileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   602
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   603
2137dff405f0 initial checkin
tz
parents:
diff changeset
   604
rcFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   605
    "ImageEditor openOnClass:self andSelector:#rcFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   606
2137dff405f0 initial checkin
tz
parents:
diff changeset
   607
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   608
    ^(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
   609
2137dff405f0 initial checkin
tz
parents:
diff changeset
   610
sFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   611
    "ImageEditor openOnClass:self andSelector:#sFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   612
2137dff405f0 initial checkin
tz
parents:
diff changeset
   613
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   614
    ^(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
   615
2137dff405f0 initial checkin
tz
parents:
diff changeset
   616
stFileIcon
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   617
    "Generated by the Image Editor"
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   618
    "
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   619
    ImageEditor openOnClass:self andSelector:#stFileIcon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   620
    "
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   621
2137dff405f0 initial checkin
tz
parents:
diff changeset
   622
    <resource: #image>
590
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   623
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   624
    ^Icon
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   625
        constantNamed:#'DirectoryView::FileRow stFileIcon'
c2f5cd223be2 read routine changed (monitoring will be added later)
tz
parents: 516
diff changeset
   626
        ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 A@0 A@0 [00 !!@0 1@0 Y@0&I@;&004 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]!
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   627
2137dff405f0 initial checkin
tz
parents:
diff changeset
   628
stcFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   629
    "ImageEditor openOnClass:self andSelector:#stcFileIcon"
2137dff405f0 initial checkin
tz
parents:
diff changeset
   630
2137dff405f0 initial checkin
tz
parents:
diff changeset
   631
    <resource: #image>
2137dff405f0 initial checkin
tz
parents:
diff changeset
   632
    ^(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
   633
2137dff405f0 initial checkin
tz
parents:
diff changeset
   634
!DirectoryView::FileRow methodsFor:'accessing'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   635
2137dff405f0 initial checkin
tz
parents:
diff changeset
   636
baseName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   637
2137dff405f0 initial checkin
tz
parents:
diff changeset
   638
    ^baseName ? (baseName := fileName baseName)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   639
2137dff405f0 initial checkin
tz
parents:
diff changeset
   640
2137dff405f0 initial checkin
tz
parents:
diff changeset
   641
2137dff405f0 initial checkin
tz
parents:
diff changeset
   642
2137dff405f0 initial checkin
tz
parents:
diff changeset
   643
2137dff405f0 initial checkin
tz
parents:
diff changeset
   644
2137dff405f0 initial checkin
tz
parents:
diff changeset
   645
2137dff405f0 initial checkin
tz
parents:
diff changeset
   646
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   647
2137dff405f0 initial checkin
tz
parents:
diff changeset
   648
fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   649
2137dff405f0 initial checkin
tz
parents:
diff changeset
   650
    ^fileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   651
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   652
2137dff405f0 initial checkin
tz
parents:
diff changeset
   653
fileName: aFileName
2137dff405f0 initial checkin
tz
parents:
diff changeset
   654
2137dff405f0 initial checkin
tz
parents:
diff changeset
   655
    fileName := aFileName.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   656
    self validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   657
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   658
2137dff405f0 initial checkin
tz
parents:
diff changeset
   659
group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   660
2137dff405f0 initial checkin
tz
parents:
diff changeset
   661
    ^group
2137dff405f0 initial checkin
tz
parents:
diff changeset
   662
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   663
2137dff405f0 initial checkin
tz
parents:
diff changeset
   664
iconOn:aGC
2137dff405f0 initial checkin
tz
parents:
diff changeset
   665
2137dff405f0 initial checkin
tz
parents:
diff changeset
   666
    (aGC registeredImageAt:iconKey) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   667
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   668
    [
474
7b19423c8b79 max read image size reduced
tz
parents: 473
diff changeset
   669
        ((iconKey == #imageFileIcon) and: [size < 5000])
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   670
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   671
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   672
            Object errorSignal handle: [:ex|]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   673
            do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   674
            [   
2137dff405f0 initial checkin
tz
parents:
diff changeset
   675
                |image|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   676
                (image := Image fromFile: fileName name) notNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   677
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   678
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   679
                    image extent y > 22
2137dff405f0 initial checkin
tz
parents:
diff changeset
   680
                    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   681
                    [         
2137dff405f0 initial checkin
tz
parents:
diff changeset
   682
                        image := image magnifiedBy: 22/image extent y
2137dff405f0 initial checkin
tz
parents:
diff changeset
   683
                    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   684
                    (aGC registeredImageAt: (iconKey := fileName name asSymbol)) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   685
                    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   686
                    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   687
                        aGC registerImage: image key: iconKey
2137dff405f0 initial checkin
tz
parents:
diff changeset
   688
                    ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   689
                ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   690
            ] 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   691
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   692
        ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   693
        [  
2137dff405f0 initial checkin
tz
parents:
diff changeset
   694
            aGC registerImage: (self class perform: iconKey) key: iconKey
2137dff405f0 initial checkin
tz
parents:
diff changeset
   695
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   696
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   697
    ^aGC registeredImageAt: iconKey
2137dff405f0 initial checkin
tz
parents:
diff changeset
   698
2137dff405f0 initial checkin
tz
parents:
diff changeset
   699
2137dff405f0 initial checkin
tz
parents:
diff changeset
   700
2137dff405f0 initial checkin
tz
parents:
diff changeset
   701
2137dff405f0 initial checkin
tz
parents:
diff changeset
   702
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   703
2137dff405f0 initial checkin
tz
parents:
diff changeset
   704
modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   705
2137dff405f0 initial checkin
tz
parents:
diff changeset
   706
    ^modified
2137dff405f0 initial checkin
tz
parents:
diff changeset
   707
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   708
2137dff405f0 initial checkin
tz
parents:
diff changeset
   709
owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   710
2137dff405f0 initial checkin
tz
parents:
diff changeset
   711
    ^owner
2137dff405f0 initial checkin
tz
parents:
diff changeset
   712
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   713
2137dff405f0 initial checkin
tz
parents:
diff changeset
   714
permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   715
2137dff405f0 initial checkin
tz
parents:
diff changeset
   716
    ^permissions
2137dff405f0 initial checkin
tz
parents:
diff changeset
   717
!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   718
2137dff405f0 initial checkin
tz
parents:
diff changeset
   719
size
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   720
    size isNumber ifFalse:[^ size].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   721
    size < 1000        ifTrue: [^ size printString].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   722
    size < (100*1024)  ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   723
    size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb'].
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   724
    ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb'
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   725
607
8b6cd53f93b8 geometry
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
   726
    "Modified: / 6.2.1998 / 03:38:45 / cg"
424
2137dff405f0 initial checkin
tz
parents:
diff changeset
   727
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   728
2137dff405f0 initial checkin
tz
parents:
diff changeset
   729
!DirectoryView::FileRow methodsFor:'private'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   730
2137dff405f0 initial checkin
tz
parents:
diff changeset
   731
validateAttributes
2137dff405f0 initial checkin
tz
parents:
diff changeset
   732
2137dff405f0 initial checkin
tz
parents:
diff changeset
   733
    |info mode|    
2137dff405f0 initial checkin
tz
parents:
diff changeset
   734
    permissions := String new:9 withAll:$-.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   735
2137dff405f0 initial checkin
tz
parents:
diff changeset
   736
    (info := fileName info) isNil
2137dff405f0 initial checkin
tz
parents:
diff changeset
   737
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   738
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   739
        iconKey := #lockedFileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   740
        size    := owner := group := '?'.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   741
      ^ self
2137dff405f0 initial checkin
tz
parents:
diff changeset
   742
    ].        
2137dff405f0 initial checkin
tz
parents:
diff changeset
   743
    size   := info size.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   744
    modified := info modified printString.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   745
    owner  := OperatingSystem getUserNameFromID: info uid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   746
    group  := OperatingSystem getGroupNameFromID: info gid.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   747
    mode   := info mode.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   748
2137dff405f0 initial checkin
tz
parents:
diff changeset
   749
    1 to:9 by:3 do:[:i|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   750
        #((0 $x) (1 $w) (2 $r)) do:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   751
        [:m|
2137dff405f0 initial checkin
tz
parents:
diff changeset
   752
            (mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   753
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   754
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   755
2137dff405f0 initial checkin
tz
parents:
diff changeset
   756
    fileName isReadable
2137dff405f0 initial checkin
tz
parents:
diff changeset
   757
    ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   758
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   759
        info type == #symbolicLink
2137dff405f0 initial checkin
tz
parents:
diff changeset
   760
        ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   761
        [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   762
            ^iconKey := #linkedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   763
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   764
        ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   765
        [       
2137dff405f0 initial checkin
tz
parents:
diff changeset
   766
            ((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol))
2137dff405f0 initial checkin
tz
parents:
diff changeset
   767
            or:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   768
            [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)])
2137dff405f0 initial checkin
tz
parents:
diff changeset
   769
            ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   770
            [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   771
                iconKey := #fileIcon.
2137dff405f0 initial checkin
tz
parents:
diff changeset
   772
                (Image isImageFileSuffix:fileName suffix)
2137dff405f0 initial checkin
tz
parents:
diff changeset
   773
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   774
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   775
                    ^iconKey := #imageFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   776
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   777
                (fileName suffix = 'o') | (fileName suffix = 'so')
2137dff405f0 initial checkin
tz
parents:
diff changeset
   778
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   779
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   780
                    ^iconKey := #binaryFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   781
                ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   782
2137dff405f0 initial checkin
tz
parents:
diff changeset
   783
                fileName isExecutableProgram
2137dff405f0 initial checkin
tz
parents:
diff changeset
   784
                ifTrue:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   785
                [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   786
                    ^iconKey := #exeFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   787
                ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   788
            ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   789
        ]
2137dff405f0 initial checkin
tz
parents:
diff changeset
   790
    ] 
2137dff405f0 initial checkin
tz
parents:
diff changeset
   791
    ifFalse:
2137dff405f0 initial checkin
tz
parents:
diff changeset
   792
    [
2137dff405f0 initial checkin
tz
parents:
diff changeset
   793
        ^iconKey := #lockedFileIcon
2137dff405f0 initial checkin
tz
parents:
diff changeset
   794
    ].
2137dff405f0 initial checkin
tz
parents:
diff changeset
   795
2137dff405f0 initial checkin
tz
parents:
diff changeset
   796
2137dff405f0 initial checkin
tz
parents:
diff changeset
   797
! !
2137dff405f0 initial checkin
tz
parents:
diff changeset
   798
2137dff405f0 initial checkin
tz
parents:
diff changeset
   799
!DirectoryView class methodsFor:'documentation'!
2137dff405f0 initial checkin
tz
parents:
diff changeset
   800
2137dff405f0 initial checkin
tz
parents:
diff changeset
   801
version
2137dff405f0 initial checkin
tz
parents:
diff changeset
   802
    ^ '$Header$'
2137dff405f0 initial checkin
tz
parents:
diff changeset
   803
! !