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