DirectoryView.st
changeset 1346 0793db434b21
parent 999 3dc1bc073981
child 1385 cbe7e7763105
equal deleted inserted replaced
1345:218b7fcff239 1346:0793db434b21
    83      DirectoryView open
    83      DirectoryView open
    84     "
    84     "
    85 
    85 
    86     <resource: #canvas>
    86     <resource: #canvas>
    87 
    87 
    88     ^
    88     ^ 
    89      
    89      #(#FullSpec
    90        #(#FullSpec
    90         #name: #windowSpec
    91           #window: 
    91         #window: 
    92            #(#WindowSpec
    92        #(#WindowSpec
    93               #name: 'Directory View'
    93           #label: 'Directory View'
    94               #layout: #(#LayoutFrame 412 0 367 0 811 0 666 0)
    94           #name: 'Directory View'
    95               #label: 'Directory View'
    95           #min: #(#Point 10 10)
    96               #min: #(#Point 10 10)
    96           #max: #(#Point 1152 900)
    97               #max: #(#Point 1152 900)
    97           #bounds: #(#Rectangle 13 23 413 323)
    98               #bounds: #(#Rectangle 412 367 812 667)
    98         )
    99               #usePreferredExtent: false
    99         #component: 
   100           )
   100        #(#SpecCollection
   101           #component: 
   101           #collection: #(
   102            #(#SpecCollection
   102            #(#DataSetSpec
   103               #collection: 
   103               #name: 'filesDataSetView'
   104                #(
   104               #layout: #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
   105                  #(#DataSetSpec
   105               #model: #selectionOfFile
   106                     #name: 'filesDataSetView'
   106               #menu: #fileListMenu
   107                     #layout: #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0)
   107               #hasHorizontalScrollBar: true
   108                     #model: #selectionOfFile
   108               #hasVerticalScrollBar: true
   109                     #hasHorizontalScrollBar: true
   109               #miniScrollerHorizontal: true
   110                     #hasVerticalScrollBar: true
   110               #dataList: #listOfFiles
   111                     #miniScrollerHorizontal: true
   111               #useIndex: false
   112                     #dataList: #listOfFiles
   112               #has3Dsepartors: false
   113                     #useIndex: false
   113               #doubleClickSelector: #fileDoubleClicked
   114                     #doubleClickSelector: #fileDoubleClicked
   114               #columnHolder: #fileAttributeColumns
   115                     #columnHolder: #fileAttributeColumns
   115               #valueChangeSelector: #fileSelected
   116                     #valueChangeSelector: #fileSelected
   116               #verticalSpacing: 1
   117                     #verticalSpacing: 1
   117             )
   118                 )
   118            #(#ComboBoxSpec
   119                  #(#ComboBoxSpec
   119               #name: 'formatComboBox'
   120                     #name: 'formatComboBox'
   120               #layout: #(#LayoutFrame 63 0.0 0 0 0 1.0 22 0)
   121                     #layout: #(#LayoutFrame 63 0.0 0 0 0 1.0 22 0)
   121               #model: #selectionOfFileFilter
   122                     #model: #selectionOfFileFilter
   122               #immediateAccept: false
   123                     #immediateAccept: false
   123               #acceptOnTab: false
   124                     #acceptOnTab: false
   124               #acceptOnPointerLeave: false
   125                     #comboList: #listOfFileFilters
   125               #comboList: #listOfFileFilters
   126                 )
   126             )
   127                  #(#LabelSpec
   127            #(#LabelSpec
   128                     #name: 'filterLabel'
   128               #label: 'Filter: '
   129                     #layout: #(#LayoutFrame 0 0 0 0 62 0 22 0)
   129               #name: 'filterLabel'
   130                     #label: 'Filter: '
   130               #layout: #(#LayoutFrame 0 0 0 0 62 0 22 0)
   131                     #adjust: #right
   131               #adjust: #right
   132                 )
   132             )
   133               )
   133            )
   134           )
   134          
       
   135         )
   135       )
   136       )
       
   137 
       
   138     "Modified: / 11.2.2000 / 00:11:43 / cg"
   136 ! !
   139 ! !
   137 
   140 
   138 !DirectoryView class methodsFor:'list specs'!
   141 !DirectoryView class methodsFor:'list specs'!
   139 
   142 
   140 tableColumnsForFileAttributes
   143 tableColumnsForFileAttributes
   201            #canSelect: false
   204            #canSelect: false
   202        )
   205        )
   203      )
   206      )
   204 ! !
   207 ! !
   205 
   208 
       
   209 !DirectoryView class methodsFor:'menu specs'!
       
   210 
       
   211 fileListMenu
       
   212     "This resource specification was automatically generated
       
   213      by the MenuEditor of ST/X."
       
   214 
       
   215     "Do not manually edit this!! If it is corrupted,
       
   216      the MenuEditor may not be able to read the specification."
       
   217 
       
   218     "
       
   219      MenuEditor new openOnClass:DirectoryView andSelector:#fileListMenu
       
   220      (Menu new fromLiteralArrayEncoding:(DirectoryView fileListMenu)) startUp
       
   221     "
       
   222 
       
   223     <resource: #menu>
       
   224 
       
   225     ^ 
       
   226      #(#Menu
       
   227         #(
       
   228          #(#MenuItem
       
   229             #label: 'Update'
       
   230             #translateLabel: true
       
   231             #value: #updateFileList
       
   232           )
       
   233          )
       
   234         nil
       
   235         nil
       
   236       )
       
   237 
       
   238     "Created: / 11.2.2000 / 00:11:39 / cg"
       
   239 ! !
       
   240 
   206 !DirectoryView methodsFor:'accessing'!
   241 !DirectoryView methodsFor:'accessing'!
   207 
   242 
   208 directory: aDirectory
   243 directory: aDirectory
   209 
   244 
   210     directory := aDirectory asFilename asAbsoluteFilename name
   245     directory := aDirectory asFilename asAbsoluteFilename name
   364     monitoring := false.
   399     monitoring := false.
   365     fileAttributes := #('File name' 'Size' 'Modified').
   400     fileAttributes := #('File name' 'Size' 'Modified').
   366     self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
   401     self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]).
   367 
   402 
   368     "Modified: / 20.6.1998 / 14:46:10 / cg"
   403     "Modified: / 20.6.1998 / 14:46:10 / cg"
       
   404 ! !
       
   405 
       
   406 !DirectoryView methodsFor:'menu actions'!
       
   407 
       
   408 updateFileList
       
   409     DirectoryContents flushCache.
       
   410     self readDirectory
       
   411 
       
   412     "Created: / 11.2.2000 / 00:12:46 / cg"
       
   413     "Modified: / 11.2.2000 / 00:14:32 / cg"
   369 ! !
   414 ! !
   370 
   415 
   371 !DirectoryView methodsFor:'private'!
   416 !DirectoryView methodsFor:'private'!
   372 
   417 
   373 readDirectory
   418 readDirectory