FileBrowser.st
author Claus Gittinger <cg@exept.de>
Sat, 21 Nov 1998 15:42:40 +0100
changeset 1964 ee92677f96af
parent 1962 b3355227e9da
child 1965 2533c3e08243
permissions -rw-r--r--
added image preview.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     1
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
     3
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     4
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    10
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    11
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    12
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    13
StandardSystemView subclass:#FileBrowser
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    14
	instanceVariableNames:'labelView filterField fileListView subView currentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    15
		fileList checkBlock checkDelta timeOfLastCheck myName killButton
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    16
		pauseToggle compressTabs lockUpdate previousDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    17
		currentFileName timeOfFileRead tabSpec commandView commandIndex
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    18
		fileEncoding tabRulerView scrollView icons listUpdateProcess
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    19
		currentFileInFileName lastFileDiffDirectory sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
    20
		sortCaseless showingDetails showingHiddenFiles'
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    21
	classVariableNames:'DirectoryHistory DirectoryHistoryWhere HistorySize DefaultIcon
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
    22
		CommandHistory CommandHistorySize Icons DefaultCommandPerSuffix'
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    23
	poolDictionaries:''
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
    24
	category:'Interface-Browsers'
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    25
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    26
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    27
!FileBrowser class methodsFor:'documentation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    28
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    29
copyright
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    30
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    31
 COPYRIGHT (c) 1991 by Claus Gittinger
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    32
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    33
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    34
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    35
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    36
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    37
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    38
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    39
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    40
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    41
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    42
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    43
documentation
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    44
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    45
    this used to be a very simple demo application,
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    46
    but migrated into a quite nice tool, includes all kinds of 
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    47
    warning and information boxes, background processes for directory-
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    48
    reading and internationalized strings. A good example for beginners,
100
claus
parents: 98
diff changeset
    49
    on how to do things .... (and maybe how not to do things ;-, since some
claus
parents: 98
diff changeset
    50
    stuff is historic and was implemented at times when better mechanisms
claus
parents: 98
diff changeset
    51
    were not available)
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    52
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    53
    See additional information in 'doc/misc/fbrowser.doc'.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
    54
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    55
    WARNING: files edited with FileBrowser will have leading spaces (multiple-8)
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    56
	     being replaced by tabs. If tabs are to be preserved at other
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    57
	     positions (for example, sendmail-config files) they will be
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    58
	     corrupt after being written.
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    59
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    60
    [instance variables]:
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    61
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    62
	checkDelta      <Integer>       number of seconds of check interval
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    63
					(looks ever so often if shown directory
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    64
					 has changed). You may make this number
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    65
					higher, if your network-times are
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    66
					incorrect and thus, the filebrowser
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    67
					checks too often.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    68
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    69
	compressTabs    <Boolean>       if true, leading spaces will be
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    70
					replaced by tabs when saving text
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    71
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    72
    some of the defaults (long/short list etc.) can be set by the resource file;
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    73
    see FileBrowser>>initialize for more details..
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    74
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 495
diff changeset
    75
    [author:]
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
    76
	Claus Gittinger
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    77
"
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
    78
! !
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    79
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    80
!FileBrowser class methodsFor:'instance creation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    81
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    82
openOn:aDirectoryPath
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    83
    "start a new FileBrowser in a pathname"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    84
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    85
    ^ (self new currentDirectory:aDirectoryPath) open
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    86
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    87
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    88
     FileBrowser openOn:'aDirectoryPath'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    89
     FileBrowser openOn:'/etc'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    90
     FileBrowser openOn:'..'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    91
     FileBrowser openOn:'.'
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
    92
    "
93
claus
parents: 85
diff changeset
    93
!
claus
parents: 85
diff changeset
    94
claus
parents: 85
diff changeset
    95
openOnFileNamed:aFilename
claus
parents: 85
diff changeset
    96
    "start a new FileBrowser on a file"
claus
parents: 85
diff changeset
    97
claus
parents: 85
diff changeset
    98
    |f browser|
claus
parents: 85
diff changeset
    99
claus
parents: 85
diff changeset
   100
    f := aFilename asFilename.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   101
    f isDirectory ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   102
	^ self openOn:aFilename
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   103
    ].
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   104
93
claus
parents: 85
diff changeset
   105
    browser := self new.
claus
parents: 85
diff changeset
   106
    browser currentDirectory:f directoryName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   107
    browser updateCurrentDirectory.
93
claus
parents: 85
diff changeset
   108
    browser showFile:f baseName.
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   109
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   110
    ^ browser open.
93
claus
parents: 85
diff changeset
   111
claus
parents: 85
diff changeset
   112
    "
claus
parents: 85
diff changeset
   113
     FileBrowser openOnFileNamed:'Makefile'
claus
parents: 85
diff changeset
   114
     FileBrowser openOnFileNamed:'../Makefile'
claus
parents: 85
diff changeset
   115
     FileBrowser openOnFileNamed:'/tmp/foo'
claus
parents: 85
diff changeset
   116
    "
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
   117
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
   118
    "Modified: / 17.6.1998 / 11:25:29 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   119
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   120
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   121
!FileBrowser class methodsFor:'class initialization'!
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   122
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   123
initializeIcons
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   124
    |resources|
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   125
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   126
    resources := self classResources.
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   127
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   128
    Icons := Dictionary new.
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   129
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   130
    #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   131
	"/ internal-type to icon mappings.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   132
	(#directory       'ICON_DIRECTORY'        'tiny_yellow_dir.xpm'       )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   133
	(#directoryLocked 'ICON_DIRECTORY_LOCKED' 'tiny_yellow_dir_locked.xpm')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   134
	(#directoryLink   'ICON_DIRECTORY_LINK'   'tiny_yellow_dir_link.xpm'  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   135
	(#file            'ICON_FILE'             'tiny_file_plain.xpm'       )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   136
	(#fileLink        'ICON_FILE_LINK'        'tiny_file_link.xpm'        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   137
	(#fileLocked      'ICON_FILE_LOCKED'      'tiny_file_lock.xpm'        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   138
	(#imageFile       'ICON_IMAGE_FILE'       'tiny_file_pix.xpm'         )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   139
	(#textFile        'ICON_TEXT_FILE'        'tiny_file_text.xpm'        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   140
	(#executableFile  'ICON_EXECUTABLEFILE'   'tiny_file_exec.xpm'        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   141
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   142
	"/ mime-type to icon mappings.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   143
	('text/plain'                     nil     'tiny_file_text.xpm'        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   144
	('text/html'                      nil     'tiny_file_text.xpm'        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   145
	('application/x-smalltalk-source' nil     'tiny_file_st.xpm'          )
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
   146
     ) do:[:entry |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   147
	|key resource defaultName nm|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   148
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   149
	key := entry at:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   150
	resource := entry at:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   151
	defaultName := entry at:3.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   152
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   153
	resource notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   154
	    nm := resources at:resource default:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   155
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   156
	nm isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   157
	    nm := 'bitmaps/xpmBitmaps/document_images/' , defaultName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   158
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   159
	Icons at:key put:(Image fromFile:nm).
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   160
    ]
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   161
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   162
    "
1178
f5f4d0c605db lazy initialization of Icons
Claus Gittinger <cg@exept.de>
parents: 1173
diff changeset
   163
     self initializeIcons
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   164
    "
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   165
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
   166
    "Modified: / 1.8.1998 / 17:39:27 / cg"
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   167
! !
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   168
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   169
!FileBrowser class methodsFor:'command history'!
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   170
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   171
addToCommandHistory:aCommandString for:aFilename
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   172
    |cmd suffix|
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
   173
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   174
    (aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   175
	CommandHistory notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   176
	    CommandHistory addFirst:aCommandString.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   177
	    CommandHistory size > CommandHistorySize ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   178
		CommandHistory removeLast
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   179
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   180
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   181
	aFilename notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   182
	    cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   183
	    DefaultCommandPerSuffix isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   184
		DefaultCommandPerSuffix := Dictionary new.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   185
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   186
	    suffix := aFilename asFilename suffix.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   187
	    suffix notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   188
		DefaultCommandPerSuffix at:suffix put:cmd.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   189
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   190
	]
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   191
    ]
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   192
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   193
    "Created: 14.11.1996 / 14:58:13 / cg"
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   194
! !
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   195
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   196
!FileBrowser class methodsFor:'defaults'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   197
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   198
defaultIcon
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   199
    "return the file browsers default window icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   200
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   201
    <resource: #style (#FILEBROWSER_ICON #FILEBROWSER_ICON_FILE)>
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   202
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   203
    |nm i res|
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   204
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   205
    (i := DefaultIcon) isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   206
	res := self classResources.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   207
	i := res at:'FILEBROWSER_ICON' default:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   208
	i isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   209
	    nm := res at:'FILEBROWSER_ICON_FILE' default:'FBrowser.xbm'.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   210
	    i := Image fromFile:nm resolution:100.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   211
	    i isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   212
		i := Image fromFile:('bitmaps/' , nm) resolution:100.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   213
		i isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   214
		    i := StandardSystemView defaultIcon
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   215
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   216
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   217
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   218
	i notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   219
	    DefaultIcon := i := i on:Display
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   220
	]
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   221
    ].
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   222
    ^ i
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
   223
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   224
    "Modified: 19.3.1997 / 20:48:34 / ca"
1287
93e2021e4ac8 fixed icon
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   225
    "Modified: 15.8.1997 / 15:27:19 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   226
! !
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
   227
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   228
!FileBrowser class methodsFor:'interface specs'!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   229
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   230
fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   231
    "This resource specification was automatically generated
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   232
     by the UIPainter of ST/X."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   233
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   234
    "Do not manually edit this!! If it is corrupted,
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   235
     the UIPainter may not be able to read the specification."
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   236
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   237
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   238
     UIPainter new openOnClass:FileBrowser andSelector:#fileSearchDialogSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   239
    "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   240
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   241
    <resource: #canvas>
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   242
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   243
    ^
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   244
     
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   245
       #(#FullSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   246
          #window: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   247
           #(#WindowSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   248
              #name: 'File Search'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   249
              #layout: #(#LayoutFrame 216 0 173 0 527 0 472 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   250
              #label: 'File Search'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   251
              #min: #(#Point 10 10)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   252
              #max: #(#Point 1280 1024)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   253
              #bounds: #(#Rectangle 216 173 528 473)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   254
              #usePreferredExtent: false
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   255
          )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   256
          #component: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   257
           #(#SpecCollection
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   258
              #collection: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   259
               #(
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   260
                 #(#HorizontalPanelViewSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   261
                    #name: 'HorizontalPanel1'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   262
                    #layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1.0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   263
                    #component: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   264
                     #(#SpecCollection
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   265
                        #collection: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   266
                         #(
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   267
                           #(#ActionButtonSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   268
                              #name: 'Button1'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   269
                              #label: 'Cancel'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   270
                              #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   271
                              #model: #cancel
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   272
                              #extent: #(#Point 151 22)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   273
                          )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   274
                           #(#ActionButtonSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   275
                              #name: 'Button2'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   276
                              #label: 'Search'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   277
                              #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   278
                              #model: #accept
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   279
                              #extent: #(#Point 152 25)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   280
                          )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   281
                        )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   282
                    )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   283
                    #horizontalLayout: #fitSpace
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   284
                    #verticalLayout: #center
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   285
                    #horizontalSpace: 3
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   286
                    #verticalSpace: 3
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   287
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   288
                 #(#LabelSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   289
                    #name: 'Label1'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   290
                    #layout: #(#LayoutFrame 0 0 10 0 300 0 32 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   291
                    #label: 'Search for files named:'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   292
                    #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   293
                    #adjust: #left
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   294
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   295
                 #(#InputFieldSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   296
                    #name: 'EntryField1'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   297
                    #layout: #(#LayoutFrame 10 0 40 0 305 0 62 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   298
                    #model: #namePatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   299
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   300
                 #(#CheckBoxSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   301
                    #name: 'CheckBox1'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   302
                    #layout: #(#LayoutFrame 10 0 70 0 146 0 92 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   303
                    #model: #ignoreCaseInName
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   304
                    #label: 'Ignore case'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   305
                    #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   306
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   307
                 #(#LabelSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   308
                    #name: 'Label2'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   309
                    #layout: #(#LayoutFrame 0 0 119 0 300 0 141 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   310
                    #label: 'Containing the string:'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   311
                    #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   312
                    #adjust: #left
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   313
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   314
                 #(#InputFieldSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   315
                    #name: 'EntryField2'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   316
                    #layout: #(#LayoutFrame 10 0 149 0 305 0 171 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   317
                    #model: #contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   318
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   319
                 #(#CheckBoxSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   320
                    #name: 'CheckBox2'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   321
                    #layout: #(#LayoutFrame 10 0 179 0 146 0 201 0)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   322
                    #model: #ignoreCaseInContents
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   323
                    #label: 'Ignore case'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   324
                    #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   325
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   326
              )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   327
          )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   328
      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   329
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   330
    "Modified: / 15.10.1998 / 11:30:02 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   331
! !
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   332
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   333
!FileBrowser class methodsFor:'menu specs'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   334
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   335
baseDirectoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   336
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   337
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   338
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   339
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   340
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   341
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   342
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   343
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   344
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   345
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   346
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   347
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   348
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   349
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   350
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   351
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   352
          
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   353
	   #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   354
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   355
		#label: 'Copy Path'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   356
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   357
		#value: #copyPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   358
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   359
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   360
		#label: '-'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   361
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   362
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   363
		#label: 'Up'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   364
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   365
		#value: #changeToParentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   366
		#enabled: #currentDirectoryIsNotTop
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   367
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   368
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   369
		#label: 'Back'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   370
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   371
		#value: #changeToPreviousDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   372
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   373
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   374
		#label: 'Home'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   375
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   376
		#value: #changeToHomeDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   377
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   378
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   379
		#label: 'Default'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   380
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   381
		#value: #changeToDefaultDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   382
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   383
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   384
		#label: 'Goto...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   385
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   386
		#value: #changeCurrentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   387
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   388
	  ) nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   389
	  nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   390
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   391
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   392
    "Created: / 4.8.1998 / 17:21:16 / cg"
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   393
    "Modified: / 14.8.1998 / 19:19:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   394
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   395
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   396
directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   397
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   398
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   399
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   400
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   401
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   402
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   403
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   404
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   405
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   406
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   407
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   408
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   409
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   410
    |base|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   411
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   412
    base := self baseDirectoryMenuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   413
    base := base decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   414
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   415
    "/ add the history items ...
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   416
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   417
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   418
	base addItem:(MenuItem labeled:'-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   419
	DirectoryHistory do:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   420
	    base addItem:((MenuItem label:dirName value:#changeDirectoryTo:)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   421
			    argument:dirName;
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   422
			    yourself).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   423
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   424
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   425
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   426
    ^ base
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   427
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   428
    "Modified: / 17.8.1998 / 10:13:05 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   429
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   430
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   431
menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   432
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   433
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   434
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   435
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   436
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   437
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   438
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   439
     MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   440
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   441
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   442
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   443
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   444
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   445
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   446
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   447
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   448
          
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   449
           #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   450
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   451
                #label: 'Spawn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   452
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   453
                #value: #fileSpawn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   454
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   455
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   456
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   457
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   458
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   459
                #label: 'Get Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   460
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   461
                #value: #fileGet
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   462
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   463
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   464
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   465
                #label: 'Insert Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   466
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   467
                #value: #fileInsert
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   468
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   469
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   470
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   471
                #label: 'FileIn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   472
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   473
                #value: #fileFileIn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   474
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   475
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   476
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   477
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   478
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   479
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   480
                #label: 'Unix Command...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   481
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   482
                #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   483
                #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   484
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   485
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   486
                #label: 'DOS Command...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   487
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   488
                #isVisible: #systemIsDOS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   489
                #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   490
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   491
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   492
                #label: 'VMS Command...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   493
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   494
                #isVisible: #systemIsVMS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   495
                #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   496
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   497
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   498
                #label: 'ST/X Tools'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   499
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   500
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   501
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   502
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   503
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   504
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   505
                          #label: 'Changes Browser'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   506
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   507
                          #value: #openChangesBrowser
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   508
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   509
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   510
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   511
                          #label: 'Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   512
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   513
                          #value: #openEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   514
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   515
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   516
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   517
                          #label: 'HTML Reader'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   518
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   519
                          #value: #openHTMLReader
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   520
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   521
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   522
                       #(#MenuItem
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   523
                          #label: 'Applet Viewer'
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   524
                          #translateLabel: true
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   525
                          #isVisible: #hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   526
                          #value: #openAppletViewer
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   527
                          #enabled: #hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   528
                      )
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   529
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   530
                          #label: 'Image Inspect'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   531
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   532
                          #value: #openImageInspector
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   533
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   534
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   535
                       #(#MenuItem
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   536
                          #label: 'Image Preview'
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   537
                          #translateLabel: true
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   538
                          #value: #openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   539
                          #enabled: #hasSelection
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   540
                      )
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   541
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   542
                          #label: 'Image Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   543
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   544
                          #value: #openImageEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   545
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   546
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   547
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   548
                          #label: 'ZipFile Tool'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   549
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   550
                          #value: #openZipTool
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   551
                          #enabled: #hasZipFileSelected
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   552
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   553
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   554
                          #label: 'Hex Dump'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   555
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   556
                          #value: #fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   557
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   558
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   559
                          #label: 'Show File Differences'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   560
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   561
                          #value: #openDiffView
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   562
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   563
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   564
                          #label: 'Terminal'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   565
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   566
                          #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   567
                          #value: #openTerminal
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   568
                          #enabled: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   569
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   570
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   571
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   572
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   573
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   574
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   575
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   576
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   577
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   578
                #label: 'Remove...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   579
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   580
                #value: #fileRemove
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   581
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   582
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   583
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   584
                #label: 'Rename...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   585
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   586
                #value: #fileRename
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   587
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   588
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   589
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   590
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   591
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   592
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   593
                #label: 'New Directory...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   594
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   595
                #value: #newDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   596
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   597
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   598
                #label: 'New File...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   599
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   600
                #value: #newFile
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   601
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   602
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   603
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   604
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   605
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   606
                #label: 'Update'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   607
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   608
                #value: #updateCurrentDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   609
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   610
          ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   611
          nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   612
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   613
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   614
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   615
menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   616
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   617
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   618
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   619
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   620
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   621
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   622
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   623
     MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   624
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   625
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   626
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   627
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   628
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   629
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   630
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   631
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   632
          
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   633
           #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   634
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   635
                #label: 'About'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   636
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   637
                #labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   638
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   639
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   640
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   641
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   642
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   643
                          #label: 'About Smalltalk/X...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   644
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   645
                          #value: #showAboutSTX
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   646
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   647
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   648
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   649
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   650
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   651
                          #label: 'About FileBrowser...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   652
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   653
                          #value: #openAboutThisApplication
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   654
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   655
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   656
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   657
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   658
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   659
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   660
                #label: 'File'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   661
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   662
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   663
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   664
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   665
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   666
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   667
                          #label: 'Open'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   668
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   669
                          #value: #menuOpen
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   670
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   671
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   672
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   673
                          #label: 'FileIn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   674
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   675
                          #value: #fileFileIn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   676
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   677
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   678
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   679
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   680
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   681
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   682
                          #label: 'New'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   683
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   684
                          #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   685
                           #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   686
                              
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   687
                               #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   688
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   689
                                    #label: 'Directory...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   690
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   691
                                    #value: #newDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   692
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   693
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   694
                                    #label: 'File...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   695
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   696
                                    #value: #newFile
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   697
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   698
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   699
                                    #label: 'Hard Link...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   700
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   701
                                    #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   702
                                    #value: #newHardLink
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   703
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   704
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   705
                                    #label: 'Symbolic Link...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   706
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   707
                                    #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   708
                                    #value: #newSoftLink
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   709
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   710
                              ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   711
                              nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   712
                          )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   713
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   714
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   715
                          #label: 'Remove'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   716
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   717
                          #value: #fileRemove
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   718
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   719
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   720
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   721
                          #label: 'Rename'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   722
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   723
                          #value: #fileRename
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   724
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   725
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   726
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   727
                          #label: 'Properties...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   728
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   729
                          #value: #fileGetLongInfo
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   730
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   731
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   732
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   733
                          #label: '-'
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   734
                          #isVisible: #javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   735
                      )
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   736
                       #(#MenuItem
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   737
                          #label: 'Add to Java ClassPath'
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   738
                          #translateLabel: true
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   739
                          #isVisible: #javaSupportLoaded
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   740
                          #value: #fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   741
                          #enabled: #canAddToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   742
                      )
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   743
                       #(#MenuItem
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   744
                          #label: 'Remove from Java ClassPath'
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   745
                          #translateLabel: true
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   746
                          #isVisible: #javaSupportLoaded
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   747
                          #value: #fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   748
                          #enabled: #canRemoveToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   749
                      )
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   750
                       #(#MenuItem
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   751
                          #label: '-'
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   752
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   753
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   754
                          #label: 'Spawn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   755
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   756
                          #value: #fileSpawn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   757
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   758
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   759
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   760
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   761
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   762
                          #label: 'Exit'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   763
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   764
                          #value: #menuExit
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   765
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   766
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   767
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   768
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   769
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   770
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   771
                #label: 'Directory'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   772
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   773
                #submenuChannel: #directoryMenuSpec
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   774
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   775
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   776
                #label: 'Edit'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   777
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   778
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   779
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   780
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   781
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   782
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   783
                          #label: 'Get Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   784
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   785
                          #value: #fileGet
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   786
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   787
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   788
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   789
                          #label: 'Insert Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   790
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   791
                          #value: #fileInsert
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   792
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   793
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   794
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   795
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   796
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   797
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   798
                          #label: 'Copy File List'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   799
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   800
                          #value: #copyFileList
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   801
                      )
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   802
                       #(#MenuItem
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   803
                          #label: 'Copy Selected Filename'
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   804
                          #translateLabel: true
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   805
                          #value: #copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   806
                      )
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   807
                       #(#MenuItem
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   808
                          #label: 'Copy Command History'
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   809
                          #translateLabel: true
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   810
                          #value: #copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   811
                      )
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   812
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   813
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   814
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   815
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   816
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   817
                #label: 'View'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   818
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   819
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   820
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   821
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   822
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   823
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   824
                          #label: 'Details'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   825
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   826
                          #indication: #showingDetails
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   827
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   828
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   829
                          #label: 'Show Hidden Files'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   830
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   831
                          #indication: #showingHiddenFiles
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   832
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   833
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   834
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   835
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   836
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   837
                          #label: 'Sort By Name'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   838
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   839
                          #choice: #sortByWhat
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   840
                          #choiceValue: #name
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   841
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   842
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   843
                          #label: 'Sort By Type'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   844
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   845
                          #choice: #sortByWhat
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   846
                          #choiceValue: #type
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   847
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   848
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   849
                          #label: 'Sort By Time'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   850
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   851
                          #choice: #sortByWhat
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   852
                          #choiceValue: #time
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   853
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   854
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   855
                          #label: 'Ignore Case'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   856
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   857
                          #enabled: #sortByName
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   858
                          #indication: #sortCaseless
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   859
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   860
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   861
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   862
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   863
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   864
                          #label: 'Encoding...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   865
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   866
                          #value: #fileEncoding
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   867
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   868
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   869
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   870
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   871
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   872
                          #label: 'Update'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   873
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   874
                          #value: #updateCurrentDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   875
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   876
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   877
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   878
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   879
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   880
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   881
                #label: 'Tools'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   882
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   883
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   884
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   885
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   886
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   887
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   888
                          #label: 'Unix Command'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   889
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   890
                          #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   891
                          #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   892
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   893
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   894
                          #label: 'DOS Command'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   895
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   896
                          #isVisible: #systemIsDOS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   897
                          #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   898
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   899
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   900
                          #label: 'VMS Command'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   901
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   902
                          #isVisible: #systemIsVMS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   903
                          #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   904
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   905
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   906
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   907
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   908
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   909
                          #label: 'Changes Browser'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   910
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   911
                          #value: #openChangesBrowser
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   912
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   913
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   914
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   915
                          #label: 'Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   916
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   917
                          #value: #openEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   918
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   919
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   920
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   921
                          #label: 'HTML Reader'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   922
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   923
                          #value: #openHTMLReader
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   924
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   925
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   926
                       #(#MenuItem
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   927
                          #label: 'Applet Viewer'
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   928
                          #translateLabel: true
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   929
                          #isVisible: #hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   930
                          #value: #openAppletViewer
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   931
                          #enabled: #hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   932
                      )
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   933
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   934
                          #label: 'Image Inspector'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   935
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   936
                          #value: #openImageInspector
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   937
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   938
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   939
                       #(#MenuItem
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   940
                          #label: 'Image Preview'
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   941
                          #translateLabel: true
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   942
                          #value: #openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   943
                          #enabled: #hasSelection
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   944
                      )
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   945
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   946
                          #label: 'Image Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   947
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   948
                          #value: #openImageEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   949
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   950
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   951
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   952
                          #label: 'ZipFile Tool'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   953
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   954
                          #value: #openZipTool
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   955
                          #enabled: #hasZipFileSelected
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   956
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   957
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   958
                          #label: 'File Differences...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   959
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   960
                          #value: #openDiffView
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   961
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   962
                       #(#MenuItem
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   963
                          #label: 'Find Duplicate Files'
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   964
                          #translateLabel: true
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   965
                          #value: #fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   966
                      )
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   967
                       #(#MenuItem
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   968
                          #label: 'Find a File'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   969
                          #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   970
                          #value: #fileFindFile
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   971
                      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   972
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   973
                          #label: 'Hex Dump'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   974
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   975
                          #value: #fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   976
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   977
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   978
                          #label: 'Shell Terminal'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   979
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   980
                          #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   981
                          #value: #openTerminal
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   982
                          #enabled: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   983
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   984
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   985
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   986
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   987
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   988
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   989
                #label: 'Help'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   990
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   991
                #startGroup: #right
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   992
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   993
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   994
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   995
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   996
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   997
                          #label: 'FileBrowser Documentation'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   998
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   999
                          #value: #openHTMLDocument:
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1000
                          #argument: 'tools/fbrowser/TOP.html'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1001
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1002
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1003
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1004
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1005
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1006
          ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1007
          nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1008
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1009
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1010
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1011
!FileBrowser methodsFor:'aspects'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1012
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1013
canAddToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1014
    ^ [ |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1015
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1016
        (Java isNil or:[Java isLoaded not]) ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1017
            false
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1018
        ] ifFalse:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1019
            f := self getSelectedFileName.
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1020
            f notNil ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1021
                f := currentDirectory asFilename construct:f
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1022
            ].
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1023
            f notNil
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1024
            and:[(Java classPath includes:f pathName) not
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1025
            and:[f isDirectory
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1026
                 or:[(f hasSuffix:'jar')
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1027
                 or:[(f hasSuffix:'zip')]]]].
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1028
        ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1029
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1030
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1031
    "Modified: / 22.9.1998 / 16:56:40 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1032
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1033
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1034
canRemoveToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1035
    ^ [ |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1036
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1037
        (Java isNil or:[Java isLoaded not]) ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1038
            false
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1039
        ] ifFalse:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1040
            f := self getSelectedFileName.
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1041
            f notNil ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1042
                f := currentDirectory asFilename construct:f
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1043
            ].
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1044
            f notNil
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1045
            and:[(Java classPath includes:f pathName)
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1046
            and:[f isDirectory
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1047
                 or:[(f hasSuffix:'jar')
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1048
                 or:[(f hasSuffix:'zip')]]]]
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1049
          ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1050
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1051
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1052
    "Modified: / 22.9.1998 / 16:57:16 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1053
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1054
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1055
currentDirectoryIsNotTop
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1056
    ^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1057
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1058
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1059
    "Created: / 14.8.1998 / 12:07:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1060
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1061
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1062
hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1063
    ^ [ JavaClassReader notNil 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1064
        and:[JavaClassReader isLoaded]]
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1065
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1066
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1067
    "Created: / 17.10.1998 / 22:58:25 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1068
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1069
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1070
hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1071
    ^ [ fileListView selection size > 0
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1072
        and:[JavaClassReader notNil 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1073
        and:[JavaClassReader isLoaded]]]
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1074
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1075
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1076
    "Created: / 17.10.1998 / 22:58:03 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1077
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1078
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1079
hasSelection
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1080
    ^ [fileListView selection size > 0]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1081
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1082
    "Created: / 4.8.1998 / 14:10:31 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1083
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1084
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1085
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1086
hasVisitHistory
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1087
    ^ [DirectoryHistory size > 0]
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1088
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1089
    "Created: / 14.8.1998 / 19:17:02 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1090
    "Modified: / 14.8.1998 / 19:17:17 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1091
!
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1092
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1093
hasZipFileSelected
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1094
    ^ [|sel fn|
1854
21e208473bca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1853
diff changeset
  1095
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1096
	sel := fileListView selectionValue.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1097
	sel size == 1 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1098
	and:[ ((fn := self getSelectedFileName asFilename) hasSuffix:'zip')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1099
	      or:[fn hasSuffix:'jar']]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1100
      ]
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1101
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1102
    "Created: / 26.8.1998 / 16:15:26 / cg"
1854
21e208473bca checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1853
diff changeset
  1103
    "Modified: / 26.8.1998 / 16:33:05 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1104
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1105
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1106
javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1107
    ^ [ JavaClassReader notNil 
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1108
        and:[JavaClassReader isLoaded]]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1109
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1110
    "Created: / 9.11.1998 / 05:33:17 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1111
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1112
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1113
showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1114
    ^ showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1115
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1116
    "Created: / 14.8.1998 / 14:15:15 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1117
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1118
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1119
showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1120
    ^ showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1121
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1122
    "Created: / 14.8.1998 / 14:15:44 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1123
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1124
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1125
sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1126
    ^ sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1127
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1128
    "Created: / 14.8.1998 / 15:55:18 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1129
    "Modified: / 14.8.1998 / 15:56:08 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1130
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1131
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1132
sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1133
    ^ sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1134
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1135
    "Created: / 14.8.1998 / 14:21:21 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1136
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1137
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1138
systemIsDOS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1139
    ^ OperatingSystem isMSDOSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1140
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1141
    "Created: / 4.8.1998 / 13:37:28 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1142
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1143
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1144
systemIsUnix
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1145
    ^ OperatingSystem isUNIXlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1146
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1147
    "Created: / 4.8.1998 / 13:37:13 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1148
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1149
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1150
systemIsVMS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1151
    ^ OperatingSystem isVMSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1152
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1153
    "Created: / 4.8.1998 / 13:37:37 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1154
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1155
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1156
!FileBrowser methodsFor:'drag & drop'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1157
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1158
canDrop:aCollectionOfDropObjects
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1159
    "I accept fileObjects only"
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1160
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1161
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1162
	aDropObject isFileObject ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1163
	    aDropObject isTextObject ifFalse:[^ false].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1164
	]
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1165
    ].
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1166
    ^ true
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1167
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1168
    "Modified: 11.4.1997 / 12:41:59 / cg"
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1169
!
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1170
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1171
drop:aCollectionOfDropObjects at:aPoint
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1172
    "handle drops"
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1173
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1174
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1175
	self dropSingleObject:aDropObject at:aPoint
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1176
    ]
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1177
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1178
    "Modified: 11.4.1997 / 12:43:36 / cg"
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1179
!
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1180
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1181
dropSingleObject:someObject at:aPoint
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1182
    "handle drops; if its a directory, change to it.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1183
     If its a file, change to its directory and select the file.
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1184
     If its text, paste it into the codeView."
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1185
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1186
    |newDir newFile|
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1187
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1188
    someObject isFileObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1189
	someObject isDirectory ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1190
	    newDir := someObject theObject pathName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1191
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1192
	    newDir := someObject theObject directoryName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1193
	    newFile := someObject theObject baseName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1194
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1195
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1196
	newDir notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1197
	    newDir ~= currentDirectory pathName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1198
		self changeDirectoryTo:newDir.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1199
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1200
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1201
	newFile notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1202
	    newFile ~= currentFileName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1203
		fileListView selection:(fileList indexOf:newFile).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1204
		self doFileGet:false.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1205
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1206
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1207
	^ self
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1208
    ].
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1209
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1210
    someObject isTextObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1211
	subView paste:someObject theObject.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1212
	^ self
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1213
    ].
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1214
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1215
    "Modified: 6.4.1997 / 14:46:44 / cg"
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1216
! !
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1217
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1218
!FileBrowser methodsFor:'events'!
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1219
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1220
handlesKeyPress:key inView:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1221
    "this method is reached via delegation: are we prepared to handle
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1222
     a keyPress in some other view ?"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1223
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1224
    <resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept #CmdF #CmdD)>
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1225
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1226
    view == fileListView ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1227
	(key == #Delete 
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1228
	or:[key == #BackSpace
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1229
	or:[key == #Accept
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1230
	or:[key == #CmdI
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1231
	or:[key == #CmdF
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1232
	or:[key == #CmdD
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1233
	or:[key == #Cmdu
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1234
	or:[key == #InspectIt
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1235
	or:[key == #GotoLine
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1236
	or:[key == #DoIt]]]]]]]]]) ifTrue:[^ true].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1237
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1238
    ^ false
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1239
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1240
    "Created: / 28.1.1997 / 14:03:20 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1241
    "Modified: / 20.6.1997 / 16:35:01 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1242
    "Modified: / 16.1.1998 / 16:50:39 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1243
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1244
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1245
keyPress:key x:x y:y view:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1246
    "this method is reached via delegation from the fileListView"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1247
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1248
    <resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept)>
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1249
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1250
    (key == #Delete or:[key == #BackSpace]) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1251
	self fileRemove.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1252
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1253
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1254
    (key == #Accept) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1255
	self fileFileIn.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1256
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1257
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1258
    (key == #GotoLine) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1259
	self fileGet.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1260
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1261
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1262
    (key == #DoIt) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1263
	self fileExecute.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1264
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1265
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1266
    (key == #InspectIt) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1267
	self fileGetInfo.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1268
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1269
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1270
    (key == #CmdI) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1271
	self fileGetLongInfo.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1272
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1273
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1274
    (key == #Cmdu) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1275
	self updateCurrentDirectory.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1276
	^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1277
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1278
    (key == #CmdF) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1279
	self newFile.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1280
	^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1281
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1282
    (key == #CmdD) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1283
	self newDirectory.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1284
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1285
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1286
    fileListView keyPress:key x:x y:y
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1287
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1288
    "Created: / 28.1.1997 / 14:03:56 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1289
    "Modified: / 20.6.1997 / 16:35:08 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1290
    "Modified: / 16.1.1998 / 16:51:38 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1291
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1292
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1293
mapped 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1294
    super mapped.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1295
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1296
     whant to know about changed history
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1297
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1298
    self updateCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1299
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1300
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1301
visibilityChange:how
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1302
    |wasVisible|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1303
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1304
    wasVisible := shown.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1305
    super visibilityChange:how.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1306
    (wasVisible not and:[shown]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1307
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1308
	 start checking again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1309
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1310
	Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1311
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1312
    ]
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1313
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1314
    "Modified: / 18.2.1998 / 17:57:44 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1315
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1316
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1317
!FileBrowser methodsFor:'fileList user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1318
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1319
changeDisplayMode
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1320
    "toggle from long to short listing (and vice-versa)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1321
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1322
    showingDetails value:(showingDetails value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1323
    "/ showLongList := showLongList not.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  1324
    self showOrHideTabView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1325
    self updateCurrentDirectory
747
a50e8643c666 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
  1326
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1327
    "Modified: / 4.8.1998 / 13:43:54 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1328
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1329
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1330
changeDotFileVisibility
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1331
    "turn on/off visibility of files whose name starts with '.'"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1332
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1333
    showingHiddenFiles value:(showingHiddenFiles value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1334
    "/ showDotFiles := showDotFiles not.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1335
    self updateCurrentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1336
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1337
    "Modified: / 4.8.1998 / 13:45:46 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1338
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1339
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1340
detailsSettingChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1341
    "invoked, when detail (i.e. long / short) listing flag changed"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1342
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1343
    self showOrHideTabView.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1344
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1345
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1346
    "Modified: / 4.8.1998 / 13:43:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1347
    "Created: / 14.8.1998 / 14:17:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1348
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1349
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1350
fileDoubleClick:lineNr
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1351
    "double click on a file - get its contents"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1352
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1353
    self fileSelect:lineNr.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1354
    self fileGet:true
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1355
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1356
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1357
fileEncoding
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1358
    "open a dialog to allow change of the files character encoding.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1359
     Files are converted to internal encoding when read, and converted back
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1360
     to this encoding when saved.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1361
     The default encoding is nil, which means that files are already in
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1362
     the internal encoding (which is iso8859).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1363
     Notice: currently, not too many encodings are supported by the system."
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1364
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1365
    |dialog list descr encodings encodingNames idx|
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1366
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1367
    list := SelectionInList new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1368
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1369
    descr := CharacterArray supportedExternalEncodings.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1370
    encodings := descr at:2.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1371
    encodingNames := descr at:1.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1372
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1373
    list list:encodingNames.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1374
    list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1375
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1376
    dialog := Dialog new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1377
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1378
    dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1379
    dialog addVerticalSpace.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1380
    dialog addListBoxOn:list withNumberOfLines:5.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1381
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1382
    dialog addAbortButton; addOkButton.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1383
    dialog open.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1384
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1385
    dialog accepted ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1386
	idx := list selectionIndex.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1387
	fileEncoding := encodings at:idx.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1388
	subView externalEncoding:fileEncoding.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1389
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1390
	self validateFontEncodingFor:fileEncoding ask:true.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1391
    ].
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1392
1219
8495da2ea4cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  1393
    "Modified: 30.6.1997 / 14:41:12 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1394
!
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1395
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1396
fileExecute
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1397
    "if text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1398
     otherwise pop up execute box immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1399
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1400
    |action sel fileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1401
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1402
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1403
     this replaces everything by the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1404
    "
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1405
    action := [:command | 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1406
		self class addToCommandHistory:command for:fileName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1407
		self doExecuteCommand:command replace:true
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1408
	      ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1409
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1410
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when command is executed.'
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1411
	      yesButton:'execute') ifFalse:[^ self].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1412
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1413
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1414
"/     this inserts the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1415
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1416
"/    action := [:command| self doExecuteCommand:command replace:false].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1417
"/
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1418
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1419
    sel := fileListView selection.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1420
    sel size == 1 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1421
	fileName := fileList at:sel first
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1422
    ].
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1423
    self askForCommandFor:fileName thenDo:action
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1424
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1425
    "Modified: 14.11.1996 / 14:59:34 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1426
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1427
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1428
fileFileIn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1429
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1430
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1431
    self fileFileInLazy:false 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1432
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1433
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1434
fileFileInLazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1435
    "fileIn the selected file(s). Do a quick load (no compilation)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1436
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1437
    self fileFileInLazy:true 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1438
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1439
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1440
fileFileInLazy:lazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1441
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1442
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1443
    |aStream path oldPath wasLazy bos prevCurrentFileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1444
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1445
    self selectedFilesDo:[:fileName |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1446
	path := currentDirectory filenameFor:fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1447
	path type == #regular ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1448
	    prevCurrentFileName := currentFileInFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1449
	    currentFileInFileName := fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1450
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1451
	    (ObjectFileLoader notNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1452
	    and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1453
		Object abortSignal catch:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1454
		    |p|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1455
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1456
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1457
		    "/ look if already loaded ...  then unload first
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1458
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1459
		    p := path pathName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1460
		    (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1461
			(Dialog confirm:(resources 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1462
					    string:'%1 is already loaded; load anyway ?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1463
					    with:p)) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1464
			    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1465
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1466
			Transcript showCR:'unloading old ' , p , ' ...'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1467
			ObjectFileLoader unloadObjectFile:p. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1468
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1469
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1470
		    Transcript showCR:'loading ' , p , ' ...'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1471
		    ObjectFileLoader loadObjectFile:p.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1472
		    Class addInfoRecord:('fileIn ' , fileName) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1473
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1474
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1475
		(path hasSuffix:'cls') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1476
		    aStream := path readStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1477
		    aStream notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1478
			bos := BinaryObjectStorage onOld:aStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1479
			Class nameSpaceQuerySignal 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1480
			    answer:Smalltalk
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1481
			    do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1482
				bos next.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1483
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1484
			bos close
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1485
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1486
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1487
		    ((path hasSuffix:'class')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1488
		    or:[(path hasSuffix:'cla')]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1489
			JavaClassReader notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1490
			    JavaClassReader loadFile:(path pathName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1491
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1492
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1493
			aStream := path readStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1494
			aStream notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1495
			    [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1496
				Class withoutUpdatingChangesDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1497
				    oldPath := Smalltalk systemPath.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1498
				    Smalltalk systemPath:(oldPath copy addFirst:currentDirectory pathName; yourself).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1499
				    wasLazy := Compiler compileLazy:lazy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1500
				    aStream fileIn.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1501
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1502
				Class addInfoRecord:('fileIn ' , fileName) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1503
			    ] valueNowOrOnUnwindDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1504
				Compiler compileLazy:wasLazy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1505
				Smalltalk systemPath:oldPath.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1506
				aStream close
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1507
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1508
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1509
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1510
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1511
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1512
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1513
	currentFileInFileName := prevCurrentFileName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1514
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1515
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1516
    "Modified: / 19.9.1997 / 23:42:22 / stefan"
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1517
    "Modified: / 18.6.1998 / 15:30:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1518
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1519
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1520
fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1521
    "scan directory for duplicate files"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1522
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1523
    |fileNames dir infoDir filesBySize
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1524
     result info|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1525
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1526
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.'
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1527
              yesButton:'proceed') ifFalse:[^ self].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1528
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1529
    self withWaitCursorDo:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1530
        result := Dictionary new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1531
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1532
        dir := currentDirectory asFilename.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1533
        fileNames := dir directoryContents.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1534
        fileNames := fileNames collect:[:fn | dir construct:fn].
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1535
        fileNames := fileNames select:[:fn | fn isDirectory not].
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1536
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1537
        infoDir := Dictionary new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1538
        fileNames do:[:fn |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1539
            infoDir at:fn put:(fn info)
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1540
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1541
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1542
        "/ for each, get the files size.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1543
        "/ in a first pass, look for files of the same size and
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1544
        "/ compare them ...
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1545
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1546
        filesBySize := Dictionary new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1547
        infoDir keysAndValuesDo:[:fn :info |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1548
            |sz entry|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1549
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1550
            sz := info size.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1551
            entry := filesBySize at:sz ifAbsentPut:[Set new].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1552
            entry add:fn.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1553
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1554
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1555
        "/ any of same size ?
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1556
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1557
        filesBySize do:[:entry |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1558
            |files|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1559
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1560
            entry size > 1 ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1561
                files := entry asArray.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1562
                1 to:files size-1 do:[:idx1 |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1563
                    idx1+1 to:files size do:[:idx2 |
1962
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1564
                        |fn1 fn2 s1 s2 b1 b2 n same|
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1565
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1566
                        fn1 := files at:idx1.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1567
                        fn2 := files at:idx2.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1568
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1569
                        (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1570
                            "/ compare the files
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1571
1962
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1572
                            (fn1 fileSize < (512*1024)) ifTrue:[
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1573
                                (fn1 binaryContentsOfEntireFile = fn2 binaryContentsOfEntireFile) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1574
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
1962
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1575
                                    result at:fn1 put:fn2.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1576
                                ]
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1577
                            ] ifFalse:[
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1578
                                "/ compare blockwise ...
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1579
                                s1 := fn1 readStream binary.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1580
                                s2 := fn2 readStream binary.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1581
                                b1 := ByteArray new:8192.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1582
                                b2 := ByteArray new:8192.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1583
                                same := true.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1584
                                [same and:[s1 atEnd not]] whileTrue:[
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1585
                                    n := s1 nextBytes:8192 into:b1 startingAt:1.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1586
                                    s2 nextBytes:n into:b2 startingAt:1.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1587
                                    n == 8192 ifFalse:[
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1588
                                        b1 from:n+1 to:8192 put:0.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1589
                                        b2 from:n+1 to:8192 put:0.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1590
                                    ].
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1591
                                    same := (b1 = b2)
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1592
                                ].
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1593
                                s1 close.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1594
                                s2 close.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1595
                                same ifTrue:[
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1596
                                    result at:fn1 put:fn2.
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1597
                                ]
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1598
                            ]
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1599
                        ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1600
                    ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1601
                ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1602
            ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1603
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1604
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1605
        result := result associations.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1606
        result := result collect:[:assoc |
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1607
                                        |f1 f2|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1608
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1609
                                        f1 := assoc key baseName.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1610
                                        f2 := assoc value baseName.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1611
                                        f1 < f2 ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1612
                                            f2 -> f1
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1613
                                        ] ifFalse:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1614
                                            f1 -> f2
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1615
                                        ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1616
                                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1617
        result sort:[:f1 :f2 | f2 value < f1 value].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1618
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1619
        info := OrderedCollection new.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1620
        result do:[:assoc |
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1621
            info add:(assoc key , ' same as ' , assoc value)
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1622
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1623
        info isEmpty ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1624
            info := 'No duplicate files found.'
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1625
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1626
    ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1627
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1628
    subView contents:info
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1629
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1630
    "Created: / 3.10.1998 / 17:59:00 / cg"
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1631
    "Modified: / 3.10.1998 / 19:29:19 / cg"
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1632
!
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1633
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1634
fileFindFile
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1635
    |bindings
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1636
     namePatternHolder contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1637
     ignoreCaseInName ignoreCaseInContents
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1638
     namePattern contentsPattern|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1639
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1640
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1641
              yesButton:'proceed') ifFalse:[^ self].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1642
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1643
    subView contents:nil; scrollToTop.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1644
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1645
    bindings := IdentityDictionary new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1646
    bindings at:#namePatternHolder put:(namePatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1647
    bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1648
    bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1649
    bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1650
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1651
    (SimpleDialog new 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1652
        openFor:self
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1653
        interfaceSpec:(self class fileSearchDialogSpec)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1654
        withBindings:bindings) ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1655
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1656
        namePattern := namePatternHolder value.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1657
        namePattern size == 0 ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1658
            namePattern := nil
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1659
        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1660
            ignoreCaseInName value ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1661
                namePattern := namePattern asLowercase
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1662
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1663
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1664
        contentsPattern := contentsPatternHolder value.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1665
        contentsPattern size == 0 ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1666
            contentsPattern := nil
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1667
        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1668
            ignoreCaseInContents value ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1669
                contentsPattern := contentsPattern asLowercase
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1670
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1671
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1672
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1673
        self withWaitCursorDo:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1674
            |stopSignal access myProcess lowerFrameView|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1675
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1676
            myProcess := Processor activeProcess.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1677
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1678
            access := Semaphore forMutualExclusion name:'accessLock'.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1679
            stopSignal := Signal new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1680
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1681
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1682
             The following is tricky: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1683
             the pauseToggle & killButton will
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1684
             be handled by their own windowGroup process.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1685
             This means, that they respond to events even though
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1686
             I myself am reading the commands output.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1687
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1688
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1689
            commandView beInvisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1690
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1691
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1692
             must take kill & pauseButtons out of my group
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1693
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1694
            killButton windowGroup:nil.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1695
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1696
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1697
             bring them to front, and turn hidden-mode off
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1698
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1699
            killButton label:(resources string:'stop').
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1700
            killButton raise; beVisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1701
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1702
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1703
             kill will make me raise the stopSignal when pressed
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1704
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1705
            killButton 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1706
                action:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1707
                    access critical:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1708
                        myProcess interruptWith:[stopSignal raiseRequest].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1709
                    ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1710
                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1711
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1712
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1713
             start kill button under its own windowgroup
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1714
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1715
            killButton openAutonomous.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1716
            killButton windowGroup process processGroupId:(Processor activeProcess id).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1717
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1718
            lowerFrameView := subView superView.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1719
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1720
            [
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1721
                stopSignal catch:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1722
                    self 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1723
                        doFindFileNamed:namePattern
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1724
                        ignoreCase:ignoreCaseInName value
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1725
                        containingString:contentsPattern
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1726
                        ignoreCaseInContents:ignoreCaseInContents value
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1727
                        in:currentDirectory.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1728
                ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1729
            ] valueNowOrOnUnwindDo:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1730
                |wg|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1731
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1732
                self label:myName; iconLabel:myName.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1733
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1734
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1735
                 hide the button, and make sure it will stay
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1736
                 hidden when we are realized again
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1737
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1738
                killButton beInvisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1739
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1740
                commandView beVisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1741
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1742
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1743
                 remove the killButton from its group
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1744
                 (otherwise, it will be destroyed when we shut down the group)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1745
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1746
                wg := killButton windowGroup.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1747
                killButton windowGroup:nil.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1748
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1749
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1750
                 shut down the kill buttons windowgroup
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1751
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1752
                wg notNil ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1753
                    wg process terminate.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1754
                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1755
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1756
                 clear its action (actually not needed, but
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1757
                 releases reference to thisContext earlier)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1758
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1759
                killButton action:nil.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1760
                killButton label:(resources string:'kill').
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1761
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1762
                "/    
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1763
                "/ allow interaction with the codeView
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1764
                "/ (bring it back into my group)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1765
                "/
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1766
                lowerFrameView windowGroup:(self windowGroup).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1767
            ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1768
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1769
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1770
        self label:myName.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1771
        currentFileName isNil ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1772
            subView modified:false.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1773
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1774
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1775
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1776
    "Created: / 15.10.1998 / 11:32:57 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1777
    "Modified: / 15.10.1998 / 12:41:09 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1778
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1779
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1780
fileGet
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1781
    "get contents of selected file into subView.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1782
     If text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1783
     otherwise get it immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1784
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1785
    self fileGet:false
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1786
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1787
    "Modified: 19.6.1996 / 09:38:45 / cg"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1788
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1789
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1790
fileGet:viaDoubleClick
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1791
    "get contents of selected file into subView.
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1792
     If text was modified show a queryBox,
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1793
     otherwise get it immediately"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1794
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1795
    |fileName msg label|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1796
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  1797
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1798
	self doFileGet:viaDoubleClick.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1799
	^ self
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  1800
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1801
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1802
    fileName notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1803
	(currentDirectory filenameFor:fileName) isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1804
	    msg := 'contents has not been saved.\\Modifications will be lost when directory is changed.'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1805
	    label := 'change'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1806
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1807
	    msg := 'contents has not been saved.\\Modifications will be lost when new file is read.'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1808
	    label := 'get'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1809
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1810
	(self ask:(resources at:msg) yesButton:label) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1811
	    subView modified:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1812
	    self doFileGet:viaDoubleClick
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1813
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1814
    ]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1815
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1816
    "Created: 19.6.1996 / 09:38:35 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1817
    "Modified: 23.4.1997 / 13:04:11 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  1818
    "Modified: 18.9.1997 / 16:27:34 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1819
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1820
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1821
fileGetInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1822
    "show short file (stat)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1823
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1824
    self fileGetInfo:false
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1825
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1826
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1827
fileGetInfo:longInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1828
    "get info on selected file - show it in a box"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1829
1672
9df905f8bfa3 update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1830
    |string box updater|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1831
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1832
    string := self getFileInfoString:longInfo.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1833
    string notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1834
	box := InfoBox title:string.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1835
	updater := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1836
	    [true] whileTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1837
		Delay waitForSeconds:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1838
		string := self getFileInfoString:longInfo.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1839
		box title:string
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1840
	    ] 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1841
	] fork.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1842
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1843
	box showAtPointer.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1844
	updater terminate.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1845
	box destroy
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1846
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1847
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1848
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1849
fileGetLongInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1850
    "show long stat (file)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1851
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1852
    self fileGetInfo:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1853
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1854
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1855
fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1856
    "show a hex dump (similar to od -x)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1857
     Only needed with non-Unix systems."
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1858
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1859
    self withReadCursorDo:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1860
        |fileName f stream data offs 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1861
         addrDigits col line asciiLine lines|
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1862
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1863
        fileName := self getSelectedFileName.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1864
        fileName notNil ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1865
            f := currentDirectory construct:fileName.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1866
            f isDirectory ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1867
                ^ self warn:(resources string:'%1 is a directory.' with:fileName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1868
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1869
            f exists ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1870
                self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1871
                ^ self
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1872
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1873
            f isReadable ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1874
                self warn:(resources string:'''%1'' is unreadable.' with:fileName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1875
                ^ self
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1876
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1877
            stream := f readStream binary.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1878
            data := stream contents.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1879
            stream close.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1880
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1881
            subView list:nil.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1882
            col := 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1883
            offs := 0.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1884
            lines := StringCollection new.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1885
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1886
            addrDigits := ((f fileSize + 1) log:16) truncated + 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1887
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1888
            line := (offs hexPrintString:addrDigits) , ': '.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1889
            asciiLine := ''.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1890
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1891
            data do:[:byte |
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1892
                line := line , (byte hexPrintString:2).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1893
                (byte between:32 and:127) ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1894
                    asciiLine := asciiLine copyWith:(Character value:byte)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1895
                ] ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1896
                    asciiLine := asciiLine , '.'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1897
                ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1898
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1899
                offs := offs + 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1900
                col := col + 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1901
                col > 16 ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1902
                    lines add:(line , '        ' , asciiLine).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1903
                    (offs bitAnd:16rFF) == 0 ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1904
                        lines add:nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1905
                    ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1906
                    line := (offs hexPrintString:addrDigits) , ': '.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1907
                    asciiLine := ''.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1908
                    col := 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1909
                ] ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1910
                    line := line , ' '
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1911
                ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1912
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1913
            line := line paddedTo:(3*16 + addrDigits + 1).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1914
            lines add:(line , '        ' , asciiLine).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1915
            self show:lines.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1916
        ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1917
    ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1918
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1919
    "Modified: / 7.9.1998 / 15:37:47 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1920
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1921
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1922
fileInsert
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1923
    "insert contents of file at the cursor position"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1924
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1925
    |fileName|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1926
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1927
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1928
    fileName notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1929
	self showFile:fileName insert:true encoding:fileEncoding
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1930
    ]
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1931
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1932
    "Modified: 23.4.1997 / 13:06:06 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1933
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1934
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1935
fileListMenu
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1936
    "return the menu to show in the fileList"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1937
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  1938
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  1939
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1940
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1941
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1942
    m := self class menuPopUp.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1943
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1944
    m receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1945
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1946
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1947
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1948
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1949
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1950
fileListMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1951
    "return the menu to show in the fileList"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1952
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1953
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1954
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1955
    |items m sel ns subMenu subItems|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1956
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1957
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1958
		 ('spawn'            fileSpawn        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1959
		 ('-'                nil              )  
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1960
		 ('get contents'     fileGet          GotoLine)      
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1961
		 ('insert contents'  fileInsert       )            
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1962
		 ('show info'        fileGetInfo      InspectIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1963
		 ('show full info'   fileGetLongInfo  CmdI)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1964
	       ).
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  1965
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  1966
    ((ns := Project current defaultNameSpace) notNil 
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  1967
    and:[ns ~~ Smalltalk]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1968
	items := items copyWith:(Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1969
				    with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1970
				    with:#fileFileIn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1971
				    with:#Accept)
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1972
                                
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  1973
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1974
	items := items copyWith:#( 'fileIn'  #fileFileIn  #Accept)
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  1975
    ].
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  1976
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1977
    items := items , #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1978
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1979
		 ('update'                    updateCurrentDirectory    Cmdu)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1980
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1981
		 ('execute unix command ...'  fileExecute               DoIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1982
		 ('st/x tools'                stxTools                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1983
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1984
		 ('remove'                    fileRemove                Delete)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1985
		 ('rename ...'                fileRename                )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1986
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1987
		 ('display long list'         changeDisplayMode         )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1988
		 ('show all files'            changeDotFileVisibility   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1989
		 ('encoding ...'              fileEncoding              )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1990
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1991
		 ('create directory ...'      newDirectory              CmdD)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1992
		 ('create file ...'           newFile                   CmdF)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1993
	       ).             
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1994
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1995
    m := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1996
	    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1997
	    resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1998
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1999
    showingHiddenFiles value "showDotFiles" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2000
	m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2001
    ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2002
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2003
	m labelAt:#changeDisplayMode put:(resources string:'display short list')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2004
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2005
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2006
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2007
			      ('Changes browser'       openChangesBrowser  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2008
			      ('Editor'                openEditor          )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2009
			      ('HTML reader'           openHTMLReader      )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2010
			      ('Image inspect'         openImageInspector  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2011
			      ('show file differences' openDiffView        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2012
		  ).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2013
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2014
    OperatingSystem isUNIXlike ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2015
	items := items , #( ('terminal'              openTerminal )).
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2016
    ].
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2017
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2018
    JavaInterpreter notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2019
	items := items , #( ('Java Applet Viewer' openAppletViewer)).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2020
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2021
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2022
    m subMenuAt:#stxTools 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2023
	    put:(PopUpMenu
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2024
		    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2025
		    resources:resources).
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2026
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2027
    ((sel := fileListView selection) isNil 
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2028
    or:[sel isEmpty]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2029
	m disableAll:#(fileGet fileInsert
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2030
		       fileGetInfo fileGetLongInfo
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2031
		       fileFileIn fileFileInLazy
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2032
		       fileRemove fileRename).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2033
	(m subMenuAt:#stxTools)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2034
	    disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector)
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2035
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2036
	fileListView selection size > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2037
	    m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2038
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2039
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2040
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2041
    ^m
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2042
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2043
    "Modified: / 16.1.1998 / 16:42:59 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2044
    "Modified: / 4.8.1998 / 13:45:56 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2045
    "Created: / 13.8.1998 / 20:51:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2046
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2047
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2048
filePrint
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2049
    "send a files contents to the printer (not in the menu)"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2050
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2051
    |fileName path inStream printStream line|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2052
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2053
    self withWaitCursorDo:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2054
	fileName := self getSelectedFileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2055
	fileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2056
	    path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2057
	    (path type == #regular) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2058
		inStream := path readStream.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2059
		inStream isNil ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2060
		    printStream := PrinterStream new.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2061
		    printStream notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2062
			[inStream atEnd] whileFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2063
			    line := inStream nextLine.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2064
			    printStream nextPutLine:line.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2065
			].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2066
			printStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2067
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2068
		    inStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2069
		]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2070
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2071
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2072
	0 "compiler hint"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2073
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2074
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2075
    "Modified: 23.4.1997 / 13:05:40 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2076
    "Modified: 18.9.1997 / 16:29:17 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2077
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2078
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2079
fileRemove
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2080
    "remove the selected file(s).
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2081
     Query if user really wants to remove the file.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2082
     - should be enhanced, to look for a ~/.trash directory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2083
     and move files there if it exists (without asking in this case)."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2084
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2085
    |sel q|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2086
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2087
    sel := fileListView selectionValue.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2088
    sel notNil ifTrue:[
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2089
        sel := sel collect:[:item | item string withoutSeparators].
1901
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2090
        sel size > 1 ifTrue:[
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2091
            q := resources string:'remove %1 selected files ?' with:(sel size)
1901
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2092
        ] ifFalse:[
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2093
            q := resources string:'remove ''%1'' ?' with:(sel first)
1901
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2094
        ].
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2095
        (self sensor shiftDown
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2096
        or:[self ask:q yesButton:'remove']) ifTrue:[
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2097
            self doRemove:sel
1901
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2098
        ]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2099
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2100
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2101
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2102
fileRename
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2103
    "rename the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2104
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2105
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2106
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2107
    queryBox := FilenameEnterBox new.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2108
    queryBox okText:(resources at:'rename').
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2109
    self selectedFilesDo:[:oldName |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2110
	queryBox title:(resources string:'rename ''%1'' to:' with:oldName).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2111
	queryBox initialText:oldName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2112
	queryBox action:[:newName | self doRename:oldName to:newName].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2113
	queryBox showAtPointer
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2114
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2115
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2116
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2117
fileSelect:lineNr
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2118
    "selected a file - do nothing here"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2119
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2120
    ^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2121
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2122
    "Modified: 23.4.1997 / 13:04:55 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2123
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2124
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2125
fileSpawn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2126
    "start another FileBrowser on the selected directory or
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2127
     on the same directory if none is selected."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2128
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2129
    |any path|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2130
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2131
    any := false.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2132
    self selectedFilesDo:[:fileName |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2133
	path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2134
	path isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2135
	    self class openOn:(path pathName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2136
	    any := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2137
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2138
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2139
    any ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2140
	self class openOn:currentDirectory pathName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2141
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2142
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2143
    "Modified: 18.9.1997 / 16:32:39 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2144
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2145
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2146
loadImageAndPerform:aSelectorOrBlock
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2147
    |img path|
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2148
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2149
    self selectedFilesDo:[:fileName |
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2150
        path := currentDirectory filenameFor:fileName.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2151
        path isDirectory ifFalse:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2152
            img := Image fromFile:(path pathName).
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2153
            img notNil ifTrue:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2154
                aSelectorOrBlock isSymbol ifTrue:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2155
                    img perform:aSelectorOrBlock
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2156
                ] ifFalse:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2157
                    aSelectorOrBlock value:img
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2158
                ]
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2159
            ] ifFalse:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2160
                self warn:'unknown format: ' , fileName
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2161
            ]
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2162
        ]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2163
    ].
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2164
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2165
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2166
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2167
    "Created: / 26.8.1998 / 16:20:18 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2168
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2169
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2170
newDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2171
    "ask for and create a new directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2173
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2174
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2175
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2176
		    title:(resources at:'create new directory:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2177
		    okText:(resources at:'create')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2178
		    action:[:newName | self doCreateDirectory:newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2179
    queryBox showAtPointer
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2180
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2181
    "Modified: 23.4.1997 / 13:04:27 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2182
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2183
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2184
newFile
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2185
    "ask for and create a new file"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2186
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2187
    |sel queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2188
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2189
    queryBox := FilenameEnterBox 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2190
		    title:(resources at:'create new file:') withCRs
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2191
		    okText:(resources at:'create')
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2192
		    action:[:newName | newName isEmpty ifFalse:[self doCreateFile:newName]].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2193
    sel := subView selection.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2194
    sel notNil ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2195
	queryBox initialText:(sel asString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2196
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2197
    queryBox showAtPointer
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  2198
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2199
    "Modified: / 23.4.1997 / 13:04:38 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2200
    "Modified: / 16.1.1998 / 16:54:00 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2201
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2202
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2203
newHardLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2204
    "ask for and create a hard link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2205
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2206
    |sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2207
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2208
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2209
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2210
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2211
    (sel size > 0) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2212
	(currentDirectory construct:sel) isDirectory ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2213
	    orgName1 := sel
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2214
	]
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2215
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2216
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2217
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2218
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2219
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2220
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2221
    (box addTextLabel:'Create hard link from:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2222
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2223
    (box addTextLabel:'to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2224
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2225
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2226
    box addAbortButton; addOkButton.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2227
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2228
    orgName1 size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2229
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2230
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2231
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2232
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2233
    box accepted ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2234
	name1 := name1 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2235
	(name1 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2236
	    err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2237
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2238
	    f1 := name1 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2239
	    name2 := name2 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2240
	    (name2 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2241
		err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2242
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2243
		f2 := name2 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2244
		f2 exists ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2245
		    err := '''%2'' already exists'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2246
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2247
		    f1 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2248
			err := '''%1'' does not exist'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2249
		    ] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2250
			f1 isDirectory ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2251
			    err := '''%1'' is a directory'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2252
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2253
			    ErrorSignal handle:[:ex |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2254
				err := ex errorString
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2255
			    ] do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2256
				OperatingSystem createHardLinkFrom:name1 to:name2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2257
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2258
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2259
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2260
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2261
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2262
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2263
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2264
	err notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2265
	    self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2266
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2267
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2268
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2269
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2270
    "Modified: / 13.8.1998 / 21:47:01 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2271
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2272
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2273
newSoftLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2274
    "ask for and create a soft link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2275
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2276
    |sel box orgName1 name1 name2 f1 f2 f d err nm here l1 if1 if2|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2277
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2278
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2279
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2280
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2281
    (sel size > 0) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2282
	orgName1 := sel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2283
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2284
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2285
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2286
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2287
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2288
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2289
    (box addTextLabel:'Create symbolic link to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2290
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2291
    (box addTextLabel:'as:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2292
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2293
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2294
    box addAbortButton; addOkButton.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2295
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2296
    orgName1 size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2297
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2298
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2299
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2300
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2301
    box accepted ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2302
	name1 := name1 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2303
	(name1 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2304
	    err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2305
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2306
	    f1 := name1 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2307
	    name2 := name2 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2308
	    (name2 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2309
		err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2310
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2311
		f2 := name2 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2312
		f2 exists ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2313
		    err := '''%2'' already exists'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2314
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2315
		    f1 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2316
			err := '''%1'' does not exist (link created anyway)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2317
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2318
		    ErrorSignal handle:[:ex |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2319
			err := ex errorString
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2320
		    ] do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2321
			OperatingSystem createSymbolicLinkFrom:name1 to:name2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2322
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2323
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2324
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2325
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2326
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2327
	err notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2328
	    self warn:(resources string:err with:(name1 ? '') asText allBold with:(name2 ? '') asText allBold).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2329
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2330
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2331
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2332
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2333
    "Modified: / 13.8.1998 / 21:26:59 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2334
    "Created: / 13.8.1998 / 21:47:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2335
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2336
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2337
openAppletViewer
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2338
    |numItems|
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2339
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2340
    (numItems := fileListView selection size) > 2 ifTrue:[
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2341
        (self 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2342
            confirm:(resources string:'open for each of the %1 items ?' 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2343
                                 with:numItems)) ifFalse:[^ self].
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2344
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2345
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2346
    Java startupJavaSystem.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2347
"/    Java markAllClassesUninitialized.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2348
"/    Java initAllStaticFields.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2349
"/    Java initAllClasses.
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2350
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2351
    self selectedFilesDo:[:fileName |
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2352
        |p path|
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2353
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2354
        path := currentDirectory filenameFor:fileName.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2355
        path isDirectory ifFalse:[
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2356
            p := Java 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2357
                    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2358
                    argumentString:path pathName.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2359
            p resume.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2360
        ]
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2361
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2362
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2363
    "Modified: / 18.9.1997 / 17:00:59 / stefan"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2364
    "Modified: / 17.10.1998 / 17:00:43 / cg"
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2365
!
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2366
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2367
openChangesBrowser
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2368
    "open a change browser on the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2369
1939
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2370
    self openTool:(UserPreferences current changesBrowserClass)
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2371
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2372
    "Modified: / 17.10.1998 / 14:39:15 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2373
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2374
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2375
openDiffView
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2376
    "open a diff-view"
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2377
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2378
    |sel box orgName1 name1 name2 text1 text2 f d err nm here l1|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2379
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2380
    sel := self getSelectedFileName.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2381
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2382
    orgName1 := ''.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2383
    (sel size > 0
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2384
    and:[lastFileDiffDirectory notNil
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2385
    and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2386
	f := lastFileDiffDirectory asFilename construct:sel.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2387
	(f exists
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2388
	and:[f isReadable]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2389
	    orgName1 := f name
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2390
	]
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2391
    ].
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2392
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2393
    name1 := orgName1 asValue.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2394
    name2 := self getSelectedFileName asValue.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2395
    here := currentDirectory pathName.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2396
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2397
    box := DialogBox new.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2398
    (box addTextLabel:'show difference between:\\file1 (empty for views contents):' withCRs) adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2399
    box addFilenameInputFieldOn:name1 in:here tabable:true.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2400
    (box addTextLabel:'and file2:') adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2401
    box addFilenameInputFieldOn:name2 in:here tabable:true.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2402
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2403
    box addAbortButton; addOkButton.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2404
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2405
    box showAtPointer.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2406
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2407
    box accepted ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2408
	name1 := name1 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2409
	(name1 isNil or:[name1 isEmpty]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2410
	    text1 := subView contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2411
	    name1 := nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2412
	    l1 := 'browser contents'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2413
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2414
	    name1 := currentDirectory filenameFor:name1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2415
	    name1 isReadable ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2416
		nm := name1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2417
		name1 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2418
		    err := '%1 does not exist'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2419
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2420
		    err := '%1 is not readable'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2421
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2422
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2423
	    l1 := name1 pathName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2424
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2425
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2426
	name2 := currentDirectory filenameFor:name2 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2427
	err isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2428
	    name2 isReadable ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2429
		nm := name2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2430
		name2 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2431
		    err := '%1 does not exist'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2432
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2433
		    err := '%1 is not readable'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2434
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2435
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2436
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2437
	err notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2438
	    self warn:(resources string:err with:nm pathName).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2439
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2440
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2441
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2442
	self withWaitCursorDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2443
	    (name1 notNil and:[name1 name ~= orgName1]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2444
		lastFileDiffDirectory := name1 directoryName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2445
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2446
	    name1 notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2447
		text1 := name1 contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2448
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2449
	    text2 := name2 contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2450
	    text1 = text2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2451
		self information:'same contents'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2452
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2453
		d := DiffTextView 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2454
			openOn:text1 label:l1
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2455
			and:text2 label:name2 pathName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2456
		d label:'file differences'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2457
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2458
	]
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2459
    ].
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2460
1735
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  2461
    "Created: / 7.12.1995 / 20:33:58 / cg"
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  2462
    "Modified: / 18.9.1997 / 17:31:46 / stefan"
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2463
    "Modified: / 25.8.1998 / 21:11:46 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2464
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2465
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2466
openEditor
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2467
    self openTool:EditTextView
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2468
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2469
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2470
openHTMLReader
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2471
    self openTool:HTMLDocumentView ignoreDirectories:false
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2472
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2473
    "Modified: / 7.9.1998 / 21:31:58 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2474
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2475
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2476
openImageEditor
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2477
    [self loadImageAndPerform:#edit] fork
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2478
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2479
    "Modified: / 17.9.1995 / 17:41:24 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2480
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2481
    "Created: / 13.8.1998 / 22:07:09 / cg"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2482
    "Modified: / 7.9.1998 / 21:31:41 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2483
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2484
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2485
openImageInspector
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2486
    [self loadImageAndPerform:#inspect] fork
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2487
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2488
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2489
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2490
    "Modified: / 7.9.1998 / 21:31:30 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2491
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2492
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2493
openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2494
    [self loadImageAndPerform:[:img |
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2495
                                |i viewer|
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2496
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2497
                                viewer := ImageView new.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2498
                                i := img.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2499
                                (i width > 200 or:[i height > 200]) ifTrue:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2500
                                    i := i magnifiedPreservingRatioTo:200@200.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2501
                                ].
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2502
                                viewer image:i.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2503
                                viewer extent:200@200.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2504
                                viewer open.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2505
                              ].
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2506
    ] fork
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2507
!
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2508
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2509
openTerminal
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  2510
    VT100TerminalView openShellIn:currentDirectory
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2511
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2512
    "Created: / 20.7.1998 / 18:18:15 / cg"
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  2513
    "Modified: / 20.7.1998 / 18:32:28 / cg"
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2514
!
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2515
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2516
openTool:aToolClass
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2517
    "open a tool on the selected file(s)"
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2518
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2519
    self openTool:aToolClass ignoreDirectories:true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2520
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2521
    "Modified: / 7.9.1998 / 19:32:10 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2522
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2523
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2524
openTool:aToolClass ignoreDirectories:ignoreDirs
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2525
    "open a tool on the selected file(s)"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2526
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2527
    |numItems path|
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2528
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2529
    aToolClass isNil ifTrue:[
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2530
        ^ self warn:'Sorry, that tool seems to be not available'.
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2531
    ].
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2532
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2533
    (numItems := fileListView selection size) > 2 ifTrue:[
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2534
        (self 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2535
            confirm:(resources string:'open for each of the %1 items ?' 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2536
                                 with:numItems)) ifFalse:[^ self].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2537
    ].
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2538
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2539
    self selectedFilesDo:[:fileName |
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2540
        path := currentDirectory filenameFor:fileName.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2541
        (ignoreDirs not
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2542
        or:[path isDirectory not]) ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2543
            aToolClass openOn:(path pathName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2544
        ]
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2545
    ].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2546
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2547
    "Modified: / 18.9.1997 / 17:06:18 / stefan"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2548
    "Created: / 7.9.1998 / 19:31:49 / cg"
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2549
    "Modified: / 10.9.1998 / 13:58:23 / cg"
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2550
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2551
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2552
openZipTool
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2553
    self openTool:ZipTool
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2554
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2555
    "Created: / 26.8.1998 / 16:20:55 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2556
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2557
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2558
showOrHideTabView
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2559
    "depending on the showLongList setting, show or hde the tabSpec view"
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2560
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2561
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2562
	tabRulerView isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2563
	    self createTabRulerIn:scrollView superView.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2564
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2565
	tabRulerView beVisible.
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2566
        
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2567
	false "self is3D" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2568
	    scrollView topInset:(tabRulerView superView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2569
	    tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2570
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2571
	    scrollView topInset:(tabRulerView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2572
	    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2573
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2574
	tabRulerView hiddenTabs:#(1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2575
	tabRulerView fixedTabs:#(1).
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2576
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2577
	tabRulerView notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2578
	    tabRulerView beInvisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2579
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2580
	scrollView topInset:0
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2581
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2582
    tabSpec := nil.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2583
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2584
    "Created: / 19.4.1997 / 09:50:02 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2585
    "Modified: / 4.8.1998 / 13:44:14 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2586
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2587
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2588
!FileBrowser methodsFor:'help '!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2589
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2590
helpTextFor:aComponent
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2591
    |s|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2592
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2593
    aComponent == subView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2594
	s := 'HELP_SUBVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2595
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2596
    aComponent == fileListView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2597
	s := 'HELP_FILELIST'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2598
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2599
    aComponent == filterField ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2600
	s := 'HELP_FILTER'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2601
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2602
    aComponent == labelView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2603
	s := 'HELP_PATHFIELD'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2604
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2605
    aComponent == commandView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2606
	s := 'HELP_COMMANDVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2607
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2608
    s notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2609
	^ resources string:s
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2610
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2611
    ^ nil
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2612
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2613
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2614
!FileBrowser methodsFor:'initialization'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2615
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2616
createTabRulerIn:topFrame
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2617
    |v|
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2618
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2619
    false "self is3D" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2620
	v := View in:topFrame.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2621
	v level:-1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2622
	tabRulerView := TabSpecRuler in:v.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2623
	tabRulerView level:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2624
	v origin:(0.0@0.0) corner:(1.0@10).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2625
	tabRulerView origin:(0.0@0.0) corner:(1.0@1.0).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2626
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2627
	tabRulerView := TabSpecRuler in:topFrame.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2628
	tabRulerView origin:(0.0@0.0) corner:(1.0@10).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2629
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2630
    tabRulerView borderWidth:0.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2631
    tabRulerView synchronousOperation:true.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2632
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2633
    "Created: / 27.7.1998 / 20:23:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2634
    "Modified: / 27.7.1998 / 20:30:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2635
!
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2636
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2637
currentDirectory:aDirectoryPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2638
    "set the directory to be browsed"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2639
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2640
    currentDirectory := aDirectoryPath asFilename.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2641
    self changed:#path.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2642
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2643
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2644
     tell my subview (whatever that is) to start its file-dialog
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2645
     (i.e. save-as etc.) in that directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2646
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2647
    (subView respondsTo:#directoryForFileDialog:) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2648
	subView directoryForFileDialog:currentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2649
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2650
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2651
    "Modified: 16.9.1997 / 14:56:17 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2652
    "Modified: 21.9.1997 / 11:28:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2653
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2654
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2655
focusSequence
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2656
    "return the sequence in which ALT-CursorRight steps focus"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2657
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2658
    |fs|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2659
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2660
    fs := Array 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2661
	with:labelView
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2662
	with:filterField 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2663
	with:fileListView 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2664
	with:subView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2665
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2666
    commandView notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2667
	fs := fs copyWith:commandView
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2668
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2669
    ^fs
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2670
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2671
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2672
initEvents
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2673
    super initEvents.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2674
    self enableEvent:#visibilityChange.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2675
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2676
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2677
initialize
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2678
    |frame spacing halfSpacing v topFrame labelFrame filterModel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2679
     buttonPanel img mH menuPanel|
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2680
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2681
    super initialize.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2682
819
b78a26650047 initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
  2683
    fileEncoding := #iso8859.        "/ native ST/X encoding
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  2684
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2685
    "if true, will replace leading spaces by tabs on
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2686
     file write. If false, they will be written as spaces
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2687
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2688
    compressTabs := resources at:'COMPRESS_TABS' default:true.
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2689
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2690
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2691
     showing long or short by default
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2692
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2693
    "/ showLongList := resources at:'LONG_LIST' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2694
    showingDetails := (resources at:'LONG_LIST' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2695
    showingDetails onChangeSend:#detailsSettingChanged to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2696
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2697
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2698
     show hidden files or not ?
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2699
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2700
    "/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2701
    showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2702
    showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2703
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2704
    sortByWhat := #name asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2705
    sortByWhat onChangeSend:#sortChanged to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2706
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2707
    sortCaseless := (Filename isCaseSensitive not) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2708
    sortCaseless onChangeSend:#updateCurrentDirectory to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2709
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2710
    lockUpdate := false.
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2711
132
claus
parents: 126
diff changeset
  2712
    CommandHistory isNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2713
        CommandHistory := OrderedCollection new.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2714
        CommandHistorySize := 50
132
claus
parents: 126
diff changeset
  2715
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2716
    DirectoryHistory isNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2717
        DirectoryHistory := OrderedCollection new.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2718
        DirectoryHistoryWhere := OrderedCollection new.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2719
        HistorySize := 15.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2720
    ].
132
claus
parents: 126
diff changeset
  2721
    commandIndex := 0.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2722
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  2723
    icons := Dictionary new.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2724
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2725
    Icons isNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2726
        self class initializeIcons
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2727
    ].
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2728
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2729
    myName := (resources string:self class name).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2730
    self label:myName.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2731
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2732
    menuPanel := MenuPanel in:self.
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  2733
    menuPanel level:1.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2734
    menuPanel verticalLayout:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2735
    menuPanel receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2736
    menuPanel menu:(self pullDownMenu).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2737
    mH := menuPanel preferredExtent y.
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2738
    menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)).
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2739
93
claus
parents: 85
diff changeset
  2740
    labelFrame := View 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2741
                        origin:(0.0 @ mH)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2742
                        corner:(1.0 @ (font height * 1.8 + mH) rounded)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2743
                        in:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2744
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2745
    (styleSheet name = #st80 or:[styleSheet name == #win95]) ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2746
        labelFrame level:1.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2747
"/        labelFrame rightInset:-1.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2748
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2749
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2750
    spacing := ViewSpacing.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2751
    halfSpacing := spacing // 2.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2752
1100
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2753
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2754
      checkBlock is executed by the Processor every checkDelta seconds.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2755
      We use #pushEvent: to perform the directory update
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2756
      in our windowgroups process.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2757
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2758
    checkBlock := [self pushEvent:#checkIfDirectoryHasChanged].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2759
    checkDelta := resources at:'CHECK_DELTA' default:10.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2760
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2761
    currentDirectory := Filename currentDirectory.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2762
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2763
    filterModel := '*' asValue.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2764
    filterField := EditField in:labelFrame.
1071
Claus Gittinger <cg@exept.de>
parents: 1040
diff changeset
  2765
    filterField 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2766
        origin:[((width // 4 * 3) + halfSpacing) @ (halfSpacing)]
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2767
        corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ).
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2768
    filterField rightInset:(ViewSpacing - halfSpacing).
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2769
    filterField model:filterModel.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2770
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2771
    labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)).
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2772
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2773
    self initializeFilterPattern.
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2774
    filterModel onChangeSend:#filterPatternChanged to:self.
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2775
"/    filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2776
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2777
"/    labelView := Label in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2778
"/    labelView origin:(halfSpacing @ halfSpacing)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2779
"/              extent:[((width // 4 * 3) - spacing - borderWidth)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2780
"/                       @
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2781
"/                       (filterField heightIncludingBorder)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2782
"/                       "(font height + font descent)"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2783
"/                     ].
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2784
"/    labelView adjust:#right.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2785
"/    labelView borderWidth:0.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2786
"/    labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2787
"/    labelFrame model:self; menu:#labelMenu.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2788
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2789
    labelView := FilenameEditField in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2790
    labelView 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2791
        origin:(halfSpacing @ (halfSpacing))
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2792
        extent:[((width // 4 * 3) - spacing - borderWidth)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2793
                @
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2794
                (filterField heightIncludingBorder)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2795
                "(font height + font descent)"
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2796
               ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2797
    labelView menu:#labelMenu; 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2798
            aspect:#path; changeMessage:#pathChanged:.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2799
    labelView model:self.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2800
    labelView backgroundColor:(labelFrame viewBackground).
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  2801
    labelFrame model:self; menu:#labelMenu.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2802
    labelView cursorType:#solidCaret; cursorTypeNoFocus:#none.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2803
    labelView level:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2804
    labelView borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2805
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2806
    killButton := Button label:(resources string:'kill') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2807
"/    killButton origin:(halfSpacing @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2808
"/               extent:(killButton width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2809
    killButton origin:(halfSpacing @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2810
    killButton topInset:(killButton height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2811
    killButton beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2812
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2813
    pauseToggle := Toggle label:(resources string:'pause') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2814
"/    pauseToggle origin:((killButton corner x + 50) @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2815
"/                extent:(pauseToggle width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2816
    pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2817
    pauseToggle topInset:(pauseToggle height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2818
    pauseToggle beInvisible.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2819
132
claus
parents: 126
diff changeset
  2820
    self initializeCommandViewIn:self.
claus
parents: 126
diff changeset
  2821
claus
parents: 126
diff changeset
  2822
"/    frame := VariableVerticalPanel
claus
parents: 126
diff changeset
  2823
"/                 origin:[frame borderWidth negated 
claus
parents: 126
diff changeset
  2824
"/                         @ 
claus
parents: 126
diff changeset
  2825
"/                         labelFrame height
claus
parents: 126
diff changeset
  2826
"/                         "/ (labelView height + labelView origin y + spacing)
claus
parents: 126
diff changeset
  2827
"/                        ]
claus
parents: 126
diff changeset
  2828
"/                 corner:(1.0 @ 1.0)
claus
parents: 126
diff changeset
  2829
"/                     in:self.
claus
parents: 126
diff changeset
  2830
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2831
    frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self.
132
claus
parents: 126
diff changeset
  2832
    frame topInset:labelFrame height.
claus
parents: 126
diff changeset
  2833
    commandView notNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2834
        frame bottomInset:(commandView height + spacing + spacing)
132
claus
parents: 126
diff changeset
  2835
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2836
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2837
    topFrame := View in:frame.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2838
    topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2839
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2840
false ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2841
    self createTabRulerIn:topFrame.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2842
].
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2843
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2844
    scrollView := ScrollableView in:topFrame.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2845
    scrollView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2846
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2847
    fileListView := SelectionInListView new.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2848
    scrollView scrolledView:fileListView.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2849
    fileListView action:[:lineNr | self fileSelect:lineNr].
1326
aab1605ad945 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  2850
    fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2851
    fileListView multipleSelectOk:true.
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  2852
    fileListView delegate:self.
98
claus
parents: 93
diff changeset
  2853
    fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu.
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  2854
    fileListView allowDrag:true.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2855
    fileListView dragObjectConverter:[:obj | 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2856
                                        |dir nm path idx|
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2857
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2858
                                        nm := obj theObject asString.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2859
                                        idx := fileListView list indexOf:nm.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2860
                                        idx == 0 ifTrue:[
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2861
                                            "/ cannot happen ...
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2862
                                            nil
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2863
                                        ] ifFalse:[
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2864
                                            nm := fileList at:idx.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2865
                                            dir := currentDirectory pathName asFilename.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2866
                                            path := dir constructString:nm.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2867
                                            DropObject newFile:path.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2868
                                        ]
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2869
                                     ].
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2870
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2871
    "/ sigh - must be delayed - origin is not yet fixe
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2872
"/    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2873
"/    self showOrHideTabView.
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2874
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2875
    v := self initializeSubViewIn:frame.
132
claus
parents: 126
diff changeset
  2876
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2877
    v origin:(0.0 @ 0.3) corner:(1.0 @ 1.0).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2878
    subView := v scrolledView.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2879
    (subView respondsTo:#directoryForFileDialog:) ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2880
        subView directoryForFileDialog:currentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2881
    ].
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2882
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2883
"/    buttonPanel := HorizontalPanelView in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2884
"/    buttonPanel horizontalLayout:#leftSpace.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2885
"/    buttonPanel verticalSpace:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2886
"/    "/ buttonPanel verticalLayout:#top.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2887
"/    buttonPanel borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2888
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2889
"/    buttonPanel 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2890
"/        origin:(0.5 @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2891
"/        extent:[((width // 4) - spacing - borderWidth)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2892
"/                @
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2893
"/                (buttonPanel preferredExtent y max:(labelView height))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2894
"/               ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2895
"/    "/ buttonPanel level:-1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2896
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2897
"/    upButton := Button in:buttonPanel.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2898
"/    img := Image fromFile:'bitmaps/xpmBitmaps/document_images/tiny_yellow_dir_up.xpm'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2899
"/    upButton label:(img ? 'up').
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2900
"/    upButton action:[self changeToParentDirectory].
1328
9588cd743755 Fix kill and pause buttons.
Stefan Vogel <sv@exept.de>
parents: 1327
diff changeset
  2901
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2902
    ObjectMemory addDependent:self.
132
claus
parents: 126
diff changeset
  2903
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2904
    "Modified: / 6.9.1995 / 20:26:06 / claus"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2905
    "Modified: / 16.9.1997 / 14:52:46 / stefan"
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2906
    "Modified: / 30.8.1998 / 23:03:23 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2907
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2908
132
claus
parents: 126
diff changeset
  2909
initializeCommandViewIn:frame
claus
parents: 126
diff changeset
  2910
    "set up the command view - can be redefined in subclasses as empty,
claus
parents: 126
diff changeset
  2911
     if no commandView is wanted"
claus
parents: 126
diff changeset
  2912
claus
parents: 126
diff changeset
  2913
claus
parents: 126
diff changeset
  2914
    commandView := EditField origin:0.0@1.0 corner:1.0@1.0 in:frame.
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  2915
    commandView allInset:ViewSpacing//2.
132
claus
parents: 126
diff changeset
  2916
    commandView topInset:(commandView preferredExtent y negated - ViewSpacing).
claus
parents: 126
diff changeset
  2917
133
claus
parents: 132
diff changeset
  2918
"/    commandView contents:'** no commands which require input here **'.
132
claus
parents: 126
diff changeset
  2919
142
claus
parents: 139
diff changeset
  2920
    commandView entryCompletionBlock:[:contents |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2921
	|newString|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2922
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2923
	newString := Filename 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2924
			filenameCompletionFor:contents 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2925
			directory:currentDirectory 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2926
			directoriesOnly:false 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2927
			filesOnly:false 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2928
			ifMultiple:[:dir | commandView flash.].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2929
	commandView contents:newString.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2930
	commandView cursorToEndOfLine.
132
claus
parents: 126
diff changeset
  2931
    ].
claus
parents: 126
diff changeset
  2932
    commandView leaveAction:[:key | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2933
	|cmd nCmd empty|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2934
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2935
	(key == #CursorDown 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2936
	or:[key == #CursorUp]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2937
	    nCmd := CommandHistory size.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2938
	    nCmd == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2939
		empty := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2940
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2941
		key == #CursorUp ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2942
		    commandIndex == nCmd ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2943
			commandView flash.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2944
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2945
		    commandIndex := (commandIndex + 1) min:nCmd
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2946
		] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2947
		    commandIndex == 1 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2948
			commandView flash.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2949
			empty := true.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2950
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2951
		    commandIndex := (commandIndex - 1) max:1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2952
		].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2953
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2954
	    empty == true ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2955
		commandView contents:nil
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2956
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2957
		commandView contents:(CommandHistory at:commandIndex).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2958
	    ]        
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2959
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2960
	key == #Return ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2961
	    cmd := commandView contents.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2962
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2963
	    subView insertLine:(
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2964
				Text string:('>> ' , cmd)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2965
				     emphasis:(Array with:#bold with:#underline with:(#color->Color blue))
539
33b603dd30ba replaced ColoredListEntry by Text
Claus Gittinger <cg@exept.de>
parents: 525
diff changeset
  2966
"/                                ColoredListEntry string:('>> ' , cmd) color:Color blue
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2967
				)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2968
		    before:(subView cursorLine).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2969
	    subView cursorDown:1.
133
claus
parents: 132
diff changeset
  2970
claus
parents: 132
diff changeset
  2971
"/            subView insertStringAtCursor:cmd.
claus
parents: 132
diff changeset
  2972
"/            subView insertCharAtCursor:(Character cr).
132
claus
parents: 126
diff changeset
  2973
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2974
	    (cmd notNil and:[cmd notEmpty]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2975
		self class addToCommandHistory:cmd for:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2976
		self doExecuteCommand:cmd replace:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2977
		commandView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2978
		commandIndex := 0
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2979
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2980
	]
132
claus
parents: 126
diff changeset
  2981
    ].
claus
parents: 126
diff changeset
  2982
133
claus
parents: 132
diff changeset
  2983
    "Modified: 7.9.1995 / 15:48:45 / claus"
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  2984
    "Modified: 30.8.1997 / 19:22:52 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2985
    "Modified: 18.9.1997 / 16:55:01 / stefan"
132
claus
parents: 126
diff changeset
  2986
!
claus
parents: 126
diff changeset
  2987
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2988
initializeFilterPattern
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2989
    "set an initial matchpattern - can be redefined in subclasses"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2990
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2991
    filterField model value:'*'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2992
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2993
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2994
initializeSubViewIn:frame
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2995
    "set up the contents view - can be redefined in subclasses for
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2996
     different view types (SoundFileBrowser/ImageBrowsers etc.)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2997
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2998
    ^ HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:frame.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  2999
!
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3000
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3001
postRealize
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3002
    super postRealize.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3003
    self showOrHideTabView.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3004
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3005
    "Created: 24.7.1997 / 18:13:46 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3006
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3007
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3008
!FileBrowser methodsFor:'menu actions'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3009
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3010
copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3011
    "copy the command history to the clipBoard"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3012
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3013
    self setTextSelection:(CommandHistory asStringCollection asString).
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3014
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3015
    "Modified: / 29.10.1998 / 12:17:14 / cg"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3016
!
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3017
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3018
copyFileList
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3019
    "copy fileList to the clipBoard"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3020
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3021
    self setTextSelection:(fileListView list 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3022
			      collect:[:l | |ll|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3023
					ll := l string withoutSeparators.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3024
					(ll endsWith:' ...') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3025
					    ll copyWithoutLast:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3026
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3027
					    ll
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3028
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3029
				      ]) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3030
				asStringCollection asString.
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3031
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3032
    "Modified: / 17.8.1998 / 10:13:10 / cg"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3033
!
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3034
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3035
copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3036
    "copy the selected filename to the clipBoard (for easy paste)"
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3037
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3038
    |sel fileName|
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3039
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3040
    sel := fileListView selection.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3041
    sel size == 1 ifTrue:[
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3042
        fileName := fileList at:sel first.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3043
        self setTextSelection:fileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3044
    ].
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3045
!
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3046
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3047
menuExit
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3048
    self closeRequest
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3049
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3050
    "Created: / 4.8.1998 / 13:41:38 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3051
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3052
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3053
menuOSCommand
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3054
    self fileExecute
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3055
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3056
    "Created: / 4.8.1998 / 14:06:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3057
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3058
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3059
menuOpen
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3060
    "same as a double-click"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3061
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3062
    "Modified: / 4.8.1998 / 13:42:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3063
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3064
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3065
menuShowFileBrowserDocumentation
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3066
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3067
    "Created: / 4.8.1998 / 14:03:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3068
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3069
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3070
openAboutThisApplication
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3071
    "opens an about box for this application."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3072
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3073
    |rev box myClass clsRev image msg|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3074
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3075
    rev := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3076
    myClass := self class.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3077
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3078
    (clsRev := myClass revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3079
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3080
    msg := '\' withCRs , myClass name asBoldText, rev.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3081
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3082
    AboutBox isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3083
	"/ this handles bad installations of ST/X,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3084
	"/ where the AboutBox is missing.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3085
	"/ (May vanish in the future)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3086
	^ self information:msg
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3087
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3088
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3089
    box := AboutBox title:msg.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3090
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3091
    image := self class defaultIcon.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3092
    image notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3093
	box image:image
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3094
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3095
    box   label:'About This Application'.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3096
    box   autoHideAfter:10 with:[].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3097
    box   showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3098
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3099
    "Modified: / 14.8.1998 / 13:20:24 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3100
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3101
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3102
openHTMLDocument:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3103
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3104
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3105
    "Created: / 4.8.1998 / 14:06:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3106
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3107
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3108
pullDownMenu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3109
    "return the top (pullDown) menu"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3110
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3111
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3112
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3113
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3114
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3115
    m := self class menuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3116
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3117
    m receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3118
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3119
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3120
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3121
    "Created: / 14.8.1998 / 14:14:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3122
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3123
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3124
showAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3125
    ToolApplicationModel openAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3126
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3127
    "Created: / 14.8.1998 / 13:18:41 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3128
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3129
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3130
sortChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3131
Transcript show:'fBrowser:'; showCR:sortByWhat value.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3132
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3133
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3134
    "Created: / 14.8.1998 / 16:17:20 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3135
    "Modified: / 14.8.1998 / 16:44:00 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3136
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3137
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3138
!FileBrowser methodsFor:'misc user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3139
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3140
closeRequest
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3141
    "exit FileBrowser"
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3142
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3143
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when FileBrowser is closed.'
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3144
	      yesButton:'close') 
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3145
    ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3146
	"/ self windowGroup closeDownViews.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3147
	super closeRequest
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3148
    ]
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3149
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3150
    "Created: / 3.8.1998 / 19:55:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3151
    "Modified: / 4.8.1998 / 18:21:03 / cg"
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3152
!
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3153
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3154
destroy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3155
    "destroy view and boxes"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3156
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3157
    ObjectMemory removeDependent:self.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3158
    self stopUpdateProcess.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3159
    checkBlock := nil.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3160
    super destroy
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  3161
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3162
    "Modified: 19.4.1997 / 13:51:48 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3163
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3164
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3165
discardChangesDialog
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3166
    "ask the user if changes should be discarded,
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3167
     return true if changes should be discarded, false otherwise"
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3168
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3169
    ^ self askIfModified:'contents has not been saved.\\Modifications will be lost when directory is changed.'
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3170
	       yesButton:'change'
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3171
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3172
    "Created: 2.10.1997 / 14:08:37 / stefan"
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3173
!
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3174
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3175
filterPatternChanged
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3176
    fileListView scrollToTop.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3177
    fileListView deselect.
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3178
    self updateCurrentDirectory
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3179
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3180
    "Modified: / 3.10.1998 / 18:23:34 / cg"
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3181
!
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3182
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3183
update:what with:someArgument from:changedObject
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3184
    realized ifFalse:[^ self].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3185
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3186
    (what == #aboutToExit) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3187
	"system wants to shut down this
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3188
	 - if text was modified, pop up, and ask user and save if requested."
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3189
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3190
	(subView modified and:[subView contentsWasSaved not]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3191
	    self raiseDeiconified.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3192
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3193
	    (self 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3194
		ask:(resources at:'FileBrowser:\\contents has not been saved.\\Save before exiting ?')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3195
		yesButton:'save'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3196
		noButton:'don''t save')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3197
	    ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3198
		subView acceptAction notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3199
		    subView accept
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3200
		] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3201
		    subView save
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3202
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3203
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3204
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3205
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3206
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3207
    changedObject == tabSpec ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3208
	fileListView invalidate
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3209
    ].
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3210
585
be0241bf7268 use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 564
diff changeset
  3211
    "Modified: 29.5.1996 / 16:13:43 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3212
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3213
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3214
!FileBrowser methodsFor:'pathField user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3215
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3216
addDirToJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3217
    "add the current path to javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3218
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3219
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3220
    Java addToClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3221
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3222
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3223
    "Created: 1.8.1997 / 21:25:22 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3224
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3225
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3226
addDirToJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3227
    "add the current path to javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3228
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3229
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3230
    Java addToSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3231
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3232
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3233
    "Created: 2.8.1997 / 14:11:19 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3234
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3235
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3236
changeCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3237
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3238
     otherwise ask for & change to that directory"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3239
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3240
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3241
	self queryForDirectoryToChange
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3242
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3243
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3244
    "Modified: 21.9.1997 / 23:45:35 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3245
    "Modified: 2.10.1997 / 14:09:02 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3246
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3247
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3248
changeDirectoryTo:aDirectoryName
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3249
    "sent from label menu to change back to a previous directory"
132
claus
parents: 126
diff changeset
  3250
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3251
    self discardChangesDialog ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3252
	self doChangeCurrentDirectoryTo:aDirectoryName updateHistory:true "/false.
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3253
    ].
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3254
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3255
    "Modified: / 2.10.1997 / 14:09:24 / stefan"
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3256
    "Modified: / 21.7.1998 / 16:38:03 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3257
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3258
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3259
changeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3260
    "if text was modified show a queryBox, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3261
     otherwise change immediately to the default directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3262
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3263
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3264
	 self doChangeToDefaultDirectory
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3265
    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3266
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3267
    "Modified: 21.9.1997 / 23:45:04 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3268
    "Modified: 2.10.1997 / 14:09:33 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3269
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3270
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3271
changeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3272
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3273
     otherwise change immediately to the home directory"
132
claus
parents: 126
diff changeset
  3274
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3275
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3276
	 self doChangeToHomeDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3277
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3278
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3279
    "Modified: 21.9.1997 / 23:45:10 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3280
    "Modified: 2.10.1997 / 14:09:42 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3281
!
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3282
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3283
changeToParentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3284
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3285
     otherwise change immediately to the parent directory"
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3286
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3287
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3288
	 self doChangeToParentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3289
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3290
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3291
    "Modified: 21.9.1997 / 23:45:15 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3292
    "Modified: 2.10.1997 / 14:09:55 / stefan"
98
claus
parents: 93
diff changeset
  3293
!
claus
parents: 93
diff changeset
  3294
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3295
copyPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3296
    "copy current path into cut & paste buffer"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3297
873
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3298
    self setTextSelection:currentDirectory pathName
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3299
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3300
    "Modified: 14.12.1996 / 15:37:47 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3301
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3302
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3303
fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3304
    "add the current path to javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3305
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3306
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3307
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3308
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3309
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3310
    f isNil ifTrue:[
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3311
        ^ self addDirToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3312
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3313
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3314
    Java addToClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3315
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3316
    "Created: / 9.11.1998 / 05:41:34 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3317
    "Modified: / 9.11.1998 / 05:56:00 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3318
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3319
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3320
fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3321
    "remove the current path from javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3322
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3323
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3324
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3325
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3326
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3327
    f isNil ifTrue:[
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3328
        ^ self removeDirToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3329
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3330
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3331
    Java removeFromClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3332
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3333
    "Created: / 9.11.1998 / 05:42:05 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3334
    "Modified: / 9.11.1998 / 05:56:14 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3335
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3336
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3337
labelMenu
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3338
    "return the popUpMenu for the path label"
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3339
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  3340
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3341
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3342
    ^ self class directoryMenuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3343
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3344
    "Modified: / 14.8.1998 / 12:11:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3345
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3346
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3347
labelMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3348
    "return the popUpMenu for the path label"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3349
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3350
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3351
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3352
    |items menu currentIndex|
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3353
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3354
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3355
		   ('copy path'                   copyPath                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3356
		   ('-'                                                     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3357
		   ('up'                          changeToParentDirectory   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3358
		   ('back'                        changeToPreviousDirectory )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3359
		   ('change to home-directory'    changeToHomeDirectory     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3360
		   ('change to default-directory' changeToDefaultDirectory  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3361
		   ('change directory ...'        changeCurrentDirectory    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3362
	       ).             
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3363
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3364
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3365
	items := items , #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3366
			    ( '-')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3367
			    ( 'add to JavaClassPath'       addDirToJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3368
			    ( 'add to JavaSourcePath'      addDirToJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3369
			    ( 'remove from JavaClassPath'  removeDirFromJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3370
			    ( 'remove from JavaSourcePath' removeDirFromJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3371
			  ).
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3372
    ].
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3373
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3374
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3375
	items := items copyWith:#('-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3376
	items := items ,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3377
		 (DirectoryHistory 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3378
			collect:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3379
				    Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3380
					with:dirName 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3381
					with:#changeDirectoryTo:
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3382
					with:nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3383
					with:dirName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3384
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3385
		 ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3386
	currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3387
	currentIndex == 0 ifTrue:[currentIndex := nil].
123
claus
parents: 120
diff changeset
  3388
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3389
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3390
    menu := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3391
		itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3392
		resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3393
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3394
    previousDirectory isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3395
	menu disable:#changeToPreviousDirectory.
132
claus
parents: 126
diff changeset
  3396
    ].
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3397
    currentIndex notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3398
	menu disable:currentIndex
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3399
    ].
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3400
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3401
	(Java classPath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3402
	    menu disable:#addDirToJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3403
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3404
	    menu disable:#removeDirFromJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3405
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3406
	(Java sourcePath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3407
	    menu disable:#addDirToJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3408
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3409
	    menu disable:#removeDirFromJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3410
	].
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3411
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3412
    ^menu.
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3413
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3414
    "Modified: / 21.7.1998 / 16:43:25 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3415
    "Created: / 14.8.1998 / 12:10:02 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3416
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3417
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3418
pathChanged:newPath
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3419
    "change directory to newPath. If newPath is a filename, change
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3420
     to its directory and get get the file."
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3421
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3422
    |f name idx|
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3423
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3424
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3425
	f := newPath asFilename.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3426
	(f isDirectory) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3427
	    self changeDirectoryTo:newPath
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3428
	] ifFalse:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3429
	    self changeDirectoryTo:(f directoryName).
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3430
	    self changed:#path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3431
	    name := f baseName.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3432
	    idx := fileList indexOf:name.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3433
	    fileListView selection:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3434
	    self fileSelect:name.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3435
	    self fileGet:true.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3436
	].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3437
    ] ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3438
	self changed:#path.
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3439
    ].
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3440
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3441
    "Created: 21.9.1997 / 10:43:12 / cg"
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3442
    "Modified: 7.10.1997 / 14:10:39 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3443
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3444
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3445
queryForDirectoryToChange
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3446
    "query for new directory"
123
claus
parents: 120
diff changeset
  3447
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3448
    |queryBox dirName|
98
claus
parents: 93
diff changeset
  3449
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3450
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3451
		    title:(resources at:'change directory to:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3452
		    okText:(resources at:'change')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3453
		    action:[:newName | dirName := newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3454
"/    queryBox initialText:''.
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3455
    queryBox showAtPointer.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3456
    queryBox destroy.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3457
    self doChangeCurrentDirectoryTo:dirName updateHistory:true.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3458
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3459
    "Modified: 28.4.1997 / 19:50:52 / cg"
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3460
    "Modified: 28.4.1997 / 22:30:40 / dq"
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3461
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3462
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3463
removeDirFromJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3464
    "remove the current path from javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3465
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3466
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3467
    Java removeFromClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3468
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3469
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3470
    "Created: 1.8.1997 / 21:25:36 / cg"
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3471
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3472
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3473
removeDirFromJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3474
    "remove the current path from javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3475
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3476
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3477
    Java removeFromSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3478
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3479
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3480
    "Created: 2.8.1997 / 14:11:41 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3481
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3482
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3483
!FileBrowser methodsFor:'private'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3484
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3485
ask:question yesButton:yesButtonText
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3486
    "common method to ask a yes/no question; return true or false"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3487
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3488
    ^ self ask:question yesButton:yesButtonText noButton:'cancel' 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3489
!
93
claus
parents: 85
diff changeset
  3490
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3491
ask:question yesButton:yesButtonText noButton:noButtonText
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3492
    "common method to ask a yes/no question"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3493
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3494
    ^ Dialog 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3495
	confirm:question withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3496
	yesLabel:(resources at:yesButtonText)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3497
	noLabel:(resources at:noButtonText)
37
50f59bad66b1 *** empty log message ***
claus
parents: 36
diff changeset
  3498
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3499
    "Modified: 21.2.1996 / 01:19:21 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3500
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3501
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  3502
askForCommandFor:fileName thenDo:aBlock
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3503
    "setup and launch a querybox to ask for unix command.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3504
     Then evaluate aBlock passing the command-string as argument."
93
claus
parents: 85
diff changeset
  3505
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3506
    |box osName|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3507
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3508
    osName := OperatingSystem platformName.
93
claus
parents: 85
diff changeset
  3509
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3510
    box := FilenameEnterBox 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3511
		title:(resources string:'execute %1 command:' with:osName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3512
	       okText:(resources string:'execute')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3513
	       action:aBlock.
79
d78f92a07d5d *** empty log message ***
claus
parents: 75
diff changeset
  3514
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3515
    fileName notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3516
	self initialCommandFor:fileName into:box.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3517
    ].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3518
    box directory:currentDirectory.
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  3519
    box showAtPointer.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  3520
    box destroy.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3521
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3522
    "Modified: / 7.9.1995 / 10:31:54 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3523
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3524
    "Modified: / 14.8.1998 / 14:12:52 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3525
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3526
98
claus
parents: 93
diff changeset
  3527
askIfModified:question yesButton:yesButtonText
claus
parents: 93
diff changeset
  3528
    "tell user, that code has been modified - let her confirm"
claus
parents: 93
diff changeset
  3529
claus
parents: 93
diff changeset
  3530
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3531
	^ true
98
claus
parents: 93
diff changeset
  3532
    ].
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  3533
    (self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3534
	"/ reset modified flag so question is asked only once
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3535
	subView modified:false.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3536
	^ true
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  3537
    ].
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  3538
    ^ false
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3539
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3540
    "Modified: 2.10.1997 / 14:23:47 / stefan"
98
claus
parents: 93
diff changeset
  3541
!
claus
parents: 93
diff changeset
  3542
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3543
getSelectedFileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3544
    "returns the currently selected file; shows an error if
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3545
     multiple files are selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3546
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3547
    |sel|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3548
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3549
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3550
    (sel size > 1) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3551
        self onlyOneSelection
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3552
    ] ifFalse:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3553
        sel notNil ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3554
            ^ fileList at:sel first ifAbsent:nil
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3555
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3556
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3557
    ^ nil
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3558
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3559
    "Modified: / 3.10.1998 / 18:21:23 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3560
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3561
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3562
onlyOneSelection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3563
    "show a warning, that only one file must be selected for
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3564
     this operation"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3565
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3566
    self warn:'exactly one file must be selected !!'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3567
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3568
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3569
selectedFilesDo:aBlock
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3570
    "evaluate aBlock on all selected files;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3571
     show a wait cursor while doing this"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3572
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3573
    |sel|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3574
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3575
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3576
    sel notNil ifTrue:[
1903
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3577
        self withWaitCursorDo:[
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3578
            sel do:[:aSelectionIndex | |nm|
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3579
                nm := fileList at:aSelectionIndex ifAbsent:nil.
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3580
                nm notNil ifTrue:[
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3581
                    aBlock value:nm
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3582
                ]
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3583
            ]
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3584
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3585
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3586
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  3587
    "Modified: / 18.6.1998 / 15:29:06 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3588
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3589
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3590
show:something
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3591
    "show something in subview and undef acceptAction"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3592
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3593
    subView contents:something.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3594
    subView acceptAction:nil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3595
    subView modified:false.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3596
    currentFileName := nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3597
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3598
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3599
showAlert:aString with:anErrorString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3600
    "show an alertbox, displaying the last Unix-error"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3601
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3602
    |msg|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3603
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3604
    anErrorString isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3605
	msg := aString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3606
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3607
	msg := aString , '\\(' , anErrorString , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3608
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3609
    self warn:msg withCRs
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3610
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3611
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3612
withoutHiddenFiles:aCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3613
    "remove hidden files (i.e. those that start with '.') from
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3614
     the list in aCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3615
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3616
    |newCollection|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3617
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3618
    newCollection := aCollection species new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3619
    aCollection do:[:fname |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3620
	|ignore|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3621
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3622
	ignore := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3623
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3624
	((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3625
	    showingHiddenFiles value "showDotFiles" ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3626
		ignore := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3627
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3628
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3629
	ignore ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3630
	    newCollection add:fname
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3631
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3632
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3633
    ^ newCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3634
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3635
    "Modified: / 4.8.1998 / 13:46:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3636
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3637
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3638
!FileBrowser methodsFor:'private - actions & command execution'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3639
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3640
binaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3641
    "for some binary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3642
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3643
1330
2d8c64367afc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3644
    (currentDirectory construct:aFilename) isExecutableProgram ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3645
	(OperatingSystem executeCommand:'cd ', currentDirectory pathName, '; ',aFilename)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3646
	ifTrue:[^true].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3647
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3648
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3649
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3650
    "Modified: 19.6.1996 / 09:44:07 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3651
    "Modified: 18.9.1997 / 17:18:04 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3652
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3653
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3654
doExecuteCommand:commandArg replace:replace
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3655
    "execute a unix command inserting the output of the command.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3656
     If replace is true, all text is replaced by the commands output;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3657
     otherwise, its inserted as selected text at the cursor position."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3658
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3659
    |command stream line lnr myProcess myPriority startLine startCol stopSignal
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3660
     pauseSignal access stillReplacing pauseHolder lowerFrameView|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3661
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3662
    command := commandArg asString.
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3663
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3664
    access := Semaphore forMutualExclusion name:'accessLock'.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3665
    stopSignal := Signal new.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3666
    pauseSignal := Signal new.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3667
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3668
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3669
     The following is tricky: 
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3670
     the pauseToggle & killButton will
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3671
     be handled by their own windowGroup process.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3672
     This means, that they respond to events even though
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3673
     I myself am reading the commands output.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3674
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3675
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3676
    commandView beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3677
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3678
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3679
     must take kill & pauseButtons out of my group
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3680
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3681
    killButton windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3682
    pauseToggle windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3683
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3684
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3685
     bring them to front, and turn hidden-mode off
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3686
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3687
    killButton raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3688
    pauseToggle raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3689
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3690
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3691
     kill will make me raise the stopSignal when pressed
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3692
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3693
    killButton 
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3694
        action:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3695
            stream notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3696
                access critical:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3697
                    myProcess interruptWith:[stopSignal raiseRequest].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3698
                ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3699
            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3700
        ].
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3701
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3702
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3703
     pause makes me stop reading the commands output
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3704
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3705
    pauseHolder := false asValue.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3706
    pauseToggle model:pauseHolder.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3707
    pauseToggle pressAction:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3708
        stream notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3709
            access critical:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3710
                myProcess interruptWith:[pauseSignal raiseRequest].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3711
            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3712
        ]
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3713
    ].
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3714
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3715
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3716
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3717
     start kill button under its own windowgroup
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3718
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3719
    killButton openAutonomous.
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3720
    killButton windowGroup process processGroupId:(Processor activeProcess id).
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3721
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3722
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3723
     and add the pauseToggle to its windowGroup
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3724
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3725
    pauseToggle windowGroup:(killButton windowGroup).
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3726
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3727
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3728
    lowerFrameView := subView superView.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3729
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3730
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3731
     go fork a pipe and read it
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3732
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3733
    self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3734
    [
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3735
      self withWaitCursorDo:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3736
        stopSignal catch:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3737
            pauseSignal handle:[:ex|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3738
                |noPauseSema|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3739
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3740
                "/    
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3741
                "/ allow interaction with
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3742
                "/ the codeView via the other windowGroup
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3743
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3744
                lowerFrameView windowGroup:(killButton windowGroup).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3745
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3746
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3747
                "/ wait for pause to be turned off
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3748
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3749
                noPauseSema := Semaphore new.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3750
                pauseHolder onChangeSend:#signal to:noPauseSema.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3751
                noPauseSema wait.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3752
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3753
                "/    
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3754
                "/ no interaction with the codeView ...
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3755
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3756
                lowerFrameView windowGroup:(self windowGroup).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3757
                ex proceed.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3758
            ] do:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3759
                startLine := subView cursorLine.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3760
                startCol := subView cursorCol.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3761
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3762
                "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3763
                 this can be a time consuming operation; therefore lower my priority
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3764
                "
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3765
                myProcess := Processor activeProcess.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3766
"/                myPriority := myProcess priority.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3767
"/                myProcess priority:(Processor userBackgroundPriority).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3768
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3769
                stream := PipeStream 
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3770
                            readingFrom:command
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3771
                            errorDisposition:#inline
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3772
                            inDirectory:currentDirectory.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3773
                stream notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3774
                    [
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3775
                        |codeView lines noPauseSema enc|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3776
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3777
                        enc := fileEncoding.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3778
                        enc == #iso8859 ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3779
                            enc := nil
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3780
                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3781
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3782
                        stream buffered:true.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3783
                        codeView := subView.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3784
                        codeView unselect.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3785
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3786
                        replace ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3787
                            codeView list:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3788
                            lnr := 1.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3789
                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3790
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3791
                        stillReplacing := replace.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3792
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3793
                        [stream readWait. stream atEnd] whileFalse:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3794
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3795
                             data available; read up to 100 lines
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3796
                             and insert as a single junk. This speeds up
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3797
                             display of long output (less line-scrolling).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3798
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3799
                            lines := OrderedCollection new:100.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3800
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3801
                            [
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3802
                                line := stream nextLine.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3803
                                line notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3804
                                    enc notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3805
                                        line := line decodeFrom:enc
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3806
                                    ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3807
                                    lines add:line
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3808
                                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3809
                            ] doWhile:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3810
                                stream canReadWithoutBlocking
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3811
                                and:[stream atEnd not
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3812
                                and:[lines size < 100]]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3813
                            ]. 
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3814
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3815
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3816
                             need this critical section; otherwise,
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3817
                             we could get the signal while waiting for
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3818
                             an expose event ...
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3819
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3820
                            access critical:[                        
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3821
                                lines size > 0 ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3822
                                    stillReplacing ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3823
                                        lines do:[:line |
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3824
                                            codeView at:lnr put:line withTabsExpanded.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3825
                                            codeView cursorToBottom; cursorDown:1.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3826
                                            lnr := lnr + 1.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3827
                                            lnr > codeView list size ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3828
                                                stillReplacing := false
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3829
                                            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3830
                                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3831
                                    ] ifFalse:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3832
                                        codeView insertLines:lines before:codeView cursorLine.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3833
                                        codeView cursorDown:lines size.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3834
                                    ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3835
                                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3836
                            ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3837
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3838
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3839
                             give others running at same prio a chance too
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3840
                             (especially other FileBrowsers doing the same)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3841
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3842
                            Processor yield
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3843
                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3844
                    ] valueNowOrOnUnwindDo:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3845
                        stream shutDown "close". stream := nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3846
                    ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3847
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3848
                    "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3849
                    "/ the command could have changed the directory
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3850
                    "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3851
                    self updateCurrentDirectoryIfChanged
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3852
                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3853
                replace ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3854
                    subView modified:false.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3855
                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3856
            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3857
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3858
      ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3859
    ] valueNowOrOnUnwindDo:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3860
        |wg|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3861
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3862
        self label:myName; iconLabel:myName.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3863
"/        myProcess notNil ifTrue:[myProcess priority:myPriority].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3864
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3865
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3866
         hide the button, and make sure it will stay
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3867
         hidden when we are realized again
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3868
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3869
        killButton beInvisible.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3870
        pauseToggle beInvisible.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3871
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3872
        commandView beVisible.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3873
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3874
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3875
         remove the killButton from its group
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3876
         (otherwise, it will be destroyed when we shut down the group)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3877
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3878
        wg := killButton windowGroup.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3879
        killButton windowGroup:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3880
        pauseToggle windowGroup:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3881
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3882
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3883
         shut down the kill buttons windowgroup
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3884
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3885
        wg notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3886
            wg process terminate.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3887
        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3888
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3889
         clear its action (actually not needed, but
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3890
         releases reference to thisContext earlier)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3891
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3892
        killButton action:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3893
        pauseToggle pressAction:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3894
        "/    
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3895
        "/ allow interaction with the codeView
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3896
        "/ (bring it back into my group)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3897
        "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3898
        lowerFrameView windowGroup:(self windowGroup).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3899
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3900
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3901
    currentFileName isNil ifTrue:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3902
        subView modified:false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3903
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3904
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3905
    subView size > 10000 ifTrue:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3906
        self warn:'text quite large now - please cut off some lines'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3907
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3908
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3909
    "Modified: / 21.9.1995 / 11:18:46 / claus"
1508
66bca43c9654 Use #raiseRequest when exception handler does #proceed
Stefan Vogel <sv@exept.de>
parents: 1507
diff changeset
  3910
    "Modified: / 6.3.1998 / 17:32:03 / stefan"
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3911
    "Modified: / 15.10.1998 / 12:37:52 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3912
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3913
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3914
imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3915
    "for some image files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3916
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3917
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3918
    |img|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3919
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3920
    (Image isImageFileSuffix:(aFilename asFilename suffix))
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3921
    ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3922
	img := Image fromFile:(currentDirectory construct:aFilename).
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3923
	img notNil ifTrue:[
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3924
	    ImageEditor openOnImage:img.
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  3925
"/            img inspect.
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3926
	    ^ true
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  3927
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3928
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3929
    ^ false
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3930
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3931
    "Created: 19.6.1996 / 09:43:50 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3932
    "Modified: 18.4.1997 / 14:56:04 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3933
    "Modified: 18.9.1997 / 16:35:48 / stefan"
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  3934
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  3935
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3936
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3937
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3938
initialCommandFor:fileName into:aBox
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3939
    "set a useful initial command for execute box."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3940
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3941
    |cmd select path suffix|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3942
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3943
    "/ XXX should be changed to take stuff from a config file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3944
    "/ XXX or from resources.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3945
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3946
    path := currentDirectory filenameFor:fileName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3947
    (path type == #regular) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3948
	path isExecutableProgram ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3949
	    aBox initialText:(fileName , ' <arguments>').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3950
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3951
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3952
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3953
	select := true.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3954
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3955
	"some heuristics - my personal preferences ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3956
	 (actually this should come from a configfile)"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3957
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3958
	(fileName endsWith:'akefile') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3959
	    aBox initialText:'make target' selectFrom:6 to:11.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3960
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3961
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3962
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3963
	suffix := path suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3964
	(suffix = 'C') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3965
	    cmd := 'g++ -c %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3966
	    select := 6.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3967
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3968
	    suffix := suffix asLowercase.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3969
	    (suffix = 'taz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3970
		aBox initialText:'zcat %1 | tar tvf -'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3971
		select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3972
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3973
	    (suffix = 'tar') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3974
		cmd := 'tar tvf %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3975
		select := 7.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3976
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3977
	    (suffix = 'zoo') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3978
		cmd := 'zoo -list %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3979
		select := 9.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3980
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3981
	    (suffix = 'zip') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3982
		cmd := 'unzip -l %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3983
		select := 8.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3984
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3985
	    (suffix = 'jar') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3986
		cmd := 'unzip -l %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3987
		select := 8.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3988
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3989
	    (suffix = 'z') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3990
		(fileName endsWith:'tar.z') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3991
		    cmd := 'zcat %1 | tar tvf -'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3992
		    select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3993
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3994
		    cmd := 'uncompress %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3995
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3996
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3997
	    (suffix = 'gz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3998
		(fileName endsWith:'tar.gz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3999
		    cmd := ('gunzip < %1 | tar tvf -' ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4000
		    select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4001
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4002
		    cmd := 'gunzip %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4003
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4004
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4005
	    (suffix = 'tgz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4006
		cmd := ('gunzip < %1 | tar tvf -' ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4007
		select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4008
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4009
	    (suffix = 'html') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4010
		cmd := 'netscape %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4011
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4012
	    (suffix = 'htm') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4013
		cmd := 'netscape %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4014
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4015
	    (suffix = 'uue') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4016
		cmd := 'uudecode %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4017
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4018
	    (suffix = 'c') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4019
		cmd := 'cc -c %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4020
		select := 5.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4021
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4022
	    (suffix = 'cc') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4023
		cmd := 'g++ -c %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4024
		select := 6.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4025
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4026
	    (suffix = 'xbm') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4027
		cmd := 'bitmap %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4028
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4029
	    (suffix = 'ps') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4030
		cmd := 'ghostview %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4031
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4032
	    ((suffix = '1') or:[suffix = 'man']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4033
		cmd := 'nroff -man %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4034
		select := 10.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4035
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4036
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4037
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4038
	cmd isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4039
	    DefaultCommandPerSuffix isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4040
		cmd := '<cmd>'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4041
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4042
		cmd := DefaultCommandPerSuffix 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4043
			at:suffix
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4044
			ifAbsent:'<cmd>'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4045
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4046
	    cmd := cmd , ' %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4047
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4048
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4049
	cmd := cmd bindWith:fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4050
	select == false ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4051
	    aBox initialText:cmd
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4052
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4053
	    select isInteger ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4054
		select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4055
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4056
	    aBox initialText:cmd selectFrom:1 to:select
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4057
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4058
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4059
1542
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  4060
    "Modified: / 24.9.1997 / 16:34:52 / stefan"
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  4061
    "Modified: / 9.4.1998 / 17:15:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4062
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4063
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4064
nonBinaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4065
    "for some nonBinary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4066
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4067
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  4068
    |fullPath|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4069
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4070
    fullPath := currentDirectory filenameFor:aFilename.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4071
    ((fullPath hasSuffix:'htm') or:[fullPath hasSuffix:'html']) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4072
	HTMLDocumentView openOn:fullPath pathName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4073
	^ true
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4074
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4075
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4076
    OperatingSystem isUNIXlike ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4077
	(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4078
	ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4079
	     HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4080
	    ^ true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4081
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4082
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4083
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4084
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4085
    "Created: 19.6.1996 / 09:36:38 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4086
    "Modified: 4.4.1997 / 10:49:00 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4087
    "Modified: 18.9.1997 / 16:58:40 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4088
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4089
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4090
!FileBrowser methodsFor:'private - directory stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4091
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4092
addToHistory:path
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4093
    |pos idx|
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4094
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4095
    (DirectoryHistory includes:path) ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4096
	DirectoryHistory size >= HistorySize ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4097
	    DirectoryHistory removeLast.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4098
	    DirectoryHistoryWhere removeLast
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4099
	]
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4100
    ] ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4101
	"already been there before; move the entry to
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4102
	 the beginning, so it will fall out later."
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4103
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4104
	idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4105
	DirectoryHistory removeIndex:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4106
	pos := DirectoryHistoryWhere at:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4107
	DirectoryHistoryWhere removeIndex:idx.
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4108
    ].
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4109
    DirectoryHistory addFirst:path.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4110
    DirectoryHistoryWhere addFirst:pos.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4111
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4112
    "Created: / 8.11.1997 / 17:16:29 / cg"
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4113
!
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4114
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4115
changeToPreviousDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4116
    "if text was modified show a queryBox, 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4117
     otherwise change immediately to previous directory."
93
claus
parents: 85
diff changeset
  4118
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4119
    previousDirectory isNil ifTrue:[^ self].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4120
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4121
	self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false 
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4122
    ]
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4123
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4124
    "Modified: 2.10.1997 / 14:13:40 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4125
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4126
98
claus
parents: 93
diff changeset
  4127
checkIfDirectoryHasChanged
claus
parents: 93
diff changeset
  4128
    "every checkDelta secs, check if directoy has changed and update the list if so.
claus
parents: 93
diff changeset
  4129
     Also, we check if the file shown has been touched in the meanwhile (for example,
claus
parents: 93
diff changeset
  4130
     from another browser) and say 'outdated' in the label if so. 
claus
parents: 93
diff changeset
  4131
     This avoids confusion if the same file is being edited by two browsers. (or other editors).
claus
parents: 93
diff changeset
  4132
     If the text shown in the codeView has been edited, 'modified' is shown.
claus
parents: 93
diff changeset
  4133
    "
claus
parents: 93
diff changeset
  4134
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4135
    |oldSelection nOld newState msg newLabel t|
98
claus
parents: 93
diff changeset
  4136
claus
parents: 93
diff changeset
  4137
    shown ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4138
	currentDirectory notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4139
	    lockUpdate ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4140
		Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4141
		Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4142
		^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4143
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4144
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4145
	    subView modified ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4146
		newState := ' (modified)'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4147
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4148
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4149
	    (currentDirectory isReadable) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4150
		Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4151
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4152
		t := currentDirectory modificationTime.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4153
		(t notNil and:[t > timeOfLastCheck]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4154
		    nOld := fileListView numberOfSelections.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4155
		    oldSelection := fileListView selectionValue.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4156
		    self updateCurrentDirectory.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4157
		    nOld ~~ 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4158
			nOld > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4159
			    oldSelection do:[:element  |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4160
				fileListView addElementToSelection:element
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4161
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4162
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4163
			    fileListView selectElementWithoutScroll:oldSelection
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4164
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4165
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4166
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4167
		    Processor addTimedBlock:checkBlock afterSeconds:checkDelta
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4168
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4169
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4170
		currentFileName notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4171
		    |f|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4172
		    f := currentDirectory construct:currentFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4173
		    f exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4174
			newState := ' (removed)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4175
		    ] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4176
			f modificationTime > timeOfFileRead ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4177
			    newState := ' (outdated)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4178
			    subView modified ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4179
				newState := ' (modified & outdated)'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4180
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4181
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4182
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4183
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4184
	    ] ifFalse:[         
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4185
		"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4186
		 if the directory has been deleted, or is not readable ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4187
		"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4188
		(currentDirectory exists) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4189
		    msg := 'FileBrowser:\\directory %1 is gone ?!!?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4190
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4191
		    msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4192
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4193
		self warn:(resources string:msg with:currentDirectory pathName) withCRs.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4194
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4195
		fileListView contents:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4196
		newLabel := myName , ': directory is gone !!'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4197
		"/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4198
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4199
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4200
	    newState notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4201
		newLabel := myName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4202
		currentFileName notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4203
		    newLabel := newLabel , ': ' , currentFileName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4204
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4205
		newLabel := newLabel , newState.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4206
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4207
	    newLabel notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4208
		self label:newLabel.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4209
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4210
	]
98
claus
parents: 93
diff changeset
  4211
    ]
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4212
1380
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4213
    "Modified: / 28.4.1997 / 22:31:02 / dq"
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4214
    "Modified: / 16.9.1997 / 15:17:15 / stefan"
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4215
    "Modified: / 18.2.1998 / 17:57:49 / cg"
98
claus
parents: 93
diff changeset
  4216
!
claus
parents: 93
diff changeset
  4217
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4218
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4219
    "verify argument is name of a readable & executable directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4220
     and if so, go there"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4221
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4222
    |msg path idx f|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4223
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4224
    self label:myName; iconLabel:myName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4225
    fileName notNil ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4226
	f := (currentDirectory filenameFor:fileName) asAbsoluteFilename.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4227
	(f isDirectory) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4228
	    (f isReadable) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4229
		(f isExecutable) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4230
		    path := currentDirectory pathName.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4231
		    previousDirectory := path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4232
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4233
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4234
		     remember where we are positioned in the fileList
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4235
		     (in case we want to return)
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4236
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4237
		    idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4238
		    idx ~~ 0 ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4239
			DirectoryHistoryWhere at:idx put:fileListView firstLineShown
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4240
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4241
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4242
		    updateHistory ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4243
			self addToHistory:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4244
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4245
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4246
		    self setCurrentDirectory:(f pathName).
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4247
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4248
		    "/ fetch the new path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4249
		    path := currentDirectory pathName.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4250
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4251
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4252
		     if we have already been there, look for the
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4253
		     position offset, and scroll the fileList
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4254
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4255
		    idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4256
		    idx ~~ 0 ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4257
			|pos|
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4258
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4259
			pos := DirectoryHistoryWhere at:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4260
			pos notNil ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4261
			    fileListView scrollToLine:pos.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4262
			]
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4263
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4264
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4265
		    updateHistory ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4266
			self addToHistory:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4267
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4268
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4269
		    ^ self
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4270
		].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4271
		msg := 'cannot change directory to ''%1'' !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4272
	    ] ifFalse:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4273
		msg := 'cannot read directory ''%1'' !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4274
	    ]
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4275
	] ifFalse:[
1859
56d0cf48acd2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
  4276
	    OperatingSystem isVMSlike ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4277
		"/ cannot tell if it exists or is simply invisible ...
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4278
		msg := '''%1'' is not a directory or unreadable !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4279
	    ] ifFalse:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4280
		msg := '''%1'' is not a directory !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4281
	    ]
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4282
	].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4283
	self showAlert:(resources string:msg with:fileName) with:nil
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4284
    ]
1166
0029f77ccea7 when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
  4285
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4286
    "Modified: / 18.9.1997 / 18:22:30 / stefan"
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4287
    "Modified: / 8.11.1997 / 17:17:17 / cg"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4288
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4289
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4290
doChangeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4291
    "go to parent directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4292
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4293
    self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4294
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4295
    "Created: 21.9.1997 / 23:45:59 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4296
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4297
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4298
doChangeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4299
    "go to home directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4300
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4301
    self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4302
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4303
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4304
doChangeToParentDirectory
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4305
    "go to parent directory"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4306
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4307
    self doChangeCurrentDirectoryTo:'..' updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4308
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4309
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4310
doCreateDirectory:newName
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4311
    |f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4312
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4313
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4314
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4315
	self warn:'%1 already exists.' with:newName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4316
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4317
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4318
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4319
    f makeDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4320
	self updateCurrentDirectoryIfChanged
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4321
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4322
	self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4323
		  with:(OperatingSystem lastErrorString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4324
    ]
1157
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  4325
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  4326
    "Modified: 19.4.1997 / 15:30:32 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4327
    "Modified: 18.9.1997 / 17:21:25 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4328
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4329
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4330
setCurrentDirectory:aPathName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4331
    "setup for another directory"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4332
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4333
    |newDirectory|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4334
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4335
    aPathName isEmpty ifTrue:[^ self].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4336
    newDirectory := currentDirectory filenameFor:aPathName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4337
    newDirectory isDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4338
	self currentDirectory:newDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4339
	currentFileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4340
	    fileListView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4341
	    currentFileName := nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4342
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4343
	    fileListView setSelection:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4344
	    fileListView scrollToTop.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4345
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4346
	self updateCurrentDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4347
	self showInfo.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4348
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  4349
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4350
    "Modified: 21.9.1995 / 11:22:45 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4351
    "Modified: 25.5.1996 / 12:27:01 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4352
    "Modified: 18.9.1997 / 17:08:07 / stefan"
912
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  4353
!
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  4354
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4355
updateCurrentDirectoryIfChanged
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4356
    |t|
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4357
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4358
    ((t := currentDirectory modificationTime) isNil
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4359
    or:[t > timeOfLastCheck]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4360
	self updateCurrentDirectory
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4361
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4362
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4363
    "Modified: / 16.9.1997 / 15:35:52 / stefan"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4364
    "Modified: / 17.8.1998 / 10:13:00 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4365
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4366
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4367
!FileBrowser methodsFor:'private - encoding'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4368
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4369
guessEncodingFrom:aBuffer
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4370
    "look for a string
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4371
	encoding #name
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4372
     or:
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4373
	encoding: name
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4374
     within the given buffer 
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4375
     (which is usually the first few bytes of a textFile).
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4376
     If thats not found, use heuristics (in CharacterArray) to guess."
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4377
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4378
    |n "{Class: SmallInteger }"
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4379
     binary idx s w enc|
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4380
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4381
    binary := false.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4382
    n := aBuffer size.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4383
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4384
    (idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4385
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4386
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4387
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4388
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4389
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4390
	    (idx := w indexOf:$") ~~ 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4391
		w := w copyTo:idx-1
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4392
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4393
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4394
	].
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4395
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4396
    (idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4397
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4398
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4399
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4400
	s peek == $: ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4401
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4402
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4403
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4404
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4405
	s peek == $# ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4406
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4407
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4408
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4409
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4410
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4411
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4412
	].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4413
    ].
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4414
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4415
    1 to:n do:[:i |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4416
	(aBuffer at:i) isPrintable ifFalse:[binary := true].
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4417
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4418
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4419
    binary ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4420
	"/ look for JIS7 / EUC encoding
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4421
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4422
	enc := CharacterArray guessEncodingFrom:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4423
	enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4424
	    ^ enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4425
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4426
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4427
	"/ if the encoding has been set to any non iso setting,
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4428
	"/ assume its what we defined ...
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4429
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4430
	(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4431
	    ^ #binary
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4432
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4433
	^ fileEncoding ? #binary
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4434
    ].
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4435
    ^ #ascii
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4436
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4437
    "Created: 26.2.1996 / 17:43:08 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4438
    "Modified: 1.7.1997 / 00:00:27 / cg"
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4439
!
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4440
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4441
preferredFontEncodingFor:fileEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4442
    "given a file encoding, return corresponding preferred fontEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4443
     match pattern"
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4444
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4445
    |fe|
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4446
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4447
    fe := MIMETypes fontForCharset:fileEncoding.
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4448
    fe notNil ifTrue:[^ fe].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4449
    ^ 'iso8859*'
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4450
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4451
    "Created: 28.6.1997 / 20:47:35 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4452
    "Modified: 1.7.1997 / 00:04:56 / cg"
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4453
!
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4454
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4455
validateFontEncodingFor:newEncoding ask:ask
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4456
    "if required, query user if he/she wants to change to another font,
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4457
     which is able to display text encoded as specified by newEncoding"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4458
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4459
    |fontsEncoding msg filter f defaultFont pref|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4460
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4461
    fontsEncoding := subView font encoding.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4462
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4463
    pref := self preferredFontEncodingFor:newEncoding.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4464
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4465
    (pref match:fontsEncoding) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4466
	^ self
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4467
    ].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4468
    "/ stupid ...
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4469
    pref = 'ascii*' ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4470
	(fontsEncoding match:'iso8859*') ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4471
	    ^ self
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4472
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4473
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4474
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4475
    filter := [:f | |coding|
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4476
		    (coding := f encoding) notNil 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4477
		    and:[pref match:coding]].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4478
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4479
    defaultFont := TextView defaultFont onDevice:device.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4480
    (pref match:(defaultFont encoding)) ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4481
	defaultFont := nil.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4482
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4483
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4484
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4485
	(pref = 'ascii*'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4486
	or:[pref = 'iso8859*']) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4487
	    defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4488
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4489
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4490
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4491
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4492
	defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4493
			    listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4494
				detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4495
				ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4496
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4497
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4498
	    "/ flush list, and refetch font list
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4499
	    "/ (in case someone just changed the font path ...)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4500
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4501
	    device flushListOfAvailableFonts.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4502
	    defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4503
				listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4504
				    detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4505
				    ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4506
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4507
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4508
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4509
	    self warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4510
	    ^ self.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4511
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4512
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4513
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4514
    msg := 'switch to a %1 encoded font ?'.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4515
    (ask not or:[self confirm:(resources string:msg with:pref) withCRs])
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4516
    ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4517
	self withWaitCursorDo:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4518
	    f := FontPanel 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4519
		fontFromUserInitial:defaultFont
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4520
			      title:(resources string:'font selection')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4521
			     filter:filter.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4522
	    f notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4523
		subView font:f
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4524
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4525
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4526
    ]
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4527
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4528
    "Created: 26.10.1996 / 12:06:54 / cg"
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4529
    "Modified: 30.6.1997 / 17:46:46 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4530
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4531
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4532
!FileBrowser methodsFor:'private - file stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4533
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4534
doCreateFile:newName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4535
    "create an empty file"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4536
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4537
    |aStream f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4538
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4539
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4540
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4541
	(self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4542
	    ask:(resources string:'%1 already exists\\truncate ?' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4543
	    yesButton:'truncate'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4544
	) ifFalse:[^ self].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4545
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4546
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4547
    FileStream openErrorSignal handle:[:ex|
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4548
	^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4549
		    with:(FileStream lastErrorString)
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4550
    ] do:[    
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4551
	aStream := f newReadWriteStream.
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4552
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4553
    aStream notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4554
	aStream close.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4555
	self updateCurrentDirectoryIfChanged
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4556
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4557
	self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4558
		  with:(FileStream lastErrorString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4559
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4560
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4561
    "Modified: 23.4.1997 / 13:19:12 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4562
    "Modified: 18.9.1997 / 17:21:45 / stefan"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4563
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4564
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4565
doFileGet:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4566
    "get selected file - show contents in subView.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4567
     This is invoked either by the 'get file' menu item, or via double click.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4568
     When invoked via the menu (viaDoubleClick argument is false),
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4569
     the automatic file action is not performed - instead, the file is always
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4570
     shown in the codeView (if possible).
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4571
     This distinction was done to allow xpm or xbm files (which have an automatic
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4572
     action) to be edited."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4573
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4574
    |fileName iconLbl winLbl f|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4575
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4576
    self withReadCursorDo:[
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4577
        fileName := self getSelectedFileName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4578
        fileName notNil ifTrue:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4579
            f := currentDirectory construct:fileName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4580
            f isDirectory ifTrue:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4581
                self doChangeCurrentDirectoryTo:fileName updateHistory:true.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4582
                winLbl := myName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4583
                iconLbl := myName
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4584
            ] ifFalse:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4585
                f exists ifFalse:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4586
                    self warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName).
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4587
                    ^ self
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4588
                ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4589
                timeOfFileRead := f modificationTime.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4590
                self showFile:fileName insert:false encoding:fileEncoding doubleClick:viaDoubleClick.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4591
                currentFileName := fileName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4592
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4593
                self fileTypeSpecificActions.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4594
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4595
                subView acceptAction:[:theCode |
1956
dae4a93b835b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
  4596
                    (f modificationTime <= timeOfFileRead
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4597
                    or:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4598
                        (self 
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4599
                            ask:(resources at:'FileBrowser:\\file has changed somehow in the meanwhile.\(Hint: use the file-difference menu function to see what has changed)\\Do you really want to save ?')
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4600
                            yesButton:'save'
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4601
                            noButton:'don''t save')]) ifTrue:[
1956
dae4a93b835b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
  4602
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4603
                        self withCursor:(Cursor write) do:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4604
                            self writeFile:fileName text:theCode encoding:fileEncoding.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4605
                            timeOfFileRead := f modificationTime.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4606
                            self label:myName , ': ' , currentFileName
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4607
                        ]
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4608
                    ]
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4609
                ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4610
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4611
                winLbl := myName , ': ' , fileName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4612
                f isWritable ifFalse:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4613
                    winLbl := winLbl , ' (readonly)'
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4614
                ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4615
                iconLbl := fileName
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4616
            ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4617
            self label:winLbl.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4618
            self iconLabel:iconLbl.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4619
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4620
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4621
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4622
    "Created: / 19.6.1996 / 09:39:07 / cg"
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4623
    "Modified: / 18.9.1997 / 17:35:31 / stefan"
1956
dae4a93b835b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
  4624
    "Modified: / 7.11.1998 / 16:27:39 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4625
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4626
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4627
doFindFileNamed:namePattern ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString in:aDirectory
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4628
    |dir subDirs nameMatches contentsMatches lines|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4629
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4630
    subDirs := OrderedCollection new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4631
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4632
    dir := aDirectory asFilename.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4633
    self label:myName , '- searching ' , dir name.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4634
    (dir directoryContents ? #()) sort do:[:fn |
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4635
        |f|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4636
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4637
        f := dir construct:fn.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4638
        f isDirectory ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4639
            f isSymbolicLink ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4640
                subDirs add:f
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4641
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4642
        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4643
            (nameMatches := namePattern isNil) ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4644
                ignCaseInName ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4645
                    nameMatches := namePattern match:(fn asLowercase)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4646
                ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4647
                    nameMatches := namePattern match:fn
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4648
                ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4649
            ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4650
            nameMatches ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4651
                (contentsMatches := contentsString isNil) ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4652
                    (f exists and:[f isReadable]) ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4653
                        subView insertLine:('*** ' , f pathName , ' skipped - unreadable or bad symbolic link ***') before:subView cursorLine.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4654
                        subView cursorDown.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4655
                    ] ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4656
                        f fileSize > (4024*1024) ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4657
                            subView insertLine:('*** ' , f pathName , ' skipped - too large ***') before:subView cursorLine.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4658
                            subView cursorDown.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4659
                        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4660
                            Stream lineTooLongErrorSignal handle:[:ex |
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4661
                                |cont|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4662
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4663
                                "/ this typically happens, when a binary file is read linewise ...
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4664
                                cont := f readStream binary contentsOfEntireFile.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4665
                                ignCaseInString ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4666
                                    contentsMatches := cont asLowercase includesString:contentsString
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4667
                                ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4668
                                    contentsMatches := cont includesString:contentsString
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4669
                                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4670
                            ] do:[    
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4671
                                lines := f contents ? #().
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4672
                                ignCaseInString ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4673
                                    contentsMatches := (lines findFirst:[:l | l asLowercase includesString:contentsString]) ~~ 0
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4674
                                ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4675
                                    contentsMatches := (lines findFirst:[:l | l includesString:contentsString]) ~~ 0
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4676
                                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4677
                            ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4678
                        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4679
                    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4680
                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4681
                contentsMatches ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4682
                    subView insertLine:f pathName before:subView cursorLine.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4683
                    subView cursorDown.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4684
                ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4685
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4686
        ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4687
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4688
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4689
    subDirs do:[:dir |
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4690
        self
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4691
            doFindFileNamed:namePattern 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4692
            ignoreCase:ignCaseInName 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4693
            containingString:contentsString 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4694
            ignoreCaseInContents:ignCaseInString 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4695
            in:dir
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4696
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4697
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4698
    "Created: / 15.10.1998 / 11:37:15 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4699
    "Modified: / 15.10.1998 / 12:50:48 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4700
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4701
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  4702
doRemove:filesToRemove
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4703
    "remove the selected file(s) - no questions asked"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4704
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4705
    |msg idx needUpdate toRemove updateRunning yesToAll|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4706
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4707
    updateRunning := listUpdateProcess notNil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4708
    self stopUpdateProcess.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4709
    toRemove := OrderedCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4710
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4711
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4712
    "/ did the directory change in the meanwhile ?
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4713
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4714
    needUpdate := (currentDirectory modificationTime > timeOfLastCheck).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4715
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4716
    yesToAll := false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4717
    lockUpdate := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4718
    [
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  4719
        filesToRemove do:[:fileName |
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4720
            |f|
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4721
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4722
            f := currentDirectory construct:fileName.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4723
            OperatingSystem accessDeniedErrorSignal handle:[:ex|
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4724
                "was not able to remove it"
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4725
                msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4726
                self showAlert:msg with:(OperatingSystem lastErrorString)
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4727
            ] do:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4728
                |answer contents|
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4729
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4730
                (f isSymbolicLink not and:[f isDirectory]) ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4731
                    contents := f directoryContents.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4732
                    contents isEmpty ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4733
                        f remove
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4734
                    ] ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4735
                        yesToAll ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4736
                            answer := Dialog
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4737
                                        confirmWithCancel:(resources string:'directory ''%1'' is not empty\remove anyway ?' with:fileName asText allBold) withCRs
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4738
                                        labels:#('cancel' 'remove all' 'remove')
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4739
                                        values:#(false #removeAll true) 
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4740
                                        default:3.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4741
                            answer == false ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4742
                                ^ self
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4743
                            ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4744
                            answer == #removeAll ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4745
                                yesToAll := true
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4746
                            ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4747
                        ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4748
                        f recursiveRemove
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4749
                    ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4750
                ] ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4751
                    f remove.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4752
                ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4753
"
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4754
                self show:nil
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4755
"
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4756
                idx := fileList indexOf:fileName.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4757
                idx ~~ 0 ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4758
                    toRemove add:idx.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4759
                ]
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4760
            ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4761
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4762
    ] valueNowOrOnUnwindDo:[
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4763
        lockUpdate := false.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4764
        fileListView setSelection:nil.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4765
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4766
        "/
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4767
        "/ remove reverse - otherwise indices are wrong
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4768
        "/
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4769
        toRemove sort.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4770
        toRemove reverseDo:[:idx |
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4771
            fileList removeIndex:idx.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4772
            fileListView removeIndex:idx.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4773
        ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4774
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4775
        updateRunning ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4776
            self updateCurrentDirectory
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4777
        ] ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4778
            "
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4779
             install a new check after some time
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4780
            "
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4781
            needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4782
            Processor removeTimedBlock:checkBlock.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4783
            Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4784
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4785
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4786
1374
b3a1e95a6220 Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents: 1371
diff changeset
  4787
    "Modified: / 20.11.1997 / 17:39:14 / stefan"
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4788
    "Modified: / 21.10.1998 / 17:02:11 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4789
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4790
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4791
doRename:oldName to:newName
1331
73e712c85588 Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents: 1330
diff changeset
  4792
    "rename a file (or directory)"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4793
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4794
    |old new|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4795
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4796
    (oldName notNil and:[newName notNil]) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4797
        (oldName isBlank or:[newName isBlank]) ifFalse:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4798
            old := currentDirectory filenameFor:oldName.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4799
            new := currentDirectory filenameFor:newName.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4800
            OperatingSystem errorSignal handle:[:ex|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4801
                self showAlert:(resources string:'cannot rename file ''%1'' to %2 !!' 
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4802
                                          with:oldName with:newName)
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4803
                          with:(OperatingSystem lastErrorString)
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4804
            ] do:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4805
                new exists ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4806
                    (self confirm:(resources string:'''%1'' already exists - rename (i.e. overwrite) anyway ?' with:new baseName asText allBold))
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4807
                    ifFalse:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4808
                        ^ self
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4809
                    ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4810
                ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4811
                old renameTo:new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4812
            ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4813
            self updateCurrentDirectoryIfChanged.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4814
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4815
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4816
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4817
    "Modified: / 24.9.1997 / 09:20:00 / stefan"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  4818
    "Modified: / 3.10.1998 / 18:19:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4819
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4820
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4821
!FileBrowser methodsFor:'private - file type & info'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4822
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4823
fileCommentStrings
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4824
    "return a useful comment definition; based upon the fileName for now"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4825
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4826
    "/ for now,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4827
    "/ define comment strings, by heuristics;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4828
    "/ (should look for some mode= or similar string
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4829
    "/  found in the file itself - like emacs does it)
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4830
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4831
    (currentFileName = 'Make.proto'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4832
    or:[currentFileName = 'Makefile'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4833
    or:[currentFileName = 'makefile']]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4834
	^ #('#' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4835
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4836
    ((currentFileName endsWith:'.c')
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4837
    or:[(currentFileName endsWith:'.C')]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4838
	^ #(nil ('/*' '*/')).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4839
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4840
    ((currentFileName endsWith:'.cc')
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4841
    or:[(currentFileName endsWith:'.CC')]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4842
	^ #('//' ('/*' '*/')).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4843
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4844
    (currentFileName endsWith:'.java') ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4845
	^ #('//' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4846
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4847
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4848
    "/ smalltalk comments
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4849
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4850
    ^ #('"/' ('"' '"')).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4851
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4852
    "Created: 7.1.1997 / 20:30:00 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4853
    "Modified: 23.4.1997 / 13:11:49 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4854
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4855
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4856
fileTypeSpecificActions
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4857
    "any special fileTypeSpecific actions are done here,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4858
     when a new file is selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4859
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4860
    |commentStrings|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4861
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4862
    commentStrings := self fileCommentStrings.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4863
    commentStrings notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4864
	subView
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4865
	    commentStrings:#('#' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4866
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4867
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4868
    "Modified: 7.1.1997 / 20:30:54 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4869
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4870
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4871
getFileInfoString:longInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4872
    "get stat info on selected file - return a string which can be
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4873
     shown in a box"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4874
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4875
    |fileName f fullPath text info fileOutput type modeBits modeString s ts|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4876
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4877
    fileName := self getSelectedFileName.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4878
    fileName isNil ifTrue:[^ nil].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4879
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4880
    f := currentDirectory construct:fileName.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4881
    info := f info.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4882
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4883
    info isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4884
	self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4885
		  with:(OperatingSystem lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4886
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4887
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4888
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4889
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4890
    f isSymbolicLink ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4891
	text add:(resources string:'symbolic link to: %1' with:(f linkInfo path))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4892
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4893
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4894
    type := info type.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4895
    (longInfo and:[type == #regular]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4896
	fullPath := currentDirectory pathName asFilename constructString:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4897
	fileOutput := fullPath asFilename fileType.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4898
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4899
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4900
    s := (resources at:'type:   ').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4901
    fileOutput isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4902
	s := s ,  type asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4903
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4904
	s := s , 'regular (' , fileOutput , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4905
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4906
    text add:s.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4907
    text add:(resources string:'size:   %1' with:(info size) printString).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4908
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4909
    modeBits := info mode.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4910
    modeString := self getModeString:modeBits.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4911
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4912
	text add:(resources string:'access: %1 (%2)'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4913
			      with:modeString 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4914
			      with:(modeBits printStringRadix:8))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4915
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4916
	text add:(resources string:'access: %1' with:modeString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4917
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4918
    text add:(resources string:'owner:  %1'
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4919
			  with:(OperatingSystem getUserNameFromID:(info uid))).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4920
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4921
	text add:(resources string:'group:  %1'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4922
			      with:(OperatingSystem getGroupNameFromID:(info gid))).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4923
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4924
	ts := info accessed.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4925
	text add:(resources string:'last access:       %1 %2' 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4926
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4927
			      with:(ts asDate printString)).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4928
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4929
	ts := info modified.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4930
	text add:(resources string:'last modification: %1 %2'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4931
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4932
			      with:(ts asDate printString)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4933
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4934
    ^ text asString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4935
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4936
    "Modified: 8.9.1995 / 11:59:28 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4937
    "Modified: 1.11.1996 / 20:47:52 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4938
    "Modified: 18.9.1997 / 16:34:31 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4939
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4940
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4941
getInfoFile
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4942
    "get filename of a description-file (.dir.info, README etc.);
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4943
     This file is automatically shown when a directory is enterred.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4944
     You can add more names below if you like."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4945
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4946
    #( 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4947
       '.dir.info'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4948
       'README'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4949
       'ReadMe'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4950
       'Readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4951
       'readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4952
       'read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4953
       'Read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4954
       'READ.ME'
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4955
       'README.TXT'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4956
       'readme.txt'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4957
       'Readme.txt'
1307
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  4958
       'Info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  4959
       'info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  4960
       'INFO.TXT'
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4961
    ) do:[:f | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4962
	|n|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4963
	n := currentDirectory construct:f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4964
	(n isReadable and:[n isDirectory not]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4965
	    ^ f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4966
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4967
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4968
    ^ nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4969
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  4970
    "Modified: 3.8.1997 / 16:50:33 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4971
    "Modified: 16.9.1997 / 15:26:53 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4972
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4973
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4974
getModeString:modeBits
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4975
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4976
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4977
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4978
    ^ self getModeString:modeBits 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4979
		    with:#( 'owner:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4980
			    ' group:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4981
			    ' others:' $r $w $x )
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4982
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4983
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4984
getModeString:modeBits with:texts
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4985
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4986
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4987
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4988
    |bits modeString|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4989
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4990
    bits := modeBits bitAnd:8r777.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4991
    modeString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4992
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4993
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4994
    with: texts do:[:bitMask :access |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4995
	|ch|
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4996
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4997
	bitMask isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4998
	    modeString := modeString , (resources string:access)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4999
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5000
	    (bits bitAnd:bitMask) == 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5001
		ch := $-
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5002
	    ] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5003
		ch := access
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5004
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5005
	    modeString := modeString copyWith:ch 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5006
	]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5007
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5008
    ^ modeString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5009
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5010
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5011
showInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5012
    "show directory info when dir has changed"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5013
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5014
    |info txt|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5015
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5016
    info := self getInfoFile.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5017
    info notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5018
	txt := self readFile:info
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5019
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5020
    self show:txt.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5021
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5022
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5023
sizePrintString:size
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5024
    "helper for update-directory to return a string with a files size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5025
     This one gives the size in byte, Kb or Mb depending on size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5026
     If you dont like this, just uncomment the first statement below."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5027
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5028
    |unitString n|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5029
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5030
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5031
    ^ size printString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5032
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5033
    unitString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5034
    size < (500 * 1024) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5035
	size < 1024 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5036
	    n := size
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5037
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5038
	    n := (size * 10 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5039
	    unitString := ' Kb'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5040
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5041
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5042
	n := (size * 10 // 1024 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5043
	unitString := ' Mb'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5044
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5045
    ^ (n printStringLeftPaddedTo:5) , unitString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5046
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5047
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5048
!FileBrowser methodsFor:'private - file-I/O'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5049
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5050
readFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5051
    "read in the file, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5052
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5053
    ^ self readFile:fileName lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5054
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5055
    "Modified: 22.2.1996 / 14:57:08 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5056
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5057
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5058
readFile:fileName lineDelimiter:aCharacter encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5059
    "read in the file, return its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5060
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5061
     If encoding is nonNil, the file is assumed to be coded according to
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5062
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5063
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5064
    |stream text msg sz|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5065
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5066
    stream := (currentDirectory construct:fileName) readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5067
    stream isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5068
	msg := (resources string:'cannot read file ''%1'' !!' with:fileName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5069
	self showAlert:msg with:(FileStream lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5070
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5071
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5072
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5073
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5074
     for very big files, give ObjectMemory a hint, to preallocate more
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5075
    "
1311
e09e4a65d8a9 filename stuff
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  5076
    (sz := stream fileSize) > 1000000 ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5077
	Processor activeProcess withPriority:Processor userBackgroundPriority do:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5078
	    ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5079
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5080
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5081
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5082
    text := self readStream:stream lineDelimiter:aCharacter encoding:encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5083
    stream close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5084
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5085
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5086
    "Created: 22.2.1996 / 14:56:48 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5087
    "Modified: 8.10.1996 / 21:01:57 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5088
    "Modified: 18.9.1997 / 17:06:54 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5089
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5090
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5091
readStream:aStream
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5092
    "read in from aStream, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5093
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5094
    ^ self readStream:aStream lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5095
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5096
    "Modified: 22.2.1996 / 14:58:40 / cg"
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5097
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5098
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5099
readStream:aStream lineDelimiter:aCharacter encoding:encoding 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5100
    "read from aStream, answer its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5101
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5102
     If encoding is nonNil, the file is assumed to be coded according to
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5103
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5104
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5105
    |text line enc|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5106
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5107
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5108
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5109
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5110
    enc == #iso8859 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5111
	enc := nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5112
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5113
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5114
    aCharacter == Character cr ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5115
	[aStream atEnd] whileFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5116
	    line := aStream nextLine withTabsExpanded.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5117
	    enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5118
		line := line decodeFrom:enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5119
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5120
	    text add:line
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5121
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5122
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5123
	[aStream atEnd] whileFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5124
	    line := (aStream upTo:aCharacter) withTabsExpanded.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5125
	    enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5126
		line := line decodeFrom:enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5127
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5128
	    text add:line
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5129
	].
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5130
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5131
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5132
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5133
    "Created: 22.2.1996 / 14:58:25 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5134
    "Modified: 2.4.1997 / 21:31:36 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5135
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5136
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5137
showFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5138
    "show contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5139
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5140
    fileListView selection:(fileList indexOf:fileName).
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5141
    self fileGet
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5142
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5143
    "Modified: / 17.6.1998 / 11:26:13 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5144
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5145
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5146
showFile:fileName insert:insert encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5147
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5148
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5149
    ^ self 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5150
	showFile:fileName insert:insert encoding:encoding doubleClick:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5151
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5152
    "Modified: 19.6.1996 / 09:40:19 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5153
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5154
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5155
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5156
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5157
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5158
    |path buffer s n i ok convert text msg eol guess action enc 
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5159
     fontsEncoding pref failWarning|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5160
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5161
    path := currentDirectory filenameFor:fileName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5162
    (path type == #regular) ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5163
	"asked for a non-file  - ignore it ..."
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5164
	path exists ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5165
	    msg := '''%1'' does not exist !!'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5166
	] ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5167
	    msg := '''%1'' is not a regular file !!'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5168
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5169
	self warn:(resources string:msg with:fileName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5170
	^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5171
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5172
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5173
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5174
    "/ check if file is a text file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5175
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5176
    s := path readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5177
    s isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5178
	self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5179
		  with:(FileStream lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5180
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5181
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5182
1222
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5183
    buffer := String new:4096.
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5184
    n := s nextBytes:4096 into:buffer.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5185
    s close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5186
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5187
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5188
    ok := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5189
    guess := self guessEncodingFrom:buffer.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5190
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5191
    guess == #binary ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5192
	ok := false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5193
	viaDoubleClick ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5194
	    (self binaryFileAction:fileName) ifTrue:[^ self].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5195
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5196
	(self confirm:(resources string:'''%1'' seems to be a binary file - show anyway ?' with:fileName))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5197
	ifFalse:[^ self]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5198
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5199
	viaDoubleClick ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5200
	    (self nonBinaryFileAction:fileName) ifTrue:[^ self].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5201
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5202
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5203
	fontsEncoding := subView font encoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5204
	pref := self preferredFontEncodingFor:guess.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5205
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5206
	ok := pref match:fontsEncoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5207
	ok ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5208
	    pref = 'iso8859*' ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5209
		ok := 'ascii*' match:fontsEncoding
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5210
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5211
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5212
	ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5213
	    fileEncoding := guess.    
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5214
	    enc := guess.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5215
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5216
	    action := Dialog choose:(resources string:'''%1'' seems to require a %2 font.' with:fileName with:pref)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5217
			   labels:(resources array:#('cancel' 'show' 'change font'))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5218
			   values:#(nil #show #encoding)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5219
			   default:#encoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5220
	    action isNil ifTrue:[^ self].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5221
	    action == #encoding ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5222
		fileEncoding := guess asSymbol.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5223
		subView externalEncoding:fileEncoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5224
		self validateFontEncodingFor:fileEncoding ask:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5225
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5226
		self information:(resources string:'Individual characters may be invisible/wrong in this font.')
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5227
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5228
	    enc := fileEncoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5229
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5230
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5231
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5232
    convert := false.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5233
"/    ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5234
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5235
"/        "/ check if line delimiter is a cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5236
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5237
"/        i := buffer indexOf:Character cr.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5238
"/        i == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5239
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5240
"/            "/ no newline found - try cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5241
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5242
"/            i := buffer indexOf:(Character value:13).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5243
"/            i ~~ 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5244
"/                convert := self confirm:(resources string:'''%1'' seems to have CR as line delimiter - convert to NL ?' with:fileName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5245
"/            ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5246
"/        ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5247
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5248
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5249
    insert ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5250
	"/ release old text first 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5251
	"/ - we might need the memory in case of huge files
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5252
	"/  (helps if you have a 4Mb file in the view, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5253
	"/   and click on another biggy)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5254
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5255
	subView contents:nil.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5256
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5257
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5258
    convert ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5259
	eol := Character value:13
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5260
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5261
	eol := Character cr
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5262
    ].
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5263
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5264
    failWarning := false.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5265
    CharacterArray decodingFailedSignal handle:[:ex |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5266
	|errStr|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5267
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5268
	failWarning ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5269
	    errStr := resources string:ex errorString.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5270
	    (self confirm:(resources 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5271
				string:'An error occurred while decoding:\%1\\The file has either a different encoding or is corrupted.\\Continue ?'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5272
				with:errStr) withCRs)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5273
	    ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5274
		^ self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5275
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5276
	    failWarning := true.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5277
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5278
	ex proceed.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5279
    ] do:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5280
	text := self readFile:fileName lineDelimiter:eol encoding:enc.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5281
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5282
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5283
    insert ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5284
	self show:text
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5285
    ] ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5286
	subView insertSelectedStringAtCursor:text asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5287
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5288
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5289
    "Created: 19.6.1996 / 09:39:52 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5290
    "Modified: 18.9.1997 / 17:10:20 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5291
    "Modified: 22.9.1997 / 10:02:38 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5292
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5293
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5294
writeFile:fileName text:someText encoding:encoding
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5295
    |stream errReason msg startNr nLines string|
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5296
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5297
    errReason := ''.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5298
    FileStream streamErrorSignal handle:[:ex |
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5299
	errReason := ex errorString.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5300
	ex return.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5301
    ] do:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5302
	stream := (currentDirectory filenameFor:fileName) writeStream.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5303
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5304
    stream isNil ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5305
	msg := (resources string:'cannot write file ''%1'' !!' with:fileName).
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5306
	self showAlert:msg with:errReason.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5307
	^ self.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5308
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5309
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5310
    someText isString ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5311
	stream nextPutAll:someText.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5312
    ] ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5313
	"/
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5314
	"/ on some systems, writing linewise is very slow (via NFS)
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5315
	"/ therefore we convert to a string and write it in chunks.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5316
	"/ To avoid creating huge strings, we do it in blocks of 1000 lines.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5317
	"/
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5318
	startNr := 1.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5319
	nLines := someText size.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5320
	[startNr <= nLines] whileTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5321
	    string := someText asStringWithCRsFrom:startNr
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5322
						to:((startNr + 1000) min:nLines)
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5323
				      compressTabs:compressTabs.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5324
	    encoding notNil ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5325
		string := string encodeInto:encoding
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5326
	    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5327
	    stream nextPutAll:string.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5328
	    startNr := startNr + 1000 + 1.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5329
	].
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5330
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5331
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5332
    stream close.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5333
    subView modified:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5334
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5335
    "Created: 22.2.1996 / 15:03:10 / cg"
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5336
    "Modified: 18.9.1997 / 17:12:44 / stefan"
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5337
    "Modified: 22.10.1997 / 12:34:38 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5338
! !
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5339
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5340
!FileBrowser methodsFor:'private - presentation'!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5341
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5342
defineTabulatorsForLongList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5343
    "define the tabs for the long list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5344
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5345
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5346
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5347
"/  tabSpec positions:#(0     0.25    2.3   4.3    5.3    6.0      6.5).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5348
    tabSpec widths:   #(0.25   2      2.0     1      0.5  0.5      1"any").
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5349
    "                   icon  name   mode  owner  group  size     type"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5350
    tabSpec align:    #(#left #left  #left #right #right #decimal #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5351
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5352
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5353
    tabRulerView tabulatorSpecification:tabSpec.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5354
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5355
    "Modified: 17.4.1997 / 02:56:07 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5356
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5357
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5358
defineTabulatorsForShortList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5359
    "define the tabs for the short list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5360
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5361
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5362
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5363
"/  tabSpec positions:#(0     0.25 ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5364
    tabSpec widths:   #(0.25   2   ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5365
    "                   icon  name"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5366
    tabSpec align:    #(#left #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5367
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5368
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5369
    tabRulerView notNil ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5370
	tabRulerView tabulatorSpecification:tabSpec.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5371
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5372
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5373
    "Created: / 17.4.1997 / 02:51:41 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5374
    "Modified: / 27.7.1998 / 20:23:34 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5375
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5376
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5377
iconForFile:aFilenameString
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5378
    "given a fileName, return an appropriate icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5379
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5380
    |f icn key key2 suff mimeType|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5381
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5382
    f := currentDirectory construct:aFilenameString.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5383
    f isDirectory ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5384
	f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5385
	    key := #directoryLink
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5386
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5387
	    key := #directory.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5388
	    (f isReadable not or:[f isExecutable not]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5389
		key := #directoryLocked
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5390
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5391
	]
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5392
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5393
	f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5394
	    f isReadable not ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5395
		key := #fileLocked
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5396
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5397
		key := #fileLink
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5398
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5399
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5400
	    key := key2 := #file.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5401
	    f isExecutableProgram ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5402
		key := key2 := #executableFile
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5403
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5404
	    (f isReadable not) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5405
		key := #fileLocked
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5406
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5407
		suff := f suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5408
		mimeType := MIMETypes mimeTypeForSuffix:suff.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5409
		mimeType notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5410
		    (mimeType startsWith:'image/') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5411
			key := #imageFile
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5412
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5413
			(mimeType startsWith:'text/') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5414
			    key := #textFile
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5415
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5416
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5417
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5418
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5419
	].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  5420
    ].
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5421
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5422
    "/ local (device) icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5423
    icons notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5424
	mimeType notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5425
	    icn := icons at:mimeType ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5426
	    icn notNil ifTrue:[^ icn].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5427
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5428
	icn := icons at:key ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5429
	icn notNil ifTrue:[^ icn].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  5430
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5431
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5432
    "/ global icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5433
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5434
    Icons notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5435
	mimeType notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5436
	    icn := Icons at:mimeType ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5437
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5438
	icn notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5439
	    key := mimeType
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5440
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5441
	    icn := Icons at:key ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5442
	].
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5443
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5444
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  5445
    icn isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5446
	(    (key := key2) isNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5447
	 or:[(icn := icons at:key ifAbsent:nil) notNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5448
	 or:[(icn := Icons at:key ifAbsent:nil) isNil]]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5449
	) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5450
	    ^ icn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5451
	]
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  5452
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5453
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5454
    "/ remember device icon
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5455
    icn := icn copy onDevice:device.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5456
    icn clearMaskedPixels.
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5457
    icons at:key put:icn.
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  5458
    ^ icn
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  5459
1746
68a187e3f30f another icon for executable files.
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
  5460
    "Modified: / 18.9.1997 / 16:35:28 / stefan"
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5461
    "Modified: / 1.8.1998 / 17:42:37 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5462
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5463
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5464
stopUpdateProcess
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5465
    Processor removeTimedBlock:checkBlock.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5466
    listUpdateProcess notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5467
	listUpdateProcess terminate.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5468
	listUpdateProcess := nil.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5469
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5470
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5471
    "Created: 19.4.1997 / 13:51:34 / cg"
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5472
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5473
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5474
updateCurrentDirectory
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5475
    "update listView with directory contents"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5476
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5477
    "the code below may look somewhat complex -
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5478
     it reads the directory first for the names,
1151
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  5479
     then (in followup sweeps over the files) gets the
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  5480
     files type, info and icon in a forked subprocess. 
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  5481
     This makes the Filebrowsers list update faster, since the fileInfo 
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  5482
     (i.e. stat-calls) may take long - especially on NFS-mounted directories.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5483
     The file reading is done at lower priority, to let user continue
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5484
     his work in other views. However, to be fair to other fileBrowser,
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5485
     which may also read directories at low prio, give up the processor
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  5486
     after every entry. This shares the cpu among all fileBrowsers;
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  5487
     Therefore, browsers which read short directories will finish first.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5488
     ST/X users love this behavior ;-)
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5489
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5490
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  5491
    self withReadCursorDo:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5492
	|files matchPattern list passDone f|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5493
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5494
	self stopUpdateProcess.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5495
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5496
	timeOfLastCheck := AbsoluteTime now.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5497
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5498
	files := currentDirectory asFilename fullDirectoryContents.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5499
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5500
"/        (files includes:(Filename parentDirectoryName)) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5501
"/            upButton enable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5502
"/        ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5503
"/            upButton disable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5504
"/        ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5505
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5506
	"/ show files which are either directories
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5507
	"/ or match the current pattern
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5508
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5509
	matchPattern := filterField contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5510
	(matchPattern notNil and:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5511
	 matchPattern isEmpty not and:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5512
	 matchPattern ~= '*']]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5513
	     files := files select:[:aName | 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5514
			 ((currentDirectory construct:aName) isDirectory)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5515
			 or:[matchPattern compoundMatch:aName]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5516
		      ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5517
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5518
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5519
	files size == 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5520
	    self information:('directory ', currentDirectory pathName, ' vanished').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5521
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5522
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5523
	(sortByWhat value == #name) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5524
	    sortCaseless value == true ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5525
		files sort:[:a :b | a asLowercase < b asLowercase]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5526
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5527
		files sort.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5528
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5529
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5530
	    (sortByWhat value == #time) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5531
		files sort:[:a :b | |f1 f2 t1 t2|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5532
				f1 := (currentDirectory construct:a).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5533
				f2 := (currentDirectory construct:b).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5534
				t1 := f1 isSymbolicLink 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5535
					ifFalse:[f1 modificationTime]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5536
					ifTrue:[f1 linkInfo modified].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5537
				t2 := f2 isSymbolicLink 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5538
					ifFalse:[f2 modificationTime]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5539
					ifTrue:[f2 linkInfo modified].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5540
				t1 := t1 ? (AbsoluteTime now).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5541
				t2 := t2 ? (AbsoluteTime now).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5542
				t1 > t2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5543
			   ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5544
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5545
		(sortByWhat value == #type) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5546
		    files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5547
				    f1 := (currentDirectory construct:a).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5548
				    f2 := (currentDirectory construct:b).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5549
				    t1 := f1 type ? #xbadLink. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5550
				    t2 := f2 type ? #xbadLink. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5551
				    t1 = t2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5552
					suff1 := f1 suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5553
					suff2 := f2 suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5554
					suff1 = suff2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5555
					    sortCaseless value == true ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5556
						a asLowercase < b asLowercase
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5557
					    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5558
						a < b
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5559
					    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5560
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5561
					    suff1 asLowercase < suff2 asLowercase
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5562
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5563
				    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5564
					t1 < t2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5565
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5566
			       ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5567
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5568
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5569
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5570
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5571
	files := self withoutHiddenFiles:files.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5572
	fileList := files copy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5573
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5574
	tabSpec isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5575
	    showingDetails value "showLongList" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5576
		self defineTabulatorsForLongList
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5577
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5578
		self defineTabulatorsForShortList
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5579
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5580
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5581
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5582
	"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5583
	"/ first show all the names - this can be done fast ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5584
	"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5585
	list := files collect:[:fileName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5586
		    |entry|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5587
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5588
		    entry := MultiColListEntry new.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5589
		    entry tabulatorSpecification:tabSpec.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5590
		    entry colAt:1 put:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5591
		    entry colAt:2 put:fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5592
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5593
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5594
	fileListView setList:list expandTabs:false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5595
	passDone := Array new:list size withAll:0.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5596
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5597
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5598
	 this is a time consuming operation (especially, if reading an
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5599
	 NFS-mounted directory); therefore, start a low prio process,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5600
	 which fills in the remaining fields in the fileList ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5601
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5602
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5603
	listUpdateProcess := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5604
	    |prevUid prevGid fileNameString nameString groupString 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5605
	     modeString info line len
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5606
	     anyImages lineIndex aFileName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5607
	     entry typ f p typeString done endIndex 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5608
	     state stopAtEnd nextState img prevFirstLine prevLastLine
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5609
	     numVisible dirSuffix|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5610
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5611
	    dirSuffix := Filename directorySuffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5612
	    dirSuffix size > 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5613
		dirSuffix := '.' , dirSuffix asLowercase.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5614
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5615
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5616
	    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5617
	    "/ then walk over the files, adding more info
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5618
	    "/ (since we have to stat each file, this may take a while longer)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5619
	    "/ Visible items are always filled first.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5620
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5621
	    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5622
	    "/ the state machine
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5623
	    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5624
	    nextState := IdentityDictionary new.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5625
	    showingDetails value "showLongList" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5626
		nextState add:(#visibleIcons -> #visibleAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5627
		nextState add:(#visibleAttributes -> #visibleTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5628
		nextState add:(#visibleTypes -> #visibleImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5629
		nextState add:(#visibleImages -> #nextPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5630
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5631
		nextState add:(#nextPageIcons -> #nextPageAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5632
		nextState add:(#nextPageAttributes -> #nextPageTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5633
		nextState add:(#nextPageTypes -> #nextPageImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5634
		nextState add:(#nextPageImages -> #previousPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5635
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5636
		nextState add:(#previousPageIcons -> #previousPageAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5637
		nextState add:(#previousPageAttributes -> #previousPageTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5638
		nextState add:(#previousPageTypes -> #previousPageImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5639
		nextState add:(#previousPageImages -> #remainingIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5640
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5641
		nextState add:(#remainingIcons -> #remainingAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5642
		nextState add:(#remainingAttributes -> #remainingTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5643
		nextState add:(#remainingTypes -> #remainingImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5644
		nextState add:(#remainingImages -> nil).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5645
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5646
		nextState add:(#visibleIcons -> #nextPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5647
		nextState add:(#nextPageIcons -> #previousPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5648
		nextState add:(#previousPageIcons -> #remainingIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5649
		nextState add:(#remainingIcons -> nil).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5650
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5651
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5652
	    anyImages := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5653
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5654
	    lineIndex := prevFirstLine := fileListView firstLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5655
	    endIndex := prevLastLine := fileListView lastLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5656
	    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5657
	    state := #visibleIcons.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5658
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5659
	    done := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5660
	    [done] whileFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5661
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5662
		"/ if multiple FileBrowsers are reading, let others
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5663
		"/ make some progress too
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5664
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5665
		Processor yield.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5666
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5667
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5668
		"/ could be destroyed in the meanwhile ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5669
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5670
		realized ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5671
		    listUpdateProcess := nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5672
		    Processor activeProcess terminate
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5673
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5674
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5675
		((prevFirstLine ~~ fileListView firstLineShown)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5676
		or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5677
		    "/ start all over again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5678
		    lineIndex := prevFirstLine := fileListView firstLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5679
		    endIndex := prevLastLine := fileListView lastLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5680
		    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5681
		    state := #visibleIcons.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5682
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5683
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5684
		(lineIndex between:1 and:(files size)) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5685
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5686
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5687
		    "/ expand the next entry ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5688
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5689
		    aFileName := files at:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5690
		    entry := fileListView at:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5691
		    f := currentDirectory construct:aFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5692
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5693
		    (state endsWith:'Icons') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5694
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5695
			"/ pass 1 - icons
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5696
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5697
			(passDone at:lineIndex) < 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5698
			    (f isDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5699
			      and:[(aFileName ~= '..') and:[aFileName ~= '.']]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5700
			    ) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5701
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5702
				"/ the following suffix cutOff is not really required, 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5703
				"/ but makes the list look better on VMS ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5704
				fileNameString := aFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5705
				dirSuffix notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5706
				    (aFileName asLowercase endsWith:dirSuffix) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5707
					fileNameString := aFileName copyWithoutLast:(dirSuffix size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5708
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5709
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5710
				fileNameString := fileNameString , ' ...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5711
			    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5712
				fileNameString := aFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5713
				OperatingSystem isVMSlike ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5714
				    (aFileName endsWith:'.') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5715
					aFileName ~= '..' ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5716
					    fileNameString := aFileName copyWithoutLast:1
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5717
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5718
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5719
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5720
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5721
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5722
			    showingDetails value "showLongList" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5723
				len := fileNameString size.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5724
				(len > 20) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5725
				    fileNameString := (fileNameString contractTo:20)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5726
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5727
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5728
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5729
			    entry colAt:1 put:(self iconForFile:aFileName).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5730
			    entry colAt:2 put:fileNameString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5731
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5732
			    "/fileListView at:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5733
			    fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5734
			    fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5735
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5736
			    anyImages ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5737
				(Image isImageFileSuffix:(aFileName asFilename suffix))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5738
				ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5739
				    anyImages := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5740
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5741
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5742
			    passDone at:lineIndex put:1
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5743
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5744
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5745
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5746
		    (state endsWith:'Attributes') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5747
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5748
			"/ pass 2 - everything except fileType (which takes very long)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5749
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5750
			(passDone at:lineIndex) < 2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5751
			    info := f info.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5752
			    info isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5753
				"not accessable - usually a symlink,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5754
				 to a nonexisting/nonreadable file
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5755
				"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5756
				f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5757
				    p := f linkInfo path.    
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5758
				    typeString := 'broken symbolic link to ' , p
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5759
				] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5760
				    typeString := 'unknown'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5761
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5762
			    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5763
				typ := (info type).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5764
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5765
				modeString := self getModeString:(info at:#mode)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5766
							    with:#( '' $r $w $x 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5767
								    '  ' $r $w $x 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5768
								    '  ' $r $w $x ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5769
				entry colAt:3 put:modeString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5770
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5771
				((info uid) ~~ prevUid) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5772
				    prevUid := (info uid).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5773
				    nameString := OperatingSystem getUserNameFromID:prevUid.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5774
				    nameString := nameString contractTo:10.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5775
				    nameString := nameString , (String new:(10 - nameString size))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5776
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5777
				nameString isNil ifTrue:[nameString := '???'].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5778
				entry colAt:4 put:nameString withoutSpaces.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5779
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5780
				((info gid) ~~ prevGid) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5781
				    prevGid := (info gid).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5782
				    groupString := OperatingSystem getGroupNameFromID:prevGid.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5783
				    groupString := groupString contractTo:10.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5784
				    groupString := groupString , (String new:(10 - groupString size))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5785
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5786
				groupString isNil ifTrue:[groupString := '???'].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5787
				entry colAt:5 put:groupString withoutSpaces.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5788
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5789
				(typ == #regular) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5790
				    entry colAt:6 put:(self sizePrintString:(info size)).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5791
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5792
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5793
				f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5794
				    p := f linkInfo path.    
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5795
				    typeString := 'symbolic link to ' , p
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5796
				] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5797
				    typeString := typ asString
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5798
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5799
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5800
			    entry colAt:7 put:typeString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5801
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5802
			    "/ fileListView at:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5803
			    fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5804
			    fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5805
			    passDone at:lineIndex put:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5806
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5807
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5808
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5809
		    (state endsWith:'Types') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5810
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5811
			"/ pass 3: add fileType
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5812
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5813
			(passDone at:lineIndex) < 3 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5814
			    info := f info.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5815
			    info notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5816
				f isSymbolicLink ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5817
				    (Image isImageFileSuffix:(f suffix)) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5818
					typeString := f fileType.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5819
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5820
					entry colAt:7 put:typeString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5821
					"/ fileListView at:lineIndex put:entry
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5822
					fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5823
					fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5824
				    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5825
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5826
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5827
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5828
			    passDone at:lineIndex put:3
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5829
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5830
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5831
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5832
		    (state endsWith:'Images') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5833
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5834
			"/ pass 4: read images
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5835
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5836
			(passDone at:lineIndex) < 4 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5837
			    (Image isImageFileSuffix:(f suffix)) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5838
				f isDirectory ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5839
				    img := Image fromFile:(f pathName).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5840
				    img notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5841
					img := img magnifiedTo:16@16.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5842
					img := img on:self device.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5843
					entry colAt:7 put:img.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5844
					"/ fileListView at:lineIndex put:entry
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5845
					fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5846
					fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5847
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5848
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5849
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5850
			    passDone at:lineIndex put:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5851
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5852
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5853
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5854
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5855
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5856
		"/ advance to the next line
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5857
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5858
		lineIndex := lineIndex + 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5859
		lineIndex > endIndex ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5860
		    "/ finished this round ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5861
		    "/ see what we are going for ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5862
		    numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5863
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5864
		    state := nextState at:state ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5865
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5866
		    state isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5867
			done := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5868
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5869
			(state startsWith:'visible') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5870
			    lineIndex := fileListView firstLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5871
			    endIndex := fileListView lastLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5872
			    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5873
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5874
			    (state startsWith:'nextPage') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5875
				lineIndex := fileListView lastLineShown + 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5876
				endIndex := lineIndex + numVisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5877
				endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5878
				lineIndex := lineIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5879
			    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5880
				(state startsWith:'previousPage') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5881
				    endIndex := fileListView firstLineShown - 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5882
				    lineIndex := endIndex - numVisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5883
				    lineIndex := lineIndex max:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5884
				    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5885
				    endIndex := endIndex max:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5886
				] ifFalse:[ 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5887
				    "/ remaining
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5888
				    lineIndex := 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5889
				    endIndex := files size.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5890
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5891
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5892
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5893
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5894
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5895
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5896
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5897
	    listUpdateProcess := nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5898
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5899
	] forkAt:(Processor activePriority - 1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5900
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5901
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5902
	 install a new check after some time
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5903
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5904
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5905
    ]
142
claus
parents: 139
diff changeset
  5906
1487
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  5907
    "Modified: / 21.9.1995 / 11:40:23 / claus"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  5908
    "Modified: / 28.4.1997 / 22:30:30 / dq"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  5909
    "Modified: / 18.9.1997 / 18:28:30 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  5910
    "Modified: / 14.8.1998 / 17:59:06 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  5911
! !
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  5912
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5913
!FileBrowser methodsFor:'queries'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  5914
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5915
fileName
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5916
    "return my current fileName - during fileIn, the file
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5917
     which is being loaded is returned.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5918
     This is provided for VW fileIn scripts, which walk the
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5919
     context hierarchy and ask the fileBrowser for the name."
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5920
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5921
    |f|
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5922
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5923
    f := currentFileInFileName ? currentFileName.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5924
    f isNil ifTrue:[^ nil].
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5925
    ^ self path asFilename construct:f
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5926
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5927
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5928
     (FileBrowser openOnFileNamed:'Makefile') fileName
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5929
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5930
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  5931
    "Modified: / 18.6.1998 / 15:27:35 / cg"
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5932
!
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  5933
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5934
path
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5935
    "return my currentDirectories pathName;
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5936
     sent from the pathField to aquire the pathname when I changed directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5937
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5938
    "/ somewhat tricky: first ask it for the full pathName,
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5939
    "/ then convert it to a directory name
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5940
    "/ (which only makes a difference on VMS)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5941
1828
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  5942
    ^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  5943
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  5944
    "Modified: / 12.8.1998 / 14:45:48 / cg"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5945
! !
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5946
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  5947
!FileBrowser class methodsFor:'documentation'!
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  5948
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  5949
version
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  5950
    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.275 1998-11-21 14:42:40 cg Exp $'
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  5951
! !