FileSelectionBrowser.st
author Claus Gittinger <cg@exept.de>
Sat, 21 Jul 2012 18:58:03 +0200
changeset 2898 c7f6c498df6a
parent 2777 eb16ea45aa92
child 3197 239fe0968d06
permissions -rw-r--r--
category of:15 methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
404
35982cf1482f initial checkin
tz
parents:
diff changeset
     1
"
502
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
404
35982cf1482f initial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
35982cf1482f initial checkin
tz
parents:
diff changeset
     4
35982cf1482f initial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
35982cf1482f initial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
35982cf1482f initial checkin
tz
parents:
diff changeset
     7
 inclusion of the above copyright notice. This software may not
35982cf1482f initial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
35982cf1482f initial checkin
tz
parents:
diff changeset
     9
 other person. No title to or ownership of the software is
35982cf1482f initial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
35982cf1482f initial checkin
tz
parents:
diff changeset
    11
"
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    12
"{ Package: 'stx:libtool2' }"
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    13
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    14
SelectionBrowser subclass:#FileSelectionBrowser
35982cf1482f initial checkin
tz
parents:
diff changeset
    15
	instanceVariableNames:'selectedFileFilter directoryView listOfFileFilters directory'
35982cf1482f initial checkin
tz
parents:
diff changeset
    16
	classVariableNames:''
35982cf1482f initial checkin
tz
parents:
diff changeset
    17
	poolDictionaries:''
619
36c9d07f7dc3 class category changed
tz
parents: 615
diff changeset
    18
	category:'Interface-Dialogs'
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    19
!
35982cf1482f initial checkin
tz
parents:
diff changeset
    20
35982cf1482f initial checkin
tz
parents:
diff changeset
    21
!FileSelectionBrowser class methodsFor:'documentation'!
35982cf1482f initial checkin
tz
parents:
diff changeset
    22
35982cf1482f initial checkin
tz
parents:
diff changeset
    23
copyright
35982cf1482f initial checkin
tz
parents:
diff changeset
    24
"
502
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
    25
 COPYRIGHT (c) 1997 by eXept Software AG
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    26
              All Rights Reserved
35982cf1482f initial checkin
tz
parents:
diff changeset
    27
35982cf1482f initial checkin
tz
parents:
diff changeset
    28
 This software is furnished under a license and may be used
35982cf1482f initial checkin
tz
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
35982cf1482f initial checkin
tz
parents:
diff changeset
    30
 inclusion of the above copyright notice. This software may not
35982cf1482f initial checkin
tz
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
35982cf1482f initial checkin
tz
parents:
diff changeset
    32
 other person. No title to or ownership of the software is
35982cf1482f initial checkin
tz
parents:
diff changeset
    33
 hereby transferred.
35982cf1482f initial checkin
tz
parents:
diff changeset
    34
"
35982cf1482f initial checkin
tz
parents:
diff changeset
    35
35982cf1482f initial checkin
tz
parents:
diff changeset
    36
35982cf1482f initial checkin
tz
parents:
diff changeset
    37
!
35982cf1482f initial checkin
tz
parents:
diff changeset
    38
35982cf1482f initial checkin
tz
parents:
diff changeset
    39
documentation
35982cf1482f initial checkin
tz
parents:
diff changeset
    40
"
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    41
    The FileSelectionBrowser allows you to browse in file directories
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    42
    and to select files in order to load file contents or to save
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    43
    something to files.
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    44
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    45
    [start with:]
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    46
        FileSelectionBrowser open
502
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
    47
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
    48
    [author:]
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    49
        Thomas Zwick, eXept Software AG
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    50
"
35982cf1482f initial checkin
tz
parents:
diff changeset
    51
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
    52
35982cf1482f initial checkin
tz
parents:
diff changeset
    53
!FileSelectionBrowser class methodsFor:'instance creation'!
35982cf1482f initial checkin
tz
parents:
diff changeset
    54
35982cf1482f initial checkin
tz
parents:
diff changeset
    55
request: aTitle fileName: aFileName inDirectory: dir withFileFilters: fileFilters
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    56
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    57
     using a fileFilter (list of mathcPatterns).
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    58
     Initial selection is aFileName.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    59
     return the pathName or nil if canceled."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    60
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    61
    ^self new
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    62
        title: aTitle;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    63
        fileName: aFileName;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    64
        directory: dir;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    65
        listOfFileFilters: fileFilters;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    66
        open
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    67
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    68
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    69
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    70
         request: 'Select Your Profile File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    71
         fileName: '.profile' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    72
         inDirectory: Filename homeDirectory 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    73
         withFileFilters: #('.*')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    74
    "
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    75
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    76
    "Modified: / 17.8.1998 / 10:15:50 / cg"
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    77
!
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    78
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    79
request:aTitle fileName:aFileName withFileFilters:fileFilters
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    80
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    81
     using a fileFilter (list of mathcPatterns).
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    82
     Initial selection is aFileName.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    83
     return the pathName or nil if canceled."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    84
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    85
    ^ self new
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    86
        title: aTitle;
35982cf1482f initial checkin
tz
parents:
diff changeset
    87
        fileName: aFileName;
35982cf1482f initial checkin
tz
parents:
diff changeset
    88
        listOfFileFilters: fileFilters;
35982cf1482f initial checkin
tz
parents:
diff changeset
    89
        open
35982cf1482f initial checkin
tz
parents:
diff changeset
    90
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    91
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    92
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    93
         request: 'Select Your Profile File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    94
         fileName: '/etc/fstab' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    95
         withFileFilters: #('*')  
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    96
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    97
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    98
    "Modified: / 17.8.1998 / 10:15:50 / cg"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    99
!
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   100
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   101
request:aTitle inDirectory:aPath withFileFilters:fileFilters 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   102
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   103
     using a fileFilter (list of mathcPatterns)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   104
     return the pathName or nil if canceled."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   105
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   106
    ^ (self new)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   107
        title:aTitle;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   108
        directory:aPath;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   109
        listOfFileFilters:fileFilters;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   110
        open
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   111
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   112
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   113
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   114
         request: 'Select A File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   115
         inDirectory: '/etc' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   116
         withFileFilters: #('*.conf')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   117
    "
462
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   118
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   119
    "Modified: / 17.8.1998 / 10:15:50 / cg"
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   120
!
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   121
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   122
request:aTitle pathName:aPath withFileFilters:fileFilters 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   123
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   124
     using a fileFilter (list of mathcPatterns)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   125
     return the pathName or nil if canceled.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   126
     Obsolete - for backward compatibility."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   127
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   128
    ^ self
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   129
        request:aTitle inDirectory:aPath withFileFilters:fileFilters
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   130
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   131
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   132
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   133
         request: 'Select A File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   134
         pathName: '/etc' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   135
         withFileFilters: #('*.conf')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   136
    "
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   137
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   138
    "Modified: / 17.8.1998 / 10:15:50 / cg"
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   139
!
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   140
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   141
request:aTitle withFileFilters:fileFilters 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   142
    "ask for a file in the current directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   143
     using a fileFilter (list of mathcPatterns)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   144
     return the pathName or nil if canceled"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   145
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   146
    ^ (self new)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   147
        title:aTitle;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   148
        listOfFileFilters:fileFilters;
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   149
        open
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   150
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   151
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   152
     self request:'Select A File' withFileFilters:#('.*')
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   153
     self request:'Select A File' withFileFilters:#('*.mak;*.st')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   154
    "
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   155
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   156
    "Modified: / 17.8.1998 / 10:15:49 / cg"
462
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   157
!
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   158
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   159
requestFileName
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   160
    "ask for a file in the current directory;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   161
     return the pathName or nil if canceled"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   162
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   163
    ^ self new 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   164
        title:'Select A File';
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   165
        open
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   166
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   167
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   168
     self requestFileName
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   169
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   170
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   171
    "Modified: / 17.8.1998 / 10:15:48 / cg"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   172
!
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   173
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   174
requestFileNameInDirectory:aPath
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   175
    "ask for a file in a directory;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   176
     return the pathName or nil if canceled"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   177
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   178
    ^ self new 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   179
        title:'Select A File'; 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   180
        directory:aPath; 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   181
        open
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   182
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   183
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   184
     self requestFileNameInDirectory:'/etc' 
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   185
    "
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   186
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   187
    "Modified: / 17.8.1998 / 10:15:48 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   188
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   189
35982cf1482f initial checkin
tz
parents:
diff changeset
   190
!FileSelectionBrowser class methodsFor:'accessing'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   191
35982cf1482f initial checkin
tz
parents:
diff changeset
   192
loadImageFileNameFilters
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   193
    ^ OrderedCollection 
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   194
        withAll: #(
2594
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   195
                    '*.png ; *.gif ; *.bmp ; *.tif ; *.tiff ; *.xpm ; *.xbm ; *.jpeg ; *.jpg'
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   196
                    '*'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   197
                  )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   198
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   199
    "Modified: / 12.9.1998 / 17:23:42 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   200
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   201
35982cf1482f initial checkin
tz
parents:
diff changeset
   202
projectFileNameFilters
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   203
    ^Array withAll: #(
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   204
                      '*.st ; *.*o ; *.s ; *.c ; Make* ; *.project'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   205
                      '*'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   206
                     )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   207
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   208
    "Modified: / 12.9.1998 / 17:23:22 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   209
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   210
35982cf1482f initial checkin
tz
parents:
diff changeset
   211
saveImageFileNameFilters
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   212
    ^ OrderedCollection 
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   213
        withAll: #(
2594
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   214
                    '*.png ; *.gif ; *.bmp ; *.tif ; *.tiff ; *.xpm ; *.xbm'
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   215
                    '*'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   216
                  )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   217
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   218
    "Modified: / 12.9.1998 / 17:23:54 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   219
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   220
35982cf1482f initial checkin
tz
parents:
diff changeset
   221
!FileSelectionBrowser class methodsFor:'interface specs'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   222
35982cf1482f initial checkin
tz
parents:
diff changeset
   223
windowSpec
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   224
    "This resource specification was automatically generated
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   225
     by the UIPainter of ST/X."
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   226
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   227
    "Do not manually edit this!! If it is corrupted,
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   228
     the UIPainter may not be able to read the specification."
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   229
35982cf1482f initial checkin
tz
parents:
diff changeset
   230
    "
35982cf1482f initial checkin
tz
parents:
diff changeset
   231
     UIPainter new openOnClass:FileSelectionBrowser andSelector:#windowSpec
35982cf1482f initial checkin
tz
parents:
diff changeset
   232
     FileSelectionBrowser new openInterface:#windowSpec
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   233
     FileSelectionBrowser open
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   234
    "
35982cf1482f initial checkin
tz
parents:
diff changeset
   235
35982cf1482f initial checkin
tz
parents:
diff changeset
   236
    <resource: #canvas>
35982cf1482f initial checkin
tz
parents:
diff changeset
   237
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   238
    ^ 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   239
     #(#FullSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   240
        #name: #windowSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   241
        #window: 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   242
       #(#WindowSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   243
          #label: 'File Selection Browser'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   244
          #name: 'File Selection Browser'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   245
          #min: #(#Point 10 10)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   246
          #bounds: #(#Rectangle 18 51 618 401)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   247
        )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   248
        #component: 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   249
       #(#SpecCollection
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   250
          #collection: #(
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   251
           #(#VariableHorizontalPanelSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   252
              #name: 'panel'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   253
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -40 1.0)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   254
              #component: 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   255
             #(#SpecCollection
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   256
                #collection: #(
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   257
                 #(#ViewSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   258
                    #name: 'view1'
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   259
                    #component: 
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   260
                   #(#SpecCollection
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   261
                      #collection: #(
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   262
                       #(#FileSelectionTreeSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   263
                          #name: 'directoryTreeView'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   264
                          #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -25 1.0)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   265
                          #model: #selectionOfDirectory
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   266
                          #menu: #treeMenu
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   267
                          #hasHorizontalScrollBar: true
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   268
                          #hasVerticalScrollBar: true
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   269
                          #miniScrollerHorizontal: true
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   270
                          #showDirectoryIndicatorForRoot: false
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   271
                          #showDirectoryIndicator: true
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   272
                          #valueChangeSelector: #readDirectory
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   273
                          #hierarchicalList: #rootOfDirectory
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   274
                          #highlightMode: #line
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   275
                          #itemClass: 'Directory'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   276
                        )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   277
                       #(#InputFieldSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   278
                          #name: 'directoryInputField'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   279
                          #layout: #(#LayoutFrame 2 0.0 -22 1 0 1.0 0 1)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   280
                          #model: #selectionOfDirectory
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   281
                          #immediateAccept: false
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   282
                          #acceptOnPointerLeave: false
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   283
                        )
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   284
                       )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   285
                     
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   286
                    )
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   287
                  )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   288
                 #(#ViewSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   289
                    #name: 'view2'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   290
                    #component: 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   291
                   #(#SpecCollection
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   292
                      #collection: #(
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   293
                       #(#InputFieldSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   294
                          #name: 'EditField'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   295
                          #layout: #(#LayoutFrame 1 0.0 -22 1 -2 1.0 0 1)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   296
                          #model: #valueOfFileName
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   297
                          #acceptOnReturn: false
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   298
                          #acceptOnTab: false
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   299
                          #acceptOnPointerLeave: false
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   300
                        )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   301
                       #(#SubCanvasSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   302
                          #name: 'subCanvas1'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   303
                          #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -25 1.0)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   304
                          #clientHolder: #directoryView
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   305
                        )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   306
                       )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   307
                     
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   308
                    )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   309
                  )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   310
                 )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   311
               
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   312
              )
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   313
              #handles: #(#Any 0.5 1.0)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   314
            )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   315
           #(#UISubSpecification
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   316
              #name: 'SubSpecification'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   317
              #layout: #(#LayoutFrame 2 0.0 -32 1 0 1.0 0 1.0)
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   318
              #majorKey: #ToolApplicationModel
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   319
              #minorKey: #windowSpecForCommitWithoutChannels
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   320
            )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   321
           )
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   322
         
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   323
        )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   324
      )
35982cf1482f initial checkin
tz
parents:
diff changeset
   325
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   326
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   327
!FileSelectionBrowser class methodsFor:'menu specs'!
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   328
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   329
treeMenu
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   330
    "This resource specification was automatically generated
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   331
     by the MenuEditor of ST/X."
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   332
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   333
    "Do not manually edit this!! If it is corrupted,
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   334
     the MenuEditor may not be able to read the specification."
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   335
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   336
    "
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   337
     MenuEditor new openOnClass:FileSelectionBrowser andSelector:#treeMenu
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   338
     (Menu new fromLiteralArrayEncoding:(FileSelectionBrowser treeMenu)) startUp
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   339
    "
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   340
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   341
    <resource: #menu>
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   342
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   343
    ^ 
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   344
     #(#Menu
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   345
        #(
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   346
         #(#MenuItem
1458
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   347
            #label: 'Goto Home Directory'
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   348
            #translateLabel: true
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   349
            #value: #menuGotoHomeDirectory
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   350
          )
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   351
         #(#MenuItem
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   352
            #label: 'Goto Default Directory'
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   353
            #translateLabel: true
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   354
            #value: #menuGotoDefaultDirectory
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   355
          )
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   356
         #(#MenuItem
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   357
            #label: '-'
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   358
          )
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   359
         #(#MenuItem
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   360
            #label: 'Create directory...'
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   361
            #translateLabel: true
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   362
            #value: #menuCreateDirectory
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   363
          )
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   364
         #(#MenuItem
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   365
            #label: '-'
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   366
          )
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   367
         #(#MenuItem
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   368
            #label: 'Update'
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   369
            #translateLabel: true
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   370
            #value: #menuUpdate
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   371
          )
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   372
         )
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   373
        nil
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   374
        nil
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   375
      )
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   376
! !
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   377
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   378
!FileSelectionBrowser methodsFor:'accessing'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   379
35982cf1482f initial checkin
tz
parents:
diff changeset
   380
directory: aDirectory
35982cf1482f initial checkin
tz
parents:
diff changeset
   381
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   382
    directory := (aDirectory ? Filename currentDirectory) asFilename asAbsoluteFilename pathName
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   383
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   384
    "Modified: / 17.8.1998 / 10:15:53 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   385
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   386
35982cf1482f initial checkin
tz
parents:
diff changeset
   387
directoryView
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   388
    "return the directory view on the right side (a subcanvas)"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   389
35982cf1482f initial checkin
tz
parents:
diff changeset
   390
    ^directoryView ? (directoryView := DirectoryView new)
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   391
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   392
    "Modified: / 23.9.1998 / 16:46:50 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   393
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   394
35982cf1482f initial checkin
tz
parents:
diff changeset
   395
fileName: aFileName
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   396
    |prevDir|
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   397
35982cf1482f initial checkin
tz
parents:
diff changeset
   398
    self valueOfFileName value: (aFileName ? '') asFilename baseName.
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   399
    prevDir := directory.
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   400
    directory := directory ? ((aFileName ? '') asFilename asAbsoluteFilename directoryName).
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   401
2445
d5b2e523859b comment
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
   402
    "/ on systems with volumes, we might have to update the root here.
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   403
    (prevDir isNil
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   404
    or:[directory asFilename volume ~= prevDir asFilename volume]) ifTrue:[
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   405
        self setRootForFile:directory asFilename.
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   406
    ].
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   407
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   408
    "Modified: / 24.9.1998 / 23:41:08 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   409
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   410
35982cf1482f initial checkin
tz
parents:
diff changeset
   411
listOfFileFilters: anArray
35982cf1482f initial checkin
tz
parents:
diff changeset
   412
35982cf1482f initial checkin
tz
parents:
diff changeset
   413
    listOfFileFilters := anArray
35982cf1482f initial checkin
tz
parents:
diff changeset
   414
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   415
1398
284781677ae1 category changes
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   416
!FileSelectionBrowser methodsFor:'accessing-views'!
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   417
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   418
directoryInputField
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   419
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   420
    ^self componentAt: #directoryInputField
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   421
!
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   422
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   423
directoryTreeView
35982cf1482f initial checkin
tz
parents:
diff changeset
   424
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   425
    ^self componentAt: #directoryTreeView
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   426
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   427
35982cf1482f initial checkin
tz
parents:
diff changeset
   428
!FileSelectionBrowser methodsFor:'aspects'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   429
35982cf1482f initial checkin
tz
parents:
diff changeset
   430
rootOfDirectory
35982cf1482f initial checkin
tz
parents:
diff changeset
   431
35982cf1482f initial checkin
tz
parents:
diff changeset
   432
    |holder|
35982cf1482f initial checkin
tz
parents:
diff changeset
   433
    (holder := builder bindingAt:#rootOfDirectory) isNil ifTrue:[
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   434
        builder 
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   435
            aspectAt:#rootOfDirectory 
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   436
            put: (holder :=  Filename rootDirectory name asValue).
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   437
    ].
35982cf1482f initial checkin
tz
parents:
diff changeset
   438
    ^ holder
35982cf1482f initial checkin
tz
parents:
diff changeset
   439
1011
b3be5697d26f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   440
    "Modified: / 5.10.1998 / 12:46:10 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   441
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   442
35982cf1482f initial checkin
tz
parents:
diff changeset
   443
selectionOfDirectory
35982cf1482f initial checkin
tz
parents:
diff changeset
   444
35982cf1482f initial checkin
tz
parents:
diff changeset
   445
    |holder|
35982cf1482f initial checkin
tz
parents:
diff changeset
   446
    (holder := builder bindingAt:#selectionOfDirectory) isNil ifTrue:[
35982cf1482f initial checkin
tz
parents:
diff changeset
   447
        builder aspectAt:#selectionOfDirectory put: (holder := ValueHolder new)
35982cf1482f initial checkin
tz
parents:
diff changeset
   448
    ].
35982cf1482f initial checkin
tz
parents:
diff changeset
   449
    ^ holder
35982cf1482f initial checkin
tz
parents:
diff changeset
   450
35982cf1482f initial checkin
tz
parents:
diff changeset
   451
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   452
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   453
setRootForFile:aFilename
1144
480d64f9ad81 removed unused local
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   454
    |f root parent|
1000
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   455
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   456
    f := aFilename asFilename.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   457
    root := Filename rootDirectoryOnVolume:f volume.
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   458
    self directory:aFilename.
1000
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   459
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   460
    "/ on some systems, the root itself is not readable,
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   461
    "/ but subdirs are (WIN32-network drives and VMS)
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   462
    "/ to avoid trouble in the treeView, search for the
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   463
    "/ last readable directory and fake that as the trees root.
1000
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   464
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   465
    (root exists and:[root isDirectory and:[root isReadable]])
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   466
    ifFalse:[
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   467
        "/ search backward from aFilename for the last readable dir.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   468
        root := f.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   469
        parent := root directory.
1005
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   470
        [parent ~= root
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   471
         and:[parent exists 
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   472
         and:[parent isDirectory 
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   473
         and:[parent isReadable]]]]
1000
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   474
        whileTrue:[
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   475
            root := parent.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   476
            parent := root directory.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   477
        ].
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   478
    ].
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   479
1011
b3be5697d26f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   480
    self rootOfDirectory value:root pathName
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   481
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   482
    "Created: / 23.9.1998 / 16:36:28 / cg"
1011
b3be5697d26f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   483
    "Modified: / 5.10.1998 / 12:46:06 / cg"
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   484
!
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   485
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   486
valueOfFileName
35982cf1482f initial checkin
tz
parents:
diff changeset
   487
35982cf1482f initial checkin
tz
parents:
diff changeset
   488
    |holder|
35982cf1482f initial checkin
tz
parents:
diff changeset
   489
    (holder := builder bindingAt:#valueOfFileName) isNil ifTrue:[
35982cf1482f initial checkin
tz
parents:
diff changeset
   490
        builder aspectAt:#valueOfFileName put:(holder :=  ValueHolder new).
35982cf1482f initial checkin
tz
parents:
diff changeset
   491
    ].
35982cf1482f initial checkin
tz
parents:
diff changeset
   492
    ^ holder
35982cf1482f initial checkin
tz
parents:
diff changeset
   493
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   494
35982cf1482f initial checkin
tz
parents:
diff changeset
   495
!FileSelectionBrowser methodsFor:'callbacks'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   496
35982cf1482f initial checkin
tz
parents:
diff changeset
   497
fileDoubleClicked: aFileName
35982cf1482f initial checkin
tz
parents:
diff changeset
   498
35982cf1482f initial checkin
tz
parents:
diff changeset
   499
    self valueOfFileName value: aFileName.
35982cf1482f initial checkin
tz
parents:
diff changeset
   500
    accept value: true.
1035
25575d9c0fc5 replace send of #close with #closeRequest.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   501
    self closeRequest
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   502
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   503
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   504
menuCreateDirectory
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   505
    |newSubDirName currentDir|
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   506
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   507
    currentDir := self selectionOfDirectory value.
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   508
    currentDir isNil ifTrue:[
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   509
        self warn:'No directory selected.'.
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   510
        ^ self
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   511
    ].
1492
de23c1b76333 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1458
diff changeset
   512
    newSubDirName := Dialog 
de23c1b76333 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1458
diff changeset
   513
                        request:(resources 
1915
6c4fc06faadb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   514
                                    stringWithCRs:'Create new directory in\\%1: ' 
6c4fc06faadb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   515
                                    with:(currentDir asFilename pathName allBold)).
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   516
    (currentDir asFilename construct:newSubDirName) makeDirectory.
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   517
    self menuUpdate
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   518
!
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   519
1458
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   520
menuGotoDefaultDirectory
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   521
    self selectionOfDirectory value:(Filename defaultDirectory pathName)
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   522
!
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   523
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   524
menuGotoHomeDirectory
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   525
    self selectionOfDirectory value:(Filename homeDirectory pathName)
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   526
!
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   527
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   528
menuUpdate
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   529
    (self componentAt:#directoryTreeView) monitorCycle.
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   530
!
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   531
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   532
readDirectory
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   533
    self directoryTreeView selection notNil ifTrue: [
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   534
        directoryView directory: self selectionOfDirectory value.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   535
        directoryView readDirectory.  
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   536
        self class lastSelection notNil ifTrue: [self class lastSelection: self selectionOfDirectory value]
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   537
    ]
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   538
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   539
    "Modified: / 24.9.1998 / 21:58:50 / cg"
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   540
! !
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   541
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   542
!FileSelectionBrowser methodsFor:'misc'!
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   543
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   544
entryCompletion
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   545
    |completedDirectory f dir treeView inputField|
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   546
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   547
    treeView := self directoryTreeView.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   548
    inputField := self directoryInputField.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   549
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   550
    f := inputField contents.
2450
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   551
    f asFilename isRootDirectory ifTrue:[
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   552
        dir := f.
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   553
    ] ifFalse:[
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   554
        dir := f asFilename directoryName.
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   555
    ].
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   556
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   557
    completedDirectory := Filename 
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   558
        filenameCompletionFor:f
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   559
        directory:dir
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   560
        directoriesOnly:true 
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   561
        filesOnly:false 
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   562
        ifMultiple:
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   563
            [:dir | 
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   564
                treeView selection notNil ifTrue:[
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   565
                    treeView selectedNodeExpand: true
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   566
                ]
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   567
            ].
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   568
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   569
    completedDirectory asFilename exists ifTrue:[
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   570
        "/ volume changed ... (win32 or VMS)
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   571
"/        completedDirectory asFilename volume ~= directory asFilename volume ifTrue:[
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   572
"/        ].
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   573
        completedDirectory asFilename volume ~= treeView scrolledView directory asFilename volume ifTrue:[
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   574
            treeView scrolledView directory:completedDirectory asFilename volume
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   575
        ].
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   576
        treeView selectPathname: completedDirectory.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   577
        inputField contents: completedDirectory.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   578
        self readDirectory
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   579
    ] ifFalse: [
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   580
        inputField flash
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   581
    ]
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   582
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   583
    "Created: / 24.9.1998 / 21:33:37 / cg"
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   584
    "Modified: / 24.9.1998 / 22:20:23 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   585
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   586
1716
5ae373f6fef0 method category rename
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   587
!FileSelectionBrowser methodsFor:'startup & release'!
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   588
35982cf1482f initial checkin
tz
parents:
diff changeset
   589
closeCancel
35982cf1482f initial checkin
tz
parents:
diff changeset
   590
35982cf1482f initial checkin
tz
parents:
diff changeset
   591
    directoryView release.
35982cf1482f initial checkin
tz
parents:
diff changeset
   592
    super closeCancel
35982cf1482f initial checkin
tz
parents:
diff changeset
   593
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   594
35982cf1482f initial checkin
tz
parents:
diff changeset
   595
closeRequest
35982cf1482f initial checkin
tz
parents:
diff changeset
   596
35982cf1482f initial checkin
tz
parents:
diff changeset
   597
    directoryView release.
35982cf1482f initial checkin
tz
parents:
diff changeset
   598
    super closeRequest
35982cf1482f initial checkin
tz
parents:
diff changeset
   599
35982cf1482f initial checkin
tz
parents:
diff changeset
   600
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   601
35982cf1482f initial checkin
tz
parents:
diff changeset
   602
open
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   603
    super open.
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   604
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   605
    "return the selected file or nil"
515
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   606
    accept value ifTrue:[
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   607
        ^ (self selectionOfDirectory value ? '') asFilename 
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   608
                constructString:(self valueOfFileName value ? '')
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   609
    ].
515
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   610
    ^ nil
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   611
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   612
    "Modified: / 17.8.1998 / 10:15:55 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   613
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   614
35982cf1482f initial checkin
tz
parents:
diff changeset
   615
postBuildWith:aBuilder
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   616
    |nm file|
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   617
35982cf1482f initial checkin
tz
parents:
diff changeset
   618
    directoryView listOfFileFilters: listOfFileFilters ? #('*').
462
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   619
    directoryView fileSelectAction: [:aFileName |self valueOfFileName value: aFileName asFilename baseName].
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   620
    directoryView fileDoubleClickAction: [:aFileName |self fileDoubleClicked: aFileName asFilename baseName].
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   621
    directoryView fileFilterSelectAction: [:fileFilter|
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   622
"/        CG: obscure code - isn't the code below the same as ?
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   623
"/        self valueOfFileName value:((self valueOfFileName value ? 'unknown') 
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   624
"/                                    asFilename
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   625
"/                                        withSuffix:(fileFilter asFilename suffix))
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   626
        self valueOfFileName value: (
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   627
            ((self valueOfFileName value ? 'unknown') readStream upTo: $.), '.',
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   628
            (fileFilter copy reverse readStream upTo: $.) reverse)
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   629
    ]. 
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   630
    nm := directory.
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   631
    nm isNil ifTrue:[
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   632
        nm := self class lastSelection.
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   633
        nm isNil ifTrue:[
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   634
            nm := Filename currentDirectory asAbsoluteFilename name.
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   635
        ].
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   636
    ].
2445
d5b2e523859b comment
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
   637
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   638
    self directoryTreeView selectPathname:nm.
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   639
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   640
    self directoryInputField 
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   641
        entryCompletionBlock:[:f| self entryCompletion].
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   642
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   643
    file := self valueOfFileName value.
626
402a50b931d5 select row of file after opening
tz
parents: 622
diff changeset
   644
    directoryView selectionOfFile value: 
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   645
        (directoryView listOfFiles 
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   646
            detect: [:row | row baseName = file] 
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   647
            ifNone: nil).
626
402a50b931d5 select row of file after opening
tz
parents: 622
diff changeset
   648
2027
56ea6e57b771 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   649
    super postBuildWith:aBuilder
969
c6530cd784bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   650
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   651
    "Modified: / 24.9.1998 / 23:41:29 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   652
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   653
35982cf1482f initial checkin
tz
parents:
diff changeset
   654
!FileSelectionBrowser class methodsFor:'documentation'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   655
35982cf1482f initial checkin
tz
parents:
diff changeset
   656
version
35982cf1482f initial checkin
tz
parents:
diff changeset
   657
    ^ '$Header$'
2594
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   658
!
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   659
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   660
version_CVS
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   661
    ^ '$Header$'
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   662
! !