FileSelectionBrowser.st
author Claus Gittinger <cg@exept.de>
Sun, 27 Aug 2017 16:37:24 +0200
changeset 3466 2d5ea09863c6
parent 3252 b5b2f185aa98
child 3490 e3b6106384a8
child 3630 5e718e0a754e
permissions -rw-r--r--
#BUGFIX by cg class: ImageEditor class comment/format in: #documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3197
239fe0968d06 class: FileSelectionBrowser
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
     1
"{ Encoding: utf8 }"
239fe0968d06 class: FileSelectionBrowser
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
     2
404
35982cf1482f initial checkin
tz
parents:
diff changeset
     3
"
502
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
     4
 COPYRIGHT (c) 1997 by eXept Software AG
404
35982cf1482f initial checkin
tz
parents:
diff changeset
     5
              All Rights Reserved
35982cf1482f initial checkin
tz
parents:
diff changeset
     6
35982cf1482f initial checkin
tz
parents:
diff changeset
     7
 This software is furnished under a license and may be used
35982cf1482f initial checkin
tz
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
35982cf1482f initial checkin
tz
parents:
diff changeset
     9
 inclusion of the above copyright notice. This software may not
35982cf1482f initial checkin
tz
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
35982cf1482f initial checkin
tz
parents:
diff changeset
    11
 other person. No title to or ownership of the software is
35982cf1482f initial checkin
tz
parents:
diff changeset
    12
 hereby transferred.
35982cf1482f initial checkin
tz
parents:
diff changeset
    13
"
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    14
"{ Package: 'stx:libtool2' }"
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    15
3197
239fe0968d06 class: FileSelectionBrowser
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
    16
"{ NameSpace: Smalltalk }"
239fe0968d06 class: FileSelectionBrowser
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
    17
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    18
SelectionBrowser subclass:#FileSelectionBrowser
35982cf1482f initial checkin
tz
parents:
diff changeset
    19
	instanceVariableNames:'selectedFileFilter directoryView listOfFileFilters directory'
35982cf1482f initial checkin
tz
parents:
diff changeset
    20
	classVariableNames:''
35982cf1482f initial checkin
tz
parents:
diff changeset
    21
	poolDictionaries:''
619
36c9d07f7dc3 class category changed
tz
parents: 615
diff changeset
    22
	category:'Interface-Dialogs'
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    23
!
35982cf1482f initial checkin
tz
parents:
diff changeset
    24
35982cf1482f initial checkin
tz
parents:
diff changeset
    25
!FileSelectionBrowser class methodsFor:'documentation'!
35982cf1482f initial checkin
tz
parents:
diff changeset
    26
35982cf1482f initial checkin
tz
parents:
diff changeset
    27
copyright
35982cf1482f initial checkin
tz
parents:
diff changeset
    28
"
502
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
    29
 COPYRIGHT (c) 1997 by eXept Software AG
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    30
              All Rights Reserved
35982cf1482f initial checkin
tz
parents:
diff changeset
    31
35982cf1482f initial checkin
tz
parents:
diff changeset
    32
 This software is furnished under a license and may be used
35982cf1482f initial checkin
tz
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
35982cf1482f initial checkin
tz
parents:
diff changeset
    34
 inclusion of the above copyright notice. This software may not
35982cf1482f initial checkin
tz
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
35982cf1482f initial checkin
tz
parents:
diff changeset
    36
 other person. No title to or ownership of the software is
35982cf1482f initial checkin
tz
parents:
diff changeset
    37
 hereby transferred.
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
35982cf1482f initial checkin
tz
parents:
diff changeset
    43
documentation
35982cf1482f initial checkin
tz
parents:
diff changeset
    44
"
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    45
    The FileSelectionBrowser allows you to browse in file directories
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    46
    and to select files in order to load file contents or to save
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    47
    something to files.
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    48
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    49
    [start with:]
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    50
        FileSelectionBrowser open
502
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
    51
624dc714fd69 copyright changed
tz
parents: 468
diff changeset
    52
    [author:]
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    53
        Thomas Zwick, eXept Software AG
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    54
"
35982cf1482f initial checkin
tz
parents:
diff changeset
    55
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
    56
35982cf1482f initial checkin
tz
parents:
diff changeset
    57
!FileSelectionBrowser class methodsFor:'instance creation'!
35982cf1482f initial checkin
tz
parents:
diff changeset
    58
35982cf1482f initial checkin
tz
parents:
diff changeset
    59
request: aTitle fileName: aFileName inDirectory: dir withFileFilters: fileFilters
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    60
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    61
     using a fileFilter (list of mathcPatterns).
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    62
     Initial selection is aFileName.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    63
     return the pathName or nil if canceled."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    64
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    65
    ^self new
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    66
        title: aTitle;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    67
        fileName: aFileName;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    68
        directory: dir;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    69
        listOfFileFilters: fileFilters;
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    70
        open
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    71
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    72
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    73
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    74
         request: 'Select Your Profile File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    75
         fileName: '.profile' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    76
         inDirectory: Filename homeDirectory 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    77
         withFileFilters: #('.*')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    78
    "
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    79
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    80
    "Modified: / 17.8.1998 / 10:15:50 / cg"
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    81
!
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
    82
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    83
request:aTitle fileName:aFileName withFileFilters:fileFilters
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    84
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    85
     using a fileFilter (list of mathcPatterns).
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    86
     Initial selection is aFileName.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    87
     return the pathName or nil if canceled."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    88
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    89
    ^ self new
404
35982cf1482f initial checkin
tz
parents:
diff changeset
    90
        title: aTitle;
35982cf1482f initial checkin
tz
parents:
diff changeset
    91
        fileName: aFileName;
35982cf1482f initial checkin
tz
parents:
diff changeset
    92
        listOfFileFilters: fileFilters;
35982cf1482f initial checkin
tz
parents:
diff changeset
    93
        open
35982cf1482f initial checkin
tz
parents:
diff changeset
    94
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
    95
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    96
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    97
         request: 'Select Your Profile File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    98
         fileName: '/etc/fstab' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
    99
         withFileFilters: #('*')  
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
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   102
    "Modified: / 17.8.1998 / 10:15:50 / cg"
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
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   105
request:aTitle inDirectory:aPath withFileFilters:fileFilters 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   106
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   107
     using a fileFilter (list of mathcPatterns)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   108
     return the pathName or nil if canceled."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   109
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   110
    ^ (self new)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   111
        title:aTitle;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   112
        directory:aPath;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   113
        listOfFileFilters:fileFilters;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   114
        open
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
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   117
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   118
         request: 'Select A File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   119
         inDirectory: '/etc' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   120
         withFileFilters: #('*.conf')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   121
    "
462
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   122
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   123
    "Modified: / 17.8.1998 / 10:15:50 / cg"
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   124
!
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   125
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   126
request:aTitle pathName:aPath withFileFilters:fileFilters 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   127
    "ask for a file in some directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   128
     using a fileFilter (list of mathcPatterns)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   129
     return the pathName or nil if canceled.
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   130
     Obsolete - for backward compatibility."
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   131
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:aTitle inDirectory:aPath withFileFilters:fileFilters
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   134
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   135
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   136
     self 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   137
         request: 'Select A File' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   138
         pathName: '/etc' 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   139
         withFileFilters: #('*.conf')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   140
    "
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   141
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   142
    "Modified: / 17.8.1998 / 10:15:50 / cg"
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   143
!
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   144
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   145
request:aTitle withFileFilters:fileFilters 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   146
    "ask for a file in the current directory,
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   147
     using a fileFilter (list of mathcPatterns)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   148
     return the pathName or nil if canceled"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   149
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   150
    ^ (self new)
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   151
        title:aTitle;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   152
        listOfFileFilters:fileFilters;
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   153
        open
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   154
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   155
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   156
     self request:'Select A File' withFileFilters:#('.*')
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   157
     self request:'Select A File' withFileFilters:#('*.mak;*.st')
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   158
    "
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   159
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   160
    "Modified: / 17.8.1998 / 10:15:49 / cg"
462
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   161
!
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   162
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   163
requestFileName
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   164
    "ask for a file in the current directory;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   165
     return the pathName or nil if canceled"
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
    ^ self new 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   168
        title:'Select A File';
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   169
        open
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
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   172
     self requestFileName
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   173
    "
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   174
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   175
    "Modified: / 17.8.1998 / 10:15:48 / cg"
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
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   178
requestFileNameInDirectory:aPath
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   179
    "ask for a file in a directory;
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   180
     return the pathName or nil if canceled"
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   181
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   182
    ^ self new 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   183
        title:'Select A File'; 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   184
        directory:aPath; 
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   185
        open
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
    "
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   188
     self requestFileNameInDirectory:'/etc' 
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   189
    "
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   190
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   191
    "Modified: / 17.8.1998 / 10:15:48 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   192
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   193
35982cf1482f initial checkin
tz
parents:
diff changeset
   194
!FileSelectionBrowser class methodsFor:'accessing'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   195
35982cf1482f initial checkin
tz
parents:
diff changeset
   196
loadImageFileNameFilters
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   197
    ^ OrderedCollection 
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   198
        withAll: #(
2594
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   199
                    '*.png ; *.gif ; *.bmp ; *.tif ; *.tiff ; *.xpm ; *.xbm ; *.jpeg ; *.jpg'
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   200
                    '*'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   201
                  )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   202
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   203
    "Modified: / 12.9.1998 / 17:23:42 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   204
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   205
35982cf1482f initial checkin
tz
parents:
diff changeset
   206
projectFileNameFilters
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   207
    ^Array withAll: #(
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   208
                      '*.st ; *.*o ; *.s ; *.c ; Make* ; *.project'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   209
                      '*'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   210
                     )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   211
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   212
    "Modified: / 12.9.1998 / 17:23:22 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   213
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   214
35982cf1482f initial checkin
tz
parents:
diff changeset
   215
saveImageFileNameFilters
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   216
    ^ OrderedCollection 
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   217
        withAll: #(
3252
b5b2f185aa98 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3197
diff changeset
   218
                    '*.png ; *.gif ; *.jpg ; *.bmp ; *.tif ; *.tiff ; *.xpm ; *.xbm'
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   219
                    '*'
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   220
                  )
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   221
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   222
    "Modified: / 12.9.1998 / 17:23:54 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   223
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   224
35982cf1482f initial checkin
tz
parents:
diff changeset
   225
!FileSelectionBrowser class methodsFor:'interface specs'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   226
35982cf1482f initial checkin
tz
parents:
diff changeset
   227
windowSpec
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   228
    "This resource specification was automatically generated
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   229
     by the UIPainter of ST/X."
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   230
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   231
    "Do not manually edit this!! If it is corrupted,
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   232
     the UIPainter may not be able to read the specification."
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   233
35982cf1482f initial checkin
tz
parents:
diff changeset
   234
    "
35982cf1482f initial checkin
tz
parents:
diff changeset
   235
     UIPainter new openOnClass:FileSelectionBrowser andSelector:#windowSpec
35982cf1482f initial checkin
tz
parents:
diff changeset
   236
     FileSelectionBrowser new openInterface:#windowSpec
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   237
     FileSelectionBrowser open
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   238
    "
35982cf1482f initial checkin
tz
parents:
diff changeset
   239
35982cf1482f initial checkin
tz
parents:
diff changeset
   240
    <resource: #canvas>
35982cf1482f initial checkin
tz
parents:
diff changeset
   241
1260
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   242
    ^ 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   243
     #(#FullSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   244
        #name: #windowSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   245
        #window: 
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   246
       #(#WindowSpec
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   247
          #label: 'File Selection Browser'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   248
          #name: 'File Selection Browser'
6f81c1d73e75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   249
          #min: #(#Point 10 10)
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
2445
d5b2e523859b comment
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
   406
    "/ 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
   407
    (prevDir isNil
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   408
    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
   409
        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
   410
    ].
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
    "Modified: / 24.9.1998 / 23:41:08 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   413
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   414
35982cf1482f initial checkin
tz
parents:
diff changeset
   415
listOfFileFilters: anArray
35982cf1482f initial checkin
tz
parents:
diff changeset
   416
35982cf1482f initial checkin
tz
parents:
diff changeset
   417
    listOfFileFilters := anArray
35982cf1482f initial checkin
tz
parents:
diff changeset
   418
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   419
1398
284781677ae1 category changes
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   420
!FileSelectionBrowser methodsFor:'accessing-views'!
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   421
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   422
directoryInputField
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   423
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   424
    ^self componentAt: #directoryInputField
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   425
!
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   426
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   427
directoryTreeView
35982cf1482f initial checkin
tz
parents:
diff changeset
   428
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   429
    ^self componentAt: #directoryTreeView
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   430
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   431
35982cf1482f initial checkin
tz
parents:
diff changeset
   432
!FileSelectionBrowser methodsFor:'aspects'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   433
35982cf1482f initial checkin
tz
parents:
diff changeset
   434
rootOfDirectory
35982cf1482f initial checkin
tz
parents:
diff changeset
   435
35982cf1482f initial checkin
tz
parents:
diff changeset
   436
    |holder|
35982cf1482f initial checkin
tz
parents:
diff changeset
   437
    (holder := builder bindingAt:#rootOfDirectory) isNil ifTrue:[
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   438
        builder 
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   439
            aspectAt:#rootOfDirectory 
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   440
            put: (holder :=  Filename rootDirectory name asValue).
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   441
    ].
35982cf1482f initial checkin
tz
parents:
diff changeset
   442
    ^ holder
35982cf1482f initial checkin
tz
parents:
diff changeset
   443
1011
b3be5697d26f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   444
    "Modified: / 5.10.1998 / 12:46:10 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   445
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   446
35982cf1482f initial checkin
tz
parents:
diff changeset
   447
selectionOfDirectory
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
    (holder := builder bindingAt:#selectionOfDirectory) isNil ifTrue:[
35982cf1482f initial checkin
tz
parents:
diff changeset
   451
        builder aspectAt:#selectionOfDirectory put: (holder := ValueHolder new)
35982cf1482f initial checkin
tz
parents:
diff changeset
   452
    ].
35982cf1482f initial checkin
tz
parents:
diff changeset
   453
    ^ holder
35982cf1482f initial checkin
tz
parents:
diff changeset
   454
35982cf1482f initial checkin
tz
parents:
diff changeset
   455
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   456
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   457
setRootForFile:aFilename
1144
480d64f9ad81 removed unused local
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   458
    |f root parent|
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
    f := aFilename asFilename.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   461
    root := Filename rootDirectoryOnVolume:f volume.
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   462
    self directory:aFilename.
1000
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   463
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   464
    "/ on some systems, the root itself is not readable,
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   465
    "/ 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
   466
    "/ 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
   467
    "/ 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
   468
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   469
    (root exists and:[root isDirectory and:[root isReadable]])
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   470
    ifFalse:[
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   471
        "/ search backward from aFilename for the last readable dir.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   472
        root := f.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   473
        parent := root directory.
1005
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   474
        [parent ~= root
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   475
         and:[parent exists 
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   476
         and:[parent isDirectory 
0b2b698bc4f3 oops - avoid endless loop when alking dir-hierarchy up.
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
   477
         and:[parent isReadable]]]]
1000
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   478
        whileTrue:[
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   479
            root := parent.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   480
            parent := root directory.
efafa57e0313 kludge for win32 in #setRootForFile:
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   481
        ].
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
1011
b3be5697d26f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   484
    self rootOfDirectory value:root pathName
998
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   485
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   486
    "Created: / 23.9.1998 / 16:36:28 / cg"
1011
b3be5697d26f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   487
    "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
   488
!
ad33f2625598 care for volume changes in directory field.
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   489
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   490
valueOfFileName
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
    (holder := builder bindingAt:#valueOfFileName) isNil ifTrue:[
35982cf1482f initial checkin
tz
parents:
diff changeset
   494
        builder aspectAt:#valueOfFileName put:(holder :=  ValueHolder new).
35982cf1482f initial checkin
tz
parents:
diff changeset
   495
    ].
35982cf1482f initial checkin
tz
parents:
diff changeset
   496
    ^ holder
35982cf1482f initial checkin
tz
parents:
diff changeset
   497
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   498
35982cf1482f initial checkin
tz
parents:
diff changeset
   499
!FileSelectionBrowser methodsFor:'callbacks'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   500
35982cf1482f initial checkin
tz
parents:
diff changeset
   501
fileDoubleClicked: aFileName
35982cf1482f initial checkin
tz
parents:
diff changeset
   502
35982cf1482f initial checkin
tz
parents:
diff changeset
   503
    self valueOfFileName value: aFileName.
35982cf1482f initial checkin
tz
parents:
diff changeset
   504
    accept value: true.
1035
25575d9c0fc5 replace send of #close with #closeRequest.
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   505
    self closeRequest
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   506
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   507
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   508
menuCreateDirectory
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   509
    |newSubDirName currentDir|
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   510
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   511
    currentDir := self selectionOfDirectory value.
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   512
    currentDir isNil ifTrue:[
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   513
        self warn:'No directory selected.'.
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   514
        ^ self
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   515
    ].
1492
de23c1b76333 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1458
diff changeset
   516
    newSubDirName := Dialog 
de23c1b76333 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1458
diff changeset
   517
                        request:(resources 
1915
6c4fc06faadb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   518
                                    stringWithCRs:'Create new directory in\\%1: ' 
6c4fc06faadb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1854
diff changeset
   519
                                    with:(currentDir asFilename pathName allBold)).
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   520
    (currentDir asFilename construct:newSubDirName) makeDirectory.
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   521
    self menuUpdate
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   522
!
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   523
1458
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   524
menuGotoDefaultDirectory
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   525
    self selectionOfDirectory value:(Filename defaultDirectory 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
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   528
menuGotoHomeDirectory
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   529
    self selectionOfDirectory value:(Filename homeDirectory pathName)
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   530
!
72a40564b16e added goto home/default items to menu
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   531
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   532
menuUpdate
1597
b670ad8c30e1 builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents: 1492
diff changeset
   533
    (self componentAt:#directoryTreeView) monitorCycle.
1379
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   534
!
1a2e94a447e1 added createDir and update menu-items
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
   535
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   536
readDirectory
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   537
    self directoryTreeView selection notNil ifTrue: [
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   538
        directoryView directory: self selectionOfDirectory value.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   539
        directoryView readDirectory.  
745
d3995881fa13 some changes for instancing
tz
parents: 626
diff changeset
   540
        self class lastSelection notNil ifTrue: [self class lastSelection: self selectionOfDirectory value]
592
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
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   543
    "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
   544
! !
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   545
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   546
!FileSelectionBrowser methodsFor:'misc'!
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   547
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   548
entryCompletion
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   549
    |completedDirectory f dir treeView inputField|
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   550
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   551
    treeView := self directoryTreeView.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   552
    inputField := self directoryInputField.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   553
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   554
    f := inputField contents.
2450
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   555
    f asFilename isRootDirectory ifTrue:[
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   556
        dir := f.
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   557
    ] ifFalse:[
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   558
        dir := f asFilename directoryName.
ede256dd19a1 changed #entryCompletion
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   559
    ].
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   560
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   561
    completedDirectory := Filename 
1001
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:
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   567
            [:dir | 
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   568
                treeView selection notNil ifTrue:[
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   569
                    treeView selectedNodeExpand: true
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   570
                ]
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   571
            ].
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 exists ifTrue:[
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   574
        "/ volume changed ... (win32 or VMS)
2440
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   575
"/        completedDirectory asFilename volume ~= directory asFilename volume ifTrue:[
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   576
"/        ].
853ea1a1162a fixed entry callback and net-drive handling
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
   577
        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
   578
            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
   579
        ].
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   580
        treeView selectPathname: completedDirectory.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   581
        inputField contents: completedDirectory.
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   582
        self readDirectory
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   583
    ] ifFalse: [
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   584
        inputField flash
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
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   587
    "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
   588
    "Modified: / 24.9.1998 / 22:20:23 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   589
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   590
1716
5ae373f6fef0 method category rename
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   591
!FileSelectionBrowser methodsFor:'startup & release'!
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   592
35982cf1482f initial checkin
tz
parents:
diff changeset
   593
closeCancel
35982cf1482f initial checkin
tz
parents:
diff changeset
   594
35982cf1482f initial checkin
tz
parents:
diff changeset
   595
    directoryView release.
35982cf1482f initial checkin
tz
parents:
diff changeset
   596
    super closeCancel
35982cf1482f initial checkin
tz
parents:
diff changeset
   597
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   598
35982cf1482f initial checkin
tz
parents:
diff changeset
   599
closeRequest
35982cf1482f initial checkin
tz
parents:
diff changeset
   600
35982cf1482f initial checkin
tz
parents:
diff changeset
   601
    directoryView release.
35982cf1482f initial checkin
tz
parents:
diff changeset
   602
    super closeRequest
35982cf1482f initial checkin
tz
parents:
diff changeset
   603
35982cf1482f initial checkin
tz
parents:
diff changeset
   604
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   605
35982cf1482f initial checkin
tz
parents:
diff changeset
   606
open
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   607
    super open.
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   608
1353
701e41f8ff9f code cleanup
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
   609
    "return the selected file or nil"
515
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   610
    accept value ifTrue:[
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   611
        ^ (self selectionOfDirectory value ? '') asFilename 
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   612
                constructString:(self valueOfFileName value ? '')
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   613
    ].
515
1b64e990e495 Fix copyright.
Stefan Vogel <sv@exept.de>
parents: 502
diff changeset
   614
    ^ nil
957
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   615
c09018dc6954 comments
Claus Gittinger <cg@exept.de>
parents: 923
diff changeset
   616
    "Modified: / 17.8.1998 / 10:15:55 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   617
!
35982cf1482f initial checkin
tz
parents:
diff changeset
   618
35982cf1482f initial checkin
tz
parents:
diff changeset
   619
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
   620
    |nm file|
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   621
35982cf1482f initial checkin
tz
parents:
diff changeset
   622
    directoryView listOfFileFilters: listOfFileFilters ? #('*').
462
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   623
    directoryView fileSelectAction: [:aFileName |self valueOfFileName value: aFileName asFilename baseName].
90b8b353cd2f *** empty log message ***
tz
parents: 452
diff changeset
   624
    directoryView fileDoubleClickAction: [:aFileName |self fileDoubleClicked: aFileName asFilename baseName].
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   625
    directoryView fileFilterSelectAction: [:fileFilter|
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   626
"/        CG: obscure code - isn't the code below the same as ?
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   627
"/        self valueOfFileName value:((self valueOfFileName value ? 'unknown') 
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   628
"/                                    asFilename
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   629
"/                                        withSuffix:(fileFilter asFilename suffix))
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   630
        self valueOfFileName value: (
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   631
            ((self valueOfFileName value ? 'unknown') readStream upTo: $.), '.',
3197
239fe0968d06 class: FileSelectionBrowser
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
   632
            (fileFilter reversed readStream upTo: $.) reverse)
992
4d408220a60b fixed file filters.
Claus Gittinger <cg@exept.de>
parents: 969
diff changeset
   633
    ]. 
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   634
    nm := directory.
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   635
    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
   636
        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
   637
        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
   638
            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
   639
        ].
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   640
    ].
2445
d5b2e523859b comment
Claus Gittinger <cg@exept.de>
parents: 2440
diff changeset
   641
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   642
    self directoryTreeView selectPathname:nm.
592
0383cd70fe79 dir input field added
tz
parents: 589
diff changeset
   643
1001
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   644
    self directoryInputField 
4474ba86a5d8 made expandFilename a separate method and fixed it.
Claus Gittinger <cg@exept.de>
parents: 1000
diff changeset
   645
        entryCompletionBlock:[:f| self entryCompletion].
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   646
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   647
    file := self valueOfFileName value.
626
402a50b931d5 select row of file after opening
tz
parents: 622
diff changeset
   648
    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
   649
        (directoryView listOfFiles 
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   650
            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
   651
            ifNone: nil).
626
402a50b931d5 select row of file after opening
tz
parents: 622
diff changeset
   652
2027
56ea6e57b771 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   653
    super postBuildWith:aBuilder
969
c6530cd784bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   654
1003
7880fc48f0bb care for root when file changes and volume is different (win & vms)
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
   655
    "Modified: / 24.9.1998 / 23:41:29 / cg"
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   656
! !
35982cf1482f initial checkin
tz
parents:
diff changeset
   657
35982cf1482f initial checkin
tz
parents:
diff changeset
   658
!FileSelectionBrowser class methodsFor:'documentation'!
35982cf1482f initial checkin
tz
parents:
diff changeset
   659
35982cf1482f initial checkin
tz
parents:
diff changeset
   660
version
35982cf1482f initial checkin
tz
parents:
diff changeset
   661
    ^ '$Header$'
2594
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   662
!
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   663
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   664
version_CVS
2e3885af5ea3 changed:
Claus Gittinger <cg@exept.de>
parents: 2450
diff changeset
   665
    ^ '$Header$'
404
35982cf1482f initial checkin
tz
parents:
diff changeset
   666
! !
3197
239fe0968d06 class: FileSelectionBrowser
Claus Gittinger <cg@exept.de>
parents: 2777
diff changeset
   667